| Cantera 3.0.0

Loading...
Searching...
No Matches
Protected Attributes | List of all members
BulkKinetics Class Reference
Chemical Kinetics » Kinetics Managers

Specialization of Kinetics for chemistry in a single bulk phase. More...

`#include <BulkKinetics.h>`

Inheritance diagram for BulkKinetics:
[legend]

## Detailed Description

Specialization of Kinetics for chemistry in a single bulk phase.

Definition at line 20 of file BulkKinetics.h.

## Public Member Functions
Constructors and General Information
| BulkKinetics (ThermoPhase *thermo)
string | kineticsType () const override
| Identifies the Kinetics manager type.
bool | isReversible (size_t i) override
| True if reaction i has been declared to be reversible.
Reaction Mechanism Setup Routines
bool | addReaction (shared_ptr< Reaction > r, bool resize=true) override
| Add a single reaction to the mechanism.
void | addThirdBody (shared_ptr< Reaction > r)
void | modifyReaction (size_t i, shared_ptr< Reaction > rNew) override
| Modify the rate expression associated with a reaction.
void | resizeSpecies () override
| Resize arrays with sizes that depend on the total number of species.
void | resizeReactions () override
| Finalize Kinetics object and associated objects.
void | setMultiplier (size_t i, double f) override
| Set the multiplier for reaction i to f.
void | invalidateCache () override
Reaction rate constants, rates of progress, and thermodynamic properties
void | getFwdRateConstants (double *kfwd) override
| Return the forward rate constants.
void | getEquilibriumConstants (double *kc) override
| Return a vector of Equilibrium constants.
void | getRevRateConstants (double *krev, bool doIrreversible=false) override
| Return the reverse rate constants.
void | getDeltaGibbs (double *deltaG) override
| Return the vector of values for the reaction Gibbs free energy change.
void | getDeltaEnthalpy (double *deltaH) override
| Return the vector of values for the reactions change in enthalpy.
void | getDeltaEntropy (double *deltaS) override
| Return the vector of values for the reactions change in entropy.
void | getDeltaSSGibbs (double *deltaG) override
| Return the vector of values for the reaction standard state Gibbs free energy change.
void | getDeltaSSEnthalpy (double *deltaH) override
| Return the vector of values for the change in the standard state enthalpies of reaction.
void | getDeltaSSEntropy (double *deltaS) override
| Return the vector of values for the change in the standard state entropies for each reaction.
Derivatives of rate constants and rates of progress
void | getDerivativeSettings (AnyMap &settings) const override
| Retrieve derivative settings.
void | setDerivativeSettings (const AnyMap &settings) override
| Set/modify derivative settings.
void | getFwdRateConstants_ddT (double *dkfwd) override
| Calculate derivatives for forward rate constants with respect to temperature at constant pressure, molar concentration and mole fractions.
void | getFwdRatesOfProgress_ddT (double *drop) override
| Calculate derivatives for forward rates-of-progress with respect to temperature at constant pressure, molar concentration and mole fractions.
void | getRevRatesOfProgress_ddT (double *drop) override
| Calculate derivatives for reverse rates-of-progress with respect to temperature at constant pressure, molar concentration and mole fractions.
void | getNetRatesOfProgress_ddT (double *drop) override
| Calculate derivatives for net rates-of-progress with respect to temperature at constant pressure, molar concentration and mole fractions.
void | getFwdRateConstants_ddP (double *dkfwd) override
| Calculate derivatives for forward rate constants with respect to pressure at constant temperature, molar concentration and mole fractions.
void | getFwdRatesOfProgress_ddP (double *drop) override
| Calculate derivatives for forward rates-of-progress with respect to pressure at constant temperature, molar concentration and mole fractions.
void | getRevRatesOfProgress_ddP (double *drop) override
| Calculate derivatives for reverse rates-of-progress with respect to pressure at constant temperature, molar concentration and mole fractions.
void | getNetRatesOfProgress_ddP (double *drop) override
| Calculate derivatives for net rates-of-progress with respect to pressure at constant temperature, molar concentration and mole fractions.
void | getFwdRateConstants_ddC (double *dkfwd) override
| Calculate derivatives for forward rate constants with respect to molar concentration at constant temperature, pressure and mole fractions.
void | getFwdRatesOfProgress_ddC (double *drop) override
| Calculate derivatives for forward rates-of-progress with respect to molar concentration at constant temperature, pressure and mole fractions.
void | getRevRatesOfProgress_ddC (double *drop) override
| Calculate derivatives for reverse rates-of-progress with respect to molar concentration at constant temperature, pressure and mole fractions.
void | getNetRatesOfProgress_ddC (double *drop) override
| Calculate derivatives for net rates-of-progress with respect to molar concentration at constant temperature, pressure and mole fractions.
Eigen::SparseMatrix< double > | fwdRatesOfProgress_ddX () override
| Calculate derivatives for forward rates-of-progress with respect to species mole fractions at constant temperature, pressure and molar concentration.
Eigen::SparseMatrix< double > | revRatesOfProgress_ddX () override
| Calculate derivatives for reverse rates-of-progress with respect to species mole fractions at constant temperature, pressure and molar concentration.
Eigen::SparseMatrix< double > | netRatesOfProgress_ddX () override
| Calculate derivatives for net rates-of-progress with respect to species mole fractions at constant temperature, pressure and molar concentration.
Eigen::SparseMatrix< double > | fwdRatesOfProgress_ddCi () override
| Calculate derivatives for forward rates-of-progress with respect to species concentration at constant temperature, pressure and remaining species concentrations.
Eigen::SparseMatrix< double > | revRatesOfProgress_ddCi () override
| Calculate derivatives for forward rates-of-progress with respect to species concentration at constant temperature, pressure and remaining species concentrations.
Eigen::SparseMatrix< double > | netRatesOfProgress_ddCi () override
| Calculate derivatives for net rates-of-progress with respect to species concentration at constant temperature, pressure, and remaining species concentrations.
Rate calculation intermediate methods
void | updateROP () override
void | getThirdBodyConcentrations (double *concm) override
| Return a vector of values of effective concentrations of third-body collision partners of any reaction.
const vector< double > & | thirdBodyConcentrations () const override
| Provide direct access to current third-body concentration values.
Public Member Functions inherited from Kinetics
virtual pair< size_t, size_t > | checkDuplicates (bool throw_err=true) const
| Check for unmarked duplicate reactions and unmatched marked duplicates.
void | selectPhase (const double *data, const ThermoPhase *phase, double *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.
virtual void | setRoot (shared_ptr< Solution > root)
| Set root Solution holding all phase information.
shared_ptr< Solution > | root () const
| Get the Solution object containing this Kinetics object and associated ThermoPhase objects.
virtual double | reactionEnthalpy (const Composition &reactants, const Composition &products)
| Calculate the reaction enthalpy of a reaction which has not necessarily been added into the Kinetics object.
| Kinetics ()=default
| Default constructor.
| Kinetics (const Kinetics &)=delete
| Kinetics objects are not copyable or assignable.
Kinetics & | operator= (const Kinetics &)=delete
size_t | nReactions () const
| Number of reactions in the reaction mechanism.
void | checkReactionIndex (size_t m) const
| Check that the specified reaction index is in range Throws an exception if i is greater than nReactions()
void | checkReactionArraySize (size_t ii) const
| Check that an array size is at least nReactions() Throws an exception if ii is less than nReactions().
void | checkSpeciesIndex (size_t k) const
| Check that the specified species index is in range Throws an exception if k is greater than nSpecies()-1.
void | checkSpeciesArraySize (size_t mm) const
| Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies().
size_t | nPhases () const
| The number of phases participating in the reaction mechanism.
void | checkPhaseIndex (size_t m) const
| Check that the specified phase index is in range Throws an exception if m is greater than nPhases()
void | checkPhaseArraySize (size_t mm) const
| Check that an array size is at least nPhases() Throws an exception if mm is less than nPhases().
size_t | phaseIndex (const string &ph) const
| Return the phase index of a phase in the list of phases defined within the object.
size_t | surfacePhaseIndex () const
| This returns the integer index of the phase which has ThermoPhase type cSurf.
size_t | reactionPhaseIndex () const
| Phase where the reactions occur.
shared_ptr< ThermoPhase > | reactionPhase () const
| Return pointer to phase where the reactions occur.
ThermoPhase & | thermo (size_t n=0)
| This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
const ThermoPhase & | thermo (size_t n=0) const
size_t | nTotalSpecies () const
| The total number of species in all phases participating in the kinetics mechanism.
size_t | kineticsSpeciesIndex (size_t k, size_t n) const
| The location of species k of phase n in species arrays.
string | kineticsSpeciesName (size_t k) const
| Return the name of the kth species in the kinetics manager.
size_t | kineticsSpeciesIndex (const string &nm) const
| This routine will look up a species number based on the input string nm.
size_t | kineticsSpeciesIndex (const string &nm, const string &ph) const
| This routine will look up a species number based on the input string nm.
ThermoPhase & | speciesPhase (const 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.
const ThermoPhase & | speciesPhase (const string &nm) const
ThermoPhase & | speciesPhase (size_t k)
| This function takes as an argument the kineticsSpecies index (that is, the list index in the list of species in the kinetics manager) and returns the species' owning ThermoPhase object.
size_t | speciesPhaseIndex (size_t k) const
| This function takes as an argument the kineticsSpecies index (that is, the list index in the list of species in the kinetics manager) and returns the index of the phase owning the species.
virtual void | getFwdRatesOfProgress (double *fwdROP)
| Return the forward rates of progress of the reactions.
virtual void | getRevRatesOfProgress (double *revROP)
| Return the Reverse rates of progress of the reactions.
virtual void | getNetRatesOfProgress (double *netROP)
| Net rates of progress.
virtual void | getReactionDelta (const double *property, double *deltaProperty) const
| Change in species properties.
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 reversible reactions.
virtual void | getDeltaElectrochemPotentials (double *deltaM)
| Return the vector of values for the reaction electrochemical free energy change.
virtual void | getCreationRates (double *cdot)
| Species creation rates [kmol/m^3/s or kmol/m^2/s].
virtual void | getDestructionRates (double *ddot)
| Species destruction rates [kmol/m^3/s or kmol/m^2/s].
virtual void | getNetProductionRates (double *wdot)
| Species net production rates [kmol/m^3/s or kmol/m^2/s].
void | getCreationRates_ddT (double *dwdot)
| Calculate derivatives for species creation rates with respect to temperature at constant pressure, molar concentration and mole fractions.
void | getCreationRates_ddP (double *dwdot)
| Calculate derivatives for species creation rates with respect to pressure at constant temperature, molar concentration and mole fractions.
void | getCreationRates_ddC (double *dwdot)
| Calculate derivatives for species creation rates with respect to molar concentration at constant temperature, pressure and mole fractions.
Eigen::SparseMatrix< double > | creationRates_ddX ()
| Calculate derivatives for species creation rates with respect to species mole fractions at constant temperature, pressure and molar concentration.
Eigen::SparseMatrix< double > | creationRates_ddCi ()
| Calculate derivatives for species creation rates with respect to species concentration at constant temperature, pressure, and concentration of all other species.
void | getDestructionRates_ddT (double *dwdot)
| Calculate derivatives for species destruction rates with respect to temperature at constant pressure, molar concentration and mole fractions.
void | getDestructionRates_ddP (double *dwdot)
| Calculate derivatives for species destruction rates with respect to pressure at constant temperature, molar concentration and mole fractions.
void | getDestructionRates_ddC (double *dwdot)
| Calculate derivatives for species destruction rates with respect to molar concentration at constant temperature, pressure and mole fractions.
Eigen::SparseMatrix< double > | destructionRates_ddX ()
| Calculate derivatives for species destruction rates with respect to species mole fractions at constant temperature, pressure and molar concentration.
Eigen::SparseMatrix< double > | destructionRates_ddCi ()
| Calculate derivatives for species destruction rates with respect to species concentration at constant temperature, pressure, and concentration of all other species.
void | getNetProductionRates_ddT (double *dwdot)
| Calculate derivatives for species net production rates with respect to temperature at constant pressure, molar concentration and mole fractions.
void | getNetProductionRates_ddP (double *dwdot)
| Calculate derivatives for species net production rates with respect to pressure at constant temperature, molar concentration and mole fractions.
void | getNetProductionRates_ddC (double *dwdot)
| Calculate derivatives for species net production rates with respect to molar concentration at constant temperature, pressure and mole fractions.
Eigen::SparseMatrix< double > | netProductionRates_ddX ()
| Calculate derivatives for species net production rates with respect to species mole fractions at constant temperature, pressure and molar concentration.
Eigen::SparseMatrix< double > | netProductionRates_ddCi ()
| Calculate derivatives for species net production rates with respect to species concentration at constant temperature, pressure, and concentration of all other species.
virtual double | reactantStoichCoeff (size_t k, size_t i) const
| Stoichiometric coefficient of species k as a reactant in reaction i.
Eigen::SparseMatrix< double > | reactantStoichCoeffs () const
| Stoichiometric coefficient matrix for reactants.
virtual double | productStoichCoeff (size_t k, size_t i) const
| Stoichiometric coefficient of species k as a product in reaction i.
Eigen::SparseMatrix< double > | productStoichCoeffs () const
| Stoichiometric coefficient matrix for products.
Eigen::SparseMatrix< double > | revProductStoichCoeffs () const
| Stoichiometric coefficient matrix for products of reversible reactions.
virtual double | reactantOrder (size_t k, size_t i) const
| Reactant order of species k in reaction i.
virtual double | productOrder (int k, int i) const
| product Order of species k in reaction i.
virtual void | getActivityConcentrations (double *const conc)
| Get the vector of activity concentrations used in the kinetics object.
virtual string | reactionType (size_t i) const
| String specifying the type of reaction.
virtual string | reactionTypeStr (size_t i) const
| String specifying the type of reaction.
string | reactionString (size_t i) const
| Return a string representing the reaction.
string | reactantString (size_t i) const
| Returns a string containing the reactants side of the reaction equation.
string | productString (size_t i) const
| Returns a string containing the products side of the reaction equation.
virtual void | addThermo (shared_ptr< ThermoPhase > thermo)
| Add a phase to the kinetics manager object.
virtual void | addPhase (ThermoPhase &thermo)
virtual void | init ()
| Prepare the class for the addition of reactions, after all phases have been added.
AnyMap | parameters ()
| Return the parameters for a phase definition which are needed to reconstruct an identical object using the newKinetics function.
shared_ptr< Reaction > | reaction (size_t i)
| Return the Reaction object for reaction i.
shared_ptr< const Reaction > | reaction (size_t i) const
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.
bool | skipUndeclaredSpecies () const
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.
bool | skipUndeclaredThirdBodies () const
double | multiplier (size_t i) const
| The current value of the multiplier for reaction i.

## Protected Member Functions
Internal service methods
Note These methods are for internal use, and seek to avoid code duplication while evaluating terms used for rate constants, rates of progress, and their derivatives.
void | processThirdBodies (double *rop)
| Multiply rate with third-body collider concentrations.
void | applyEquilibriumConstants (double *rop)
| Multiply rate with inverse equilibrium constant.
void | applyEquilibriumConstants_ddT (double *drkcn)
| Multiply rate with scaled temperature derivatives of the inverse equilibrium constant.
void | process_ddT (const vector< double > &in, double *drop)
| Process temperature derivative.
void | process_ddP (const vector< double > &in, double *drop)
| Process pressure derivative.
void | process_ddC (StoichManagerN &stoich, const vector< double > &in, double *drop, bool mass_action=true)
| Process concentration (molar density) derivative.
Eigen::SparseMatrix< double > | calculateCompositionDerivatives (StoichManagerN &stoich, const vector< double > &in, bool ddX=true)
| Process derivatives.
void | assertDerivativesValid (const string &name)
| Helper function ensuring that all rate derivatives can be calculated.
Protected Member Functions inherited from Kinetics
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 reactions are duplicates of one another, and 0.0 otherwise.

## Protected Attributes
vector< unique_ptr< MultiRateBase > > | m_bulk_rates
| Vector of rate handlers.
map< string, size_t > | m_bulk_types
| Mapping of rate handlers.
vector< size_t > | m_revindex
| Indices of reversible reactions.
vector< size_t > | m_irrev
| Indices of irreversible reactions.
vector< double > | m_dn
| Difference between the global reactants order and the global products order.
ThirdBodyCalc | m_multi_concm
| used with MultiRate evaluator
vector< double > | m_concm
| Third body concentrations.
vector< double > | m_act_conc
| Activity concentrations, as calculated by ThermoPhase::getActivityConcentrations.
vector< double > | m_phys_conc
| Physical concentrations, as calculated by ThermoPhase::getConcentrations.
bool | m_jac_skip_third_bodies
| Derivative settings.
bool | m_jac_skip_falloff
double | m_jac_rtol_delta
bool | m_ROP_ok = false
vector< double > | m_rbuf0
| Buffers for partial rop results with length nReactions()
vector< double > | m_rbuf1
vector< double > | m_rbuf2
vector< double > | m_kf0
| Forward rate constants without perturbation.
vector< double > | m_sbuf0
vector< double > | m_state
vector< double > | m_grt
| Standard chemical potentials for each species.
Protected Attributes inherited from Kinetics
ValueCache | m_cache
| Cache for saved calculations within each Kinetics object.
bool | m_ready = false
| Boolean indicating whether Kinetics object is fully configured.
size_t | m_kk = 0
| The number of species in all of the phases that participate in this kinetics mechanism.
vector< double > | m_perturb
| Vector of perturbation factors for each reaction's rate of progress vector.
vector< shared_ptr< Reaction > > | m_reactions
| Vector of Reaction objects represented by this Kinetics manager.
vector< ThermoPhase * > | m_thermo
| m_thermo is a vector of pointers to ThermoPhase objects that are involved with this kinetics operator
vector< shared_ptr< ThermoPhase > > | m_sharedThermo
| vector of shared pointers,
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.
map< string, size_t > | m_phaseindex
| Mapping of the phase name to the position of the phase within the kinetics object.
size_t | m_surfphase = npos
| Index in the list of phases of the one surface phase.
size_t | m_rxnphase = npos
| Phase Index where reactions are assumed to be taking place.
size_t | m_mindim = 4
| number of spatial dimensions of lowest-dimensional phase.
vector< double > | m_rfn
| Forward rate constant for each reaction.
vector< double > | m_delta_gibbs0
| Delta G^0 for all reactions.
vector< double > | m_rkcn
| Reciprocal of the equilibrium constant in concentration units.
vector< double > | m_ropf
| Forward rate-of-progress for each reaction.
vector< double > | m_ropr
| Reverse rate-of-progress for each reaction.
vector< double > | m_ropnet
| Net rate-of-progress for each reaction.
vector< double > | m_dH
| The enthalpy change for each reaction to calculate Blowers-Masel rates.
vector< double > | m_rbuf
| Buffer used for storage of intermediate reaction-specific results.
bool | m_skipUndeclaredSpecies = false
| See skipUndeclaredSpecies()
bool | m_skipUndeclaredThirdBodies = false
| See skipUndeclaredThirdBodies()
bool | m_hasUndeclaredThirdBodies = false
| Flag indicating whether reactions include undeclared third bodies.
std::weak_ptr< Solution > | m_root
| reference to Solution
StoichManagerN | m_reactantStoich
| Stoichiometry manager for the reactants for each reaction.
StoichManagerN | m_productStoich
| Stoichiometry manager for the products for each reaction.
StoichManagerN | m_revProductStoich
| Stoichiometry manager for the products of reversible reactions.
Eigen::SparseMatrix< double > | m_stoichMatrix
| Net stoichiometry (products - reactants)

## Constructor & Destructor Documentation

## ◆ BulkKinetics() [1/2]

BulkKinetics | ( |  | ) |

Definition at line 11 of file BulkKinetics.cpp.

## ◆ BulkKinetics() [2/2]

BulkKinetics | ( | ThermoPhase * | thermo | ) |

Deprecated:
  To be removed after Cantera 3.0; code base only uses default.

Definition at line 15 of file BulkKinetics.cpp.

## Member Function Documentation

## ◆ kineticsType()

string kineticsType | ( |  | ) | const
| inline override virtual

Identifies the Kinetics manager type.

Each class derived from Kinetics should override this method to return a meaningful identifier.

Since
  Starting in Cantera 3.0, the name returned by this method corresponds to the canonical name used in the YAML input format.

Reimplemented from Kinetics.

Reimplemented in GasKinetics.

Definition at line 30 of file BulkKinetics.h.

## ◆ isReversible()

bool isReversible | ( | size_t | i | ) |
| override virtual

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.

Parameters

  i | reaction index

Reimplemented from Kinetics.

Definition at line 22 of file BulkKinetics.cpp.

## ◆ addReaction()

bool addReaction | ( | shared_ptr< Reaction > | r,
|  | bool | resize = `true`
| ) |  |
| override virtual

Add a single reaction to the mechanism.

Derived classes should call the base class method in addition to handling their own specialized behavior.

Parameters

  r | Pointer to the Reaction object to be added.
  resize | If `true`, resizeReactions is called after reaction is added.

Returns
  `true` if the reaction is added or `false` if it was skipped

Reimplemented from Kinetics.

Definition at line 26 of file BulkKinetics.cpp.

## ◆ addThirdBody()

void addThirdBody | ( | shared_ptr< Reaction > | r | ) |

Definition at line 80 of file BulkKinetics.cpp.

## ◆ modifyReaction()

void modifyReaction | ( | size_t | i,
|  | shared_ptr< Reaction > | rNew
| ) |  |
| override 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.

Parameters

  i | Index of the reaction to be modified
  rNew | Reaction with the new rate expressions

Reimplemented from Kinetics.

Definition at line 100 of file BulkKinetics.cpp.

## ◆ resizeSpecies()

void resizeSpecies | ( |  | ) |
| override virtual

Resize arrays with sizes that depend on the total number of species.

Automatically called before adding each Reaction and Phase.

Reimplemented from Kinetics.

Definition at line 125 of file BulkKinetics.cpp.

## ◆ resizeReactions()

void resizeReactions | ( |  | ) |
| override virtual

Finalize Kinetics object and associated objects.

Reimplemented from Kinetics.

Definition at line 136 of file BulkKinetics.cpp.

## ◆ setMultiplier()

void setMultiplier | ( | size_t | i,
|  | double | f
| ) |  |
| override virtual

Set the multiplier for reaction i to f.

Parameters

  i | index of the reaction
  f | value of the multiplier.

Reimplemented from Kinetics.

Definition at line 154 of file BulkKinetics.cpp.

## ◆ invalidateCache()

void invalidateCache | ( |  | ) |
| override virtual

Reimplemented from Kinetics.

Definition at line 160 of file BulkKinetics.cpp.

## ◆ getFwdRateConstants()

void getFwdRateConstants | ( | double * | kfwd | ) |
| override virtual

Return the forward rate constants.

The computed values include all temperature-dependent and pressure-dependent contributions. By default, third-body concentrations are only considered if they are part of the reaction rate definition; for a legacy implementation that includes third-body concentrations see Cantera::use_legacy_rate_constants(). Length is the number of reactions. Units are a combination of kmol, m^3 and s, that depend on the rate expression for the reaction.

Parameters

  kfwd | Output vector containing the forward reaction rate constants. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 166 of file BulkKinetics.cpp.

## ◆ getEquilibriumConstants()

void getEquilibriumConstants | ( | double * | kc | ) |
| override virtual

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) \]

