Cantera
2.0
|
Adiabatic, reversible flow in a constant-area duct. More...
#include <FlowReactor.h>
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_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 | 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 |
Kinetics * | m_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_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 |
Adiabatic, reversible flow in a constant-area duct.
Definition at line 18 of file FlowReactor.h.
FlowReactor | ( | ) |
Default constructor.
Definition at line 16 of file FlowReactor.cpp.
|
inlinevirtual |
Destructor.
Definition at line 31 of file FlowReactor.h.
|
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().
|
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().
|
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().
|
inlineinherited |
|
inlineinherited |
Set the initial reactor volume.
By default, the volume is 1.0 m^3.
Definition at line 56 of file ReactorBase.h.
|
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().
|
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().
|
inlinevirtualinherited |
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.
|
inlineinherited |
return a reference to the contents.
Definition at line 125 of file ReactorBase.h.
|
inlineinherited |
the current time (s).
Definition at line 144 of file ReactorBase.h.
Referenced by ReactorBase::setInitialTime().
|
inlineinherited |
Returns the current volume of the reactor.
Definition at line 153 of file ReactorBase.h.
|
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().
|
protectedinherited |
|
protectedinherited |
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().