399 virtual void getReactionDelta(
const double* property,
double* deltaProperty)
const;
520 "Not applicable/implemented for Kinetics object of type '{}'",
530 "Not applicable/implemented for Kinetics object of type '{}'",
695 "Not implemented for kinetics type '{}'.",
kineticsType());
706 "Not implemented for kinetics type '{}'.",
kineticsType());
717 "Not implemented for kinetics type '{}'.",
kineticsType());
728 "Not implemented for kinetics type '{}'.",
kineticsType());
742 "Not implemented for kinetics type '{}'.",
kineticsType());
753 "Not implemented for kinetics type '{}'.",
kineticsType());
764 "Not implemented for kinetics type '{}'.",
kineticsType());
778 "Not implemented for kinetics type '{}'.",
kineticsType());
795 "Not implemented for kinetics type '{}'.",
kineticsType());
815 "Not implemented for kinetics type '{}'.",
kineticsType());
826 "Not implemented for kinetics type '{}'.",
kineticsType());
837 "Not implemented for kinetics type '{}'.",
kineticsType());
851 "Not implemented for kinetics type '{}'.",
kineticsType());
868 "Not implemented for kinetics type '{}'.",
kineticsType());
888 "Not implemented for kinetics type '{}'.",
kineticsType());
899 "Not implemented for kinetics type '{}'.",
kineticsType());
910 "Not implemented for kinetics type '{}'.",
kineticsType());
924 "Not implemented for kinetics type '{}'.",
kineticsType());
941 "Not implemented for kinetics type '{}'.",
kineticsType());
961 "Not implemented for kinetics type '{}'.",
kineticsType());
1246 bool doIrreversible =
false) {
1301 virtual bool addReaction(shared_ptr<Reaction> r,
bool resize=
true);
1311 virtual void modifyReaction(
size_t i, shared_ptr<Reaction> rNew);
1318 shared_ptr<Reaction> reaction(
size_t i);
1320 shared_ptr<const Reaction> reaction(
size_t i)
const;
1350 string explicitThirdBodyDuplicateHandling()
const {
1351 return m_explicit_third_body_duplicates;
1382 virtual void invalidateCache() {
1397 virtual pair<size_t, size_t>
checkDuplicates(
bool throw_err=
true)
const;
1406 shared_ptr<Solution>
root()
const {
1415 virtual void updateROP() {
1529 string m_explicit_third_body_duplicates =
"warn";
A map of string keys to values whose type can vary at runtime.
Public interface for kinetics managers.
size_t reactionPhaseIndex() const
Phase where the reactions occur.
virtual void resizeReactions()
Finalize Kinetics object and associated objects.
Eigen::SparseMatrix< double > reactantStoichCoeffs() const
Stoichiometric coefficient matrix for reactants.
double multiplier(size_t i) const
The current value of the multiplier for reaction i.
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 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 getFwdRatesOfProgress(double *fwdROP)
Return the forward rates of progress of the reactions.
virtual void getEquilibriumConstants(double *kc)
Return a vector of Equilibrium constants.
Kinetics(const Kinetics &)=delete
Kinetics objects are not copyable or assignable.
ThermoPhase & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
vector< shared_ptr< Reaction > > m_reactions
Vector of Reaction objects represented by this Kinetics manager.
void checkSpeciesIndex(size_t k) const
Check that the specified species index is in range Throws an exception if k is greater than nSpecies(...
double checkDuplicateStoich(map< int, double > &r1, map< int, double > &r2) const
Check whether r1 and r2 represent duplicate stoichiometries This function returns a ratio if two reac...
ValueCache m_cache
Cache for saved calculations within each Kinetics object.
virtual bool isReversible(size_t i)
True if reaction i has been declared to be reversible.
vector< double > m_perturb
Vector of perturbation factors for each reaction's rate of progress vector.
vector< double > m_ropf
Forward rate-of-progress for each reaction.
bool m_ready
Boolean indicating whether Kinetics object is fully configured.
virtual const vector< double > & thirdBodyConcentrations() const
Provide direct access to current third-body concentration values.
virtual void getRevReactionDelta(const double *g, double *dg) const
Given an array of species properties 'g', return in array 'dg' the change in this quantity in the rev...
void setExplicitThirdBodyDuplicateHandling(const string &flag)
Specify how to handle duplicate third body reactions where one reaction has an explicit third body an...
virtual void getNetRatesOfProgress(double *netROP)
Net rates of progress.
size_t phaseIndex(const string &ph) const
Return the phase index of a phase in the list of phases defined within the object.
virtual void getDeltaSSEntropy(double *deltaS)
Return the vector of values for the change in the standard state entropies for each reaction.
vector< size_t > m_start
m_start is a vector of integers specifying the beginning position for the species vector for the n'th...
virtual string kineticsType() const
Identifies the Kinetics manager type.
virtual void getDeltaElectrochemPotentials(double *deltaM)
Return the vector of values for the reaction electrochemical free energy change.
vector< double > m_rkcn
Reciprocal of the equilibrium constant in concentration units.
shared_ptr< ThermoPhase > reactionPhase() const
Return pointer to phase where the reactions occur.
size_t m_kk
The number of species in all of the phases that participate in this kinetics mechanism.
virtual pair< size_t, size_t > checkDuplicates(bool throw_err=true) const
Check for unmarked duplicate reactions and unmatched marked duplicates.
virtual void getReactionDelta(const double *property, double *deltaProperty) const
Change in species properties.
void checkPhaseArraySize(size_t mm) const
Check that an array size is at least nPhases() Throws an exception if mm is less than nPhases().
vector< double > m_dH
The enthalpy change for each reaction to calculate Blowers-Masel rates.
vector< double > m_ropr
Reverse rate-of-progress for each reaction.
size_t nPhases() const
The number of phases participating in the reaction mechanism.
vector< shared_ptr< ThermoPhase > > m_thermo
m_thermo is a vector of pointers to ThermoPhase objects that are involved with this kinetics operator
virtual bool addReaction(shared_ptr< Reaction > r, bool resize=true)
Add a single reaction to the mechanism.
virtual void getThirdBodyConcentrations(double *concm)
Return a vector of values of effective concentrations of third-body collision partners of any reactio...
void skipUndeclaredSpecies(bool skip)
Determine behavior when adding a new reaction that contains species not defined in any of the phases ...
string kineticsSpeciesName(size_t k) const
Return the name of the kth species in the kinetics manager.
virtual void getDestructionRates(double *ddot)
Species destruction rates [kmol/m^3/s or kmol/m^2/s].
AnyMap parameters()
Return the parameters for a phase definition which are needed to reconstruct an identical object usin...
Kinetics()=default
Default constructor.
virtual void getDeltaEntropy(double *deltaS)
Return the vector of values for the reactions change in entropy.
virtual void init()
Prepare the class for the addition of reactions, after all phases have been added.
virtual void getFwdRateConstants(double *kfwd)
Return the forward rate constants.
shared_ptr< Solution > root() const
Get the Solution object containing this Kinetics object and associated ThermoPhase objects.
bool m_skipUndeclaredThirdBodies
See skipUndeclaredThirdBodies()
virtual double reactantOrder(size_t k, size_t i) const
Reactant order of species k in reaction i.
virtual void modifyReaction(size_t i, shared_ptr< Reaction > rNew)
Modify the rate expression associated with a reaction.
vector< double > m_ropnet
Net rate-of-progress for each reaction.
void skipUndeclaredThirdBodies(bool skip)
Determine behavior when adding a new reaction that contains third-body efficiencies for species not d...
virtual double productStoichCoeff(size_t k, size_t i) const
Stoichiometric coefficient of species k as a product in reaction i.
virtual void addThermo(shared_ptr< ThermoPhase > thermo)
Add a phase to the kinetics manager object.
Eigen::SparseMatrix< double > productStoichCoeffs() const
Stoichiometric coefficient matrix for products.
vector< double > m_rbuf
Buffer used for storage of intermediate reaction-specific results.
Eigen::SparseMatrix< double > m_stoichMatrix
Net stoichiometry (products - reactants)
virtual void getActivityConcentrations(double *const conc)
Get the vector of activity concentrations used in the kinetics object.
bool m_skipUndeclaredSpecies
See skipUndeclaredSpecies()
map< string, size_t > m_phaseindex
Mapping of the phase name to the position of the phase within the kinetics object.
size_t m_mindim
number of spatial dimensions of lowest-dimensional phase.
StoichManagerN m_productStoich
Stoichiometry manager for the products for each reaction.
virtual void getDeltaSSGibbs(double *deltaG)
Return the vector of values for the reaction standard state Gibbs free energy change.
std::weak_ptr< Solution > m_root
reference to Solution
virtual void getDeltaSSEnthalpy(double *deltaH)
Return the vector of values for the change in the standard state enthalpies of reaction.
StoichManagerN m_revProductStoich
Stoichiometry manager for the products of reversible reactions.
Eigen::SparseMatrix< double > revProductStoichCoeffs() const
Stoichiometric coefficient matrix for products of reversible reactions.
size_t nReactions() const
Number of reactions in the reaction mechanism.
virtual void getRevRatesOfProgress(double *revROP)
Return the Reverse rates of progress of the reactions.
virtual void setRoot(shared_ptr< Solution > root)
Set root Solution holding all phase information.
bool m_hasUndeclaredThirdBodies
Flag indicating whether reactions include undeclared third bodies.
size_t kineticsSpeciesIndex(size_t k, size_t n) const
The location of species k of phase n in species arrays.
virtual double productOrder(int k, int i) const
product Order of species k in reaction i.
virtual void setMultiplier(size_t i, double f)
Set the multiplier for reaction i to f.
vector< double > m_rfn
Forward rate constant for each reaction.
virtual void getDeltaEnthalpy(double *deltaH)
Return the vector of values for the reactions change in enthalpy.
StoichManagerN m_reactantStoich
Stoichiometry manager for the reactants for each reaction.
virtual void getRevRateConstants(double *krev, bool doIrreversible=false)
Return the reverse rate constants.
virtual void resizeSpecies()
Resize arrays with sizes that depend on the total number of species.
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 nTotalSpecies() const
The total number of species in all phases participating in the kinetics mechanism.
virtual double reactantStoichCoeff(size_t k, size_t i) const
Stoichiometric coefficient of species k as a reactant in reaction i.
void checkReactionIndex(size_t m) const
Check that the specified reaction index is in range Throws an exception if i is greater than nReactio...
virtual void getDeltaGibbs(double *deltaG)
Return the vector of values for the reaction Gibbs free energy change.
virtual void getNetProductionRates(double *wdot)
Species net production rates [kmol/m^3/s or kmol/m^2/s].
ThermoPhase & speciesPhase(const string &nm)
This function looks up the name of a species and returns a reference to the ThermoPhase object of the...
vector< double > m_delta_gibbs0
Delta G^0 for all reactions.
virtual void getCreationRates(double *cdot)
Species creation rates [kmol/m^3/s or kmol/m^2/s].
ThermoPhase & speciesPhase(size_t k)
This function takes as an argument the kineticsSpecies index (that is, the list index in the list of ...
size_t speciesPhaseIndex(size_t k) const
This function takes as an argument the kineticsSpecies index (that is, the list index in the list of ...
An error indicating that an unimplemented function has been called.
This class handles operations involving the stoichiometric coefficients on one side of a reaction (re...
const Eigen::SparseMatrix< double > & stoichCoeffs() const
Return matrix containing stoichiometric coefficients.
Base class for a phase with thermodynamic properties.
Storage for cached values.
void clear()
Clear all cached values.
virtual void setDerivativeSettings(const AnyMap &settings)
Set/modify derivative settings.
virtual Eigen::SparseMatrix< double > fwdRatesOfProgress_ddCi()
Calculate derivatives for forward rates-of-progress with respect to species concentration at constant...
Eigen::SparseMatrix< double > creationRates_ddCi()
Calculate derivatives for species creation rates with respect to species concentration at constant te...
virtual Eigen::SparseMatrix< double > netRatesOfProgress_ddCi()
Calculate derivatives for net rates-of-progress with respect to species concentration at constant tem...
void getCreationRates_ddT(double *dwdot)
Calculate derivatives for species creation rates with respect to temperature at constant pressure,...
virtual Eigen::SparseMatrix< double > netRatesOfProgress_ddX()
Calculate derivatives for net rates-of-progress with respect to species mole fractions at constant te...
Eigen::SparseMatrix< double > destructionRates_ddX()
Calculate derivatives for species destruction rates with respect to species mole fractions at constan...
void getCreationRates_ddC(double *dwdot)
Calculate derivatives for species creation rates with respect to molar concentration at constant temp...
void getDestructionRates_ddP(double *dwdot)
Calculate derivatives for species destruction rates with respect to pressure at constant temperature,...
void getNetProductionRates_ddC(double *dwdot)
Calculate derivatives for species net production rates with respect to molar concentration at constan...
void getDestructionRates_ddT(double *dwdot)
Calculate derivatives for species destruction rates with respect to temperature at constant pressure,...
virtual void getFwdRatesOfProgress_ddP(double *drop)
Calculate derivatives for forward rates-of-progress with respect to pressure at constant temperature,...
Eigen::SparseMatrix< double > netProductionRates_ddX()
Calculate derivatives for species net production rates with respect to species mole fractions at cons...
Eigen::SparseMatrix< double > creationRates_ddX()
Calculate derivatives for species creation rates with respect to species mole fractions at constant t...
Eigen::SparseMatrix< double > destructionRates_ddCi()
Calculate derivatives for species destruction rates with respect to species concentration at constant...
void getNetProductionRates_ddT(double *dwdot)
Calculate derivatives for species net production rates with respect to temperature at constant pressu...
virtual Eigen::SparseMatrix< double > fwdRatesOfProgress_ddX()
Calculate derivatives for forward rates-of-progress with respect to species mole fractions at constan...
virtual void getRevRatesOfProgress_ddT(double *drop)
Calculate derivatives for reverse rates-of-progress with respect to temperature at constant pressure,...
virtual void getFwdRateConstants_ddP(double *dkfwd)
Calculate derivatives for forward rate constants with respect to pressure at constant temperature,...
virtual void getFwdRateConstants_ddT(double *dkfwd)
Calculate derivatives for forward rate constants with respect to temperature at constant pressure,...
void getCreationRates_ddP(double *dwdot)
Calculate derivatives for species creation rates with respect to pressure at constant temperature,...
virtual void getNetRatesOfProgress_ddT(double *drop)
Calculate derivatives for net rates-of-progress with respect to temperature at constant pressure,...
virtual void getRevRatesOfProgress_ddP(double *drop)
Calculate derivatives for reverse rates-of-progress with respect to pressure at constant temperature,...
Eigen::SparseMatrix< double > netProductionRates_ddCi()
Calculate derivatives for species net production rates with respect to species concentration at const...
virtual void getRevRatesOfProgress_ddC(double *drop)
Calculate derivatives for reverse rates-of-progress with respect to molar concentration at constant t...
virtual void getDerivativeSettings(AnyMap &settings) const
Retrieve derivative settings.
void getNetProductionRates_ddP(double *dwdot)
Calculate derivatives for species net production rates with respect to pressure at constant temperatu...
virtual void getNetRatesOfProgress_ddP(double *drop)
Calculate derivatives for net rates-of-progress with respect to pressure at constant temperature,...
virtual Eigen::SparseMatrix< double > revRatesOfProgress_ddCi()
Calculate derivatives for forward rates-of-progress with respect to species concentration at constant...
virtual void getFwdRatesOfProgress_ddT(double *drop)
Calculate derivatives for forward rates-of-progress with respect to temperature at constant pressure,...
void getDestructionRates_ddC(double *dwdot)
Calculate derivatives for species destruction rates with respect to molar concentration at constant t...
virtual void getNetRatesOfProgress_ddC(double *drop)
Calculate derivatives for net rates-of-progress with respect to molar concentration at constant tempe...
virtual Eigen::SparseMatrix< double > revRatesOfProgress_ddX()
Calculate derivatives for reverse rates-of-progress with respect to species mole fractions at constan...
virtual void getFwdRateConstants_ddC(double *dkfwd)
Calculate derivatives for forward rate constants with respect to molar concentration at constant temp...
virtual void getFwdRatesOfProgress_ddC(double *drop)
Calculate derivatives for forward rates-of-progress with respect to molar concentration at constant t...
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"