Kinetics Class Reference
[Kinetics Managers]

Public interface for kinetics managers. More...

#include <Kinetics.h>

List of all members.

Public Types

typedef ThermoPhase thermo_t
 typedef for ThermoPhase

Public Member Functions

void incrementRxnCount ()
 Increment the number of reactions in the mechanism by one.
virtual bool ready () const
 Returns true if the kinetics manager has been properly initialized and finalized.
void selectPhase (const doublereal *data, const thermo_t *phase, doublereal *phase_data)
 Extract from array data the portion pertaining to phase phase.
int index ()
 For internal use. May be removed in a future release.
void setIndex (int index)
 Set the index of the Kinetics Manager.
Constructors and General Information about Mechanism

 Kinetics ()
 Default constructor.
virtual ~Kinetics ()
 This constructor initializes with a starting phase.
 Kinetics (const Kinetics &)
 Copy Constructor for the Kinetics object.
Kineticsoperator= (const Kinetics &right)
 Assignment operator.
virtual KineticsduplMyselfAsKinetics () const
 Duplication routine for objects which inherit from Kinetics.
virtual int ID () const
 Identifies the subclass of the Kinetics manager type.
virtual int type () const
 Identifies the kinetics manager type.
int nReactions () const
 Number of reactions in the reaction mechanism.
Information/Lookup Functions about Phases and Species

int nPhases () const
 The number of phases participating in the reaction mechanism.
int phaseIndex (std::string ph)
 Return the phase index of a phase in the list of phases defined within the object.
int surfacePhaseIndex ()
 This returns the integer index of the phase which has ThermoPhase type cSurf.
int reactionPhaseIndex ()
 Phase where the reactions occur.
thermo_tthermo (int n=0)
 This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
const thermo_tthermo (int n=0) const
thermo_tphase (int n=0)
 This method returns a reference to the nth ThermoPhase defined in this kinetics mechanism.
const thermo_tphase (int n=0) const
 This method returns a reference to the nth ThermoPhase defined in this kinetics mechanism.
int nTotalSpecies () const
 The total number of species in all phases participating in the kinetics mechanism.
int start (int n)
 Returns the starting index of the species in the nth phase associated with the reaction mechanism.
int kineticsSpeciesIndex (int k, int n) const
 The location of species k of phase n in species arrays.
std::string kineticsSpeciesName (int k) const
 Return the std::string name of the kth species in the kinetics manager.
int kineticsSpeciesIndex (std::string nm, std::string ph="<any>") const
 This routine will look up a species number based on the input std::string nm.
thermo_tspeciesPhase (std::string nm)
 This function looks up the std::string name of a species and returns a reference to the ThermoPhase object of the phase where the species resides.