Parameters

  kc | Output vector containing the equilibrium constants. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 175 of file BulkKinetics.cpp.

## ◆ getRevRateConstants()

void getRevRateConstants | ( | double * | krev,
|  | bool | doIrreversible = `false`
| ) |  |
| override virtual

Return the reverse rate constants.

The computed values include all temperature-dependent and pressure-dependent contributions. By default, third-body concentrations are only considered if they are part of the reaction rate definition; for a legacy implementation that includes third-body concentrations see Cantera::use_legacy_rate_constants(). Length is the number of reactions. Units are a combination of kmol, m^3 and s, that depend on the rate expression for the reaction. Note, this routine will return rate constants for irreversible reactions if the default for `doIrreversible` is overridden.

Parameters

  krev | Output vector of reverse rate constants
  doIrreversible | boolean indicating whether irreversible reactions should be included.

Reimplemented from Kinetics.

Definition at line 192 of file BulkKinetics.cpp.

## ◆ getDeltaGibbs()

void getDeltaGibbs | ( | double * | deltaG | ) |
| override virtual

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

Parameters

  deltaG | Output vector of deltaG's for reactions Length: nReactions().

Reimplemented from Kinetics.

Definition at line 211 of file BulkKinetics.cpp.

## ◆ getDeltaEnthalpy()

