Cantera
2.0
|
Base class for stirred reactors. More...
#include <ReactorBase.h>
Public Member Functions | |
ReactorBase (std::string name="(none)") | |
virtual int | type () const |
std::string | name () const |
void | setName (std::string name) |
void | resetState () |
thermo_t & | contents () |
return a reference to the contents. | |
const thermo_t & | contents () const |
doublereal | residenceTime () |
int | error (std::string msg) const |
Methods to set up a simulation. | |
void | setInitialVolume (doublereal vol) |
Set the initial reactor volume. | |
void | setInitialTime (doublereal time) |
Set initial time. | |
void | setThermoMgr (thermo_t &thermo) |
Specify the mixture contained in the reactor. | |
void | addInlet (FlowDevice &inlet) |
void | addOutlet (FlowDevice &outlet) |
FlowDevice & | inlet (size_t n=0) |
FlowDevice & | outlet (size_t n=0) |
size_t | nInlets () |
size_t | nOutlets () |
size_t | nWalls () |
void | addWall (Wall &w, int lr) |
Wall & | wall (size_t n) |
virtual void | initialize (doublereal t0=0.0) |
Initialize the reactor. | |
virtual void | advance (doublereal time) |
Advance the state of the reactor in time. | |
virtual double | step (doublereal time) |
virtual void | start () |
Solution components. | |
The values returned are those after the last call to advance or step. | |
doublereal | time () const |
the current time (s). | |
doublereal | volume () const |
Returns the current volume of the reactor. | |
doublereal | density () const |
doublereal | temperature () const |
doublereal | enthalpy_mass () const |
doublereal | intEnergy_mass () const |
doublereal | pressure () const |
doublereal | mass () const |
const doublereal * | massFractions () const |
doublereal | massFraction (size_t k) const |
Protected Attributes | |
size_t | m_nsp |
Number of homogeneous species in the mixture. | |
thermo_t * | m_thermo |
doublereal | m_time |
doublereal | m_vol |
doublereal | m_vol0 |
bool | m_init |
size_t | m_nInlets |
size_t | m_nOutlets |
bool | m_open |
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< Wall * > | m_wall |
vector_int | m_lr |
size_t | m_nwalls |
std::string | m_name |
double | m_rho0 |
Private Member Functions | |
void | tilt (std::string method="") const |
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 28 of file ReactorBase.h.
|
inline |
Set the initial reactor volume.
By default, the volume is 1.0 m^3.
Definition at line 56 of file ReactorBase.h.
|
inline |
Set initial time.
Default = 0.0 s. Restarts integration from this time using the current mixture state as the initial condition.
Definition at line 66 of file ReactorBase.h.
References ReactorBase::time().
void setThermoMgr | ( | thermo_t & | thermo | ) |
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.
Definition at line 40 of file ReactorBase.cpp.
References ThermoPhase::enthalpy_mass(), ThermoPhase::intEnergy_mass(), ReactorBase::m_nsp, Phase::nSpecies(), ThermoPhase::pressure(), and Phase::saveState().
Referenced by Reactor::insert().
|
inlinevirtual |
Initialize the reactor.
Must be called after specifying the (and if necessary the inlet mixture) and before calling advance.
Reimplemented in Reactor, ConstPressureReactor, and FlowReactor.
Definition at line 101 of file ReactorBase.h.
|
inlinevirtual |
Advance the state of the reactor in time.
time | Time to advance to (s). Note that this method changes the state of the mixture object. |
Definition at line 111 of file ReactorBase.h.
|
inline |
return a reference to the contents.
Definition at line 125 of file ReactorBase.h.
|
inline |
the current time (s).
Definition at line 144 of file ReactorBase.h.
Referenced by ReactorBase::setInitialTime().
|
inline |
Returns the current volume of the reactor.
Definition at line 153 of file ReactorBase.h.
|
protected |
Number of homogeneous species in the mixture.
Definition at line 191 of file ReactorBase.h.
Referenced by FlowReactor::initialize(), ConstPressureReactor::initialize(), Reactor::initialize(), ReactorBase::setThermoMgr(), ConstPressureReactor::updateState(), and Reactor::updateState().