17 #include "cantera/base/smart_ptr.h"
190 virtual int type()
const;
364 const std::string& ph)
const;
463 doublereal* deltaProperty);
660 virtual const std::vector<size_t>&
reactants(
size_t i)
const {
662 "To be removed after Cantera 2.2.");
673 virtual const std::vector<size_t>&
products(
size_t i)
const {
675 "To be removed after Cantera 2.2.");
744 bool doIrreversible =
false) {
823 shared_ptr<Reaction>
reaction(
size_t i);
848 virtual void installGroups(
size_t irxn,
const std::vector<grouplist_t>& r,
849 const std::vector<grouplist_t>& p);
851 virtual const std::vector<grouplist_t>& reactantGroups(
size_t i) {
855 virtual const std::vector<grouplist_t>& productGroups(
size_t i) {
914 virtual std::pair<size_t, size_t>
checkDuplicates(
bool throw_err=
true)
const;
927 doublereal* phase_data);
934 virtual void updateROP() {
952 std::map<int, double>& r2)
const;
1027 std::vector<std::map<size_t, doublereal> >
m_rrxn;
1037 std::vector<std::map<size_t, doublereal> >
m_prxn;
1039 std::vector<int> m_rxntype;
1119 std::map<size_t, std::vector<grouplist_t> > m_rgroups;
1120 std::map<size_t, std::vector<grouplist_t> > m_pgroups;
virtual void modifyReaction(size_t i, shared_ptr< Reaction > rNew)
Modify the rate expression associated with a reaction.
virtual void getDeltaElectrochemPotentials(doublereal *deltaM)
Return the vector of values for the reaction electrochemical free energy change.
const std::string & reactionString(size_t i) const
Return a string representing the reaction.
virtual void installReagents(const ReactionData &r)
StoichManagerN m_irrevProductStoich
Stoichiometry manager for the products of irreversible reactions.
StoichManagerN m_revProductStoich
Stoichiometry manager for the products of reversible reactions.
const std::string & reactantString(size_t i) const
Returns a string containing the reactants side of the reaction equation.
vector_fp m_ropr
Reverse rate-of-progress 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...
void incrementRxnCount()
Increment the number of reactions in the mechanism by one.
std::vector< std::vector< size_t > > m_reactants
This is a vector of vectors containing the reactants for each reaction.
virtual void assignShallowPointers(const std::vector< thermo_t * > &tpVector)
Reassign the pointers within the Kinetics object.
An error indicating that an unimplemented function has been called.
virtual void getRevRateConstants(doublereal *krev, bool doIrreversible=false)
Return the reverse rate constants.
thermo_t & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism...
virtual void getDeltaEntropy(doublereal *deltaS)
Return the vector of values for the reactions change in entropy.
size_t m_kk
The number of species in all of the phases that participate in this kinetics mechanism.
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...
const size_t npos
index returned by functions to indicate "no position"
virtual void getNetRatesOfProgress(doublereal *netROP)
Net rates of progress.
virtual Kinetics * duplMyselfAsKinetics(const std::vector< thermo_t * > &tpVector) const
Duplication routine for objects which inherit from Kinetics.
virtual void getDeltaSSEntropy(doublereal *deltaS)
Return the vector of values for the change in the standard state entropies for each reaction...
virtual bool isReversible(size_t i)
True if reaction i has been declared to be reversible.
std::string kineticsSpeciesName(size_t k) const
Return the name of the kth species in the kinetics manager.
std::vector< std::string > m_reactantStrings
Representation of the reactant side of each reaction equation.
void selectPhase(const doublereal *data, const thermo_t *phase, doublereal *phase_data)
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 getDeltaSSGibbs(doublereal *deltaG)
Return the vector of values for the reaction standard state Gibbs free energy change.
size_t nTotalSpecies() const
The total number of species in all phases participating in the kinetics mechanism.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
virtual void getFwdRateConstants(doublereal *kfwd)
Return the forward rate constants.
doublereal multiplier(size_t i) const
The current value of the multiplier for reaction i.
Kinetics()
Default constructor.
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 rev...
vector_fp m_ropnet
Net rate-of-progress for each reaction.
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).
size_t reactionPhaseIndex()
Phase where the reactions occur.
virtual doublereal reactantOrder(size_t k, size_t i) const
Reactant order of species k in reaction i.
virtual void getEquilibriumConstants(doublereal *kc)
Return a vector of Equilibrium constants.
virtual void getDestructionRates(doublereal *ddot)
Species destruction rates [kmol/m^3/s or kmol/m^2/s].
virtual void getCreationRates(doublereal *cdot)
Species creation rates [kmol/m^3/s or kmol/m^2/s].
virtual void getDeltaGibbs(doublereal *deltaG)
Return the vector of values for the reaction Gibbs free energy change.
virtual void getNetProductionRates(doublereal *wdot)
Species net production rates [kmol/m^3/s or kmol/m^2/s].
vector_fp m_ropf
Forward rate-of-progress for each reaction.
Base class for a phase with thermodynamic properties.
virtual void init()
Prepare the class for the addition of reactions.
void checkPhaseIndex(size_t m) const
Check that the specified phase index is in range Throws an exception if m is greater than nPhases() ...
std::vector< std::string > m_rxneqn
Representation of each reaction equation.
size_t surfacePhaseIndex()
This returns the integer index of the phase which has ThermoPhase type cSurf.
virtual std::pair< size_t, size_t > checkDuplicates(bool throw_err=true) const
Check for duplicate reactions.
void checkReactionBalance(const Reaction &R)
Check that the specified reaction is balanced (same number of atoms for each element in the reactants...
ValueCache m_cache
Cache for saved calculations within each Kinetics object.
size_t nPhases() const
The number of phases participating in the reaction mechanism.
std::vector< std::map< size_t, doublereal > > m_prxn
m_prxn is a vector of maps, containing the reactant stoichiometric coefficient information ...
vector_fp m_rfn
Forward rate constant for each reaction.
StoichManagerN m_reactantStoich
Stoichiometry manager for the reactants for each reaction.
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...
bool m_skipUndeclaredThirdBodies
void checkSpeciesArraySize(size_t mm) const
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies()...
virtual void getRevRatesOfProgress(doublereal *revROP)
Return the Reverse rates of progress of the reactions.
void checkSpeciesIndex(size_t k) const
Check that the specified species index is in range Throws an exception if k is greater than nSpecies(...
vector_fp m_perturb
Vector of perturbation factors for each reaction's rate of progress vector.
Public interface for kinetics managers.
Intermediate class which stores data about a reaction and its rate parameterization before adding the...
virtual doublereal productOrder(int k, int i) const
product Order of species k in reaction i.
Intermediate class which stores data about a reaction and its rate parameterization so that it can be...
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...
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 reac...
std::vector< std::map< size_t, doublereal > > m_rrxn
m_rrxn is a vector of maps, containing the reactant stoichiometric coefficient information ...
virtual void getDeltaEnthalpy(doublereal *deltaH)
Return the vector of values for the reactions change in enthalpy.
Kinetics & operator=(const Kinetics &right)
Assignment operator.
size_t kineticsSpeciesIndex(size_t k, size_t n) const
The location of species k of phase n in species arrays.
vector_fp m_rkcn
Reciprocal of the equilibrium constant in concentration units.
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...
std::vector< shared_ptr< Reaction > > m_reactions
Vector of Reaction objects represented by this Kinetics manager.
virtual void getActivityConcentrations(doublereal *const conc)
Get the vector of activity concentrations used in the kinetics object.
size_t m_mindim
number of spatial dimensions of lowest-dimensional phase.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
thermo_t & speciesPhase(size_t k)
This function takes as an argument the kineticsSpecies index (i.e., the list index in the list of spe...
void checkReactionIndex(size_t m) const
Check that the specified reaction index is in range Throws an exception if i is greater than nReactio...
size_t speciesPhaseIndex(size_t k)
This function takes as an argument the kineticsSpecies index (i.e., the list index in the list of spe...
std::vector< std::vector< size_t > > m_products
This is a vector of vectors containing the products for each reaction.
std::vector< std::string > m_productStrings
Representation of the product side of each reaction equation.
void checkReactionArraySize(size_t ii) const
Check that an array size is at least nReactions() Throws an exception if ii is less than nReactions()...
size_t m_ii
Number of reactions in the mechanism.
size_t nReactions() const
Number of reactions in the reaction mechanism.
virtual int type() const
Identifies the kinetics manager type.
size_t m_surfphase
Index in the list of phases of the one surface phase.
virtual double reactantStoichCoeff(size_t k, size_t i) const
Stoichiometric coefficient of species k as a reactant in reaction i.
virtual void getDeltaSSEnthalpy(doublereal *deltaH)
Return the vector of values for the change in the standard state enthalpies of reaction.
shared_ptr< Reaction > reaction(size_t i)
Return the Reaction object for reaction i.
virtual void setMultiplier(size_t i, doublereal f)
Set the multiplier for reaction i to f.
size_t m_rxnphase
Phase Index where reactions are assumed to be taking place.
virtual void getFwdRatesOfProgress(doublereal *fwdROP)
Return the forward rates of progress of the reactions.
virtual int reactionType(size_t i) const
Flag specifying the type of reaction.
virtual void finalize()
Finish adding reactions and prepare for use.
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
virtual void addPhase(thermo_t &thermo)
Add a phase to the kinetics manager object.
virtual ~Kinetics()
Destructor.
const std::string & productString(size_t i) const
Returns a string containing the products side of the reaction equation.
void checkPhaseArraySize(size_t mm) const
Check that an array size is at least nPhases() Throws an exception if mm is less than nPhases()...
virtual double productStoichCoeff(size_t k, size_t i) const
Stoichiometric coefficient of species k as a product in reaction i.
bool m_skipUndeclaredSpecies
virtual void getReactionDelta(const doublereal *property, doublereal *deltaProperty)
Change in species properties.
void skipUndeclaredThirdBodies(bool skip)
Determine behavior when adding a new reaction that contains third-body efficiencies for species not d...
virtual void addReaction(ReactionData &r)
Add a single reaction to the mechanism.
size_t phaseIndex(const std::string &ph)
Return the phase index of a phase in the list of phases defined within the object.
void skipUndeclaredSpecies(bool skip)
Determine behavior when adding a new reaction that contains species not defined in any of the phases ...
virtual bool ready() const
Returns true if the kinetics manager has been properly initialized and finalized. ...