22 "Error: reactor is empty.");
60 double* dndt = RHS + m_sidx;
78 for (
size_t n = 0; n <
m_nsp; n++) {
84 for (
auto outlet : m_outlet) {
88 for (
size_t n = 0; n <
m_nsp; n++) {
94 for (
auto inlet : m_inlet) {
98 for (
size_t n = 0; n <
m_nsp; n++) {
115 }
else if (nm ==
"enthalpy") {
125 }
else if (k >= m_sidx && k <
neq()) {
127 if (k < m_thermo->nSpecies()) {
132 for (
auto& S : m_surfaces) {
134 if (k < th->nSpecies()) {
141 throw CanteraError(
"ConstPressureMoleReactor::componentName",
142 "Index is out of bounds.");
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
Header file for class ReactorSurface.
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
Header file for base class WallBase.
Base class for exceptions thrown by Cantera classes.
void eval(double t, double *LHS, double *RHS) override
Evaluate the reactor governing equations.
size_t componentIndex(const string &nm) const override
Return the index in the solution vector for this reactor of the component named nm.
void getState(double *y) override
Get the the current state of the reactor.
string componentName(size_t k) override
Return the name of the solution component with index i.
void updateState(double *y) override
Set the state of the reactor to correspond to the state vector y.
void initialize(double t0=0.0) override
Initialize the reactor.
double outletSpeciesMassFlowRate(size_t k)
Mass flow rate (kg/s) of outlet species k.
double enthalpy_mass()
specific enthalpy
double massFlowRate()
Mass flow rate (kg/s).
virtual void getNetProductionRates(double *wdot)
Species net production rates [kmol/m^3/s or kmol/m^2/s].
void evalSurfaces(double *LHS, double *RHS, double *sdot) override
Evaluate terms related to surface reactions.
void getSurfaceInitialConditions(double *y) override
Get initial conditions for SurfPhase objects attached to this reactor.
void getMoles(double *y)
Get moles of the system from mass fractions stored by thermo object.
void setMassFromMoles(double *y)
Set internal mass variable based on moles given.
void initialize(double t0=0.0) override
Initialize the reactor.
void updateSurfaceState(double *y) override
Update the state of SurfPhase objects attached to this reactor.
void restoreState(const vector< double > &state)
Restore a state saved on a previous call to saveState.
size_t nSpecies() const
Returns the number of species in the phase.
virtual void setPressure(double p)
Set the internally stored pressure (Pa) at constant temperature and composition.
string speciesName(size_t k) const
Name of the species with index k.
const vector< double > & inverseMolecularWeights() const
Return a const reference to the internal vector of molecular weights.
virtual double density() const
Density (kg/m^3).
virtual void setMolesNoTruncate(const double *const N)
Set the state of the object with moles in [kmol].
FlowDevice & outlet(size_t n=0)
Return a reference to the n-th outlet FlowDevice connected to this reactor.
double m_pressure
Current pressure in the reactor [Pa].
FlowDevice & inlet(size_t n=0)
Return a reference to the n-th inlet FlowDevice connected to this reactor.
double m_vol
Current volume of the reactor [m^3].
size_t m_nsp
Number of homogeneous species in the mixture.
double m_enthalpy
Current specific enthalpy of the reactor [J/kg].
Kinetics * m_kin
Pointer to the homogeneous Kinetics object that handles the reactions.
vector< double > m_wdot
Species net molar production rates.
virtual void evalWalls(double t)
Evaluate terms related to Walls.
size_t neq()
Number of equations (state variables) for this reactor.
double m_Qdot
net heat transfer into the reactor, through walls [W]
vector< double > m_sdot
Production rates of gas phase species on surfaces [kmol/s].
virtual size_t speciesIndex(const string &nm) const
Return the index in the solution vector for this reactor of the species named nm, in either the homog...
virtual void updateConnected(bool updatePressure)
Update the state information needed by connected reactors, flow devices, and reactor walls.
Base class for a phase with thermodynamic properties.
virtual void setState_HP(double h, double p, double tol=1e-9)
Set the internally stored specific enthalpy (J/kg) and pressure (Pa) of the phase.
double enthalpy_mass() const
Specific enthalpy. Units: J/kg.
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...