thermo_tspeciesPhase (int 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.
int speciesPhaseIndex (int 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.
Reaction Rates Of Progress

virtual void getFwdRatesOfProgress (doublereal *fwdROP)
 Return the forward rates of progress of the reactions.
virtual void getRevRatesOfProgress (doublereal *revROP)
 Return the Reverse rates of progress of the reactions.
virtual void getNetRatesOfProgress (doublereal *netROP)
 Net rates of progress.
virtual void getEquilibriumConstants (doublereal *kc)
 Return a vector of Equilibrium constants.
virtual void getReactionDelta (const doublereal *property, doublereal *deltaProperty)
 Change in species properties.
virtual void getDeltaGibbs (doublereal *deltaG)
 Return the vector of values for the reaction gibbs free energy change.
virtual void getDeltaEnthalpy (doublereal *deltaH)
 Return the vector of values for the reactions change in enthalpy.
virtual void getDeltaEntropy (doublereal *deltaS)
 Return the vector of values for the reactions change in entropy.
virtual void getDeltaSSGibbs (doublereal *deltaG)
 Return the vector of values for the reaction standard state gibbs free energy change.
virtual void getDeltaSSEnthalpy (doublereal *deltaH)
 Return the vector of values for the change in the standard state enthalpies of reaction.
virtual void getDeltaSSEntropy (doublereal *deltaS)
 Return the vector of values for the change in the standard state entropies for each reaction.
Species Production Rates

virtual void getCreationRates (doublereal *cdot)
 Species creation rates [kmol/m^3/s or kmol/m^2/s].
virtual void getDestructionRates (doublereal *ddot)
 Species destruction rates [kmol/m^3/s or kmol/m^2/s].
virtual void getNetProductionRates (doublereal *wdot)
 Species net production rates [kmol/m^3/s or kmol/m^2/s].
Reaction Mechanism Informational Query Routines

virtual doublereal reactantStoichCoeff (int k, int i) const
 Stoichiometric coefficient of species k as a reactant in reaction i.
virtual doublereal productStoichCoeff (int k, int i) const
 Stoichiometric coefficient of species k as a product in reaction i.
virtual doublereal reactantOrder (int k, int i) const
 reactant Order of species k in reaction i.
virtual const vector_int & reactants (int i) const
 Returns a read-only reference to the vector of reactant index numbers for reaction i.
virtual const vector_int & products (int i) const
 Returns a read-only reference to the vector of product index numbers for reaction i.
virtual int reactionType (int i) const
 Flag specifying the type of reaction.
virtual bool isReversible (int i)
 True if reaction i has been declared to be reversible.
virtual std::string reactionString (int i) const
 Return a std::string representing the reaction.
virtual void getFwdRateConstants (doublereal *kfwd)
 Return the forward rate constants.
virtual void getRevRateConstants (doublereal *krev, bool doIrreversible=false)
 Return the reverse rate constants.
virtual void getActivationEnergies (doublereal *E)
 Return the activation energies in Kelvin.
Reaction Mechanism Construction

virtual void addPhase (thermo_t &thermo)
 Add a phase to the kinetics manager object.
virtual void init ()
 Prepare the class for the addition of reactions.
virtual void finalize ()
 Finish adding reactions and prepare for use.
virtual void addReaction (const ReactionData &r)
 Add a single reaction to the mechanism.
virtual const std::vector
< grouplist_t > & 
reactantGroups (int i)
virtual const std::vector
< grouplist_t > & 
productGroups (int i)
Altering Reaction Rates

These methods alter reaction rates.

They are designed primarily for carrying out sensitivity analysis, but may be used for any purpose requiring dynamic alteration of rate constants. For each reaction, a real-valued multiplier may be defined that multiplies the reaction rate coefficient. The multiplier may be set to zero to completely remove a reaction from the mechanism.

doublereal multiplier (int i) const
 The current value of the multiplier for reaction i.
void setMultiplier (int i, doublereal f)
 Set the multiplier for reaction i to f.

Protected Attributes

int m_ii
 Number of reactions in the mechanism.
vector_fp m_perturb
 Vector of perturbation factors for each reaction's rate of progress vector.
std::vector< vector_int > m_reactants
 This is a vector of vectors containing the reactants for each reaction.
std::vector< vector_int > m_products
 This is a vector of vectors containing the products for each reaction.
std::vector< thermo_t * > m_thermo
 m_thermo is a vector of pointers to ThermoPhase objects.
vector_int 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.
std::map< std::string, int > 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.
int m_index
 Index of the Kinetics Manager.
int m_surfphase
 Index in the list of phases of the one surface phase.
int m_rxnphase
 Index in the list of phases of the one phase where the reactions occur.
int m_mindim
 number of spatial dimensions of lowest-dimensional phase.

Private Member Functions

void err (std::string m) const
 Function for unhandled situations.

Private Attributes

std::vector< grouplist_tm_dummygroups
 Vector of group lists.

Detailed Description

Public interface for kinetics managers.

This class serves as a base class to derive 'kinetics managers', which are classes that manage homogeneous chemistry within one phase, or heterogeneous chemistry at one interface. The virtual methods of this class are meant to be overloaded in subclasses. The non-virtual methods perform generic functions and are implemented in Kinetics. They should not be overloaded. Only those methods required by a subclass need to be overloaded; the rest will throw exceptions if called.

When the nomenclature "kinetics species index" is used below, this means that the species index ranges over all species in all phases handled by the kinetics manager.

Definition at line 133 of file Kinetics.h.


Member Typedef Documentation

typedef for ThermoPhase

Definition at line 138 of file Kinetics.h.


Constructor & Destructor Documentation

Kinetics (  ) 

Default constructor.

Definition at line 32 of file Kinetics.cpp.

Referenced by Kinetics::duplMyselfAsKinetics().

~Kinetics (  )  [virtual]

This constructor initializes with a starting phase.

Deprecated:

Destructor.

Definition at line 36 of file Kinetics.cpp.

Kinetics ( const Kinetics right  ) 

Copy Constructor for the Kinetics object.

Currently, this is not fully implemented. If called it will throw an exception.

Definition at line 44 of file Kinetics.cpp.

References Kinetics::operator=().


Member Function Documentation

void addPhase ( thermo_t thermo  )  [virtual]

Add a phase to the kinetics manager object.

This must be done before the function init() is called or before any reactions are input. The following fields are updated: m_start -> vector of integers, containing the starting position of the species for each phase in the kinetics mechanism. m_surfphase -> index of the surface phase. m_thermo -> vector of pointers to ThermoPhase phases that participate in the kinetics mechanism. m_phaseindex -> map containing the std::string id of each ThermoPhase phase as a key and the index of the phase within the kinetics manager object as the value.

Parameters:
thermo Reference to the ThermoPhase to be added.

Definition at line 253 of file Kinetics.cpp.

References ThermoPhase::eosType(), Kinetics::m_mindim, Kinetics::m_phaseindex, Kinetics::m_rxnphase, Kinetics::m_start, Kinetics::m_surfphase, Kinetics::m_thermo, Phase::nDim(), Kinetics::nPhases(), and Kinetics::type().

virtual void addReaction ( const ReactionData &  r  )  [inline, 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.

Definition at line 823 of file Kinetics.h.

References Kinetics::err().

Kinetics * duplMyselfAsKinetics (  )  const [virtual]

Duplication routine for objects which inherit from Kinetics.

This virtual routine can be used to duplicate Kinetics objects inherited 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.

Definition at line 101 of file Kinetics.cpp.

References Kinetics::Kinetics().

void err ( std::string  m  )  const [private]
virtual void finalize (  )  [inline, virtual]

Finish adding reactions and prepare for use.

This method is called by function 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.

Definition at line 814 of file Kinetics.h.

virtual void getActivationEnergies ( doublereal *  E  )  [inline, virtual]

Return the activation energies in Kelvin.

length is the number of reactions

Parameters:
E Ouptut vector of activation energies. Length: m_ii.

Definition at line 762 of file Kinetics.h.

References Kinetics::err().

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

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

Definition at line 595 of file Kinetics.h.

References Kinetics::err().

virtual void getDeltaEnthalpy ( doublereal *  deltaH  )  [inline, 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.

Definition at line 519 of file Kinetics.h.

References Kinetics::err().

virtual void getDeltaEntropy ( doublereal *  deltaS  )  [inline, 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.

Definition at line 533 of file Kinetics.h.

References Kinetics::err().

virtual void getDeltaGibbs ( doublereal *  deltaG  )  [inline, 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.

Definition at line 505 of file Kinetics.h.

References Kinetics::err().

virtual void getDeltaSSEnthalpy ( doublereal *  deltaH  )  [inline, 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.

Definition at line 561 of file Kinetics.h.

References Kinetics::err().

virtual void getDeltaSSEntropy ( doublereal *  deltaS  )  [inline, 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.

Definition at line 575 of file Kinetics.h.

References Kinetics::err().

virtual void getDeltaSSGibbs ( doublereal *  deltaG  )  [inline, 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.

Definition at line 547 of file Kinetics.h.

References Kinetics::err().

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

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

Definition at line 608 of file Kinetics.h.

References Kinetics::err().

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

Definition at line 470 of file Kinetics.h.

References Kinetics::err().

virtual void getFwdRateConstants ( doublereal *  kfwd  )  [inline, virtual]

Return the forward rate constants.

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

Todo:
DGG: recommend changing name to getFwdRateCoefficients.
Parameters:
kfwd Output vector containing the foward reaction rate constants. Length: m_ii.

Definition at line 731 of file Kinetics.h.

References Kinetics::err().

virtual void getFwdRatesOfProgress ( doublereal *  fwdROP  )  [inline, virtual]

Return the forward rates of progress of the reactions.

Forward rates of progress. Return the forward rates of progress in array fwdROP, which must be dimensioned at least as large as the total number of reactions.

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

Definition at line 429 of file Kinetics.h.

References Kinetics::err().

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

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

Definition at line 621 of file Kinetics.h.

References Kinetics::err().

virtual void getNetRatesOfProgress ( doublereal *  netROP  )  [inline, virtual]

Net rates of progress.

Return the net (forward - reverse) rates of progress in array netROP, which must be dimensioned at least as large as the total number of reactions.

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

Definition at line 454 of file Kinetics.h.

References Kinetics::err().

virtual void getReactionDelta ( const doublereal *  property,
doublereal *  deltaProperty 
) [inline, virtual]

Change in species properties.

Given an array of molar species property values $ z_k, k = 1, \dots, K $, return the array of reaction values

\[ \Delta Z_i = \sum_k \nu_{k,i} z_k, i = 1, \dots, I. \]

For example, if this method is called with the array of standard-state molar Gibbs free energies for the species, then the values returned in array deltaProperty would be the standard-state Gibbs free energies of reaction for each reaction.

Parameters:
property Input vector of property value. Length: m_kk.
deltaProperty Output vector of deltaRxn. Length: m_ii.

Definition at line 490 of file Kinetics.h.

References Kinetics::err().

virtual void getRevRateConstants ( doublereal *  krev,
bool  doIrreversible = false 
) [inline, 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.

Todo:
DGG: recommend changing name to getRevRateCoefficients.
Parameters:
krev Output vector of reverse rate constants.
doIrreversible boolean indicating whether irreversible reactions should be included.

Definition at line 748 of file Kinetics.h.

References Kinetics::err().

virtual void getRevRatesOfProgress ( doublereal *  revROP  )  [inline, virtual]

Return the Reverse rates of progress of the reactions.

Return the reverse rates of progress in array revROP, which must be dimensioned at least as large as the total number of reactions.

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

Definition at line 442 of file Kinetics.h.

References Kinetics::err().

int ID (  )  const [virtual]

Identifies the subclass of the Kinetics manager type.

These are listed in mix_defs.h.

Definition at line 108 of file Kinetics.cpp.

void incrementRxnCount (  )  [inline]

Increment the number of reactions in the mechanism by one.

Todo:
Should be protected?

Definition at line 871 of file Kinetics.h.

References Kinetics::m_ii, and Kinetics::m_perturb.

int index (  )  [inline]

For internal use. May be removed in a future release.

Definition at line 893 of file Kinetics.h.

References Kinetics::m_index.

virtual void init (  )  [inline, virtual]

Prepare the class for the addition of reactions.

This method is called by function 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.

Definition at line 803 of file Kinetics.h.

virtual bool isReversible ( int  i  )  [inline, 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

Definition at line 707 of file Kinetics.h.

References Kinetics::err().

int kineticsSpeciesIndex ( std::string  nm,
std::string  ph = "<any>" 
) const

This routine will look up a species number based on the input std::string nm.

kineticsSpeciesIndex():

The lookup of species will occur for all phases listed in the kinetics object, unless the std::string ph refers to a specific phase of the object.

return

  • If a match is found, the position in the species list is returned.
  • If a specific phase is specified and no match is found, the value -1 is returned.
  • If no match is found in any phase, the value -2 is returned.
Parameters:
nm Input string name of the species
ph Input string name of the phase. Defaults to "<any>"

This routine will look up a species number based on the input string nm. The lookup of species will occur for all phases listed in the kinetics object, unless the string ph refers to a specific phase of the object.

return

  • If a match is found, the position in the species list is returned.
  • If a specific phase is specified and no match is found, the value -1 is returned.
  • If no match is found in any phase, the value -2 is returned.

Definition at line 178 of file Kinetics.cpp.

References Phase::id(), Kinetics::m_start, Kinetics::m_thermo, Constituents::speciesIndex(), and Kinetics::thermo().

int kineticsSpeciesIndex ( int  k,
int  n 
) const [inline]

The location of species k of phase n in species arrays.

Kinetics manager classes return species production rates in flat arrays, with the species of each phases following one another, in the order the phases were added. This method is useful to find the value for a particular species of a particular phase in arrrays returned from methods like getCreationRates that return an array of species-specific quantities.

Example: suppose a heterogeneous mechanism involves three phases. The first contains 12 species, the second 26, and the third 3. Then species arrays must have size at least 41, and positions 0 - 11 are the values for the species in the first phase, positions 12 - 37 are the values for the species in the second phase, etc. Then kineticsSpeciesIndex(7, 0) = 7, kineticsSpeciesIndex(4, 1) = 16, and kineticsSpeciesIndex(2, 2) = 40.

Parameters:
k species index
n phase index for the species

Definition at line 343 of file Kinetics.h.

References Kinetics::m_start.

string kineticsSpeciesName ( int  k  )  const

Return the std::string name of the kth species in the kinetics manager.

kineticsSpeciesName():

k is an integer from 0 to ktot - 1, where ktot is the number of species in the kinetics manager, which is the sum of the number of species in all phases participating in the kinetics manager. If k is out of bounds, the std::string "<unknown>" is returned.

Parameters:
k species index

Return the string name of the kth species in the kinetics manager. k is an integer from 0 to ktot - 1, where ktot is the number of species in the kinetics manager, which is the sum of the number of species in all phases participating in the kinetics manager. If k is out of bounds, the string "<unknown>" is returned.

Definition at line 152 of file Kinetics.cpp.

References Kinetics::m_start, Constituents::speciesName(), and Kinetics::thermo().

doublereal multiplier ( int  i  )  const [inline]

The current value of the multiplier for reaction i.

Parameters:
i index of the reaction

Definition at line 856 of file Kinetics.h.

References Kinetics::m_perturb.

int nPhases (  )  const [inline]

The number of phases participating in the reaction mechanism.

For a homogeneous reaction mechanism, this will always return 1, but for a heterogeneous mechanism it will return the total number of phases in the mechanism.

Definition at line 216 of file Kinetics.h.

References Kinetics::m_thermo.

Referenced by Kinetics::addPhase(), Kinetics::nTotalSpecies(), and Kinetics::selectPhase().

int nReactions (  )  const [inline]

Number of reactions in the reaction mechanism.

Definition at line 200 of file Kinetics.h.

References Kinetics::m_ii.

int nTotalSpecies (  )  const [inline]

The total number of species in all phases participating in the kinetics mechanism.

This is useful to dimension arrays for use in calls to methods that return the species production rates, for example.

Definition at line 301 of file Kinetics.h.

References Kinetics::nPhases(), Constituents::nSpecies(), and Kinetics::thermo().

Kinetics & operator= ( const Kinetics right  ) 

Assignment operator.

This is NOT a virtual function.

Parameters:
right Reference to Kinetics object to be copied into the current one.

Definition at line 66 of file Kinetics.cpp.

References Kinetics::m_dummygroups, Kinetics::m_ii, Kinetics::m_index, Kinetics::m_mindim, Kinetics::m_perturb, Kinetics::m_phaseindex, Kinetics::m_products, Kinetics::m_reactants, Kinetics::m_rxnphase, Kinetics::m_start, Kinetics::m_surfphase, and Kinetics::m_thermo.

Referenced by Kinetics::Kinetics().

const thermo_t& phase ( int  n = 0  )  const [inline]

This method returns a reference to the nth ThermoPhase defined in this kinetics mechanism.

It is typically used so that member functions of the ThermoPhase may be called.

Deprecated:
This method is redundant.
Parameters:
n Index of the ThermoPhase being sought.

Definition at line 290 of file Kinetics.h.

References Cantera::deprecatedMethod(), and Kinetics::m_thermo.

thermo_t& phase ( int  n = 0  )  [inline]

This method returns a reference to the nth ThermoPhase defined in this kinetics mechanism.

It is typically used so that member functions of the ThermoPhase may be called.

Deprecated:
This method is redundant.
Parameters:
n Index of the ThermoPhase being sought.

Definition at line 278 of file Kinetics.h.

References Cantera::deprecatedMethod(), and Kinetics::m_thermo.

int phaseIndex ( std::string  ph  )  [inline]

Return the phase index of a phase in the list of phases defined within the object.

Parameters:
ph std::string name of the phase

If a -1 is returned, then the phase is not defined in the Kinetics object.

Definition at line 227 of file Kinetics.h.

References Kinetics::m_phaseindex.

virtual const vector_int& products ( int  i  )  const [inline, virtual]

Returns a read-only reference to the vector of product index numbers for reaction i.

Parameters:
i reaction index

Definition at line 684 of file Kinetics.h.

References Kinetics::m_products.

virtual doublereal productStoichCoeff ( int  k,
int  i 
) const [inline, virtual]

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

Parameters:
k kinetic species index
i reaction index

Definition at line 652 of file Kinetics.h.

References Kinetics::err().

virtual doublereal reactantOrder ( int  k,
int  i 
) const [inline, virtual]

reactant Order of species k in reaction i.

Parameters:
k kinetic species index
i reaction index

Definition at line 663 of file Kinetics.h.

References Kinetics::err().

virtual const vector_int& reactants ( int  i  )  const [inline, virtual]

Returns a read-only reference to the vector of reactant index numbers for reaction i.

Parameters:
i reaction index

Definition at line 674 of file Kinetics.h.

References Kinetics::m_reactants.

virtual doublereal reactantStoichCoeff ( int  k,
int  i 
) const [inline, virtual]

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

Parameters:
k kinetic species index
i reaction index

Definition at line 640 of file Kinetics.h.

References Kinetics::err().

int reactionPhaseIndex (  )  [inline]

Phase where the reactions occur.

For heterogeneous mechanisms, one of the phases in the list of phases represents the 2D interface or 1D edge at which the reactions take place. This method returns the index of the phase with the smallest spatial dimension (1, 2, or 3) among the list of phases. If there is more than one, the index of the first one is returned. For homogeneous mechanisms, the value 0 is returned.

Definition at line 254 of file Kinetics.h.

References Kinetics::m_rxnphase.

virtual std::string reactionString ( int  i  )  const [inline, virtual]

Return a std::string representing the reaction.

Parameters:
i reaction index

Definition at line 717 of file Kinetics.h.

References Kinetics::err().

virtual int reactionType ( int  i  )  const [inline, virtual]

Flag specifying the type of reaction.

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

Parameters:
i reaction index

Definition at line 695 of file Kinetics.h.

References Kinetics::err().

virtual bool ready (  )  const [inline, virtual]

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

Definition at line 877 of file Kinetics.h.

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

Extract from array data the portion pertaining to phase phase.

Takes as input an array of properties for all species in the mechanism and copies those values beloning to a particular phase to the output array.

Parameters:
data data
phase phase
phase_data phase_data
data Input data array.
phase Pointer to one of the phase objects participating in this reaction mechanism
phase_data Output array where the values for the the specified phase are to be written.

Definition at line 127 of file Kinetics.cpp.

References Kinetics::m_start, Kinetics::m_thermo, Kinetics::nPhases(), and Constituents::nSpecies().

void setIndex ( int  index  )  [inline]

Set the index of the Kinetics Manager.

Parameters:
index input index

Definition at line 899 of file Kinetics.h.

References Kinetics::m_index.

void setMultiplier ( int  i,
doublereal  f 
) [inline]

Set the multiplier for reaction i to f.

Parameters:
i index of the reaction
f value of the multiplier.

Definition at line 863 of file Kinetics.h.

References Kinetics::m_perturb.

thermo_t& speciesPhase ( int  k  )  [inline]

This function takes as an argument the kineticsSpecies index (i.e., the list index in the list of species in the kinetics manager) and returns the species' owning ThermoPhase object.

Parameters:
k Species index

Definition at line 397 of file Kinetics.h.

References Kinetics::speciesPhaseIndex(), and Kinetics::thermo().

thermo_t & speciesPhase ( std::string  nm  ) 

This function looks up the std::string name of a species and returns a reference to the ThermoPhase object of the phase where the species resides.

This function looks up the string name of a species and returns a reference to the ThermoPhase object of the phase where the species resides.

Will throw an error if the species std::string doesn't match.

Parameters:
nm String containing the name of the species.

Will throw an error if the species string doesn't match.

Definition at line 207 of file Kinetics.cpp.

References Kinetics::m_thermo, Constituents::speciesIndex(), and Kinetics::thermo().

int speciesPhaseIndex ( int  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.

Parameters:
k Species index

Definition at line 225 of file Kinetics.cpp.

References Cantera::int2str(), and Kinetics::m_start.

Referenced by Kinetics::speciesPhase().

int start ( int  n  )  [inline]

Returns the starting index of the species in the nth phase associated with the reaction mechanism.

Parameters:
n Return the index of first species in the nth phase associated with the reaction mechanism.

Definition at line 315 of file Kinetics.h.

References Cantera::deprecatedMethod(), and Kinetics::m_start.

int surfacePhaseIndex (  )  [inline]

This returns the integer index of the phase which has ThermoPhase type cSurf.

For heterogeneous mechanisms, this identifies the one surface phase. For homogeneous mechanisms, this reurns -1.

Definition at line 242 of file Kinetics.h.

References Kinetics::m_surfphase.

thermo_t& thermo ( int  n = 0  )  [inline]

This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.

It is typically used so that member functions of the ThermoPhase object may be called. For homogeneous mechanisms, there is only one object, and this method can be called without an argument to access it.

Parameters:
n Index of the ThermoPhase being sought.

Definition at line 267 of file Kinetics.h.

References Kinetics::m_thermo.

Referenced by Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), Kinetics::nTotalSpecies(), and Kinetics::speciesPhase().

int type (  )  const [virtual]

Identifies the kinetics manager type.

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

Definition at line 112 of file Kinetics.cpp.

Referenced by Kinetics::addPhase().


Member Data Documentation

std::vector<grouplist_t> m_dummygroups [private]

Vector of group lists.

Definition at line 993 of file Kinetics.h.

Referenced by Kinetics::operator=().

int m_ii [protected]

Number of reactions in the mechanism.

Definition at line 906 of file Kinetics.h.

Referenced by Kinetics::incrementRxnCount(), Kinetics::nReactions(), and Kinetics::operator=().

int m_index [protected]

Index of the Kinetics Manager.

Definition at line 974 of file Kinetics.h.

Referenced by Kinetics::index(), Kinetics::operator=(), and Kinetics::setIndex().

int m_mindim [protected]

number of spatial dimensions of lowest-dimensional phase.

Definition at line 988 of file Kinetics.h.

Referenced by Kinetics::addPhase(), and Kinetics::operator=().

vector_fp m_perturb [protected]

Vector of perturbation factors for each reaction's rate of progress vector.

It is initialized to one.

Definition at line 911 of file Kinetics.h.

Referenced by Kinetics::incrementRxnCount(), Kinetics::multiplier(), Kinetics::operator=(), and Kinetics::setMultiplier().

std::map<std::string, int> m_phaseindex [protected]

Mapping of the phase id, i.e., the id attribute in the xml phase element to the position of the phase within the kinetics object.

Positions start with the value of 1. The member function, phaseIndex() decrements by one before returning the index value, so that missing phases return -1.

Definition at line 972 of file Kinetics.h.

Referenced by Kinetics::addPhase(), Kinetics::operator=(), and Kinetics::phaseIndex().

std::vector<vector_int> m_products [protected]

This is a vector of vectors containing the products for each reaction.

The outer vector is over the number of reactions, m_ii. The inner vector is a list of species indeces. If the stoichiometric coefficient for a product is greater than one, then the reactant is listed contiguously in the vector a number of times equal to its stoichiometric coefficient. NOTE: These vectors will be wrong if there are real stoichiometric coefficients in the expression.

Definition at line 937 of file Kinetics.h.

Referenced by Kinetics::operator=(), and Kinetics::products().

std::vector<vector_int> m_reactants [protected]

This is a vector of vectors containing the reactants for each reaction.

The outer vector is over the number of reactions, m_ii. The inner vector is a list of species indices. If the stoichiometric coefficient for a reactant is greater than one, then the reactant is listed contiguously in the vector a number of times equal to its stoichiometric coefficient. NOTE: These vectors will be wrong if there are real stoichiometric coefficients in the expression.

Definition at line 924 of file Kinetics.h.

Referenced by Kinetics::operator=(), and Kinetics::reactants().

int m_rxnphase [protected]

Index in the list of phases of the one phase where the reactions occur.

Definition at line 985 of file Kinetics.h.

Referenced by Kinetics::addPhase(), Kinetics::operator=(), and Kinetics::reactionPhaseIndex().

vector_int m_start [protected]

m_start is a vector of integers specifying the beginning position for the species vector for the n'th phase in the kinetics class.

Definition at line 962 of file Kinetics.h.

Referenced by Kinetics::addPhase(), Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), Kinetics::operator=(), Kinetics::selectPhase(), Kinetics::speciesPhaseIndex(), and Kinetics::start().

int m_surfphase [protected]

Index in the list of phases of the one surface phase.

Definition at line 979 of file Kinetics.h.

Referenced by Kinetics::addPhase(), Kinetics::operator=(), and Kinetics::surfacePhaseIndex().

std::vector<thermo_t*> m_thermo [protected]

m_thermo is a vector of pointers to ThermoPhase objects.

For homogeneous kinetics applications, this vector will only have one entry. For interfacial reactions, this vector will consist of multiple entries; some of them will be surface phases, and the other ones will be bulk phases. The order that the objects are listed determines the order in which the species comprising each phase are listed in the source term vector, originating from the reaction mechanism.

Note that this kinetics object doesn't own these ThermoPhase objects and is not responsible for creating or deleting them.

Definition at line 955 of file Kinetics.h.

Referenced by Kinetics::addPhase(), Kinetics::kineticsSpeciesIndex(), Kinetics::nPhases(), Kinetics::operator=(), Kinetics::phase(), Kinetics::selectPhase(), Kinetics::speciesPhase(), and Kinetics::thermo().


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.3