Clean up Doxygen docs and comments in Reactor classes
This commit is contained in:
parent
34ff39e3df
commit
0540cf26d0
19 changed files with 73 additions and 133 deletions
|
|
@ -1,6 +1,4 @@
|
|||
/**
|
||||
* @file ConstPressureReactor.h
|
||||
*/
|
||||
//! @file ConstPressureReactor.h
|
||||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
/**
|
||||
* @file IdealGasReactor.h
|
||||
*/
|
||||
//! @file IdealGasReactor.h
|
||||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
|
|
|
|||
|
|
@ -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<class G>
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
/**
|
||||
* @file ReactorFactory.h
|
||||
*/
|
||||
//! @file ReactorFactory.h
|
||||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
#ifndef REACTOR_FACTORY_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<Reactor*> 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<std::string> 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::pair<void*, int>, std::map<size_t, size_t> > 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<size_t> m_sensIndex;
|
||||
|
||||
vector_fp m_ydot;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
/**
|
||||
* @file Reservoir.h
|
||||
*/
|
||||
//! @file Reservoir.h
|
||||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
#ifndef CT_RESERVOIR_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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
/**
|
||||
* @file ReactorBase.cpp
|
||||
*/
|
||||
//! @file ReactorBase.cpp
|
||||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue