Cantera
2.5.1
|
Base class for stirred reactors. More...
#include <ReactorBase.h>
Public Member Functions | |
ReactorBase (const std::string &name="(none)") | |
ReactorBase (const ReactorBase &)=delete | |
ReactorBase & | operator= (const ReactorBase &)=delete |
virtual std::string | typeStr () const |
String indicating the reactor model implemented. More... | |
virtual int | type () const |
Return a constant indicating the type of this Reactor. More... | |
std::string | name () const |
Return the name of this reactor. More... | |
void | setName (const std::string &name) |
Set the name of this reactor. More... | |
Methods to set up a simulation. | |
void | setInitialVolume (doublereal vol) |
Set the initial reactor volume. By default, the volume is 1.0 m^3. More... | |
virtual void | setThermoMgr (thermo_t &thermo) |
Specify the mixture contained in the reactor. More... | |
virtual void | setKineticsMgr (Kinetics &kin) |
Specify chemical kinetics governing the reactor. More... | |
virtual void | setChemistry (bool cflag=true) |
Enable or disable changes in reactor composition due to chemical reactions. More... | |
virtual void | setEnergy (int eflag=1) |
Set the energy equation on or off. More... | |
void | addInlet (FlowDevice &inlet) |
Connect an inlet FlowDevice to this reactor. More... | |
void | addOutlet (FlowDevice &outlet) |
Connect an outlet FlowDevice to this reactor. More... | |
FlowDevice & | inlet (size_t n=0) |
Return a reference to the n-th inlet FlowDevice connected to this reactor. More... | |
FlowDevice & | outlet (size_t n=0) |
Return a reference to the n-th outlet FlowDevice connected to this reactor. More... | |
size_t | nInlets () |
Return the number of inlet FlowDevice objects connected to this reactor. More... | |
size_t | nOutlets () |
Return the number of outlet FlowDevice objects connected to this reactor. More... | |
size_t | nWalls () |
Return the number of Wall objects connected to this reactor. More... | |
void | addWall (WallBase &w, int lr) |
Insert a Wall between this reactor and another reactor. More... | |
WallBase & | wall (size_t n) |
Return a reference to the n-th Wall connected to this reactor. More... | |
void | addSurface (ReactorSurface *surf) |
ReactorSurface * | surface (size_t n) |
Return a reference to the n-th ReactorSurface connected to this reactor. More... | |
virtual void | initialize (doublereal t0=0.0) |
Initialize the reactor. More... | |
void | restoreState () |
Set the state of the Phase object associated with this reactor to the reactor's current state. More... | |
virtual void | syncState () |
Set the state of the reactor to correspond to the state of the associated ThermoPhase object. More... | |
thermo_t & | contents () |
return a reference to the contents. More... | |
const thermo_t & | contents () const |
doublereal | residenceTime () |
Return the residence time (s) of the contents of this reactor, based on the outlet mass flow rates and the mass of the reactor contents. More... | |
Solution components. | |
The values returned are those after the last call to ReactorNet::advance or ReactorNet::step. | |
size_t | m_nsp |
Number of homogeneous species in the mixture. More... | |
thermo_t * | m_thermo |
doublereal | m_vol |
doublereal | m_enthalpy |
doublereal | m_intEnergy |
doublereal | m_pressure |
vector_fp | m_state |
std::vector< FlowDevice * > | m_inlet |
std::vector< FlowDevice * > | m_outlet |
std::vector< WallBase * > | m_wall |
std::vector< ReactorSurface * > | m_surfaces |
vector_int | m_lr |
std::string | m_name |
ReactorNet * | m_net |
The ReactorNet that this reactor is part of. More... | |
doublereal | volume () const |
Returns the current volume (m^3) of the reactor. More... | |
doublereal | density () const |
Returns the current density (kg/m^3) of the reactor's contents. More... | |
doublereal | temperature () const |
Returns the current temperature (K) of the reactor's contents. More... | |
doublereal | enthalpy_mass () const |
Returns the current enthalpy (J/kg) of the reactor's contents. More... | |
doublereal | intEnergy_mass () const |
Returns the current internal energy (J/kg) of the reactor's contents. More... | |
doublereal | pressure () const |
Returns the current pressure (Pa) of the reactor. More... | |
doublereal | mass () const |
Returns the mass (kg) of the reactor's contents. More... | |
const doublereal * | massFractions () const |
Return the vector of species mass fractions. More... | |
doublereal | massFraction (size_t k) const |
Return the mass fraction of the k-th species. More... | |
ReactorNet & | network () |
The ReactorNet that this reactor belongs to. More... | |
void | setNetwork (ReactorNet *net) |
Set the ReactorNet that this reactor belongs to. More... | |
Base class for stirred reactors.
Allows using any substance model, with arbitrary inflow, outflow, heat loss/gain, surface chemistry, and volume change.
Definition at line 47 of file ReactorBase.h.
|
inlinevirtual |
String indicating the reactor model implemented.
Usually corresponds to the name of the derived class.
Reimplemented in Reactor, IdealGasReactor, IdealGasConstPressureReactor, FlowReactor, and ConstPressureReactor.
Definition at line 57 of file ReactorBase.h.
|
inlinevirtual |
Return a constant indicating the type of this Reactor.
Reimplemented in Reactor, IdealGasReactor, IdealGasConstPressureReactor, FlowReactor, and ConstPressureReactor.
Definition at line 63 of file ReactorBase.h.
References Cantera::warn_deprecated().
|
inline |
Return the name of this reactor.
Definition at line 72 of file ReactorBase.h.
Referenced by ReactorBase::setName().
|
inline |
Set the name of this reactor.
Definition at line 77 of file ReactorBase.h.
References ReactorBase::name().
|
inline |
Set the initial reactor volume. By default, the volume is 1.0 m^3.
Definition at line 85 of file ReactorBase.h.
|
virtual |
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.
Reimplemented in IdealGasReactor, and IdealGasConstPressureReactor.
Definition at line 26 of file ReactorBase.cpp.
References Phase::nSpecies().
|
inlinevirtual |
Specify chemical kinetics governing the reactor.
Reimplemented in Reactor.
Definition at line 95 of file ReactorBase.h.
|
inlinevirtual |
Enable or disable changes in reactor composition due to chemical reactions.
Reimplemented in Reactor.
Definition at line 100 of file ReactorBase.h.
|
inlinevirtual |
Set the energy equation on or off.
Reimplemented in Reactor.
Definition at line 105 of file ReactorBase.h.
void addInlet | ( | FlowDevice & | inlet | ) |
Connect an inlet FlowDevice to this reactor.
Definition at line 47 of file ReactorBase.cpp.
void addOutlet | ( | FlowDevice & | outlet | ) |
Connect an outlet FlowDevice to this reactor.
Definition at line 52 of file ReactorBase.cpp.
Referenced by FlowDevice::install().
FlowDevice & inlet | ( | size_t | n = 0 | ) |
Return a reference to the n-th inlet FlowDevice connected to this reactor.
Definition at line 109 of file ReactorBase.cpp.
FlowDevice & outlet | ( | size_t | n = 0 | ) |
Return a reference to the n-th outlet FlowDevice connected to this reactor.
Definition at line 113 of file ReactorBase.cpp.
|
inline |
Return the number of inlet FlowDevice objects connected to this reactor.
Definition at line 124 of file ReactorBase.h.
|
inline |
Return the number of outlet FlowDevice objects connected to this reactor.
Definition at line 130 of file ReactorBase.h.
|
inline |
Return the number of Wall objects connected to this reactor.
Definition at line 135 of file ReactorBase.h.
void addWall | ( | WallBase & | w, |
int | lr | ||
) |
Insert a Wall between this reactor and another reactor.
lr
= 0 if this reactor is to the left of the wall and lr
= 1 if this reactor is to the right of the wall. This method is called automatically for both the left and right reactors by WallBase::install.
Definition at line 57 of file ReactorBase.cpp.
Referenced by WallBase::install().
WallBase & wall | ( | size_t | n | ) |
Return a reference to the n-th Wall connected to this reactor.
Definition at line 67 of file ReactorBase.cpp.
ReactorSurface * surface | ( | size_t | n | ) |
Return a reference to the n-th ReactorSurface connected to this reactor.
Definition at line 80 of file ReactorBase.cpp.
|
inlinevirtual |
Initialize the reactor.
Called automatically by ReactorNet::initialize.
Reimplemented in Reactor, IdealGasReactor, IdealGasConstPressureReactor, FlowReactor, and ConstPressureReactor.
Definition at line 159 of file ReactorBase.h.
|
inline |
Set the state of the Phase object associated with this reactor to the reactor's current state.
Definition at line 167 of file ReactorBase.h.
References Phase::restoreState().
|
virtual |
Set the state of the reactor to correspond to the state of the associated ThermoPhase object.
This is the inverse of restoreState(). Calling this will trigger integrator reinitialization.
Reimplemented in Reactor.
Definition at line 36 of file ReactorBase.cpp.
|
inline |
return a reference to the contents.
Definition at line 180 of file ReactorBase.h.
doublereal residenceTime | ( | ) |
Return the residence time (s) of the contents of this reactor, based on the outlet mass flow rates and the mass of the reactor contents.
Definition at line 100 of file ReactorBase.cpp.
|
inline |
Returns the current volume (m^3) of the reactor.
Definition at line 208 of file ReactorBase.h.
|
inline |
Returns the current density (kg/m^3) of the reactor's contents.
Definition at line 213 of file ReactorBase.h.
Referenced by ReactorBase::mass().
|
inline |
Returns the current temperature (K) of the reactor's contents.
Definition at line 218 of file ReactorBase.h.
Referenced by Wall::Q().
|
inline |
Returns the current enthalpy (J/kg) of the reactor's contents.
Definition at line 223 of file ReactorBase.h.
|
inline |
Returns the current internal energy (J/kg) of the reactor's contents.
Definition at line 228 of file ReactorBase.h.
|
inline |
Returns the current pressure (Pa) of the reactor.
Definition at line 233 of file ReactorBase.h.
Referenced by PressureController::updateMassFlowRate(), Valve::updateMassFlowRate(), and Wall::vdot().
|
inline |
Returns the mass (kg) of the reactor's contents.
Definition at line 238 of file ReactorBase.h.
References ReactorBase::density().
|
inline |
Return the vector of species mass fractions.
Definition at line 243 of file ReactorBase.h.
|
inline |
Return the mass fraction of the k-th species.
Definition at line 248 of file ReactorBase.h.
ReactorNet & network | ( | ) |
The ReactorNet that this reactor belongs to.
Definition at line 85 of file ReactorBase.cpp.
void setNetwork | ( | ReactorNet * | net | ) |
Set the ReactorNet that this reactor belongs to.
Definition at line 95 of file ReactorBase.cpp.
Referenced by ReactorNet::addReactor().
|
protected |
Number of homogeneous species in the mixture.
Definition at line 262 of file ReactorBase.h.
|
protected |
The ReactorNet that this reactor is part of.
Definition at line 278 of file ReactorBase.h.