From 0540cf26d0555473b40e6061af3cb85c5683401b Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 12 Nov 2015 11:22:12 -0500 Subject: [PATCH] Clean up Doxygen docs and comments in Reactor classes --- include/cantera/zeroD/ConstPressureReactor.h | 4 +-- include/cantera/zeroD/FlowDevice.h | 18 ++++-------- include/cantera/zeroD/FlowReactor.h | 8 ++---- .../zeroD/IdealGasConstPressureReactor.h | 13 ++++----- include/cantera/zeroD/IdealGasReactor.h | 4 +-- include/cantera/zeroD/Reactor.h | 17 +++++------ include/cantera/zeroD/ReactorBase.h | 21 +++++--------- include/cantera/zeroD/ReactorFactory.h | 5 ++-- include/cantera/zeroD/ReactorNet.h | 28 ++++++++----------- include/cantera/zeroD/Reservoir.h | 5 ++-- include/cantera/zeroD/Wall.h | 27 +++++++++--------- include/cantera/zeroD/flowControllers.h | 6 +--- src/zeroD/ConstPressureReactor.cpp | 5 +--- src/zeroD/FlowReactor.cpp | 9 ++---- src/zeroD/IdealGasConstPressureReactor.cpp | 5 +--- src/zeroD/IdealGasReactor.cpp | 4 +-- src/zeroD/Reactor.cpp | 15 ++++------ src/zeroD/ReactorBase.cpp | 4 +-- src/zeroD/ReactorFactory.cpp | 8 ++---- 19 files changed, 73 insertions(+), 133 deletions(-) diff --git a/include/cantera/zeroD/ConstPressureReactor.h b/include/cantera/zeroD/ConstPressureReactor.h index 4bc0f843a..445344434 100644 --- a/include/cantera/zeroD/ConstPressureReactor.h +++ b/include/cantera/zeroD/ConstPressureReactor.h @@ -1,6 +1,4 @@ -/** - * @file ConstPressureReactor.h - */ +//! @file ConstPressureReactor.h // Copyright 2001 California Institute of Technology diff --git a/include/cantera/zeroD/FlowDevice.h b/include/cantera/zeroD/FlowDevice.h index c38d04c3e..f87aa7cab 100644 --- a/include/cantera/zeroD/FlowDevice.h +++ b/include/cantera/zeroD/FlowDevice.h @@ -1,6 +1,4 @@ -/** - * @file FlowDevice.h - */ +//! @file FlowDevice.h // Copyright 2001 California Institute of Technology @@ -39,9 +37,7 @@ public: return m_type; } - /*! - * Mass flow rate (kg/s). - */ + //! Mass flow rate (kg/s). doublereal massFlowRate(double time = -999.0) { if (time != -999.0) { updateMassFlowRate(time); @@ -53,17 +49,15 @@ public: //! subclassess to update m_mdot. virtual void updateMassFlowRate(doublereal time) {} - /*! - * Mass flow rate (kg/s) of outlet species k. Returns zero if this species - * is not present in the upstream mixture. - */ + //! Mass flow rate (kg/s) of outlet species k. Returns zero if this species + //! is not present in the upstream mixture. doublereal outletSpeciesMassFlowRate(size_t k); //! specific enthalpy doublereal enthalpy_mass(); - /** - * Install a flow device between two reactors. + //! Install a flow device between two reactors. + /*! * @param in Upstream reactor. * @param out Downstream reactor. */ diff --git a/include/cantera/zeroD/FlowReactor.h b/include/cantera/zeroD/FlowReactor.h index 407e465d4..7d97910e6 100644 --- a/include/cantera/zeroD/FlowReactor.h +++ b/include/cantera/zeroD/FlowReactor.h @@ -1,6 +1,4 @@ -/** - * @file FlowReactor.h - */ +//! @file FlowReactor.h // Copyright 2001 California Institute of Technology @@ -12,9 +10,7 @@ namespace Cantera { -/** - * Adiabatic flow in a constant-area duct. - */ +//! Adiabatic flow in a constant-area duct. class FlowReactor : public Reactor { public: diff --git a/include/cantera/zeroD/IdealGasConstPressureReactor.h b/include/cantera/zeroD/IdealGasConstPressureReactor.h index 8dd0919a6..76f0accac 100644 --- a/include/cantera/zeroD/IdealGasConstPressureReactor.h +++ b/include/cantera/zeroD/IdealGasConstPressureReactor.h @@ -1,6 +1,4 @@ -/** - * @file ConstPressureReactor.h - */ +//! @file ConstPressureReactor.h // Copyright 2001 California Institute of Technology @@ -14,11 +12,10 @@ namespace Cantera /** * Class ConstPressureReactor is a class for constant-pressure reactors. The - * reactor may have an arbitrary number of inlets and outlets, each of which - * may be connected to a "flow device" such as a mass flow controller, a - * pressure regulator, etc. Additional reactors may be connected to the other - * end of the flow device, allowing construction of arbitrary reactor - * networks. + * reactor may have an arbitrary number of inlets and outlets, each of which may + * be connected to a "flow device" such as a mass flow controller, a pressure + * regulator, etc. Additional reactors may be connected to the other end of the + * flow device, allowing construction of arbitrary reactor networks. */ class IdealGasConstPressureReactor : public ConstPressureReactor { diff --git a/include/cantera/zeroD/IdealGasReactor.h b/include/cantera/zeroD/IdealGasReactor.h index b77ebfedc..ca1f0f747 100644 --- a/include/cantera/zeroD/IdealGasReactor.h +++ b/include/cantera/zeroD/IdealGasReactor.h @@ -1,6 +1,4 @@ -/** - * @file IdealGasReactor.h - */ +//! @file IdealGasReactor.h // Copyright 2001 California Institute of Technology diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index 6a337525c..4fad2d399 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -1,6 +1,4 @@ -/** - * @file Reactor.h - */ +//! @file Reactor.h // Copyright 2001 California Institute of Technology @@ -45,9 +43,8 @@ public: } /** - * Insert something into the reactor. The 'something' must - * belong to a class that is a subclass of both ThermoPhase - * and Kinetics. + * Insert something into the reactor. The 'something' must belong to a class + * that is a subclass of both ThermoPhase and Kinetics. */ template void insert(G& contents) { @@ -168,13 +165,13 @@ protected: //! specific reactor implementations. virtual size_t speciesIndex(const std::string& nm) const; - //! Evaluate terms related to Walls - //! Calculates #m_vdot and #m_Q based on wall movement and heat transfer + //! Evaluate terms related to Walls. Calculates #m_vdot and #m_Q based on + //! wall movement and heat transfer. //! @param t the current time virtual void evalWalls(double t); - //! Evaluate terms related to surface reactions - //! Calculates #m_sdot and rate of change in surface species coverages + //! Evaluate terms related to surface reactions. Calculates #m_sdot and rate + //! of change in surface species coverages. //! @param t the current time //! @param[out] ydot array of d(coverage)/dt for surface species //! @returns Net mass flux from surfaces diff --git a/include/cantera/zeroD/ReactorBase.h b/include/cantera/zeroD/ReactorBase.h index 6307ba38f..4fb355ff1 100644 --- a/include/cantera/zeroD/ReactorBase.h +++ b/include/cantera/zeroD/ReactorBase.h @@ -1,6 +1,5 @@ -/** - * @file ReactorBase.h - */ +//! @file ReactorBase.h + // Copyright 2001 California Institute of Technology #ifndef CT_REACTORBASE_H @@ -51,19 +50,14 @@ public: //! @name Methods to set up a simulation. //@{ - /** - * Set the initial reactor volume. By default, the volume is - * 1.0 m^3. - */ + //! Set the initial reactor volume. By default, the volume is 1.0 m^3. void setInitialVolume(doublereal vol) { m_vol = vol; } - /** - * Specify the mixture contained in the reactor. Note that - * a pointer to this substance is stored, and as the integration - * proceeds, the state of the substance is modified. - */ + //! Specify the mixture contained in the reactor. Note that a pointer to + //! this substance is stored, and as the integration proceeds, the state of + //! the substance is modified. virtual void setThermoMgr(thermo_t& thermo); //! Connect an inlet FlowDevice to this reactor @@ -80,8 +74,7 @@ public: //! reactor. FlowDevice& outlet(size_t n = 0); - //! Return the number of inlet FlowDevice objects connected to this - //! reactor. + //! Return the number of inlet FlowDevice objects connected to this reactor. size_t nInlets() { return m_inlet.size(); } diff --git a/include/cantera/zeroD/ReactorFactory.h b/include/cantera/zeroD/ReactorFactory.h index 0d06dfaba..9626689d2 100644 --- a/include/cantera/zeroD/ReactorFactory.h +++ b/include/cantera/zeroD/ReactorFactory.h @@ -1,6 +1,5 @@ -/** - * @file ReactorFactory.h - */ +//! @file ReactorFactory.h + // Copyright 2001 California Institute of Technology #ifndef REACTOR_FACTORY_H diff --git a/include/cantera/zeroD/ReactorNet.h b/include/cantera/zeroD/ReactorNet.h index 0d4c1c0c9..e514959fe 100644 --- a/include/cantera/zeroD/ReactorNet.h +++ b/include/cantera/zeroD/ReactorNet.h @@ -1,6 +1,5 @@ -/** - * @file ReactorNet.h - */ +//! @file ReactorNet.h + // Copyright 2004 California Institute of Technology #ifndef CT_REACTORNET_H @@ -29,11 +28,8 @@ public: //! @name Methods to set up a simulation. //@{ - /** - * Set initial time. Default = 0.0 s. Restarts integration - * from this time using the current mixture state as the - * initial condition. - */ + //! Set initial time. Default = 0.0 s. Restarts integration from this time + //! using the current mixture state as the initial condition. void setInitialTime(doublereal time) { m_time = time; m_integrator_init = false; @@ -232,17 +228,15 @@ public: } protected: - /** - * Initialize the reactor network. Called automatically the first time - * advance or step is called. - */ + //! Initialize the reactor network. Called automatically the first time + //! advance or step is called. void initialize(); std::vector m_reactors; Integrator* m_integ; doublereal m_time; bool m_init; - bool m_integrator_init; //! True if integrator initialization is current + bool m_integrator_init; //!< True if integrator initialization is current size_t m_nv; //! m_start[n] is the starting point in the state vector for reactor n @@ -264,12 +258,12 @@ protected: std::vector m_paramNames; //! Structure used to determine the order of sensitivity parameters - //! m_sensOrder[Reactor or Wall, leftright][reaction number] = parameter index + //! m_sensOrder[Reactor or Wall, leftright][reaction number] = parameter + //! index std::map, std::map > m_sensOrder; - //! Mapping from the order in which sensitivity parameters were added to - //! the ReactorNet to the order in which they occur in the integrator - //! output. + //! Mapping from the order in which sensitivity parameters were added to the + //! ReactorNet to the order in which they occur in the integrator output. std::vector m_sensIndex; vector_fp m_ydot; diff --git a/include/cantera/zeroD/Reservoir.h b/include/cantera/zeroD/Reservoir.h index 1cfc63135..99f798638 100644 --- a/include/cantera/zeroD/Reservoir.h +++ b/include/cantera/zeroD/Reservoir.h @@ -1,6 +1,5 @@ -/** - * @file Reservoir.h - */ +//! @file Reservoir.h + // Copyright 2001 California Institute of Technology #ifndef CT_RESERVOIR_H diff --git a/include/cantera/zeroD/Wall.h b/include/cantera/zeroD/Wall.h index 33a6853e4..6e2d9b494 100644 --- a/include/cantera/zeroD/Wall.h +++ b/include/cantera/zeroD/Wall.h @@ -1,7 +1,5 @@ -/** - * @file Wall.h - * Header file for class Wall. - */ +//! @file Wall.h Header file for class Wall. + // Copyright 2001-2004 California Institute of Technology #ifndef CT_WALL_H @@ -32,8 +30,11 @@ public: virtual ~Wall() {} //! Rate of volume change (m^3/s) for the adjacent reactors. - /*! The volume rate of change is given by - * \f[ \dot V = K A (P_{left} - P_{right}) + F(t) \f] + /*! + * The volume rate of change is given by + * \f[ + * \dot V = K A (P_{left} - P_{right}) + F(t) + * \f] * where *K* is the specified expansion rate coefficient, *A* is the wall * area, and *F(t)* is a specified function of time. Positive values for * `vdot` correspond to increases in the volume of reactor on left, and @@ -44,7 +45,9 @@ public: //! Heat flow rate through the wall (W). /*! * The heat flux is given by - * \f[ Q = h A (T_{left} - T_{right}) + A G(t) \f] + * \f[ + * Q = h A (T_{left} - T_{right}) + A G(t) + * \f] * where *h* is the heat transfer coefficient, *A* is the wall area, and * *G(t)* is a specified function of time. Positive values denote a flux * from left to right. @@ -126,14 +129,12 @@ public: return (m_left != 0 && m_right != 0); } - //! Return a reference to the Reactor or Reservoir to the left - //! of the wall. + //! Return a reference to the Reactor or Reservoir to the left of the wall. ReactorBase& left() const { return *m_left; } - //! Return a reference to the Reactor or Reservoir to the - //! right of the wall. + //! Return a reference to the Reactor or Reservoir to the right of the wall. const ReactorBase& right() { return *m_right; } @@ -171,8 +172,8 @@ public: //! Write the coverages of the left or right surface into array `cov`. void getCoverages(int leftright, doublereal* cov); - //! Set the coverages in the surface phase object to the - //! values for this wall surface. + //! Set the coverages in the surface phase object to the values for this + //! wall surface. void syncCoverages(int leftright); //! Number of sensitivity parameters associated with reactions on the left diff --git a/include/cantera/zeroD/flowControllers.h b/include/cantera/zeroD/flowControllers.h index c301043f3..3e8e09202 100644 --- a/include/cantera/zeroD/flowControllers.h +++ b/include/cantera/zeroD/flowControllers.h @@ -1,8 +1,4 @@ -/** - * @file flowControllers.h - * - * Some flow devices derived from class FlowDevice. - */ +//! @file flowControllers.h Some flow devices derived from class FlowDevice. // Copyright 2001 California Institute of Technology diff --git a/src/zeroD/ConstPressureReactor.cpp b/src/zeroD/ConstPressureReactor.cpp index 610977c09..171a1467c 100644 --- a/src/zeroD/ConstPressureReactor.cpp +++ b/src/zeroD/ConstPressureReactor.cpp @@ -1,7 +1,4 @@ -/** - * @file ConstPressureReactor.cpp A constant pressure zero-dimensional - * reactor - */ +//! @file ConstPressureReactor.cpp A constant pressure zero-dimensional reactor // Copyright 2001 California Institute of Technology diff --git a/src/zeroD/FlowReactor.cpp b/src/zeroD/FlowReactor.cpp index e7c365dd7..624abe6c4 100644 --- a/src/zeroD/FlowReactor.cpp +++ b/src/zeroD/FlowReactor.cpp @@ -1,6 +1,4 @@ -/** -* @file FlowReactor.cpp A steady-state plug flow reactor -*/ +//! @file FlowReactor.cpp A steady-state plug flow reactor // Copyright 2001 California Institute of Technology @@ -94,11 +92,10 @@ void FlowReactor::evalEqs(doublereal time, doublereal* y, // distance equation ydot[0] = m_speed; - // speed equation. Set m_fctr to a large value, so that rho*u is - // held fixed + // speed equation. Set m_fctr to a large value, so that rho*u is held fixed ydot[1] = m_fctr*(m_speed0 - m_thermo->density()*m_speed/m_rho0); - /* species equations */ + // species equations // const vector_fp& mw = m_thermo->molecularWeights(); if (m_chem) { diff --git a/src/zeroD/IdealGasConstPressureReactor.cpp b/src/zeroD/IdealGasConstPressureReactor.cpp index 1df97c47a..6df0b9dd9 100644 --- a/src/zeroD/IdealGasConstPressureReactor.cpp +++ b/src/zeroD/IdealGasConstPressureReactor.cpp @@ -1,7 +1,4 @@ -/** - * @file ConstPressureReactor.cpp A constant pressure zero-dimensional - * reactor - */ +//! @file ConstPressureReactor.cpp A constant pressure zero-dimensional reactor // Copyright 2001 California Institute of Technology diff --git a/src/zeroD/IdealGasReactor.cpp b/src/zeroD/IdealGasReactor.cpp index 80f0d711a..4f7064bb8 100644 --- a/src/zeroD/IdealGasReactor.cpp +++ b/src/zeroD/IdealGasReactor.cpp @@ -1,6 +1,4 @@ -/** - * @file IdealGasReactor.cpp A zero-dimensional reactor - */ +//! @file IdealGasReactor.cpp A zero-dimensional reactor #include "cantera/zeroD/IdealGasReactor.h" #include "cantera/zeroD/FlowDevice.h" diff --git a/src/zeroD/Reactor.cpp b/src/zeroD/Reactor.cpp index dbe14a7cb..2fc30212e 100644 --- a/src/zeroD/Reactor.cpp +++ b/src/zeroD/Reactor.cpp @@ -1,6 +1,4 @@ -/** - * @file Reactor.cpp A zero-dimensional reactor - */ +//! @file Reactor.cpp A zero-dimensional reactor // Copyright 2001 California Institute of Technology @@ -229,13 +227,10 @@ void Reactor::evalEqs(doublereal time, doublereal* y, dYdt[k] -= Y[k] * mdot_surf / m_mass; } - /* - * Energy equation. - * \f[ - * \dot U = -P\dot V + A \dot q + \dot m_{in} h_{in} - * - \dot m_{out} h. - * \f] - */ + // Energy equation. + // \f[ + // \dot U = -P\dot V + A \dot q + \dot m_{in} h_{in} - \dot m_{out} h. + // \f] if (m_energy) { ydot[2] = - m_thermo->pressure() * m_vdot - m_Q; } else { diff --git a/src/zeroD/ReactorBase.cpp b/src/zeroD/ReactorBase.cpp index 48b36427e..7f05334ce 100644 --- a/src/zeroD/ReactorBase.cpp +++ b/src/zeroD/ReactorBase.cpp @@ -1,6 +1,4 @@ -/** - * @file ReactorBase.cpp - */ +//! @file ReactorBase.cpp // Copyright 2001 California Institute of Technology diff --git a/src/zeroD/ReactorFactory.cpp b/src/zeroD/ReactorFactory.cpp index d25ef9439..0b96b4f19 100644 --- a/src/zeroD/ReactorFactory.cpp +++ b/src/zeroD/ReactorFactory.cpp @@ -1,6 +1,5 @@ -/** - * @file ReactorFactory.cpp - */ +//! @file ReactorFactory.cpp + // Copyright 2006 California Institute of Technology #include "cantera/zeroD/ReactorFactory.h" @@ -30,9 +29,6 @@ static int _itypes[] = {ReservoirType, ReactorType, ConstPressureReactorType, IdealGasConstPressureReactorType }; -/** - * This method returns a new instance of a subclass of ThermoPhase - */ ReactorBase* ReactorFactory::newReactor(const std::string& reactorType) { int ir=-1;