Cantera
2.2.1
|
Public interface for kinetics managers. More...
#include <Kinetics.h>
Public Member Functions | |
void | incrementRxnCount () |
Increment the number of reactions in the mechanism by one. More... | |
virtual bool | ready () const |
Returns true if the kinetics manager has been properly initialized and finalized. More... | |
virtual std::pair< size_t, size_t > | checkDuplicates (bool throw_err=true) const |
Check for duplicate reactions. More... | |
void | selectPhase (const doublereal *data, const thermo_t *phase, doublereal *phase_data) |
Constructors and General Information about Mechanism | |
Kinetics () | |
Default constructor. More... | |
virtual | ~Kinetics () |
Destructor. More... | |
Kinetics (const Kinetics &) | |
Copy Constructor for the Kinetics object. More... | |
Kinetics & | operator= (const Kinetics &right) |
Assignment operator. More... | |
virtual Kinetics * | duplMyselfAsKinetics (const std::vector< thermo_t * > &tpVector) const |
Duplication routine for objects which inherit from Kinetics. More... | |
virtual void | assignShallowPointers (const std::vector< thermo_t * > &tpVector) |
Reassign the pointers within the Kinetics object. More... | |
virtual int | type () const |
Identifies the kinetics manager type. More... | |
size_t | nReactions () const |
Number of reactions in the reaction mechanism. More... | |
void | checkReactionIndex (size_t m) const |
Check that the specified reaction index is in range Throws an exception if i is greater than nReactions() More... | |
void | checkReactionArraySize (size_t ii) const |
Check that an array size is at least nReactions() Throws an exception if ii is less than nReactions(). More... | |
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. More... | |
void | checkSpeciesArraySize (size_t mm) const |
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies(). More... | |
Information/Lookup Functions about Phases and Species | |
size_t | nPhases () const |
The number of phases participating in the reaction mechanism. More... | |
void | checkPhaseIndex (size_t m) const |
Check that the specified phase index is in range Throws an exception if m is greater than nPhases() More... | |
void | checkPhaseArraySize (size_t mm) const |
Check that an array size is at least nPhases() Throws an exception if mm is less than nPhases(). More... | |
size_t | phaseIndex (const std::string &ph) |
Return the phase index of a phase in the list of phases defined within the object. More... | |
size_t | surfacePhaseIndex () |
This returns the integer index of the phase which has ThermoPhase type cSurf. More... | |
size_t | reactionPhaseIndex () |
Phase where the reactions occur. More... | |
thermo_t & | thermo (size_t n=0) |
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism. More... | |
const thermo_t & | thermo (size_t n=0) const |
size_t | nTotalSpecies () const |
The total number of species in all phases participating in the kinetics mechanism. More... | |
size_t | kineticsSpeciesIndex (size_t k, size_t n) const |
The location of species k of phase n in species arrays. More... | |
std::string | kineticsSpeciesName (size_t k) const |
Return the name of the kth species in the kinetics manager. More... | |
size_t | kineticsSpeciesIndex (const std::string &nm) const |
This routine will look up a species number based on the input std::string nm. More... | |
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. More... | |
thermo_t & | speciesPhase (const std::string &nm) |
This function looks up the name of a species and returns a reference to the ThermoPhase object of the phase where the species resides. More... | |
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. More... | |
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. More... | |
Reaction Rates Of Progress | |
virtual void | getFwdRatesOfProgress (doublereal *fwdROP) |
Return the forward rates of progress of the reactions. More... | |
virtual void | getRevRatesOfProgress (doublereal *revROP) |
Return the Reverse rates of progress of the reactions. More... | |
virtual void | getNetRatesOfProgress (doublereal *netROP) |
Net rates of progress. More... | |
virtual void | getEquilibriumConstants (doublereal *kc) |
Return a vector of Equilibrium constants. More... | |
virtual void | getReactionDelta (const doublereal *property, doublereal *deltaProperty) |
Change in species properties. More... | |
virtual void | getRevReactionDelta (const doublereal *g, doublereal *dg) |
Given an array of species properties 'g', return in array 'dg' the change in this quantity in the reversible reactions. More... | |
virtual void | getDeltaGibbs (doublereal *deltaG) |
Return the vector of values for the reaction Gibbs free energy change. More... | |
virtual void | getDeltaElectrochemPotentials (doublereal *deltaM) |
Return the vector of values for the reaction electrochemical free energy change. More... | |
virtual void | getDeltaEnthalpy (doublereal *deltaH) |
Return the vector of values for the reactions change in enthalpy. More... | |
virtual void | getDeltaEntropy (doublereal *deltaS) |
Return the vector of values for the reactions change in entropy. More... | |
virtual void | getDeltaSSGibbs (doublereal *deltaG) |
Return the vector of values for the reaction standard state Gibbs free energy change. More... | |
virtual void | getDeltaSSEnthalpy (doublereal *deltaH) |
Return the vector of values for the change in the standard state enthalpies of reaction. More... | |
virtual void | getDeltaSSEntropy (doublereal *deltaS) |
Return the vector of values for the change in the standard state entropies for each reaction. More... | |
Species Production Rates | |
virtual void | getCreationRates (doublereal *cdot) |
Species creation rates [kmol/m^3/s or kmol/m^2/s]. More... | |
virtual void | getDestructionRates (doublereal *ddot) |
Species destruction rates [kmol/m^3/s or kmol/m^2/s]. More... | |
virtual void | getNetProductionRates (doublereal *wdot) |
Species net production rates [kmol/m^3/s or kmol/m^2/s]. More... | |
Reaction Mechanism Informational Query Routines | |
virtual double | reactantStoichCoeff (size_t k, size_t i) const |
Stoichiometric coefficient of species k as a reactant in reaction i. More... | |
virtual double | productStoichCoeff (size_t k, size_t i) const |
Stoichiometric coefficient of species k as a product in reaction i. More... | |
virtual doublereal | reactantOrder (size_t k, size_t i) const |
Reactant order of species k in reaction i. More... | |
virtual doublereal | productOrder (int k, int i) const |
product Order of species k in reaction i. More... | |
virtual void | getActivityConcentrations (doublereal *const conc) |
Get the vector of activity concentrations used in the kinetics object. More... | |
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. More... | |
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. More... | |
virtual int | reactionType (size_t i) const |
Flag specifying the type of reaction. More... | |
virtual bool | isReversible (size_t i) |
True if reaction i has been declared to be reversible. More... | |
const std::string & | reactionString (size_t i) const |
Return a string representing the reaction. More... | |
const std::string & | reactantString (size_t i) const |
Returns a string containing the reactants side of the reaction equation. More... | |
const std::string & | productString (size_t i) const |
Returns a string containing the products side of the reaction equation. More... | |
virtual void | getFwdRateConstants (doublereal *kfwd) |
Return the forward rate constants. More... | |
virtual void | getRevRateConstants (doublereal *krev, bool doIrreversible=false) |
Return the reverse rate constants. More... | |
Reaction Mechanism Construction | |
virtual void | addPhase (thermo_t &thermo) |
Add a phase to the kinetics manager object. More... | |
virtual void | init () |
Prepare the class for the addition of reactions. More... | |
virtual void | finalize () |
Finish adding reactions and prepare for use. More... | |
virtual void | addReaction (ReactionData &r) |
Add a single reaction to the mechanism. More... | |
virtual bool | addReaction (shared_ptr< Reaction > r) |
Add a single reaction to the mechanism. More... | |
virtual void | modifyReaction (size_t i, shared_ptr< Reaction > rNew) |
Modify the rate expression associated with a reaction. More... | |
shared_ptr< Reaction > | reaction (size_t i) |
Return the Reaction object for reaction i. More... | |
void | skipUndeclaredSpecies (bool skip) |
Determine behavior when adding a new reaction that contains species not defined in any of the phases associated with this kinetics manager. More... | |
void | skipUndeclaredThirdBodies (bool skip) |
Determine behavior when adding a new reaction that contains third-body efficiencies for species not defined in any of the phases associated with this kinetics manager. More... | |
virtual void | installReagents (const ReactionData &r) |
virtual void | installGroups (size_t irxn, const std::vector< grouplist_t > &r, const std::vector< grouplist_t > &p) |
virtual const std::vector < grouplist_t > & | reactantGroups (size_t i) |
virtual const std::vector < grouplist_t > & | productGroups (size_t i) |
Altering Reaction Rates | |
doublereal | multiplier (size_t i) const |
The current value of the multiplier for reaction i. More... | |
virtual void | setMultiplier (size_t i, doublereal f) |
Set the multiplier for reaction i to f. More... | |
Protected Member Functions | |
virtual void | updateROP () |
double | checkDuplicateStoich (std::map< int, double > &r1, std::map< int, double > &r2) const |
Check whether r1 and r2 represent duplicate stoichiometries This function returns a ratio if two reactions are duplicates of one another, and 0.0 otherwise. More... | |
void | checkReactionBalance (const Reaction &R) |
Check that the specified reaction is balanced (same number of atoms for each element in the reactants and products). More... | |
Protected Attributes | |
ValueCache | m_cache |
Cache for saved calculations within each Kinetics object. More... | |
size_t | m_ii |
Number of reactions in the mechanism. More... | |
size_t | m_kk |
The number of species in all of the phases that participate in this kinetics mechanism. More... | |
vector_fp | m_perturb |
Vector of perturbation factors for each reaction's rate of progress vector. More... | |
std::vector< shared_ptr < Reaction > > | m_reactions |
Vector of Reaction objects represented by this Kinetics manager. More... | |
std::vector< std::vector < size_t > > | m_reactants |
This is a vector of vectors containing the reactants for each reaction. More... | |
std::vector< std::vector < size_t > > | m_products |
This is a vector of vectors containing the products for each reaction. More... | |
std::vector< std::map< size_t, doublereal > > | m_rrxn |
m_rrxn is a vector of maps, containing the reactant stoichiometric coefficient information More... | |
std::vector< std::map< size_t, doublereal > > | m_prxn |
m_prxn is a vector of maps, containing the reactant stoichiometric coefficient information More... | |
std::vector< int > | m_rxntype |
std::vector< thermo_t * > | m_thermo |
m_thermo is a vector of pointers to ThermoPhase objects that are involved with this kinetics operator More... | |
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. More... | |
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. More... | |
size_t | m_surfphase |
Index in the list of phases of the one surface phase. More... | |
size_t | m_rxnphase |
Phase Index where reactions are assumed to be taking place. More... | |
size_t | m_mindim |
number of spatial dimensions of lowest-dimensional phase. More... | |
std::vector< std::string > | m_rxneqn |
Representation of each reaction equation. More... | |
std::vector< std::string > | m_reactantStrings |
Representation of the reactant side of each reaction equation. More... | |
std::vector< std::string > | m_productStrings |
Representation of the product side of each reaction equation. More... | |
vector_fp | m_rfn |
Forward rate constant for each reaction. More... | |
vector_fp | m_rkcn |
Reciprocal of the equilibrium constant in concentration units. More... | |
vector_fp | m_ropf |
Forward rate-of-progress for each reaction. More... | |
vector_fp | m_ropr |
Reverse rate-of-progress for each reaction. More... | |
vector_fp | m_ropnet |
Net rate-of-progress for each reaction. More... | |
bool | m_skipUndeclaredSpecies |
bool | m_skipUndeclaredThirdBodies |
Stoichiometry management | |
StoichManagerN | m_reactantStoich |
Stoichiometry manager for the reactants for each reaction. More... | |
StoichManagerN | m_revProductStoich |
Stoichiometry manager for the products of reversible reactions. More... | |
StoichManagerN | m_irrevProductStoich |
Stoichiometry manager for the products of irreversible reactions. More... | |
Private Attributes | |
std::map< size_t, std::vector < grouplist_t > > | m_rgroups |
std::map< size_t, std::vector < grouplist_t > > | m_pgroups |
Public interface for kinetics managers.
This class serves as a base class to derive 'kinetics managers', which are classes that manage homogeneous chemistry within one phase, or heterogeneous chemistry at one interface. The virtual methods of this class are meant to be overloaded in subclasses. The non-virtual methods perform generic functions and are implemented in Kinetics. They should not be overloaded. Only those methods required by a subclass need to be overloaded; the rest will throw exceptions if called.
When the nomenclature "kinetics species index" is used below, this means that the species index ranges over all species in all phases handled by the kinetics manager.
Definition at line 128 of file Kinetics.h.
Kinetics | ( | ) |
Default constructor.
Definition at line 19 of file Kinetics.cpp.
Referenced by Kinetics::duplMyselfAsKinetics().
|
virtual |
Destructor.
Definition at line 31 of file Kinetics.cpp.
Copy Constructor for the Kinetics object.
Definition at line 33 of file Kinetics.cpp.
Assignment operator.
right | Reference to Kinetics object to be copied into the current one. |
Definition at line 41 of file Kinetics.cpp.
References Kinetics::m_ii, Kinetics::m_irrevProductStoich, Kinetics::m_kk, Kinetics::m_mindim, Kinetics::m_perturb, Kinetics::m_phaseindex, Kinetics::m_products, Kinetics::m_productStrings, Kinetics::m_prxn, Kinetics::m_reactants, Kinetics::m_reactantStoich, Kinetics::m_reactantStrings, Kinetics::m_reactions, Kinetics::m_revProductStoich, Kinetics::m_rfn, Kinetics::m_rkcn, Kinetics::m_ropf, Kinetics::m_ropnet, Kinetics::m_ropr, Kinetics::m_rrxn, Kinetics::m_rxneqn, Kinetics::m_rxnphase, Kinetics::m_skipUndeclaredSpecies, Kinetics::m_start, Kinetics::m_surfphase, and Kinetics::m_thermo.
Referenced by InterfaceKinetics::operator=().
Duplication routine for objects which inherit from Kinetics.
This function can be used to duplicate objects derived 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 pointers to ThermoPhase objects. this is the m_thermo vector within this object |
Reimplemented in InterfaceKinetics, ElectrodeKinetics, AqueousKinetics, EdgeKinetics, GasKinetics, and BulkKinetics.
Definition at line 85 of file Kinetics.cpp.
References Kinetics::assignShallowPointers(), and Kinetics::Kinetics().
|
virtual |
Reassign the pointers within the Kinetics object.
This type or routine is 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:
tpVector | Vector of pointers to ThermoPhase objects. this is the m_thermo vector within this object |
Definition at line 140 of file Kinetics.cpp.
References ThermoPhase::eosType(), Phase::id(), Kinetics::m_thermo, and Phase::nSpecies().
Referenced by BulkKinetics::duplMyselfAsKinetics(), GasKinetics::duplMyselfAsKinetics(), EdgeKinetics::duplMyselfAsKinetics(), AqueousKinetics::duplMyselfAsKinetics(), ElectrodeKinetics::duplMyselfAsKinetics(), InterfaceKinetics::duplMyselfAsKinetics(), and Kinetics::duplMyselfAsKinetics().
|
virtual |
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 in InterfaceKinetics, ElectrodeKinetics, EdgeKinetics, AqueousKinetics, and GasKinetics.
Definition at line 93 of file Kinetics.cpp.
Referenced by Kinetics::addPhase().
|
inline |
Number of reactions in the reaction mechanism.
Definition at line 193 of file Kinetics.h.
References Kinetics::m_ii.
Referenced by BulkKinetics::addReaction(), InterfaceKinetics::addReaction(), Kinetics::addReaction(), Reactor::addSensitivityReaction(), ExtraGlobalRxn::ExtraGlobalRxn(), InterfaceKinetics::getFwdRateConstants(), InterfaceKinetics::getRevRateConstants(), RxnMolChange::RxnMolChange(), and InterfaceKinetics::updateKc().
void checkReactionIndex | ( | size_t | m | ) | const |
Check that the specified reaction index is in range Throws an exception if i is greater than nReactions()
Definition at line 98 of file Kinetics.cpp.
References Kinetics::m_ii.
Referenced by Kinetics::modifyReaction(), and Kinetics::reaction().
void checkReactionArraySize | ( | size_t | ii | ) | const |
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 105 of file Kinetics.cpp.
References Kinetics::m_ii.
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.
Definition at line 126 of file Kinetics.cpp.
References Kinetics::m_kk.
void checkSpeciesArraySize | ( | size_t | mm | ) | const |
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 133 of file Kinetics.cpp.
References Kinetics::m_kk.
|
inline |
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 225 of file Kinetics.h.
References Kinetics::m_thermo.
Referenced by InterfaceKinetics::_update_rates_C(), InterfaceKinetics::_update_rates_phi(), Kinetics::addPhase(), InterfaceKinetics::addReaction(), InterfaceKinetics::applyVoltageKfwdCorrection(), InterfaceKinetics::buildSurfaceArrhenius(), Kinetics::checkPhaseArraySize(), Kinetics::checkPhaseIndex(), Kinetics::finalize(), InterfaceKinetics::getDeltaElectrochemPotentials(), InterfaceKinetics::getDeltaEnthalpy(), InterfaceKinetics::getDeltaEntropy(), InterfaceKinetics::getDeltaGibbs(), InterfaceKinetics::getDeltaSSEnthalpy(), InterfaceKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSGibbs(), ElectrodeKinetics::identifyMetalPhase(), ImplicitSurfChem::ImplicitSurfChem(), InterfaceKinetics::init(), solveProb::print_header(), RxnMolChange::RxnMolChange(), Kinetics::selectPhase(), InterfaceKinetics::updateExchangeCurrentQuantities(), solveSP::updateMFKinSpecies(), InterfaceKinetics::updateMu0(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
void checkPhaseIndex | ( | size_t | m | ) | const |
Check that the specified phase index is in range Throws an exception if m is greater than nPhases()
Definition at line 112 of file Kinetics.cpp.
References Kinetics::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().
Used before calls which take an array pointer.
Definition at line 119 of file Kinetics.cpp.
References Kinetics::nPhases().
|
inline |
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 247 of file Kinetics.h.
References Kinetics::m_phaseindex, and Cantera::npos.
Referenced by Cantera::importKinetics().
|
inline |
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 260 of file Kinetics.h.
References Kinetics::m_surfphase.
Referenced by InterfaceKinetics::_update_rates_T(), InterfaceKinetics::buildSurfaceArrhenius(), solveSP::calc_t(), Reactor::evalSurfaces(), solveSP::fun_eval(), Cantera::getRateCoefficient(), solveProb::print_header(), Wall::setKinetics(), and solveSP::solveSP().
|
inline |
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 272 of file Kinetics.h.
References Kinetics::m_rxnphase.
Referenced by InterfaceKinetics::buildSurfaceArrhenius(), EdgeKinetics::finalize(), and InterfaceKinetics::finalize().
|
inline |
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 285 of file Kinetics.h.
References Kinetics::m_thermo.
Referenced by AqueousKinetics::_update_rates_C(), InterfaceKinetics::_update_rates_phi(), AqueousKinetics::_update_rates_T(), InterfaceKinetics::_update_rates_T(), InterfaceKinetics::applyVoltageKfwdCorrection(), InterfaceKinetics::buildSurfaceArrhenius(), solveSP::calc_t(), InterfaceKinetics::convertExchangeCurrentDensityFormulation(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), InterfaceKinetics::getDeltaElectrochemPotentials(), BulkKinetics::getDeltaEnthalpy(), InterfaceKinetics::getDeltaEnthalpy(), BulkKinetics::getDeltaEntropy(), InterfaceKinetics::getDeltaEntropy(), BulkKinetics::getDeltaGibbs(), BulkKinetics::getDeltaSSEnthalpy(), InterfaceKinetics::getDeltaSSEnthalpy(), BulkKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSEntropy(), BulkKinetics::getDeltaSSGibbs(), InterfaceKinetics::getDeltaSSGibbs(), Cantera::getEfficiencies(), AqueousKinetics::getEquilibriumConstants(), GasKinetics::getEquilibriumConstants(), InterfaceKinetics::getEquilibriumConstants(), Cantera::getRateCoefficient(), Cantera::getStick(), ImplicitSurfChem::ImplicitSurfChem(), BulkKinetics::init(), GasKinetics::init(), InterfaceKinetics::init(), Reactor::initialize(), Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), solveProb::print_header(), RxnMolChange::RxnMolChange(), InterfaceKinetics::setElectricPotential(), Wall::setKinetics(), ImplicitSurfChem::solvePseudoSteadyStateProblem(), solveSP::solveSP(), Kinetics::speciesPhase(), GasKinetics::update_rates_C(), GasKinetics::update_rates_T(), InterfaceKinetics::updateExchangeCurrentQuantities(), AqueousKinetics::updateKc(), GasKinetics::updateKc(), InterfaceKinetics::updateKc(), solveSP::updateMFKinSpecies(), and InterfaceKinetics::updateMu0().
|
inline |
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 297 of file Kinetics.h.
References Kinetics::m_kk.
Referenced by InterfaceKinetics::addReaction(), Kinetics::checkDuplicates(), ExtraGlobalRxn::ExtraGlobalRxn(), ReactingSurf1D::init(), and RxnMolChange::RxnMolChange().
|
inline |
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 323 of file Kinetics.h.
References Kinetics::m_start.
Referenced by InterfaceKinetics::addReaction(), Kinetics::addReaction(), InterfaceKinetics::buildSurfaceArrhenius(), solveSP::calc_t(), Kinetics::checkDuplicates(), Cantera::checkRxnElementBalance(), ReactingSurf1D::eval(), Reactor::evalSurfaces(), solveSP::fun_eval(), Cantera::getEfficiencies(), Cantera::getReagents(), Cantera::getStick(), Kinetics::kineticsSpeciesIndex(), RxnMolChange::RxnMolChange(), solveSP::solveSP(), and solveSP::updateMFKinSpecies().
string kineticsSpeciesName | ( | size_t | k | ) | const |
Return the 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.
k | species index |
Definition at line 359 of file Kinetics.cpp.
References Kinetics::m_start, Cantera::npos, Phase::speciesName(), and Kinetics::thermo().
Referenced by Kinetics::checkDuplicates(), Cantera::getStick(), solveSP::printIteration(), and solveProb::printIteration().
size_t kineticsSpeciesIndex | ( | const std::string & | nm | ) | const |
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 369 of file Kinetics.cpp.
References Phase::id(), Kinetics::m_start, Kinetics::m_thermo, Cantera::npos, Phase::speciesIndex(), and Kinetics::thermo().
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.
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 382 of file Kinetics.cpp.
References Phase::id(), Kinetics::kineticsSpeciesIndex(), Kinetics::m_start, Kinetics::m_thermo, Cantera::npos, Phase::speciesIndex(), and Kinetics::thermo().
thermo_t & speciesPhase | ( | const std::string & | nm | ) |
This function looks up the 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 doesn't match.
nm | String containing the name of the species. |
Definition at line 402 of file Kinetics.cpp.
References Kinetics::m_thermo, Cantera::npos, Phase::speciesIndex(), and Kinetics::thermo().
Referenced by Kinetics::checkReactionBalance(), Cantera::checkRxnElementBalance(), Cantera::getStick(), and ElectrodeKinetics::updateROP().
|
inline |
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 382 of file Kinetics.h.
References Kinetics::speciesPhaseIndex(), and Kinetics::thermo().
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.
k | Species index |
Definition at line 417 of file Kinetics.cpp.
References Cantera::int2str(), Kinetics::m_start, and Cantera::npos.
Referenced by InterfaceKinetics::addReaction(), InterfaceKinetics::buildSurfaceArrhenius(), Cantera::checkRxnElementBalance(), Cantera::getStick(), RxnMolChange::RxnMolChange(), Kinetics::speciesPhase(), and ElectrodeKinetics::updateROP().
|
virtual |
Return the forward rates of progress of the reactions.
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.
fwdROP | Output vector containing forward rates of progress of the reactions. Length: m_ii. |
Definition at line 438 of file Kinetics.cpp.
References Kinetics::m_ropf.
|
virtual |
Return the Reverse rates of progress of the reactions.
Return the reverse rates of progress in array revROP, which must be dimensioned at least as large as the total number of reactions.
revROP | Output vector containing reverse rates of progress of the reactions. Length: m_ii. |
Definition at line 444 of file Kinetics.cpp.
References Kinetics::m_ropr.
|
virtual |
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.
netROP | Output vector of the net ROP. Length: m_ii. |
Definition at line 450 of file Kinetics.cpp.
References Kinetics::m_ropnet.
|
inlinevirtual |
Return a vector of Equilibrium constants.
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.
\[ Kc_i = exp [ \Delta G_{ss,i} ] prod(Cs_k) exp(\sum_k \nu_{k,i} F \phi_n) ] \]
kc | Output vector containing the equilibrium constants. Length: m_ii. |
Reimplemented in InterfaceKinetics, GasKinetics, and AqueousKinetics.
Definition at line 442 of file Kinetics.h.
Referenced by BulkKinetics::getRevRateConstants().
|
virtual |
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 456 of file Kinetics.cpp.
References Kinetics::m_ii, Kinetics::m_irrevProductStoich, Kinetics::m_reactantStoich, and Kinetics::m_revProductStoich.
Referenced by InterfaceKinetics::applyVoltageKfwdCorrection(), InterfaceKinetics::getDeltaElectrochemPotentials(), BulkKinetics::getDeltaEnthalpy(), InterfaceKinetics::getDeltaEnthalpy(), BulkKinetics::getDeltaEntropy(), InterfaceKinetics::getDeltaEntropy(), BulkKinetics::getDeltaGibbs(), InterfaceKinetics::getDeltaGibbs(), BulkKinetics::getDeltaSSEnthalpy(), InterfaceKinetics::getDeltaSSEnthalpy(), BulkKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSEntropy(), BulkKinetics::getDeltaSSGibbs(), InterfaceKinetics::getDeltaSSGibbs(), AqueousKinetics::getEquilibriumConstants(), GasKinetics::getEquilibriumConstants(), InterfaceKinetics::getEquilibriumConstants(), and InterfaceKinetics::updateExchangeCurrentQuantities().
|
virtual |
Given an array of species properties 'g', return in array 'dg' the change in this quantity in the reversible reactions.
Array 'g' must have a length at least as great as the number of species, and array 'dg' must have a length as great as the total number of reactions. This method only computes 'dg' for the reversible reactions, and the entries of 'dg' for the irreversible reactions are unaltered. This is primarily designed for use in calculating reverse rate coefficients from thermochemistry for reversible reactions.
Definition at line 466 of file Kinetics.cpp.
References Kinetics::m_ii, Kinetics::m_reactantStoich, and Kinetics::m_revProductStoich.
Referenced by AqueousKinetics::updateKc(), GasKinetics::updateKc(), and InterfaceKinetics::updateKc().
|
inlinevirtual |
Return the vector of values for the reaction Gibbs free energy change.
(virtual from Kinetics.h) These values depend upon the concentration of the solution.
units = J kmol-1
deltaG | Output vector of deltaG's for reactions Length: m_ii. |
Reimplemented in InterfaceKinetics, and BulkKinetics.
Definition at line 486 of file Kinetics.h.
|
inlinevirtual |
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 500 of file Kinetics.h.
|
inlinevirtual |
Return the vector of values for the reactions change in enthalpy.
These values depend upon the concentration of the solution.
units = J kmol-1
deltaH | Output vector of deltaH's for reactions Length: m_ii. |
Reimplemented in InterfaceKinetics, and BulkKinetics.
Definition at line 512 of file Kinetics.h.
|
inlinevirtual |
Return the vector of values for the reactions change in entropy.
These values depend upon the concentration of the solution.
units = J kmol-1 Kelvin-1
deltaS | Output vector of deltaS's for reactions Length: m_ii. |
Reimplemented in InterfaceKinetics, and BulkKinetics.
Definition at line 524 of file Kinetics.h.
|
inlinevirtual |
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
deltaG | Output vector of ss deltaG's for reactions Length: m_ii. |
Reimplemented in InterfaceKinetics, and BulkKinetics.
Definition at line 537 of file Kinetics.h.
|
inlinevirtual |
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
deltaH | Output vector of ss deltaH's for reactions Length: m_ii. |
Reimplemented in InterfaceKinetics, and BulkKinetics.
Definition at line 550 of file Kinetics.h.
|
inlinevirtual |
Return the vector of values for the change in the standard state entropies for each reaction.
These values don't depend upon the concentration of the solution.
units = J kmol-1 Kelvin-1
deltaS | Output vector of ss deltaS's for reactions Length: m_ii. |
Reimplemented in InterfaceKinetics, and BulkKinetics.
Definition at line 563 of file Kinetics.h.
|
virtual |
Species creation rates [kmol/m^3/s or kmol/m^2/s].
Return the species creation rates in array cdot, which must be dimensioned at least as large as the total number of species in all phases.
cdot | Output vector of creation rates. Length: m_kk. |
Definition at line 475 of file Kinetics.cpp.
References Kinetics::m_irrevProductStoich, Kinetics::m_kk, Kinetics::m_reactantStoich, Kinetics::m_revProductStoich, Kinetics::m_ropf, and Kinetics::m_ropr.
|
virtual |
Species destruction rates [kmol/m^3/s or kmol/m^2/s].
Return the species destruction rates in array ddot, which must be dimensioned at least as large as the total number of species.
ddot | Output vector of destruction rates. Length: m_kk. |
Definition at line 490 of file Kinetics.cpp.
References Kinetics::m_kk, Kinetics::m_reactantStoich, Kinetics::m_revProductStoich, Kinetics::m_ropf, and Kinetics::m_ropr.
|
virtual |
Species net production rates [kmol/m^3/s or kmol/m^2/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.
wdot | Output vector of net production rates. Length: m_kk. |
Definition at line 501 of file Kinetics.cpp.
References Kinetics::m_irrevProductStoich, Kinetics::m_kk, Kinetics::m_reactantStoich, Kinetics::m_revProductStoich, and Kinetics::m_ropnet.
Referenced by solveSP::calc_t(), ReactingSurf1D::eval(), FlowReactor::evalEqs(), Reactor::evalEqs(), Reactor::evalSurfaces(), solveSP::fun_eval(), StFlow::getWdot(), solveProb::print_header(), and solveProb::printIteration().
|
virtual |
Stoichiometric coefficient of species k as a reactant in reaction i.
k | kinetic species index |
i | reaction index |
Definition at line 428 of file Kinetics.cpp.
References Cantera::getValue(), and Kinetics::m_rrxn.
Referenced by RxnMolChange::RxnMolChange().
|
virtual |
Stoichiometric coefficient of species k as a product in reaction i.
k | kinetic species index |
i | reaction index |
Definition at line 433 of file Kinetics.cpp.
References Cantera::getValue(), and Kinetics::m_prxn.
Referenced by RxnMolChange::RxnMolChange().
|
inlinevirtual |
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 626 of file Kinetics.h.
|
inlinevirtual |
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 640 of file Kinetics.h.
|
inlinevirtual |
Get the vector of activity concentrations used in the kinetics object.
[out] | conc | Vector of activity concentrations. Length is equal to the number of species in the kinetics object |
Reimplemented in InterfaceKinetics.
Definition at line 649 of file Kinetics.h.
|
inlinevirtual |
Returns a read-only reference to the vector of reactant index numbers for reaction i.
i | reaction index |
Definition at line 660 of file Kinetics.h.
References Kinetics::m_reactants, and Cantera::warn_deprecated().
|
inlinevirtual |
Returns a read-only reference to the vector of product index numbers for reaction i.
i | reaction index |
Definition at line 673 of file Kinetics.h.
References Kinetics::m_products, and Cantera::warn_deprecated().
|
inlinevirtual |
Flag specifying the type of reaction.
The legal values and their meaning are specific to the particular kinetics manager.
i | reaction index |
Definition at line 686 of file Kinetics.h.
Referenced by InterfaceKinetics::addReaction(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
inlinevirtual |
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.
i | reaction index |
Reimplemented in InterfaceKinetics, and BulkKinetics.
Definition at line 697 of file Kinetics.h.
|
inline |
Return a string representing the reaction.
i | reaction index |
Definition at line 706 of file Kinetics.h.
References Kinetics::m_rxneqn.
Referenced by Reactor::addSensitivityReaction().
|
inline |
Returns a string containing the reactants side of the reaction equation.
Definition at line 711 of file Kinetics.h.
References Kinetics::m_reactantStrings.
|
inline |
Returns a string containing the products side of the reaction equation.
Definition at line 716 of file Kinetics.h.
References Kinetics::m_productStrings.
|
inlinevirtual |
Return the forward rate constants.
length is the number of reactions. units depends on many issues.
kfwd | Output vector containing the forward reaction rate constants. Length: m_ii. |
Reimplemented in InterfaceKinetics, GasKinetics, and AqueousKinetics.
Definition at line 728 of file Kinetics.h.
Referenced by BulkKinetics::getRevRateConstants().
|
inlinevirtual |
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.
krev | Output vector of reverse rate constants. |
doIrreversible | boolean indicating whether irreversible reactions should be included. |
Reimplemented in InterfaceKinetics, and BulkKinetics.
Definition at line 743 of file Kinetics.h.
|
virtual |
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:
thermo | Reference to the ThermoPhase to be added. |
Reimplemented in InterfaceKinetics.
Definition at line 513 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(), and Cantera::importKinetics().
|
inlinevirtual |
Prepare the class for the addition of reactions.
This method is called by 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 in InterfaceKinetics, ElectrodeKinetics, GasKinetics, and BulkKinetics.
Definition at line 778 of file Kinetics.h.
Referenced by Cantera::importKinetics().
|
virtual |
Finish adding reactions and prepare for use.
This method is called by 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 in InterfaceKinetics, ElectrodeKinetics, GasKinetics, EdgeKinetics, and BulkKinetics.
Definition at line 548 of file Kinetics.cpp.
References Kinetics::m_kk, Kinetics::m_thermo, and Kinetics::nPhases().
Referenced by EdgeKinetics::finalize(), InterfaceKinetics::finalize(), and Cantera::installReactionArrays().
|
virtual |
Add a single reaction to the mechanism.
This routine must be called after init() and before finalize(). Derived classes should call the base class method in addition to handling their own specialized behavior.
r | Reference to the ReactionData object for the reaction to be added. |
Reimplemented in InterfaceKinetics, AqueousKinetics, GasKinetics, and BulkKinetics.
Definition at line 557 of file Kinetics.cpp.
References ReactionData::equation, ReactionData::forwardFullOrder_, Kinetics::incrementRxnCount(), Kinetics::m_ii, Kinetics::m_irrevProductStoich, Kinetics::m_products, Kinetics::m_productStrings, Kinetics::m_prxn, Kinetics::m_reactants, Kinetics::m_reactantStoich, Kinetics::m_reactantStrings, Kinetics::m_revProductStoich, Kinetics::m_rfn, Kinetics::m_rkcn, Kinetics::m_ropf, Kinetics::m_ropnet, Kinetics::m_ropr, Kinetics::m_rrxn, Kinetics::m_rxneqn, Kinetics::nReactions(), ReactionData::pgroups, ReactionData::porder, ReactionData::products, ReactionData::productString, ReactionData::pstoich, ReactionData::reactants, ReactionData::reactantString, ReactionData::reactionType, ReactionData::reversible, ReactionData::rgroups, ReactionData::rorder, and ReactionData::rstoich.
Referenced by BulkKinetics::addReaction(), InterfaceKinetics::addReaction(), and Cantera::installReactionArrays().
|
virtual |
Add a single reaction to the mechanism.
Derived classes should call the base class method in addition to handling their own specialized behavior.
r | Pointer to the Reaction object to be added. |
true
if the reaction is added or false
if it was skipped Reimplemented in InterfaceKinetics, AqueousKinetics, GasKinetics, and BulkKinetics.
Definition at line 656 of file Kinetics.cpp.
References Kinetics::checkReactionBalance(), Kinetics::incrementRxnCount(), Kinetics::kineticsSpeciesIndex(), Kinetics::m_irrevProductStoich, Kinetics::m_products, Kinetics::m_productStrings, Kinetics::m_prxn, Kinetics::m_reactants, Kinetics::m_reactantStoich, Kinetics::m_reactantStrings, Kinetics::m_reactions, Kinetics::m_revProductStoich, Kinetics::m_rfn, Kinetics::m_rkcn, Kinetics::m_ropf, Kinetics::m_ropnet, Kinetics::m_ropr, Kinetics::m_rrxn, Kinetics::m_rxneqn, Kinetics::m_skipUndeclaredSpecies, Cantera::npos, and Kinetics::nReactions().
|
virtual |
Modify the rate expression associated with a reaction.
The stoichiometric equation, type of the reaction, reaction orders, third body efficiencies, reversibility, etc. must be unchanged.
i | Index of the reaction to be modified |
rNew | Reaction with the new rate expressions |
Reimplemented in InterfaceKinetics, AqueousKinetics, and GasKinetics.
Definition at line 773 of file Kinetics.cpp.
References Kinetics::checkReactionIndex(), Cantera::int2str(), and Kinetics::m_reactions.
Referenced by GasKinetics::modifyReaction(), AqueousKinetics::modifyReaction(), and InterfaceKinetics::modifyReaction().
shared_ptr< Reaction > reaction | ( | size_t | i | ) |
Return the Reaction object for reaction i.
Definition at line 797 of file Kinetics.cpp.
References Kinetics::checkReactionIndex(), and Kinetics::m_reactions.
|
inline |
Determine behavior when adding a new reaction that contains species not defined in any of the phases associated with this kinetics manager.
If set to true, the reaction will silently be ignored. If false, (the default) an exception will be raised.
Definition at line 829 of file Kinetics.h.
References Kinetics::m_skipUndeclaredSpecies.
Referenced by Cantera::installReactionArrays().
|
inline |
Determine behavior when adding a new reaction that contains third-body efficiencies for species not defined in any of the phases associated with this kinetics manager.
If set to true, the given third-body efficiency will be ignored. If false, (the default) an exception will be raised.
Definition at line 838 of file Kinetics.h.
References Kinetics::m_skipUndeclaredThirdBodies.
Referenced by Cantera::installReactionArrays().
|
inlinevirtual |
Definition at line 844 of file Kinetics.h.
|
inline |
The current value of the multiplier for reaction i.
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.
i | index of the reaction |
Definition at line 875 of file Kinetics.h.
References Kinetics::m_perturb.
Referenced by Reactor::applySensitivity(), FlowReactor::evalEqs(), and Reactor::resetSensitivity().
|
inlinevirtual |
Set the multiplier for reaction i to f.
i | index of the reaction |
f | value of the multiplier. |
Reimplemented in BulkKinetics.
Definition at line 884 of file Kinetics.h.
References Kinetics::m_perturb.
Referenced by Reactor::applySensitivity(), FlowReactor::evalEqs(), Reactor::resetSensitivity(), and BulkKinetics::setMultiplier().
|
inline |
Increment the number of reactions in the mechanism by one.
Definition at line 894 of file Kinetics.h.
References Kinetics::m_ii, and Kinetics::m_perturb.
Referenced by Kinetics::addReaction().
|
inlinevirtual |
Returns true if the kinetics manager has been properly initialized and finalized.
Reimplemented in InterfaceKinetics, Interface, GasKinetics, IdealGasMix, BulkKinetics, and Edge.
Definition at line 903 of file Kinetics.h.
|
virtual |
Check for duplicate reactions.
If throw_err
is true, then an exception will be thrown if any unmarked duplicate reactions are found. Otherwise, the indices of the first pair of duplicate reactions found will be returned. If no duplicate reactions are found, returns (npos, npos)
.
Definition at line 168 of file Kinetics.cpp.
References Kinetics::checkDuplicateStoich(), Cantera::CHEMACT_RXN, Reaction::duplicate, ThirdBody::efficiency(), Reaction::equation(), Cantera::FALLOFF_RXN, Cantera::int2str(), Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), Kinetics::m_reactions, Cantera::npos, Kinetics::nTotalSpecies(), Reaction::products, Reaction::reactants, Reaction::reaction_type, Reaction::reversible, and Cantera::THREE_BODY_RXN.
Referenced by Cantera::installReactionArrays().
void selectPhase | ( | const doublereal * | data, |
const thermo_t * | phase, | ||
doublereal * | phase_data | ||
) |
Takes as input an array of properties for all species in the mechanism and copies those values belonging to a particular phase to the output array.
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 345 of file Kinetics.cpp.
References Kinetics::m_start, Kinetics::m_thermo, Kinetics::nPhases(), and Phase::nSpecies().
|
protected |
Check that the specified reaction is balanced (same number of atoms for each element in the reactants and products).
Raises an exception if the reaction is not balanced.
Definition at line 298 of file Kinetics.cpp.
References Phase::elementName(), Reaction::equation(), Cantera::fp2str(), Phase::nAtoms(), Phase::nElements(), Reaction::products, Reaction::reactants, Phase::speciesIndex(), and Kinetics::speciesPhase().
Referenced by Kinetics::addReaction().
|
protected |
Cache for saved calculations within each Kinetics object.
Definition at line 931 of file Kinetics.h.
|
protected |
Stoichiometry manager for the reactants for each reaction.
These objects and functions handle turning reaction extents into species production rates and also handle turning thermo properties into reaction thermo properties.
Definition at line 968 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::getCreationRates(), Kinetics::getDestructionRates(), Kinetics::getNetProductionRates(), Kinetics::getReactionDelta(), Kinetics::getRevReactionDelta(), Kinetics::operator=(), InterfaceKinetics::updateExchangeCurrentQuantities(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
protected |
Stoichiometry manager for the products of reversible reactions.
Definition at line 971 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::getCreationRates(), Kinetics::getDestructionRates(), Kinetics::getNetProductionRates(), Kinetics::getReactionDelta(), Kinetics::getRevReactionDelta(), Kinetics::operator=(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
protected |
Stoichiometry manager for the products of irreversible reactions.
Definition at line 974 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::getCreationRates(), Kinetics::getNetProductionRates(), Kinetics::getReactionDelta(), and Kinetics::operator=().
|
protected |
Number of reactions in the mechanism.
Definition at line 978 of file Kinetics.h.
Referenced by InterfaceKinetics::addReaction(), Kinetics::addReaction(), Kinetics::checkReactionArraySize(), Kinetics::checkReactionIndex(), BulkKinetics::finalize(), EdgeKinetics::finalize(), ElectrodeKinetics::finalize(), InterfaceKinetics::finalize(), InterfaceKinetics::getDeltaGibbs(), AqueousKinetics::getEquilibriumConstants(), GasKinetics::getEquilibriumConstants(), InterfaceKinetics::getEquilibriumConstants(), AqueousKinetics::getFwdRateConstants(), GasKinetics::getFwdRateConstants(), Kinetics::getReactionDelta(), BulkKinetics::getRevRateConstants(), InterfaceKinetics::getRevRateConstants(), Kinetics::getRevReactionDelta(), Kinetics::incrementRxnCount(), Kinetics::nReactions(), ElectrodeKinetics::operator=(), Kinetics::operator=(), InterfaceKinetics::reactionNumber(), InterfaceKinetics::updateExchangeCurrentQuantities(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
protected |
The number of species in all of the phases that participate in this kinetics mechanism.
Definition at line 982 of file Kinetics.h.
Referenced by InterfaceKinetics::addReaction(), Kinetics::checkSpeciesArraySize(), Kinetics::checkSpeciesIndex(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), Kinetics::finalize(), Kinetics::getCreationRates(), BulkKinetics::getDeltaSSEnthalpy(), InterfaceKinetics::getDeltaSSEnthalpy(), BulkKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSEntropy(), Kinetics::getDestructionRates(), Kinetics::getNetProductionRates(), BulkKinetics::init(), InterfaceKinetics::init(), Kinetics::nTotalSpecies(), and Kinetics::operator=().
|
protected |
Vector of perturbation factors for each reaction's rate of progress vector.
It is initialized to one.
Definition at line 986 of file Kinetics.h.
Referenced by BulkKinetics::finalize(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), AqueousKinetics::getFwdRateConstants(), GasKinetics::getFwdRateConstants(), InterfaceKinetics::getFwdRateConstants(), Kinetics::incrementRxnCount(), Kinetics::multiplier(), Kinetics::operator=(), Kinetics::setMultiplier(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
protected |
Vector of Reaction objects represented by this Kinetics manager.
Definition at line 989 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::checkDuplicates(), Kinetics::modifyReaction(), Kinetics::operator=(), and Kinetics::reaction().
|
protected |
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 1003 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::operator=(), and Kinetics::reactants().
|
protected |
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 1017 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::operator=(), and Kinetics::products().
|
protected |
m_rrxn is a vector of maps, containing the reactant stoichiometric coefficient information
m_rrxn has a length equal to the total number of species in the kinetics object. For each species, there exists a map, with the reaction number being the key, and the reactant stoichiometric coefficient for the species being the value.
Definition at line 1027 of file Kinetics.h.
Referenced by Kinetics::addReaction(), BulkKinetics::init(), InterfaceKinetics::init(), Kinetics::operator=(), and Kinetics::reactantStoichCoeff().
|
protected |
m_prxn is a vector of maps, containing the reactant stoichiometric coefficient information
m_prxn is a vector of maps. m_prxn has a length equal to the total number of species in the kinetics object. For each species, there exists a map, with the reaction number being the key, and the product stoichiometric coefficient for the species being the value.
Definition at line 1037 of file Kinetics.h.
Referenced by Kinetics::addReaction(), BulkKinetics::init(), InterfaceKinetics::init(), Kinetics::operator=(), and Kinetics::productStoichCoeff().
|
protected |
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 1056 of file Kinetics.h.
Referenced by InterfaceKinetics::_update_rates_C(), Kinetics::addPhase(), Kinetics::assignShallowPointers(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), Kinetics::finalize(), InterfaceKinetics::getDeltaGibbs(), ElectrodeKinetics::identifyMetalPhase(), Kinetics::kineticsSpeciesIndex(), Kinetics::nPhases(), Kinetics::operator=(), InterfaceKinetics::phaseExistence(), InterfaceKinetics::phaseStability(), Kinetics::selectPhase(), InterfaceKinetics::setPhaseExistence(), InterfaceKinetics::setPhaseStability(), Kinetics::speciesPhase(), and Kinetics::thermo().
|
protected |
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 1063 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(), ElectrodeKinetics::identifyMetalPhase(), Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), Kinetics::operator=(), Kinetics::selectPhase(), Kinetics::speciesPhaseIndex(), InterfaceKinetics::updateExchangeCurrentQuantities(), InterfaceKinetics::updateMu0(), and ElectrodeKinetics::updateROP().
|
protected |
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 1073 of file Kinetics.h.
Referenced by Kinetics::addPhase(), Kinetics::operator=(), and Kinetics::phaseIndex().
|
protected |
Index in the list of phases of the one surface phase.
Definition at line 1076 of file Kinetics.h.
Referenced by Kinetics::addPhase(), Kinetics::operator=(), and Kinetics::surfacePhaseIndex().
|
protected |
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().
|
protected |
number of spatial dimensions of lowest-dimensional phase.
Definition at line 1086 of file Kinetics.h.
Referenced by Kinetics::addPhase(), and Kinetics::operator=().
|
protected |
Representation of each reaction equation.
Definition at line 1089 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::operator=(), and Kinetics::reactionString().
|
protected |
Representation of the reactant side of each reaction equation.
Definition at line 1092 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::operator=(), and Kinetics::reactantString().
|
protected |
Representation of the product side of each reaction equation.
Definition at line 1095 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::operator=(), and Kinetics::productString().
|
protected |
Forward rate constant for each reaction.
Definition at line 1098 of file Kinetics.h.
Referenced by AqueousKinetics::_update_rates_T(), InterfaceKinetics::_update_rates_T(), Kinetics::addReaction(), AqueousKinetics::getFwdRateConstants(), GasKinetics::getFwdRateConstants(), InterfaceKinetics::getFwdRateConstants(), Kinetics::operator=(), GasKinetics::update_rates_T(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
protected |
Reciprocal of the equilibrium constant in concentration units.
Definition at line 1101 of file Kinetics.h.
Referenced by Kinetics::addReaction(), BulkKinetics::finalize(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), AqueousKinetics::getEquilibriumConstants(), GasKinetics::getEquilibriumConstants(), BulkKinetics::getRevRateConstants(), InterfaceKinetics::getRevRateConstants(), Kinetics::operator=(), AqueousKinetics::updateKc(), GasKinetics::updateKc(), InterfaceKinetics::updateKc(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
protected |
Forward rate-of-progress for each reaction.
Definition at line 1104 of file Kinetics.h.
Referenced by Kinetics::addReaction(), BulkKinetics::finalize(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), Kinetics::getCreationRates(), Kinetics::getDestructionRates(), AqueousKinetics::getFwdRateConstants(), GasKinetics::getFwdRateConstants(), Kinetics::getFwdRatesOfProgress(), Kinetics::operator=(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
protected |
Reverse rate-of-progress for each reaction.
Definition at line 1107 of file Kinetics.h.
Referenced by Kinetics::addReaction(), BulkKinetics::finalize(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), Kinetics::getCreationRates(), Kinetics::getDestructionRates(), Kinetics::getRevRatesOfProgress(), Kinetics::operator=(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
protected |
Net rate-of-progress for each reaction.
Definition at line 1110 of file Kinetics.h.
Referenced by Kinetics::addReaction(), BulkKinetics::finalize(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), Kinetics::getNetProductionRates(), Kinetics::getNetRatesOfProgress(), BulkKinetics::getRevRateConstants(), InterfaceKinetics::getRevRateConstants(), Kinetics::operator=(), ElectrodeKinetics::updateROP(), and InterfaceKinetics::updateROP().
|
protected |
Definition at line 1113 of file Kinetics.h.
Referenced by Kinetics::addReaction(), Kinetics::operator=(), and Kinetics::skipUndeclaredSpecies().
|
protected |
Definition at line 1116 of file Kinetics.h.
Referenced by Kinetics::skipUndeclaredThirdBodies().