Cantera
2.0
|
Kinetics manager implementing reaction mechanism GRI-Mech 3.0. More...
#include <GRI_30_Kinetics.h>
Public Member Functions | |
GRI_30_Kinetics (thermo_t *th=0) | |
Default constructor. | |
virtual | ~GRI_30_Kinetics () |
Destructor. | |
virtual int | ID () const |
virtual int | type () const |
Identifies the kinetics manager type. | |
virtual void | getNetProductionRates (doublereal *net) |
Return the species net production rates. | |
void | incrementRxnCount () |
Increment the number of reactions in the mechanism by one. | |
void | selectPhase (const doublereal *data, const thermo_t *phase, doublereal *phase_data) |
Extract from array data the portion pertaining to phase phase . | |
Constructors and General Information | |
virtual Kinetics * | duplMyselfAsKinetics (const std::vector< thermo_t * > &tpVector) const |
Duplication routine for objects which inherit from Kinetics. | |
virtual doublereal | reactantStoichCoeff (size_t k, size_t i) const |
Stoichiometric coefficient of species k as a reactant in reaction i. | |
virtual doublereal | productStoichCoeff (size_t k, size_t i) const |
Stoichiometric coefficient of species k as a product in reaction i. | |
Reaction Rates Of Progress | |
virtual void | getFwdRatesOfProgress (doublereal *fwdROP) |
Forward rates of progress. | |
virtual void | getRevRatesOfProgress (doublereal *revROP) |
Reverse rates of progress. | |
virtual void | getNetRatesOfProgress (doublereal *netROP) |
Net rates of progress. | |
virtual void | getEquilibriumConstants (doublereal *kc) |
Equilibrium constants. | |
virtual void | getDeltaGibbs (doublereal *deltaG) |
Return the array of values for the reaction gibbs free energy change. | |
virtual void | getDeltaEnthalpy (doublereal *deltaH) |
Return the array of values for the reaction enthalpy change. | |
virtual void | getDeltaEntropy (doublereal *deltaS) |
Return the array of values for the reactions change in entropy. | |
virtual void | getDeltaSSGibbs (doublereal *deltaG) |
Return the array of values for the reaction standard state Gibbs free energy change. | |
virtual void | getDeltaSSEnthalpy (doublereal *deltaH) |
Return the array of values for the change in the standard state enthalpies of reaction. | |
virtual void | getDeltaSSEntropy (doublereal *deltaS) |
Return the array of values for the change in the standard state entropies for each reaction. | |
Species Production Rates | |
virtual void | getCreationRates (doublereal *cdot) |
Return the species creation rates. | |
virtual void | getDestructionRates (doublereal *ddot) |
Return a vector of the species destruction rates. | |
Reaction Mechanism Informational Query Routines | |
virtual int | reactionType (size_t i) const |
Flag specifying the type of reaction. | |
virtual std::string | reactionString (size_t i) const |
Return a std::string representing the reaction. | |
virtual bool | isReversible (size_t i) |
True if reaction i has been declared to be reversible. | |
virtual void | getFwdRateConstants (doublereal *kfwd) |
Return the forward rate constants. | |
virtual void | getRevRateConstants (doublereal *krev, bool doIrreversible=false) |
Return the reverse rate constants. | |
Reaction Mechanism Setup Routines | |
virtual void | init () |
Prepare the class for the addition of reactions. | |
virtual void | addReaction (ReactionData &r) |
Add a reaction to the mechanism. | |
virtual void | finalize () |
Finish adding reactions and prepare for use. | |
virtual bool | ready () const |
Returns true if the kinetics manager has been properly initialized and finalized. | |
virtual void | update_T () |
Update temperature-dependent portions of reaction rates and falloff functions. | |
virtual void | update_C () |
void | updateROP () |
const std::vector< grouplist_t > & | reactantGroups (size_t i) |
const std::vector< grouplist_t > & | productGroups (size_t i) |
virtual void | update_rates_T () |
virtual void | update_rates_C () |
void | _update_rates_T () |
void | _update_rates_C () |
Update properties that depend on concentrations. | |
Constructors and General Information about Mechanism | |
virtual void | assignShallowPointers (const std::vector< thermo_t * > &tpVector) |
Reassign the shallow pointers within the FKinetics object. | |
size_t | nReactions () const |
Number of reactions in the reaction mechanism. | |
void | checkReactionIndex (size_t m) const |
Check that the specified reaction index is in range Throws an exception if i is greater than nReactions() | |
void | checkReactionArraySize (size_t ii) const |
Check that an array size is at least nReactions() Throws an exception if ii is less than nReactions(). | |
void | checkSpeciesIndex (size_t k) const |
Check that the specified species index is in range Throws an exception if k is greater than nSpecies()-1. | |
void | checkSpeciesArraySize (size_t mm) const |
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies(). | |
Information/Lookup Functions about Phases and Species | |
size_t | nPhases () const |
The number of phases participating in the reaction mechanism. | |
void | checkPhaseIndex (size_t m) const |
Check that the specified phase index is in range Throws an exception if m is greater than nPhases() | |
void | checkPhaseArraySize (size_t mm) const |
Check that an array size is at least nPhases() Throws an exception if mm is less than nPhases(). | |
size_t | phaseIndex (std::string ph) |
Return the phase index of a phase in the list of phases defined within the object. | |
size_t | surfacePhaseIndex () |
This returns the integer index of the phase which has ThermoPhase type cSurf. | |
size_t | reactionPhaseIndex () |
Phase where the reactions occur. | |
thermo_t & | thermo (size_t n=0) |
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism. | |
const thermo_t & | thermo (size_t n=0) const |
thermo_t & | phase (size_t n=0) |
This method returns a reference to the nth ThermoPhase defined in this kinetics mechanism. | |
const thermo_t & | phase (size_t n=0) const |
This method returns a reference to the nth ThermoPhase defined in this kinetics mechanism. | |
size_t | nTotalSpecies () const |
The total number of species in all phases participating in the kinetics mechanism. | |
size_t | start (size_t n) |
Returns the starting index of the species in the nth phase associated with the reaction mechanism. | |
size_t | kineticsSpeciesIndex (size_t k, size_t n) const |
The location of species k of phase n in species arrays. | |
size_t | kineticsSpeciesIndex (const std::string &nm) const |
This routine will look up a species number based on the input std::string nm. | |
size_t | kineticsSpeciesIndex (const std::string &nm, const std::string &ph) const |
This routine will look up a species number based on the input std::string nm. | |
std::string | kineticsSpeciesName (size_t k) const |
Return the std::string name of the kth species in the kinetics manager. | |
thermo_t & | speciesPhase (std::string nm) |
This function looks up the std::string name of a species and returns a reference to the ThermoPhase object of the phase where the species resides. | |
thermo_t & | speciesPhase (size_t k) |
This function takes as an argument the kineticsSpecies index (i.e., the list index in the list of species in the kinetics manager) and returns the species' owning ThermoPhase object. | |
size_t | speciesPhaseIndex (size_t k) |
This function takes as an argument the kineticsSpecies index (i.e., the list index in the list of species in the kinetics manager) and returns the index of the phase owning the species. | |
Reaction Rates Of Progress | |
virtual void | getReactionDelta (const doublereal *property, doublereal *deltaProperty) |
Change in species properties. | |
virtual void | getDeltaElectrochemPotentials (doublereal *deltaM) |
Return the vector of values for the reaction electrochemical free energy change. | |
Reaction Mechanism Informational Query Routines | |
virtual doublereal | reactantOrder (size_t k, size_t i) const |
Reactant order of species k in reaction i. | |
virtual doublereal | productOrder (int k, int i) const |
product Order of species k in reaction i. | |
virtual void | getActivityConcentrations (doublereal *const conc) |
Get the vector of activity concentrations used in the kinetics object. | |
virtual const std::vector < size_t > & | reactants (size_t i) const |
Returns a read-only reference to the vector of reactant index numbers for reaction i. | |
virtual const std::vector < size_t > & | products (size_t i) const |
Returns a read-only reference to the vector of product index numbers for reaction i. | |
virtual void | getActivationEnergies (doublereal *E) |
Return the activation energies in Kelvin. | |
Reaction Mechanism Construction | |
virtual void | addPhase (thermo_t &thermo) |
Add a phase to the kinetics manager object. | |
Altering Reaction Rates | |
These methods alter reaction rates. They are designed primarily for carrying out sensitivity analysis, but may be used for any purpose requiring dynamic alteration of rate constants. For each reaction, a real-valued multiplier may be defined that multiplies the reaction rate coefficient. The multiplier may be set to zero to completely remove a reaction from the mechanism. | |
doublereal | multiplier (size_t i) const |
The current value of the multiplier for reaction i. | |
void | setMultiplier (size_t i, doublereal f) |
Set the multiplier for reaction i to f. | |
Protected Member Functions | |
void | processFalloffReactions () |
Protected Attributes | |
size_t | m_nfall |
std::vector< size_t > | m_fallindx |
Rate1< Arrhenius > | m_falloff_low_rates |
Rate1< Arrhenius > | m_falloff_high_rates |
Rate1< Arrhenius > | m_rates |
std::map< size_t, std::pair < int, size_t > > | m_index |
FalloffMgr | m_falloffn |
ThirdBodyMgr< Enhanced3BConc > | m_3b_concm |
ThirdBodyMgr< Enhanced3BConc > | m_falloff_concm |
std::vector< size_t > | m_irrev |
Rate1< Plog > | m_plog_rates |
Rate1< ChebyshevRate > | m_cheb_rates |
ReactionStoichMgr | m_rxnstoich |
std::vector< size_t > | m_fwdOrder |
size_t | m_nirrev |
size_t | m_nrev |
std::map< size_t, std::vector < grouplist_t > > | m_rgroups |
std::map< size_t, std::vector < grouplist_t > > | m_pgroups |
std::vector< int > | m_rxntype |
std::vector< std::map< size_t, doublereal > > | m_rrxn |
std::vector< std::map< size_t, doublereal > > | m_prxn |
vector_fp | m_dn |
Difference between the input global reactants order and the input global products order. | |
std::vector< size_t > | m_revindex |
std::vector< std::string > | m_rxneqn |
vector_fp | m_conc |
vector_fp | m_grt |
size_t | m_ii |
Number of reactions in the mechanism. | |
size_t | m_kk |
The number of species in all of the phases that participate in this kinetics mechanism. | |
vector_fp | m_perturb |
Vector of perturbation factors for each reaction's rate of progress vector. | |
std::vector< std::vector < size_t > > | m_reactants |
This is a vector of vectors containing the reactants for each reaction. | |
std::vector< std::vector < size_t > > | m_products |
This is a vector of vectors containing the products for each reaction. | |
std::vector< thermo_t * > | m_thermo |
m_thermo is a vector of pointers to ThermoPhase objects that are involved with this kinetics operator | |
std::vector< size_t > | m_start |
m_start is a vector of integers specifying the beginning position for the species vector for the n'th phase in the kinetics class. | |
std::map< std::string, size_t > | m_phaseindex |
Mapping of the phase id, i.e., the id attribute in the xml phase element to the position of the phase within the kinetics object. | |
size_t | m_surfphase |
Index in the list of phases of the one surface phase. | |
size_t | m_rxnphase |
Phase Index where reactions are assumed to be taking place. | |
size_t | m_mindim |
number of spatial dimensions of lowest-dimensional phase. | |
Reaction rate data | |
doublereal | m_logp_ref |
doublereal | m_logc_ref |
doublereal | m_logStandConc |
vector_fp | m_ropf |
vector_fp | m_ropr |
vector_fp | m_ropnet |
vector_fp | m_rfn_low |
vector_fp | m_rfn_high |
bool | m_ROP_ok |
doublereal | m_temp |
vector_fp | m_rfn |
vector_fp | falloff_work |
vector_fp | concm_3b_values |
vector_fp | concm_falloff_values |
vector_fp | m_rkcn |
Private Member Functions | |
void | gri30_update_rates_T () |
void | gri30_updateROP () |
void | gri30_updateKc () |
Update the equilibrium constants in molar units. | |
void | get_wdot (const doublereal *rop, doublereal *wdot) |
void | update_kc (const doublereal *grt, doublereal c0, doublereal *rkc) |
void | update_rates (doublereal t, doublereal tlog, doublereal *rf) |
void | eval_ropnet (const doublereal *c, const doublereal *rf, const doublereal *rkc, doublereal *r) |
Kinetics manager implementing reaction mechanism GRI-Mech 3.0.
Definition at line 24 of file GRI_30_Kinetics.h.
GRI_30_Kinetics | ( | thermo_t * | th = 0 | ) |
Default constructor.
Construct an empty reaction mechanism.
Definition at line 28 of file GRI_30_Kinetics.cpp.
|
inlinevirtual |
Destructor.
Definition at line 33 of file GRI_30_Kinetics.h.
|
inlinevirtual |
Reimplemented from GasKinetics.
Definition at line 38 of file GRI_30_Kinetics.h.
|
inlinevirtual |
Identifies the kinetics manager type.
Each class derived from Kinetics should overload this method to return a unique integer. Standard values are defined in file mix_defs.h.
Reimplemented from GasKinetics.
Definition at line 41 of file GRI_30_Kinetics.h.
|
inlinevirtual |
Return the species net production rates.
Species net production rates [kmol/m^3/s]. Return the species net production rates (creation - destruction) in array wdot, which must be dimensioned at least as large as the total number of species.
net | Array of species production rates. units kmol m-3 s-1 |
Reimplemented from GasKinetics.
Definition at line 45 of file GRI_30_Kinetics.h.
|
private |
Update the equilibrium constants in molar units.
Definition at line 51 of file GRI_30_Kinetics.cpp.
References Kinetics::m_thermo.
|
virtualinherited |
Duplication routine for objects which inherit from Kinetics.
This virtual routine can be used to duplicate Kinetics objects inherited from Kinetics even if the application only has a pointer to Kinetics to work with.
These routines are basically wrappers around the derived copy constructor.
tpVector | Vector of shallow pointers to ThermoPhase objects. this is the m_thermo vector within this object |
Reimplemented from Kinetics.
Definition at line 140 of file GasKinetics.cpp.
References Kinetics::assignShallowPointers(), and GasKinetics::GasKinetics().
|
inlinevirtualinherited |
Stoichiometric coefficient of species k as a reactant in reaction i.
k | kinetic species index |
i | reaction index |
Reimplemented from Kinetics.
Definition at line 115 of file GasKinetics.h.
|
inlinevirtualinherited |
Stoichiometric coefficient of species k as a product in reaction i.
k | kinetic species index |
i | reaction index |
Reimplemented from Kinetics.
Definition at line 119 of file GasKinetics.h.
|
inlinevirtualinherited |
Forward rates of progress.
Return the forward rates of progress in array fwdROP, which must be dimensioned at least as large as the total number of reactions.
Reimplemented from Kinetics.
Definition at line 134 of file GasKinetics.h.
|
inlinevirtualinherited |
Reverse rates of progress.
Return the reverse rates of progress in array revROP, which must be dimensioned at least as large as the total number of reactions.
Reimplemented from Kinetics.
Definition at line 145 of file GasKinetics.h.
|
inlinevirtualinherited |
Net rates of progress.
Return the net (forward - reverse) rates of progress in array netROP, which must be dimensioned at least as large as the total number of reactions.
Reimplemented from Kinetics.
Definition at line 156 of file GasKinetics.h.
|
virtualinherited |
Equilibrium constants.
Get the equilibrium constants of all reactions, whether reversible or not.
Return the equilibrium constants of the reactions in concentration units in array kc, which must be dimensioned at least as large as the total number of reactions.
Reimplemented from Kinetics.
Definition at line 248 of file GasKinetics.cpp.
References Cantera::GasConstant, ReactionStoichMgr::getReactionDelta(), ThermoPhase::getStandardChemPotentials(), GasKinetics::m_dn, Kinetics::m_ii, Phase::temperature(), and Kinetics::thermo().
Referenced by GasKinetics::getRevRateConstants().
|
virtualinherited |
Return the array of values for the reaction gibbs free energy change.
These values depend on the species concentrations.
units = J kmol-1
Return the vector of values for the reaction gibbs free energy change These values depend upon the concentration of the ideal gas.
units = J kmol-1
Reimplemented from Kinetics.
Definition at line 278 of file GasKinetics.cpp.
References ThermoPhase::getChemPotentials(), ReactionStoichMgr::getReactionDelta(), Kinetics::m_ii, and Kinetics::thermo().
|
virtualinherited |
Return the array of values for the reaction enthalpy change.
These values depend upon the species concentrations.
units = J kmol-1
Return the vector of values for the reactions change in enthalpy. These values depend upon the concentration of the solution.
units = J kmol-1
Reimplemented from Kinetics.
Definition at line 303 of file GasKinetics.cpp.
References ThermoPhase::getPartialMolarEnthalpies(), ReactionStoichMgr::getReactionDelta(), Kinetics::m_ii, and Kinetics::thermo().
|
virtualinherited |
Return the array of values for the reactions change in entropy.
These values depend upon the concentration of the solution.
units = J kmol-1 Kelvin-1
Reimplemented from Kinetics.
Definition at line 328 of file GasKinetics.cpp.
References ThermoPhase::getPartialMolarEntropies(), ReactionStoichMgr::getReactionDelta(), Kinetics::m_ii, and Kinetics::thermo().
|
virtualinherited |
Return the array of values for the reaction standard state Gibbs free energy change.
These values do not depend on the species concentrations.
units = J kmol-1
Return the vector of values for the reaction standard state gibbs free energy change. These values don't depend upon the concentration of the solution.
units = J kmol-1
Reimplemented from Kinetics.
Definition at line 353 of file GasKinetics.cpp.
References ReactionStoichMgr::getReactionDelta(), ThermoPhase::getStandardChemPotentials(), Kinetics::m_ii, and Kinetics::thermo().
|
virtualinherited |
Return the array of values for the change in the standard state enthalpies of reaction.
These values do not depend upon the concentration of the solution.
units = J kmol-1
Return the vector of values for the change in the standard state enthalpies of reaction. These values don't depend upon the concentration of the solution.
units = J kmol-1
Reimplemented from Kinetics.
Definition at line 380 of file GasKinetics.cpp.
References Cantera::GasConstant, ThermoPhase::getEnthalpy_RT(), ReactionStoichMgr::getReactionDelta(), Kinetics::m_ii, Kinetics::m_kk, Phase::temperature(), and Kinetics::thermo().
|
virtualinherited |
Return the array of values for the change in the standard state entropies for each reaction.
These values do not depend upon the concentration of the solution.
units = J kmol-1 Kelvin-1
Reimplemented from Kinetics.
Definition at line 411 of file GasKinetics.cpp.
References Cantera::GasConstant, ThermoPhase::getEntropy_R(), ReactionStoichMgr::getReactionDelta(), Kinetics::m_ii, Kinetics::m_kk, and Kinetics::thermo().
|
virtualinherited |
Return the species creation rates.
Species creation rates [kmol/m^3]. Return the species creation rates in array cdot, which must be dimensioned at least as large as the total number of species.
cdot | Array of species creation rates. units kmol m-3 s-1 |
Reimplemented from Kinetics.
Definition at line 457 of file GasKinetics.cpp.
References ReactionStoichMgr::getCreationRates(), and Kinetics::m_kk.
|
virtualinherited |
Return a vector of the species destruction rates.
Species destruction rates [kmol/m^3]. Return the species destruction rates in array ddot, which must be dimensioned at least as large as the total number of species.
ddot | Array of species destruction rates. units kmol m-3 s-1 |
Reimplemented from Kinetics.
Definition at line 475 of file GasKinetics.cpp.
References ReactionStoichMgr::getDestructionRates(), and Kinetics::m_kk.
|
inlinevirtualinherited |
Flag specifying the type of reaction.
The legal values and their meaning are specific to the particular kinetics manager.
Reimplemented from Kinetics.
Definition at line 282 of file GasKinetics.h.
|
inlinevirtualinherited |
Return a std::string representing the reaction.
i | reaction index |
Reimplemented from Kinetics.
Definition at line 286 of file GasKinetics.h.
|
inlinevirtualinherited |
True if reaction i has been declared to be reversible.
If isReversible(i) is false, then the reverse rate of progress for reaction i is always zero.
Reimplemented from Kinetics.
Definition at line 295 of file GasKinetics.h.
|
virtualinherited |
Return the forward rate constants.
length is the number of reactions. units depends on many issues.
Update the rate of progress for the reactions. This key routine makes sure that the rate of progress vectors located in the solid kinetics data class are up to date.
Reimplemented from Kinetics.
Definition at line 559 of file GasKinetics.cpp.
References Kinetics::m_ii, Kinetics::m_perturb, and Cantera::multiply_each().
Referenced by GasKinetics::getRevRateConstants().
|
virtualinherited |
Return the reverse rate constants.
length is the number of reactions. units depends on many issues. Note, this routine will return rate constants for irreversible reactions if the default for doIrreversible is overridden.
Return a vector of the reverse reaction rate constants
Length is the number of reactions. units depends on many issues. Note, this routine will return rate constants for irreversible reactions if the default for doIrreversible is overridden.
Reimplemented from Kinetics.
Definition at line 600 of file GasKinetics.cpp.
References GasKinetics::getEquilibriumConstants(), GasKinetics::getFwdRateConstants(), and Kinetics::m_ii.
|
virtualinherited |
Prepare the class for the addition of reactions.
This method is called by function importKinetics after all phases have been added but before any reactions have been. The base class method does nothing, but derived classes may use this to perform any initialization (allocating arrays, etc.) that requires knowing the phases and species, but before any reactions are added.
Reimplemented from Kinetics.
Definition at line 825 of file GasKinetics.cpp.
References Cantera::GasConstant, Kinetics::m_kk, Phase::nSpecies(), and Kinetics::thermo().
|
virtualinherited |
Add a reaction to the mechanism.
Reimplemented from Kinetics.
Definition at line 623 of file GasKinetics.cpp.
References Cantera::CHEBYSHEV_RXN, Cantera::ELEMENTARY_RXN, Cantera::FALLOFF_RXN, Kinetics::incrementRxnCount(), Cantera::PLOG_RXN, and Cantera::THREE_BODY_RXN.
|
virtualinherited |
Finish adding reactions and prepare for use.
This method is called by function importKinetics after all reactions have been entered into the mechanism and before the mechanism is used to calculate reaction rates. The base class method does nothing, but derived classes may use this to perform any initialization (allocating arrays, etc.) that must be done after the reactions are entered.
Reimplemented from Kinetics.
Definition at line 835 of file GasKinetics.cpp.
References Kinetics::m_ii, Kinetics::m_perturb, and FalloffMgr::workSize().
|
virtualinherited |
Returns true if the kinetics manager has been properly initialized and finalized.
Reimplemented from Kinetics.
Reimplemented in GRI30.
Definition at line 855 of file GasKinetics.cpp.
|
virtualinherited |
Update temperature-dependent portions of reaction rates and falloff functions.
Definition at line 151 of file GasKinetics.cpp.
|
inlineinherited |
Update properties that depend on concentrations.
Currently the enhanced collision partner concentrations are updated here, as well as the pressure-dependent portion of P-log and Chebyshev reactions.
Definition at line 361 of file GasKinetics.h.
|
virtualinherited |
Reassign the shallow pointers within the FKinetics object.
This type or routine is absolute necessary because the Kinetics object doesn't own the ThermoPhase objects. After a duplication, we need to point to different ThermoPhase objects.
We check that the ThermoPhase objects are aligned in the same order and have the following identical properties to the ones that they are replacing. id() eosType() nSpecies()
tpVector | Vector of shallow pointers to ThermoPhase objects. this is the m_thermo vector within this object |
Definition at line 179 of file Kinetics.cpp.
References ThermoPhase::eosType(), Phase::id(), Kinetics::m_thermo, and Phase::nSpecies().
Referenced by EdgeKinetics::duplMyselfAsKinetics(), AqueousKinetics::duplMyselfAsKinetics(), GasKinetics::duplMyselfAsKinetics(), InterfaceKinetics::duplMyselfAsKinetics(), and Kinetics::duplMyselfAsKinetics().
|
inlineinherited |
Number of reactions in the reaction mechanism.
Definition at line 209 of file Kinetics.h.
References Kinetics::m_ii.
Referenced by EdgeKinetics::finalize(), InterfaceKinetics::finalize(), InterfaceKinetics::getFwdRateConstants(), InterfaceKinetics::getRevRateConstants(), and InterfaceKinetics::updateKc().
|
inherited |
Check that the specified reaction index is in range Throws an exception if i is greater than nReactions()
Definition at line 136 of file Kinetics.cpp.
References Kinetics::m_ii.
|
inherited |
Check that an array size is at least nReactions() Throws an exception if ii is less than nReactions().
Used before calls which take an array pointer.
Definition at line 143 of file Kinetics.cpp.
References Kinetics::m_ii.
|
inherited |
Check that the specified species index is in range Throws an exception if k is greater than nSpecies()-1.
Definition at line 164 of file Kinetics.cpp.
References Kinetics::m_kk.
|
inherited |
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies().
Used before calls which take an array pointer.
Definition at line 171 of file Kinetics.cpp.
References Kinetics::m_kk.
|
inlineinherited |
The number of phases participating in the reaction mechanism.
For a homogeneous reaction mechanism, this will always return 1, but for a heterogeneous mechanism it will return the total number of phases in the mechanism.
Definition at line 244 of file Kinetics.h.
References Kinetics::m_thermo.
Referenced by InterfaceKinetics::_update_rates_C(), InterfaceKinetics::_update_rates_phi(), Kinetics::addPhase(), InterfaceKinetics::addReaction(), InterfaceKinetics::applyButlerVolmerCorrection(), Kinetics::checkPhaseArraySize(), Kinetics::checkPhaseIndex(), Kinetics::finalize(), InterfaceKinetics::getDeltaElectrochemPotentials(), InterfaceKinetics::getDeltaEnthalpy(), InterfaceKinetics::getDeltaEntropy(), InterfaceKinetics::getDeltaGibbs(), InterfaceKinetics::getDeltaSSEnthalpy(), InterfaceKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSGibbs(), InterfaceKinetics::getEquilibriumConstants(), ImplicitSurfChem::ImplicitSurfChem(), InterfaceKinetics::init(), Kinetics::nTotalSpecies(), InterfaceKinetics::operator=(), solveProb::print_header(), Kinetics::selectPhase(), InterfaceKinetics::updateKc(), solveSP::updateMFKinSpecies(), and InterfaceKinetics::updateROP().
|
inherited |
Check that the specified phase index is in range Throws an exception if m is greater than nPhases()
Definition at line 150 of file Kinetics.cpp.
References Kinetics::nPhases().
|
inherited |
Check that an array size is at least nPhases() Throws an exception if mm is less than nPhases().
Used before calls which take an array pointer.
Definition at line 157 of file Kinetics.cpp.
References Kinetics::nPhases().
|
inlineinherited |
Return the phase index of a phase in the list of phases defined within the object.
ph | std::string name of the phase |
If a -1 is returned, then the phase is not defined in the Kinetics object.
Definition at line 266 of file Kinetics.h.
References Kinetics::m_phaseindex, and Cantera::npos.
Referenced by Cantera::importKinetics().
|
inlineinherited |
This returns the integer index of the phase which has ThermoPhase type cSurf.
For heterogeneous mechanisms, this identifies the one surface phase. For homogeneous mechanisms, this returns -1.
Definition at line 280 of file Kinetics.h.
References Kinetics::m_surfphase.
Referenced by InterfaceKinetics::_update_rates_T(), solveSP::calc_t(), solveSP::fun_eval(), Cantera::getRateCoefficient(), solveProb::print_header(), and solveSP::solveSP().
|
inlineinherited |
Phase where the reactions occur.
For heterogeneous mechanisms, one of the phases in the list of phases represents the 2D interface or 1D edge at which the reactions take place. This method returns the index of the phase with the smallest spatial dimension (1, 2, or 3) among the list of phases. If there is more than one, the index of the first one is returned. For homogeneous mechanisms, the value 0 is returned.
Definition at line 294 of file Kinetics.h.
References Kinetics::m_rxnphase.
Referenced by EdgeKinetics::finalize(), and InterfaceKinetics::finalize().
|
inlineinherited |
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
It is typically used so that member functions of the ThermoPhase object may be called. For homogeneous mechanisms, there is only one object, and this method can be called without an argument to access it.
n | Index of the ThermoPhase being sought. |
Definition at line 309 of file Kinetics.h.
References Kinetics::m_thermo.
Referenced by AqueousKinetics::_update_rates_C(), InterfaceKinetics::_update_rates_C(), InterfaceKinetics::_update_rates_phi(), InterfaceKinetics::_update_rates_T(), InterfaceKinetics::applyButlerVolmerCorrection(), InterfaceKinetics::applyExchangeCurrentDensityFormulation(), solveSP::calc_t(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), InterfaceKinetics::getDeltaElectrochemPotentials(), AqueousKinetics::getDeltaEnthalpy(), GasKinetics::getDeltaEnthalpy(), InterfaceKinetics::getDeltaEnthalpy(), AqueousKinetics::getDeltaEntropy(), GasKinetics::getDeltaEntropy(), InterfaceKinetics::getDeltaEntropy(), AqueousKinetics::getDeltaGibbs(), GasKinetics::getDeltaGibbs(), InterfaceKinetics::getDeltaGibbs(), AqueousKinetics::getDeltaSSEnthalpy(), GasKinetics::getDeltaSSEnthalpy(), InterfaceKinetics::getDeltaSSEnthalpy(), AqueousKinetics::getDeltaSSEntropy(), GasKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSEntropy(), AqueousKinetics::getDeltaSSGibbs(), GasKinetics::getDeltaSSGibbs(), InterfaceKinetics::getDeltaSSGibbs(), Cantera::getEfficiencies(), AqueousKinetics::getEquilibriumConstants(), GasKinetics::getEquilibriumConstants(), InterfaceKinetics::getEquilibriumConstants(), Cantera::getRateCoefficient(), Cantera::getStick(), ImplicitSurfChem::ImplicitSurfChem(), AqueousKinetics::init(), GasKinetics::init(), InterfaceKinetics::init(), ConstPressureReactor::initialize(), Reactor::initialize(), Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), Kinetics::nTotalSpecies(), solveProb::print_header(), InterfaceKinetics::setElectricPotential(), ImplicitSurfChem::solvePseudoSteadyStateProblem(), solveSP::solveSP(), Kinetics::speciesPhase(), AqueousKinetics::updateKc(), GasKinetics::updateKc(), InterfaceKinetics::updateKc(), and solveSP::updateMFKinSpecies().
|
inlineinherited |
This method returns a reference to the nth ThermoPhase defined in this kinetics mechanism.
It is typically used so that member functions of the ThermoPhase may be called.
n | Index of the ThermoPhase being sought. |
Definition at line 324 of file Kinetics.h.
References Cantera::deprecatedMethod(), and Kinetics::m_thermo.
|
inlineinherited |
This method returns a reference to the nth ThermoPhase defined in this kinetics mechanism.
It is typically used so that member functions of the ThermoPhase may be called.
n | Index of the ThermoPhase being sought. |
Definition at line 336 of file Kinetics.h.
References Cantera::deprecatedMethod(), and Kinetics::m_thermo.
|
inlineinherited |
The total number of species in all phases participating in the kinetics mechanism.
This is useful to dimension arrays for use in calls to methods that return the species production rates, for example.
Definition at line 347 of file Kinetics.h.
References Kinetics::nPhases(), Phase::nSpecies(), and Kinetics::thermo().
Referenced by ReactingSurf1D::init(), and rxninfo::installReaction().
|
inlineinherited |
Returns the starting index of the species in the nth phase associated with the reaction mechanism.
n | Return the index of first species in the nth phase associated with the reaction mechanism. |
Definition at line 363 of file Kinetics.h.
References Cantera::deprecatedMethod(), and Kinetics::m_start.
|
inlineinherited |
The location of species k of phase n in species arrays.
Kinetics manager classes return species production rates in flat arrays, with the species of each phases following one another, in the order the phases were added. This method is useful to find the value for a particular species of a particular phase in arrays returned from methods like getCreationRates that return an array of species-specific quantities.
Example: suppose a heterogeneous mechanism involves three phases. The first contains 12 species, the second 26, and the third 3. Then species arrays must have size at least 41, and positions 0 - 11 are the values for the species in the first phase, positions 12 - 37 are the values for the species in the second phase, etc. Then kineticsSpeciesIndex(7, 0) = 7, kineticsSpeciesIndex(4, 1) = 16, and kineticsSpeciesIndex(2, 2) = 40.
k | species index |
n | phase index for the species |
Definition at line 391 of file Kinetics.h.
References Kinetics::m_start.
Referenced by solveSP::calc_t(), Cantera::checkRxnElementBalance(), ReactingSurf1D::eval(), solveSP::fun_eval(), Cantera::getEfficiencies(), Cantera::getReagents(), Cantera::getStick(), Kinetics::kineticsSpeciesIndex(), solveSP::solveSP(), and solveSP::updateMFKinSpecies().
|
inherited |
This routine will look up a species number based on the input std::string nm.
The lookup of species will occur for all phases listed in the kinetics object.
return
nm | Input string name of the species |
Definition at line 263 of file Kinetics.cpp.
References Phase::id(), Kinetics::m_start, Kinetics::m_thermo, Cantera::npos, Phase::speciesIndex(), and Kinetics::thermo().
|
inherited |
This routine will look up a species number based on the input std::string nm.
The lookup of species will occur in the specified phase of the object, or all phases if ph is "<any>".
return
nm | Input string name of the species |
ph | Input string name of the phase. |
Definition at line 288 of file Kinetics.cpp.
References Phase::id(), Kinetics::kineticsSpeciesIndex(), Kinetics::m_start, Kinetics::m_thermo, Cantera::npos, Phase::speciesIndex(), and Kinetics::thermo().
|
inherited |
Return the std::string name of the kth species in the kinetics manager.
k is an integer from 0 to ktot - 1, where ktot is the number of species in the kinetics manager, which is the sum of the number of species in all phases participating in the kinetics manager. If k is out of bounds, the std::string "<unknown>" is returned.
k | species index |
Return the string name of the kth species in the kinetics manager. k is an integer from 0 to ktot - 1, where ktot is the number of species in the kinetics manager, which is the sum of the number of species in all phases participating in the kinetics manager. If k is out of bounds, the string "<unknown>" is returned.
Definition at line 242 of file Kinetics.cpp.
References Kinetics::m_start, Cantera::npos, Phase::speciesName(), and Kinetics::thermo().
Referenced by Cantera::getStick(), solveSP::printFinal(), solveProb::printIteration(), and solveSP::printIteration().
|
inherited |
This function looks up the std::string name of a species and returns a reference to the ThermoPhase object of the phase where the species resides.
This function looks up the string name of a species and returns a reference to the ThermoPhase object of the phase where the species resides.
Will throw an error if the species std::string doesn't match.
nm | String containing the name of the species. |
Will throw an error if the species string doesn't match.
Definition at line 315 of file Kinetics.cpp.
References Kinetics::m_thermo, Cantera::npos, Phase::speciesIndex(), and Kinetics::thermo().
Referenced by Cantera::checkRxnElementBalance(), Cantera::getStick(), and rxninfo::installReaction().
|
inlineinherited |
This function takes as an argument the kineticsSpecies index (i.e., the list index in the list of species in the kinetics manager) and returns the species' owning ThermoPhase object.
k | Species index |
Definition at line 454 of file Kinetics.h.
References Kinetics::speciesPhaseIndex(), and Kinetics::thermo().
|
inherited |
This function takes as an argument the kineticsSpecies index (i.e., the list index in the list of species in the kinetics manager) and returns the index of the phase owning the species.
k | Species index |
Definition at line 337 of file Kinetics.cpp.
References Cantera::int2str(), Kinetics::m_start, and Cantera::npos.
Referenced by InterfaceKinetics::addReaction(), Cantera::checkRxnElementBalance(), Cantera::getStick(), and Kinetics::speciesPhase().
|
inlinevirtualinherited |
Change in species properties.
Given an array of molar species property values \( z_k, k = 1, \dots, K \), return the array of reaction values
\[ \Delta Z_i = \sum_k \nu_{k,i} z_k, i = 1, \dots, I. \]
For example, if this method is called with the array of standard-state molar Gibbs free energies for the species, then the values returned in array deltaProperty
would be the standard-state Gibbs free energies of reaction for each reaction.
property | Input vector of property value. Length: m_kk. |
deltaProperty | Output vector of deltaRxn. Length: m_ii. |
Definition at line 547 of file Kinetics.h.
References Kinetics::err().
|
inlinevirtualinherited |
Return the vector of values for the reaction electrochemical free energy change.
These values depend upon the concentration of the solution and the voltage of the phases
units = J kmol-1
deltaM | Output vector of deltaM's for reactions Length: m_ii. |
Reimplemented in InterfaceKinetics.
Definition at line 575 of file Kinetics.h.
References Kinetics::err().
|
inlinevirtualinherited |
Reactant order of species k in reaction i.
This is the nominal order of the activity concentration in determining the forward rate of progress of the reaction
k | kinetic species index |
i | reaction index |
Definition at line 735 of file Kinetics.h.
References Kinetics::err().
|
inlinevirtualinherited |
product Order of species k in reaction i.
This is the nominal order of the activity concentration of species k in determining the reverse rate of progress of the reaction i
For irreversible reactions, this will all be zero.
k | kinetic species index |
i | reaction index |
Definition at line 750 of file Kinetics.h.
References Kinetics::err().
|
inlinevirtualinherited |
Get the vector of activity concentrations used in the kinetics object.
conc | (output) Vector of activity concentrations. Length is equal to the number of species in the kinetics object |
Reimplemented in InterfaceKinetics.
Definition at line 760 of file Kinetics.h.
References Kinetics::err().
|
inlinevirtualinherited |
Returns a read-only reference to the vector of reactant index numbers for reaction i.
i | reaction index |
Definition at line 770 of file Kinetics.h.
References Kinetics::m_reactants.
Referenced by InterfaceKinetics::addReaction(), and rxninfo::installReaction().
|
inlinevirtualinherited |
Returns a read-only reference to the vector of product index numbers for reaction i.
i | reaction index |
Definition at line 780 of file Kinetics.h.
References Kinetics::m_products.
Referenced by InterfaceKinetics::addReaction(), and rxninfo::installReaction().
|
inlinevirtualinherited |
Return the activation energies in Kelvin.
length is the number of reactions
E | Ouptut vector of activation energies. Length: m_ii. |
Reimplemented in InterfaceKinetics.
Definition at line 859 of file Kinetics.h.
References Kinetics::err().
|
virtualinherited |
Add a phase to the kinetics manager object.
This must be done before the function init() is called or before any reactions are input. The following fields are updated: m_start -> vector of integers, containing the starting position of the species for each phase in the kinetics mechanism. m_surfphase -> index of the surface phase. m_thermo -> vector of pointers to ThermoPhase phases that participate in the kinetics mechanism. m_phaseindex -> map containing the std::string id of each ThermoPhase phase as a key and the index of the phase within the kinetics manager object as the value.
thermo | Reference to the ThermoPhase to be added. |
Reimplemented in InterfaceKinetics.
Definition at line 365 of file Kinetics.cpp.
References Cantera::cEdge, Cantera::cSurf, ThermoPhase::eosType(), Kinetics::m_mindim, Kinetics::m_phaseindex, Kinetics::m_rxnphase, Kinetics::m_start, Kinetics::m_surfphase, Kinetics::m_thermo, Phase::nDim(), Kinetics::nPhases(), and Kinetics::type().
Referenced by InterfaceKinetics::addPhase(), AqueousKinetics::AqueousKinetics(), GasKinetics::GasKinetics(), and Cantera::importKinetics().
|
inlineinherited |
The current value of the multiplier for reaction i.
i | index of the reaction |
Definition at line 953 of file Kinetics.h.
References Kinetics::m_perturb.
|
inlineinherited |
Set the multiplier for reaction i to f.
i | index of the reaction |
f | value of the multiplier. |
Definition at line 962 of file Kinetics.h.
References Kinetics::m_perturb.
|
inlineinherited |
Increment the number of reactions in the mechanism by one.
Definition at line 972 of file Kinetics.h.
References Kinetics::m_ii, and Kinetics::m_perturb.
Referenced by AqueousKinetics::addReaction(), GasKinetics::addReaction(), and InterfaceKinetics::addReaction().
|
inherited |
Extract from array data
the portion pertaining to phase phase
.
Takes as input an array of properties for all species in the mechanism and copies those values beloning to a particular phase to the output array.
data | data |
phase | phase |
phase_data | phase_data |
data | Input data array. |
phase | Pointer to one of the phase objects participating in this reaction mechanism |
phase_data | Output array where the values for the the specified phase are to be written. |
Definition at line 217 of file Kinetics.cpp.
References Kinetics::m_start, Kinetics::m_thermo, Kinetics::nPhases(), and Phase::nSpecies().
|
protectedinherited |
Difference between the input global reactants order and the input global products order.
Changed to a double to account for the fact that we can have real-valued stoichiometries.
Definition at line 410 of file GasKinetics.h.
Referenced by GasKinetics::getEquilibriumConstants(), GasKinetics::operator=(), and GasKinetics::updateKc().
|
protectedinherited |
Number of reactions in the mechanism.
Definition at line 1000 of file Kinetics.h.
Referenced by Kinetics::checkReactionArraySize(), Kinetics::checkReactionIndex(), AqueousKinetics::finalize(), GasKinetics::finalize(), AqueousKinetics::getDeltaEnthalpy(), GasKinetics::getDeltaEnthalpy(), AqueousKinetics::getDeltaEntropy(), GasKinetics::getDeltaEntropy(), AqueousKinetics::getDeltaGibbs(), GasKinetics::getDeltaGibbs(), AqueousKinetics::getDeltaSSEnthalpy(), GasKinetics::getDeltaSSEnthalpy(), AqueousKinetics::getDeltaSSEntropy(), GasKinetics::getDeltaSSEntropy(), AqueousKinetics::getDeltaSSGibbs(), GasKinetics::getDeltaSSGibbs(), AqueousKinetics::getEquilibriumConstants(), GasKinetics::getEquilibriumConstants(), InterfaceKinetics::getEquilibriumConstants(), AqueousKinetics::getFwdRateConstants(), GasKinetics::getFwdRateConstants(), AqueousKinetics::getRevRateConstants(), GasKinetics::getRevRateConstants(), InterfaceKinetics::getRevRateConstants(), Kinetics::incrementRxnCount(), Kinetics::nReactions(), InterfaceKinetics::operator=(), Kinetics::operator=(), AqueousKinetics::updateKc(), GasKinetics::updateKc(), InterfaceKinetics::updateKc(), InterfaceKinetics::updateROP(), and InterfaceKinetics::~InterfaceKinetics().
|
protectedinherited |
The number of species in all of the phases that participate in this kinetics mechanism.
Definition at line 1004 of file Kinetics.h.
Referenced by Kinetics::checkSpeciesArraySize(), Kinetics::checkSpeciesIndex(), InterfaceKinetics::finalize(), Kinetics::finalize(), AqueousKinetics::getCreationRates(), GasKinetics::getCreationRates(), InterfaceKinetics::getCreationRates(), AqueousKinetics::getDeltaSSEnthalpy(), GasKinetics::getDeltaSSEnthalpy(), InterfaceKinetics::getDeltaSSEnthalpy(), AqueousKinetics::getDeltaSSEntropy(), GasKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSEntropy(), AqueousKinetics::getDestructionRates(), GasKinetics::getDestructionRates(), InterfaceKinetics::getDestructionRates(), AqueousKinetics::getNetProductionRates(), GasKinetics::getNetProductionRates(), InterfaceKinetics::getNetProductionRates(), AqueousKinetics::init(), GasKinetics::init(), InterfaceKinetics::init(), and Kinetics::operator=().
|
protectedinherited |
Vector of perturbation factors for each reaction's rate of progress vector.
It is initialized to one.
Definition at line 1009 of file Kinetics.h.
Referenced by EdgeKinetics::finalize(), AqueousKinetics::finalize(), GasKinetics::finalize(), InterfaceKinetics::finalize(), AqueousKinetics::getFwdRateConstants(), GasKinetics::getFwdRateConstants(), InterfaceKinetics::getFwdRateConstants(), Kinetics::incrementRxnCount(), Kinetics::multiplier(), Kinetics::operator=(), Kinetics::setMultiplier(), and InterfaceKinetics::updateROP().
|
protectedinherited |
This is a vector of vectors containing the reactants for each reaction.
The outer vector is over the number of reactions, m_ii. The inner vector is a list of species indices. If the stoichiometric coefficient for a reactant is greater than one, then the reactant is listed contiguously in the vector a number of times equal to its stoichiometric coefficient. NOTE: These vectors will be wrong if there are real stoichiometric coefficients in the expression.
Definition at line 1022 of file Kinetics.h.
Referenced by Kinetics::operator=(), and Kinetics::reactants().
|
protectedinherited |
This is a vector of vectors containing the products for each reaction.
The outer vector is over the number of reactions, m_ii. The inner vector is a list of species indices. If the stoichiometric coefficient for a product is greater than one, then the reactant is listed contiguously in the vector a number of times equal to its stoichiometric coefficient. NOTE: These vectors will be wrong if there are real stoichiometric coefficients in the expression.
Definition at line 1035 of file Kinetics.h.
Referenced by Kinetics::operator=(), and Kinetics::products().
|
protectedinherited |
m_thermo is a vector of pointers to ThermoPhase objects that are involved with this kinetics operator
For homogeneous kinetics applications, this vector will only have one entry. For interfacial reactions, this vector will consist of multiple entries; some of them will be surface phases, and the other ones will be bulk phases. The order that the objects are listed determines the order in which the species comprising each phase are listed in the source term vector, originating from the reaction mechanism.
Note that this kinetics object doesn't own these ThermoPhase objects and is not responsible for creating or deleting them.
Definition at line 1052 of file Kinetics.h.
Referenced by Kinetics::addPhase(), Kinetics::assignShallowPointers(), InterfaceKinetics::finalize(), Kinetics::finalize(), GRI_30_Kinetics::gri30_updateKc(), Kinetics::kineticsSpeciesIndex(), Kinetics::nPhases(), Kinetics::operator=(), Kinetics::phase(), InterfaceKinetics::phaseExistence(), InterfaceKinetics::phaseStability(), Kinetics::selectPhase(), InterfaceKinetics::setPhaseExistence(), InterfaceKinetics::setPhaseStability(), Kinetics::speciesPhase(), and Kinetics::thermo().
|
protectedinherited |
m_start is a vector of integers specifying the beginning position for the species vector for the n'th phase in the kinetics class.
Definition at line 1059 of file Kinetics.h.
Referenced by InterfaceKinetics::_update_rates_C(), Kinetics::addPhase(), InterfaceKinetics::getDeltaElectrochemPotentials(), InterfaceKinetics::getDeltaEnthalpy(), InterfaceKinetics::getDeltaEntropy(), InterfaceKinetics::getDeltaGibbs(), InterfaceKinetics::getDeltaSSEnthalpy(), InterfaceKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSGibbs(), InterfaceKinetics::getEquilibriumConstants(), Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), Kinetics::operator=(), Kinetics::selectPhase(), Kinetics::speciesPhaseIndex(), Kinetics::start(), and InterfaceKinetics::updateKc().
|
protectedinherited |
Mapping of the phase id, i.e., the id attribute in the xml phase element to the position of the phase within the kinetics object.
Positions start with the value of 1. The member function, phaseIndex() decrements by one before returning the index value, so that missing phases return -1.
Definition at line 1069 of file Kinetics.h.
Referenced by Kinetics::addPhase(), Kinetics::operator=(), and Kinetics::phaseIndex().
|
protectedinherited |
Index in the list of phases of the one surface phase.
Definition at line 1075 of file Kinetics.h.
Referenced by Kinetics::addPhase(), Kinetics::operator=(), and Kinetics::surfacePhaseIndex().
|
protectedinherited |
Phase Index where reactions are assumed to be taking place.
We calculate this by assuming that the phase with the lowest dimensionality is the phase where reactions are taking place
Definition at line 1083 of file Kinetics.h.
Referenced by Kinetics::addPhase(), Kinetics::operator=(), and Kinetics::reactionPhaseIndex().
|
protectedinherited |
number of spatial dimensions of lowest-dimensional phase.
Definition at line 1086 of file Kinetics.h.
Referenced by Kinetics::addPhase(), and Kinetics::operator=().