Cantera  2.1.2

Kinetics manager for elementary gas-phase chemistry. More...

#include <GasKinetics.h>

[legend]
[legend]

## Public Member Functions

void updateROP ()

const std::vector< grouplist_t > & reactantGroups (size_t i)

const std::vector< grouplist_t > & productGroups (size_t i)

virtual void update_rates_T ()
Update temperature-dependent portions of reaction rates and falloff functions. More...

virtual void update_rates_C ()
Update properties that depend on concentrations. More...

Constructors and General Information
Constructor. More...

Copy Constructor. More...

Assignment operator. More...

virtual KineticsduplMyselfAsKinetics (const std::vector< thermo_t * > &tpVector) const
Duplication routine for objects which inherit from Kinetics. More...

virtual int type () const
Identifies the kinetics manager type. More...

virtual doublereal reactantStoichCoeff (size_t k, size_t i) const
Stoichiometric coefficient of species k as a reactant in reaction i. More...

virtual doublereal productStoichCoeff (size_t k, size_t i) const
Stoichiometric coefficient of species k as a product in reaction i. 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 getDeltaGibbs (doublereal *deltaG)
Return the vector of values for the reaction gibbs 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 getNetProductionRates (doublereal *net)
Species net production rates [kmol/m^3/s or kmol/m^2/s]. More...

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...

Reaction Mechanism Informational Query Routines
virtual int reactionType (size_t i) const
Flag specifying the type of reaction. More...

virtual std::string reactionString (size_t i) const
Return a string representing the reaction. More...

virtual bool isReversible (size_t i)
True if reaction i has been declared to be reversible. 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 Setup Routines
virtual void init ()
Prepare the class for the addition of reactions. More...

Add a single reaction to the mechanism. More...

virtual void finalize ()
Finish adding reactions and prepare for use. More...

Returns true if the kinetics manager has been properly initialized and finalized. More...

Public Member Functions inherited from Kinetics
void incrementRxnCount ()
Increment the number of reactions in the mechanism by one. More...

void selectPhase (const doublereal *data, const thermo_t *phase, doublereal *phase_data)

Kinetics ()
Default constructor. More...

virtual ~Kinetics ()
Destructor. More...

Kinetics (const Kinetics &)
Copy Constructor for the Kinetics object. More...

Kineticsoperator= (const Kinetics &right)
Assignment operator. More...

