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

Adiabatic, reversible flow in a constant-area duct. More...

#include <FlowReactor.h>

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

Public Member Functions

 FlowReactor ()
 Default constructor.
 
virtual ~FlowReactor ()
 Destructor.
 
virtual int type () const
 
virtual void getInitialConditions (doublereal t0, size_t leny, doublereal *y)
 
virtual size_t neq ()
 
virtual void initialize (doublereal t0=0.0)
 Initialize the reactor.
 
virtual void evalEqs (doublereal t, doublereal *y, doublereal *ydot, doublereal *params)
 
virtual void updateState (doublereal *y)
 Set the mixture to a state consistent with solution vector y.
 
void setMassFlowRate (doublereal mdot)
 
void setTimeConstant (doublereal tau)
 
double speed () const
 
double distance () const
 
virtual size_t componentIndex (std::string nm) const
 
template<class G >
void insert (G &contents)
 Insert something into the reactor.
 
void setKineticsMgr (Kinetics &kin)
 
void disableChemistry ()
 
void enableChemistry ()
 
void setEnergy (int eflag=1)
 Set the energy equation on or off.
 
virtual size_t nSensParams ()
 
virtual void addSensitivityReaction (size_t rxn)
 
virtual std::string sensParamID (int p)
 
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 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

doublereal m_speed
 
doublereal m_dist
 
doublereal m_T
 
doublereal m_fctr
 
doublereal m_rho0
 
doublereal m_speed0
 
doublereal m_P0
 
doublereal m_h0
 
Kineticsm_kin
 Pointer to the homogeneous Kinetics object that handles the reactions.
 
doublereal m_temp_atol
 Tolerance on the temperature.
 
doublereal m_maxstep
 
doublereal m_vdot
 
doublereal m_Q
 
vector_fp m_atol
 
doublereal m_rtol
 
vector_fp m_work
 
vector_fp m_sdot
 
bool m_chem
 
bool m_energy
 
size_t m_nv
 
size_t m_nsens
 
std::vector< size_t > m_pnum
 
std::vector< std::string > m_pname
 
std::vector< size_t > m_nsens_wall
 
vector_fp m_mult_save
 
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
 

Detailed Description

Adiabatic, reversible flow in a constant-area duct.

Definition at line 18 of file FlowReactor.h.

Constructor & Destructor Documentation

Default constructor.

Definition at line 16 of file FlowReactor.cpp.

virtual ~FlowReactor ( )
inlinevirtual

Destructor.

Definition at line 31 of file FlowReactor.h.

Member Function Documentation

void initialize ( doublereal  t0 = 0.0)
virtual

Initialize the reactor.

Must be called after specifying the (and if necessary the inlet mixture) and before calling advance.

Reimplemented from Reactor.

Definition at line 42 of file FlowReactor.cpp.

References ReactorBase::m_nsp, and Phase::restoreState().

void updateState ( doublereal *  y)
virtual

Set the mixture to a state consistent with solution vector y.

Reimplemented from Reactor.

Definition at line 49 of file FlowReactor.cpp.

References Phase::saveState(), Phase::setMassFractions(), ThermoPhase::setState_HP(), and ThermoPhase::setState_TP().

void insert ( G &  contents)
inlineinherited

Insert something into the reactor.

The 'something' must belong to a class that is a subclass of both ThermoPhase and Kinetics.

Definition at line 72 of file Reactor.h.

References ReactorBase::setThermoMgr().

void setEnergy ( int  eflag = 1)
inlineinherited

Set the energy equation on or off.

Definition at line 92 of file Reactor.h.

void setInitialVolume ( doublereal  vol)
inlineinherited

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)
inlineinherited

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)
inherited

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 advance ( doublereal  time)
inlinevirtualinherited

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 ( )
inlineinherited

return a reference to the contents.

Definition at line 125 of file ReactorBase.h.

doublereal time ( ) const
inlineinherited

the current time (s).

Definition at line 144 of file ReactorBase.h.

Referenced by ReactorBase::setInitialTime().

doublereal volume ( ) const
inlineinherited

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

Kinetics* m_kin
protectedinherited

Pointer to the homogeneous Kinetics object that handles the reactions.

Definition at line 130 of file Reactor.h.

Referenced by ConstPressureReactor::initialize(), and Reactor::initialize().

doublereal m_temp_atol
protectedinherited

Tolerance on the temperature.

Definition at line 133 of file Reactor.h.

size_t m_nsp
protectedinherited

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