void getDeltaEnthalpy | ( | double * | deltaH | ) |
| override virtual

Return the vector of values for the reactions change in enthalpy.

These values depend upon the concentration of the solution.

units = J kmol-1

Parameters

  deltaH | Output vector of deltaH's for reactions Length: nReactions().

Reimplemented from Kinetics.

Definition at line 219 of file BulkKinetics.cpp.

## ◆ getDeltaEntropy()

void getDeltaEntropy | ( | double * | deltaS | ) |
| override virtual

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

Parameters

  deltaS | Output vector of deltaS's for reactions Length: nReactions().

Reimplemented from Kinetics.

Definition at line 227 of file BulkKinetics.cpp.

## ◆ getDeltaSSGibbs()

void getDeltaSSGibbs | ( | double * | deltaG | ) |
| override virtual

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

Parameters

  deltaG | Output vector of ss deltaG's for reactions Length: nReactions().

Reimplemented from Kinetics.

Definition at line 235 of file BulkKinetics.cpp.

## ◆ getDeltaSSEnthalpy()

void getDeltaSSEnthalpy | ( | double * | deltaH | ) |
| override virtual

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

Parameters

  deltaH | Output vector of ss deltaH's for reactions Length: nReactions().

Reimplemented from Kinetics.

Definition at line 246 of file BulkKinetics.cpp.