virtual void assignShallowPointers (const std::vector< thermo_t * > &tpVector)
Reassign the pointers within the Kinetics object. 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...

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_tthermo (size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism. More...

const thermo_tthermo (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_tspeciesPhase (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_tspeciesPhase (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...

virtual void getReactionDelta (const doublereal *property, doublereal *deltaProperty)
Change in species properties. More...

virtual void getDeltaElectrochemPotentials (doublereal *deltaM)
Return the vector of values for the reaction electrochemical free energy change. 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 void getActivationEnergies (doublereal *E)
Return the activation energies in Kelvin. More...

Add a phase to the kinetics manager object. More...

doublereal multiplier (size_t i) const
The current value of the multiplier for reaction i. More...

void setMultiplier (size_t i, doublereal f)
Set the multiplier for reaction i to f. More...

## Protected Member Functions

void processFalloffReactions ()

## Protected Attributes

size_t m_nfall

std::vector< size_t > m_fallindx

Rate1< Arrheniusm_falloff_low_rates

Rate1< Arrheniusm_falloff_high_rates

Rate1< Arrheniusm_rates

std::map< size_t, std::pair
< int, size_t > >
m_index

FalloffMgr m_falloffn

ThirdBodyMgr< Enhanced3BConcm_3b_concm

ThirdBodyMgr< Enhanced3BConcm_falloff_concm

std::vector< size_t > m_irrev

Rate1< Plog > m_plog_rates

Rate1< ChebyshevRate > m_cheb_rates

ReactionStoichMgr m_rxnstoich

std::vector< size_t > m_fwdOrder

size_t m_nirrev

size_t m_nrev

std::map< size_t, std::vector
< grouplist_t > >
m_rgroups

std::map< size_t, std::vector
< grouplist_t > >
m_pgroups

std::vector< int > m_rxntype

std::vector< std::map< size_t,
doublereal > >
m_rrxn

std::vector< std::map< size_t,
doublereal > >
m_prxn

vector_fp m_dn
Difference between the input global reactants order and the input global products order. More...

std::vector< size_t > m_revindex

std::vector< std::string > m_rxneqn

vector_fp m_conc

vector_fp m_grt

Reaction rate data
doublereal m_logp_ref

doublereal m_logc_ref

doublereal m_logStandConc

vector_fp m_ropf

vector_fp m_ropr

vector_fp m_ropnet

vector_fp m_rfn_low

vector_fp m_rfn_high

bool m_ROP_ok

doublereal m_temp

doublereal m_pres
Last pressure at which rates were evaluated. More...

vector_fp m_rfn

vector_fp falloff_work

vector_fp concm_3b_values

vector_fp concm_falloff_values

vector_fp m_rkcn

Protected Attributes inherited from Kinetics
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< 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< 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...

## Private Member Functions

size_t reactionNumber ()

void installReagents (const ReactionData &r)

void installGroups (size_t irxn, const std::vector< grouplist_t > &r, const std::vector< grouplist_t > &p)

void updateKc ()
Update the equilibrium constants in molar units. More...

void registerReaction (size_t rxnNumber, int type_, size_t loc)

## Private Attributes

std::vector< std::map< int,
doublereal > >
m_stoich

bool m_finalized

## Detailed Description

Kinetics manager for elementary gas-phase chemistry.

This kinetics manager implements standard mass-action reaction rate expressions for low-density gases.

Definition at line 35 of file GasKinetics.h.

## Constructor & Destructor Documentation

 GasKinetics ( thermo_t * thermo = 0 )

Constructor.

Parameters
 thermo Pointer to the gas ThermoPhase (optional)

Definition at line 21 of file GasKinetics.cpp.

Copy Constructor.

Definition at line 40 of file GasKinetics.cpp.

## Member Function Documentation

Assignment operator.

Definition at line 57 of file GasKinetics.cpp.

 Kinetics * duplMyselfAsKinetics ( const std::vector< thermo_t * > & tpVector ) const
virtual

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.

Parameters
 tpVector Vector of pointers to ThermoPhase objects. this is the m_thermo vector within this object

Reimplemented from Kinetics.

Definition at line 118 of file GasKinetics.cpp.

 virtual int type ( ) const
inlinevirtual

Identifies the kinetics manager type.

Each class derived from Kinetics should overload this method to return a unique integer. Standard values are defined in file mix_defs.h.

Reimplemented from Kinetics.

Reimplemented in GRI_30_Kinetics.

Definition at line 55 of file GasKinetics.h.

 virtual doublereal reactantStoichCoeff ( size_t k, size_t i ) const
inlinevirtual

Stoichiometric coefficient of species k as a reactant in reaction i.

Parameters
 k kinetic species index i reaction index

Reimplemented from Kinetics.

Definition at line 59 of file GasKinetics.h.

 virtual doublereal productStoichCoeff ( size_t k, size_t i ) const
inlinevirtual

Stoichiometric coefficient of species k as a product in reaction i.

Parameters
 k kinetic species index i reaction index

Reimplemented from Kinetics.

Definition at line 63 of file GasKinetics.h.

 virtual void getFwdRatesOfProgress ( doublereal * fwdROP )
inlinevirtual

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.

Parameters
 fwdROP Output vector containing forward rates of progress of the reactions. Length: m_ii.

Reimplemented from Kinetics.

Definition at line 71 of file GasKinetics.h.

 virtual void getRevRatesOfProgress ( doublereal * revROP )
inlinevirtual

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.

Parameters
 revROP Output vector containing reverse rates of progress of the reactions. Length: m_ii.

Reimplemented from Kinetics.

Definition at line 76 of file GasKinetics.h.

 virtual void getNetRatesOfProgress ( doublereal * netROP )
inlinevirtual

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.

Parameters
 netROP Output vector of the net ROP. Length: m_ii.

Reimplemented from Kinetics.

Definition at line 81 of file GasKinetics.h.

 void getEquilibriumConstants ( doublereal * kc )
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.

Parameters
 kc Output vector containing the equilibrium constants. Length: m_ii.

Reimplemented from Kinetics.

Definition at line 213 of file GasKinetics.cpp.

 void getDeltaGibbs ( doublereal * deltaG )
virtual

Return the vector of values for the reaction gibbs free energy change.

These values depend upon the concentration of the solution.

units = J kmol-1

Parameters
 deltaG Output vector of deltaG's for reactions Length: m_ii.

Reimplemented from Kinetics.

Definition at line 232 of file GasKinetics.cpp.

 void getDeltaEnthalpy ( doublereal * deltaH )
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: m_ii.

Reimplemented from Kinetics.

Definition at line 246 of file GasKinetics.cpp.

 void getDeltaEntropy ( doublereal * deltaS )
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: m_ii.

Reimplemented from Kinetics.

Definition at line 260 of file GasKinetics.cpp.

 void getDeltaSSGibbs ( doublereal * deltaG )
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: m_ii.

Reimplemented from Kinetics.

Definition at line 274 of file GasKinetics.cpp.

 void getDeltaSSEnthalpy ( doublereal * deltaH )
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: m_ii.

Reimplemented from Kinetics.

Definition at line 290 of file GasKinetics.cpp.

 void getDeltaSSEntropy ( doublereal * deltaS )
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: m_ii.

Reimplemented from Kinetics.

Definition at line 310 of file GasKinetics.cpp.

 void getNetProductionRates ( doublereal * wdot )
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.

nTotalSpecies.
Parameters
 wdot Output vector of net production rates. Length: m_kk.

Reimplemented from Kinetics.

Reimplemented in GRI_30_Kinetics.

Definition at line 329 of file GasKinetics.cpp.

References ReactionStoichMgr::getNetProductionRates(), and Kinetics::m_kk.

 void getCreationRates ( doublereal * cdot )
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.

nTotalSpecies.
Parameters
 cdot Output vector of creation rates. Length: m_kk.

Reimplemented from Kinetics.

Definition at line 335 of file GasKinetics.cpp.

References ReactionStoichMgr::getCreationRates(), and Kinetics::m_kk.

 void getDestructionRates ( doublereal * ddot )
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.

nTotalSpecies.
Parameters
 ddot Output vector of destruction rates. Length: m_kk.

Reimplemented from Kinetics.

Definition at line 341 of file GasKinetics.cpp.

References ReactionStoichMgr::getDestructionRates(), and Kinetics::m_kk.

 virtual int reactionType ( size_t i ) const
inlinevirtual

Flag specifying the type of reaction.

The legal values and their meaning are specific to the particular kinetics manager.

Parameters
 i reaction index

Reimplemented from Kinetics.

Definition at line 107 of file GasKinetics.h.

 virtual std::string reactionString ( size_t i ) const
inlinevirtual

Return a string representing the reaction.

Parameters
 i reaction index

Reimplemented from Kinetics.

Definition at line 111 of file GasKinetics.h.

 virtual bool isReversible ( size_t i )
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.

Parameters
 i reaction index

Reimplemented from Kinetics.

Definition at line 115 of file GasKinetics.h.

 void getFwdRateConstants ( doublereal * kfwd )
virtual

Return the forward rate constants.

length is the number of reactions. units depends on many issues.

Parameters
 kfwd Output vector containing the forward reaction rate constants. Length: m_ii.

Reimplemented from Kinetics.

Definition at line 431 of file GasKinetics.cpp.

 void getRevRateConstants ( doublereal * krev, bool doIrreversible = false )
virtual

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.

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

Reimplemented from Kinetics.

Definition at line 461 of file GasKinetics.cpp.

 void init ( )
virtual

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 from Kinetics.

Definition at line 682 of file GasKinetics.cpp.

References Cantera::GasConstant, Kinetics::m_kk, Phase::nSpecies(), and Kinetics::thermo().

 void addReaction ( ReactionData & r )
virtual

Add a single reaction to the mechanism.

This routine must be called after init() and before finalize().

Parameters
 r Reference to the ReactionData object for the reaction to be added.

Reimplemented from Kinetics.

Definition at line 484 of file GasKinetics.cpp.

 void finalize ( )
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 from Kinetics.

Definition at line 692 of file GasKinetics.cpp.

References Kinetics::m_ii, Kinetics::m_perturb, and FalloffMgr::workSize().

virtual

Returns true if the kinetics manager has been properly initialized and finalized.

Reimplemented from Kinetics.

Reimplemented in GRI30.

Definition at line 712 of file GasKinetics.cpp.

 void update_rates_T ( )
virtual

Update temperature-dependent portions of reaction rates and falloff functions.

Definition at line 125 of file GasKinetics.cpp.

 void update_rates_C ( )
virtual

Update properties that depend on concentrations.

Currently the enhanced collision partner concentrations are updated here, as well as the pressure-dependent portion of P-log and Chebyshev reactions.

Definition at line 163 of file GasKinetics.cpp.

 void updateKc ( )
private

Update the equilibrium constants in molar units.

Definition at line 193 of file GasKinetics.cpp.

## Member Data Documentation

 vector_fp m_dn
protected

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

Changed to a double to account for the fact that we can have real-valued stoichiometries.

Definition at line 199 of file GasKinetics.h.

 doublereal m_pres
protected

Last pressure at which rates were evaluated.

Definition at line 217 of file GasKinetics.h.