23 Kinetics::Kinetics() :
146 size_t ns = tpVector.size();
149 " Number of ThermoPhase objects arent't the same");
151 for (
size_t i = 0; i < ns; i++) {
154 if (ntp->
id() != otp->
id()) {
156 " id() of the ThermoPhase objects isn't the same");
160 " eosType() of the ThermoPhase objects isn't the same");
164 " Number of ThermoPhase objects isn't the same");
173 doublereal* phase_data)
175 for (
size_t n = 0; n <
nPhases(); n++) {
179 data +
m_start[n] + nsp, phase_data);
183 throw CanteraError(
"Kinetics::selectPhase",
"Phase not found.");
188 for (
size_t n =
m_start.size()-1; n !=
npos; n--) {
198 for (
size_t n = 0; n <
m_thermo.size(); n++) {
210 const std::string& ph)
const
216 for (
size_t n = 0; n <
m_thermo.size(); n++) {
234 for (
size_t n = 0; n < np; n++) {
240 throw CanteraError(
"speciesPhase",
"unknown species "+nm);
246 for (
size_t n =
m_start.size()-1; n !=
npos; n--) {
277 if (
type() == cEdgeKinetics) {
279 }
else if (
type() == cInterfaceKinetics) {
282 if (thermo.
eosType() == ptype) {
293 for (
size_t n = 0; n <
nPhases(); n++) {
294 size_t nsp =
m_thermo[n]->nSpecies();
302 "The default Base class method was called, when "
303 "the inherited class's method should "
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
std::vector< thermo_t * > m_thermo
m_thermo is a vector of pointers to ThermoPhase objects that are involved with this kinetics operator...
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase, assuming an ideal solution model (see Thermodynamic Properties and class SurfPhase).
std::vector< std::vector< size_t > > m_reactants
This is a vector of vectors containing the reactants for each reaction.
virtual void assignShallowPointers(const std::vector< thermo_t * > &tpVector)
Reassign the pointers within the Kinetics object.
thermo_t & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism...
size_t m_kk
The number of species in all of the phases that participate in this kinetics mechanism.
std::vector< size_t > m_start
m_start is a vector of integers specifying the beginning position for the species vector for the n'th...
const size_t npos
index returned by functions to indicate "no position"
virtual Kinetics * duplMyselfAsKinetics(const std::vector< thermo_t * > &tpVector) const
Duplication routine for objects which inherit from Kinetics.
std::string kineticsSpeciesName(size_t k) const
Return the name of the kth species in the kinetics manager.
void selectPhase(const doublereal *data, const thermo_t *phase, doublereal *phase_data)
std::vector< grouplist_t > m_dummygroups
Vector of group lists.
Kinetics()
Default constructor.
Base class for a phase with thermodynamic properties.
const int cSurf
A surface phase. Used by class SurfPhase.
void checkPhaseIndex(size_t m) const
Check that the specified phase index is in range Throws an exception if m is greater than nPhases() ...
size_t speciesIndex(const std::string &name) const
Returns the index of a species named 'name' within the Phase object.
size_t nPhases() const
The number of phases participating in the reaction mechanism.
thermo_t & speciesPhase(const std::string &nm)
This function looks up the name of a species and returns a reference to the ThermoPhase object of the...
void checkSpeciesArraySize(size_t mm) const
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies()...
void err(const std::string &m) const
Function indicating that a function inherited from the base class hasn't had a definition assigned to...
void checkSpeciesIndex(size_t k) const
Check that the specified species index is in range Throws an exception if k is greater than nSpecies(...
vector_fp m_perturb
Vector of perturbation factors for each reaction's rate of progress vector.
Public interface for kinetics managers.
std::string id() const
Return the string id for the phase.
Base class for exceptions thrown by Cantera classes.
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
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...
const int cEdge
An edge between two 2D surfaces.
Declarations for the implicit integration of surface site density equations (see Kinetics Managers an...
Kinetics & operator=(const Kinetics &right)
Assignment operator.
size_t kineticsSpeciesIndex(size_t k, size_t n) const
The location of species k of phase n in species arrays.
size_t nSpecies() const
Returns the number of species in the phase.
size_t nDim() const
Returns the number of spatial dimensions (1, 2, or 3)
size_t m_mindim
number of spatial dimensions of lowest-dimensional phase.
void checkReactionIndex(size_t m) const
Check that the specified reaction index is in range Throws an exception if i is greater than nReactio...
virtual int eosType() const
Equation of state type flag.
size_t speciesPhaseIndex(size_t k)
This function takes as an argument the kineticsSpecies index (i.e., the list index in the list of spe...
std::vector< std::vector< size_t > > m_products
This is a vector of vectors containing the products for each reaction.
void checkReactionArraySize(size_t ii) const
Check that an array size is at least nReactions() Throws an exception if ii is less than nReactions()...
size_t m_ii
Number of reactions in the mechanism.
virtual int type() const
Identifies the kinetics manager type.
size_t m_surfphase
Index in the list of phases of the one surface phase.
An array index is out of range.
size_t m_rxnphase
Phase Index where reactions are assumed to be taking place.
virtual void finalize()
Finish adding reactions and prepare for use.
virtual void addPhase(thermo_t &thermo)
Add a phase to the kinetics manager object.
virtual ~Kinetics()
Destructor.
void checkPhaseArraySize(size_t mm) const
Check that an array size is at least nPhases() Throws an exception if mm is less than nPhases()...
std::string speciesName(size_t k) const
Name of the species with index k.