## ◆ getDeltaSSEntropy()

void getDeltaSSEntropy | ( | double * | deltaS | ) |
| override virtual

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

Parameters

  deltaS | Output vector of ss deltaS's for reactions Length: nReactions().

Reimplemented from Kinetics.

Definition at line 257 of file BulkKinetics.cpp.

## ◆ getDerivativeSettings()

void getDerivativeSettings | ( | AnyMap & | settings | ) | const
| override virtual

Retrieve derivative settings.

Parameters

  settings | AnyMap containing settings determining derivative evaluation.

Reimplemented from Kinetics.

Definition at line 270 of file BulkKinetics.cpp.

## ◆ setDerivativeSettings()

void setDerivativeSettings | ( | const AnyMap & | settings | ) |
| override virtual

Set/modify derivative settings.

Parameters

  settings | AnyMap containing settings determining derivative evaluation.

Reimplemented from Kinetics.

Definition at line 277 of file BulkKinetics.cpp.

## ◆ getFwdRateConstants_ddT()

void getFwdRateConstants_ddT | ( | double * | dkfwd | ) |
| override virtual

Calculate derivatives for forward rate constants with respect to temperature at constant pressure, molar concentration and mole fractions.

Parameters

  [out] | dkfwd | Output vector of derivatives. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 291 of file BulkKinetics.cpp.

## ◆ getFwdRatesOfProgress_ddT()

void getFwdRatesOfProgress_ddT | ( | double * | drop | ) |
| override virtual

Calculate derivatives for forward rates-of-progress with respect to temperature at constant pressure, molar concentration and mole fractions.

Parameters

  [out] | drop | Output vector of derivatives. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 298 of file BulkKinetics.cpp.

## ◆ getRevRatesOfProgress_ddT()

void getRevRatesOfProgress_ddT | ( | double * | drop | ) |
| override virtual

Calculate derivatives for reverse rates-of-progress with respect to temperature at constant pressure, molar concentration and mole fractions.

Parameters

  [out] | drop | Output vector of derivatives. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 305 of file BulkKinetics.cpp.

## ◆ getNetRatesOfProgress_ddT()

void getNetRatesOfProgress_ddT | ( | double * | drop | ) |
| override virtual

Calculate derivatives for net rates-of-progress with respect to temperature at constant pressure, molar concentration and mole fractions.

Parameters

  [out] | drop | Output vector of derivatives. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 319 of file BulkKinetics.cpp.

## ◆ getFwdRateConstants_ddP()

void getFwdRateConstants_ddP | ( | double * | dkfwd | ) |
| override virtual

Calculate derivatives for forward rate constants with respect to pressure at constant temperature, molar concentration and mole fractions.

Parameters

  [out] | dkfwd | Output vector of derivatives. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 333 of file BulkKinetics.cpp.

## ◆ getFwdRatesOfProgress_ddP()

void getFwdRatesOfProgress_ddP | ( | double * | drop | ) |
| override virtual

Calculate derivatives for forward rates-of-progress with respect to pressure at constant temperature, molar concentration and mole fractions.

Parameters

  [out] | drop | Output vector of derivatives. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 340 of file BulkKinetics.cpp.

## ◆ getRevRatesOfProgress_ddP()

void getRevRatesOfProgress_ddP | ( | double * | drop | ) |
| override virtual

Calculate derivatives for reverse rates-of-progress with respect to pressure at constant temperature, molar concentration and mole fractions.

Parameters

  [out] | drop | Output vector of derivatives. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 347 of file BulkKinetics.cpp.

## ◆ getNetRatesOfProgress_ddP()

void getNetRatesOfProgress_ddP | ( | double * | drop | ) |
| override virtual

Calculate derivatives for net rates-of-progress with respect to pressure at constant temperature, molar concentration and mole fractions.

Parameters

  [out] | drop | Output vector of derivatives. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 354 of file BulkKinetics.cpp.

## ◆ getFwdRateConstants_ddC()

void getFwdRateConstants_ddC | ( | double * | dkfwd | ) |
| override virtual

Calculate derivatives for forward rate constants with respect to molar concentration at constant temperature, pressure and mole fractions.

Parameters

  [out] | dkfwd | Output vector of derivatives. Length: nReactions().

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Reimplemented from Kinetics.

Definition at line 361 of file BulkKinetics.cpp.

## ◆ getFwdRatesOfProgress_ddC()

void getFwdRatesOfProgress_ddC | ( | double * | drop | ) |
| override virtual

Calculate derivatives for forward rates-of-progress with respect to molar concentration at constant temperature, pressure and mole fractions.

Parameters

  [out] | drop | Output vector of derivatives. Length: nReactions().

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Reimplemented from Kinetics.

Definition at line 368 of file BulkKinetics.cpp.

## ◆ getRevRatesOfProgress_ddC()

void getRevRatesOfProgress_ddC | ( | double * | drop | ) |
| override virtual

Calculate derivatives for reverse rates-of-progress with respect to molar concentration at constant temperature, pressure and mole fractions.

Parameters

  [out] | drop | Output vector of derivatives. Length: nReactions().

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Reimplemented from Kinetics.

Definition at line 375 of file BulkKinetics.cpp.

## ◆ getNetRatesOfProgress_ddC()

void getNetRatesOfProgress_ddC | ( | double * | drop | ) |
| override virtual

Calculate derivatives for net rates-of-progress with respect to molar concentration at constant temperature, pressure and mole fractions.

Parameters

  [out] | drop | Output vector of derivatives. Length: nReactions().

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Reimplemented from Kinetics.

Definition at line 382 of file BulkKinetics.cpp.

## ◆ fwdRatesOfProgress_ddX()

Eigen::SparseMatrix< double > fwdRatesOfProgress_ddX | ( |  | ) |
| override virtual

Calculate derivatives for forward rates-of-progress with respect to species mole fractions at constant temperature, pressure and molar concentration.

The method returns a matrix with nReactions() rows and nTotalSpecies() columns. For a derivative with respect to \( X_i \), all other \( X_j \) are held constant, rather than enforcing \( \sum X_j = 1 \).

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Reimplemented from Kinetics.

Definition at line 394 of file BulkKinetics.cpp.

## ◆ revRatesOfProgress_ddX()

Eigen::SparseMatrix< double > revRatesOfProgress_ddX | ( |  | ) |
| override virtual

Calculate derivatives for reverse rates-of-progress with respect to species mole fractions at constant temperature, pressure and molar concentration.

The method returns a matrix with nReactions() rows and nTotalSpecies() columns. For a derivative with respect to \( X_i \), all other \( X_j \) are held constant, rather than enforcing \( \sum X_j = 1 \).

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Reimplemented from Kinetics.

Definition at line 404 of file BulkKinetics.cpp.

## ◆ netRatesOfProgress_ddX()

Eigen::SparseMatrix< double > netRatesOfProgress_ddX | ( |  | ) |
| override virtual

Calculate derivatives for net rates-of-progress with respect to species mole fractions at constant temperature, pressure and molar concentration.

The method returns a matrix with nReactions() rows and nTotalSpecies() columns. For a derivative with respect to \( X_i \), all other \( X_j \) are held constant, rather than enforcing \( \sum X_j = 1 \).

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Reimplemented from Kinetics.

Definition at line 415 of file BulkKinetics.cpp.

## ◆ fwdRatesOfProgress_ddCi()

Eigen::SparseMatrix< double > fwdRatesOfProgress_ddCi | ( |  | ) |
| override virtual

Calculate derivatives for forward rates-of-progress with respect to species concentration at constant temperature, pressure and remaining species concentrations.

The method returns a matrix with nReactions() rows and nTotalSpecies() columns. For a derivative with respect to \( c_i \), all other \( c_j \) are held constant.

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Since
  New in Cantera 3.0.

Reimplemented from Kinetics.

Definition at line 429 of file BulkKinetics.cpp.

## ◆ revRatesOfProgress_ddCi()

Eigen::SparseMatrix< double > revRatesOfProgress_ddCi | ( |  | ) |
| override virtual

Calculate derivatives for forward rates-of-progress with respect to species concentration at constant temperature, pressure and remaining species concentrations.

The method returns a matrix with nReactions() rows and nTotalSpecies() columns. For a derivative with respect to \( c_i \), all other \( c_j \) are held constant.

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Since
  New in Cantera 3.0.

Reimplemented from Kinetics.

Definition at line 439 of file BulkKinetics.cpp.

## ◆ netRatesOfProgress_ddCi()

Eigen::SparseMatrix< double > netRatesOfProgress_ddCi | ( |  | ) |
| override virtual

Calculate derivatives for net rates-of-progress with respect to species concentration at constant temperature, pressure, and remaining species concentrations.

The method returns a matrix with nReactions() rows and nTotalSpecies() columns. For a derivative with respect to \( c_i \), all other \( c_j \) are held constant.

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Since
  New in Cantera 3.0.

Reimplemented from Kinetics.

Definition at line 450 of file BulkKinetics.cpp.

## ◆ updateROP()

void updateROP | ( |  | ) |
| override virtual

Reimplemented from Kinetics.

Definition at line 464 of file BulkKinetics.cpp.

## ◆ getThirdBodyConcentrations()

void getThirdBodyConcentrations | ( | double * | concm | ) |
| override virtual

Return a vector of values of effective concentrations of third-body collision partners of any reaction.

Entries for reactions not involving third-body collision partners are not defined and set to not-a-number.

Parameters

  concm | Output vector of effective third-body concentrations. Length: nReactions().

Reimplemented from Kinetics.

Definition at line 548 of file BulkKinetics.cpp.

## ◆ thirdBodyConcentrations()

const vector< double > & thirdBodyConcentrations | ( |  | ) | const
| inline override virtual

Provide direct access to current third-body concentration values.

See also
  getThirdBodyConcentrations.

Reimplemented from Kinetics.

Definition at line 93 of file BulkKinetics.h.

## ◆ processThirdBodies()

void processThirdBodies | ( | double * | rop | ) |
| protected

Multiply rate with third-body collider concentrations.

Definition at line 554 of file BulkKinetics.cpp.

## ◆ applyEquilibriumConstants()

void applyEquilibriumConstants | ( | double * | rop | ) |
| protected

Multiply rate with inverse equilibrium constant.

Definition at line 562 of file BulkKinetics.cpp.

## ◆ applyEquilibriumConstants_ddT()

void applyEquilibriumConstants_ddT | ( | double * | drkcn | ) |
| protected

Multiply rate with scaled temperature derivatives of the inverse equilibrium constant.

This (scaled) derivative is handled by a finite difference.

Definition at line 571 of file BulkKinetics.cpp.

## ◆ process_ddT()

void process_ddT | ( | const vector< double > & | in,
|  | double * | drop
| ) |  |
| protected

Process temperature derivative.

Parameters

  in | rate expression used for the derivative calculation
  drop | pointer to output buffer

Definition at line 606 of file BulkKinetics.cpp.

## ◆ process_ddP()

void process_ddP | ( | const vector< double > & | in,
|  | double * | drop
| ) |  |
| protected

Process pressure derivative.

Parameters

  in | rate expression used for the derivative calculation
  drop | pointer to output buffer

Definition at line 615 of file BulkKinetics.cpp.

## ◆ process_ddC()

void process_ddC | ( | StoichManagerN & | stoich,
|  | const vector< double > & | in,
|  | double * | drop,
|  | bool | mass_action = `true`
| ) |  |
| protected

Process concentration (molar density) derivative.

Parameters

  stoich | stoichiometry manager
  in | rate expression used for the derivative calculation
  drop | pointer to output buffer
  mass_action | boolean indicating whether law of mass action applies

Definition at line 624 of file BulkKinetics.cpp.

## ◆ calculateCompositionDerivatives()

Eigen::SparseMatrix< double > calculateCompositionDerivatives | ( | StoichManagerN & | stoich,
|  | const vector< double > & | in,
|  | bool | ddX = `true`
| ) |  |
| protected

Process derivatives.

Parameters

  stoich | stoichiometry manager
  in | rate expression used for the derivative calculation
  ddX | true: w.r.t mole fractions false: w.r.t species concentrations

Returns
  a sparse matrix of derivative contributions for each reaction of dimensions nTotalReactions by nTotalSpecies

Definition at line 659 of file BulkKinetics.cpp.

## ◆ assertDerivativesValid()

void assertDerivativesValid | ( | const string & | name | ) |
| protected

Helper function ensuring that all rate derivatives can be calculated.

Parameters

  name | method name used for error output

Exceptions

  CanteraError | if ideal gas assumption does not hold

Definition at line 701 of file BulkKinetics.cpp.

## Member Data Documentation

## ◆ m_bulk_rates

vector<unique_ptr<MultiRateBase> > m_bulk_rates
| protected

Vector of rate handlers.

Definition at line 155 of file BulkKinetics.h.

## ◆ m_bulk_types

map<string, size_t> m_bulk_types
| protected

Mapping of rate handlers.

Definition at line 156 of file BulkKinetics.h.

## ◆ m_revindex

vector<size_t> m_revindex
| protected

Indices of reversible reactions.

Definition at line 158 of file BulkKinetics.h.

## ◆ m_irrev

vector<size_t> m_irrev
| protected

Indices of irreversible reactions.

Definition at line 159 of file BulkKinetics.h.

## ◆ m_dn

vector<double> m_dn
| protected

Difference between the global reactants order and the global products order.

Of type "double" to account for the fact that we can have real- valued stoichiometries.

Definition at line 164 of file BulkKinetics.h.

## ◆ m_multi_concm

ThirdBodyCalc m_multi_concm
| protected

used with MultiRate evaluator

Definition at line 166 of file BulkKinetics.h.

## ◆ m_concm

vector<double> m_concm
| protected

Third body concentrations.

Definition at line 169 of file BulkKinetics.h.

## ◆ m_act_conc

vector<double> m_act_conc
| protected

Activity concentrations, as calculated by ThermoPhase::getActivityConcentrations.

Definition at line 172 of file BulkKinetics.h.

## ◆ m_phys_conc

vector<double> m_phys_conc
| protected

Physical concentrations, as calculated by ThermoPhase::getConcentrations.

Definition at line 175 of file BulkKinetics.h.

## ◆ m_jac_skip_third_bodies

bool m_jac_skip_third_bodies
| protected

Derivative settings.

Definition at line 178 of file BulkKinetics.h.

## ◆ m_jac_skip_falloff

bool m_jac_skip_falloff
| protected

Definition at line 179 of file BulkKinetics.h.

## ◆ m_jac_rtol_delta

double m_jac_rtol_delta
| protected

Definition at line 180 of file BulkKinetics.h.

## ◆ m_ROP_ok

bool m_ROP_ok = false
| protected

Definition at line 182 of file BulkKinetics.h.

## ◆ m_rbuf0

vector<double> m_rbuf0
| protected

Buffers for partial rop results with length nReactions()

Definition at line 185 of file BulkKinetics.h.

## ◆ m_rbuf1

vector<double> m_rbuf1
| protected

Definition at line 186 of file BulkKinetics.h.

## ◆ m_rbuf2

vector<double> m_rbuf2
| protected

Definition at line 187 of file BulkKinetics.h.

## ◆ m_kf0

vector<double> m_kf0
| protected

Forward rate constants without perturbation.

Definition at line 188 of file BulkKinetics.h.

## ◆ m_sbuf0

vector<double> m_sbuf0
| protected

Definition at line 189 of file BulkKinetics.h.

## ◆ m_state

vector<double> m_state
| protected

Definition at line 190 of file BulkKinetics.h.

## ◆ m_grt

vector<double> m_grt
| protected

Standard chemical potentials for each species.

Definition at line 191 of file BulkKinetics.h.

The documentation for this class was generated from the following files:

- BulkKinetics.h
- BulkKinetics.cpp