Cantera  2.0
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
ReactorBase Class Reference

Base class for stirred reactors. More...

#include <ReactorBase.h>

Inheritance diagram for ReactorBase:
[legend]
Collaboration diagram for ReactorBase:
[legend]

Public Member Functions

 ReactorBase (std::string name="(none)")
 
virtual int type () const
 
std::string name () const
 
void setName (std::string name)
 
void resetState ()
 
thermo_tcontents ()
 return a reference to the contents.
 
const thermo_tcontents () 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)
 
FlowDeviceinlet (size_t n=0)
 
FlowDeviceoutlet (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_tm_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
 

Detailed Description

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.

Member Function Documentation

void setInitialVolume ( doublereal  vol)
inline

Set the initial reactor volume.

By default, the volume is 1.0 m^3.

Definition at line 56 of file ReactorBase.h.

void setInitialTime ( doublereal  time)
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().

virtual void initialize ( doublereal  t0 = 0.0)
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.

virtual void advance ( doublereal  time)
inlinevirtual

Advance the state of the reactor in time.

Parameters
timeTime to advance to (s). Note that this method changes the state of the mixture object.

Definition at line 111 of file ReactorBase.h.

thermo_t& contents ( )
inline

return a reference to the contents.

Definition at line 125 of file ReactorBase.h.

doublereal time ( ) const
inline

the current time (s).

Definition at line 144 of file ReactorBase.h.

Referenced by ReactorBase::setInitialTime().

doublereal volume ( ) const
inline

Returns the current volume of the reactor.

Returns
Return the volume in m**3

Definition at line 153 of file ReactorBase.h.

Member Data Documentation

size_t m_nsp
protected

The documentation for this class was generated from the following files: