From d5262e8bee889d8b62bd34108079dc9ed2ff1216 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 29 Oct 2014 23:32:07 +0000 Subject: [PATCH] [Kinetics] Move stoich manager and related functions up to Kinetics --- include/cantera/kinetics/AqueousKinetics.h | 42 ----------- include/cantera/kinetics/GasKinetics.h | 39 ---------- include/cantera/kinetics/InterfaceKinetics.h | 63 ---------------- include/cantera/kinetics/Kinetics.h | 76 +++++++++++++------- src/kinetics/AqueousKinetics.cpp | 11 --- src/kinetics/GasKinetics.cpp | 26 ------- src/kinetics/InterfaceKinetics.cpp | 55 -------------- src/kinetics/Kinetics.cpp | 57 +++++++++++++++ 8 files changed, 108 insertions(+), 261 deletions(-) diff --git a/include/cantera/kinetics/AqueousKinetics.h b/include/cantera/kinetics/AqueousKinetics.h index 983e4ed56..90cc7ed65 100644 --- a/include/cantera/kinetics/AqueousKinetics.h +++ b/include/cantera/kinetics/AqueousKinetics.h @@ -75,21 +75,6 @@ public: //! @name Reaction Rates Of Progress //@{ - virtual void getFwdRatesOfProgress(doublereal* fwdROP) { - updateROP(); - std::copy(m_ropf.begin(), m_ropf.end(), fwdROP); - } - - virtual void getRevRatesOfProgress(doublereal* revROP) { - updateROP(); - std::copy(m_ropr.begin(), m_ropr.end(), revROP); - } - - virtual void getNetRatesOfProgress(doublereal* netROP) { - updateROP(); - std::copy(m_ropnet.begin(), m_ropnet.end(), netROP); - } - virtual void getEquilibriumConstants(doublereal* kc); virtual void getDeltaGibbs(doublereal* deltaG); @@ -100,25 +85,6 @@ public: virtual void getDeltaSSEnthalpy(doublereal* deltaH); virtual void getDeltaSSEntropy(doublereal* deltaS); - //! @} - //! @name Species Production Rates - //! @{ - - virtual void getNetProductionRates(doublereal* net) { - updateROP(); - m_rxnstoich.getNetProductionRates(m_kk, &m_ropnet[0], net); - } - - virtual void getCreationRates(doublereal* cdot) { - updateROP(); - m_rxnstoich.getCreationRates(m_kk, &m_ropf[0], &m_ropr[0], cdot); - } - - virtual void getDestructionRates(doublereal* ddot) { - updateROP(); - m_rxnstoich.getDestructionRates(m_kk, &m_ropf[0], &m_ropr[0], ddot); - } - //! @} //! @name Reaction Mechanism Informational Query Routines //! @{ @@ -173,16 +139,11 @@ protected: std::vector m_irrev; - ReactionStoichMgr m_rxnstoich; - std::vector m_fwdOrder; size_t m_nirrev; size_t m_nrev; - std::vector > m_rrxn; - std::vector > m_prxn; - /** * Difference between the input global reactants order * and the input global products order. Changed to a double @@ -197,9 +158,6 @@ protected: //! @name Aqueous kinetics data //!@{ - vector_fp m_ropf; - vector_fp m_ropr; - vector_fp m_ropnet; bool m_ROP_ok; doublereal m_temp; diff --git a/include/cantera/kinetics/GasKinetics.h b/include/cantera/kinetics/GasKinetics.h index 942cef301..206bd99b0 100644 --- a/include/cantera/kinetics/GasKinetics.h +++ b/include/cantera/kinetics/GasKinetics.h @@ -52,33 +52,10 @@ public: return cGasKinetics; } - virtual doublereal reactantStoichCoeff(size_t k, size_t i) const { - return getValue(m_rrxn[k], i, 0.0); - } - - virtual doublereal productStoichCoeff(size_t k, size_t i) const { - return getValue(m_prxn[k], i, 0.0); - } - //! @} //! @name Reaction Rates Of Progress //! @{ - virtual void getFwdRatesOfProgress(doublereal* fwdROP) { - updateROP(); - std::copy(m_ropf.begin(), m_ropf.end(), fwdROP); - } - - virtual void getRevRatesOfProgress(doublereal* revROP) { - updateROP(); - std::copy(m_ropr.begin(), m_ropr.end(), revROP); - } - - virtual void getNetRatesOfProgress(doublereal* netROP) { - updateROP(); - std::copy(m_ropnet.begin(), m_ropnet.end(), netROP); - } - virtual void getEquilibriumConstants(doublereal* kc); virtual void getDeltaGibbs(doublereal* deltaG); virtual void getDeltaEnthalpy(doublereal* deltaH); @@ -88,14 +65,6 @@ public: virtual void getDeltaSSEnthalpy(doublereal* deltaH); virtual void getDeltaSSEntropy(doublereal* deltaS); - //! @} - //! @name Species Production Rates - //! @{ - - virtual void getNetProductionRates(doublereal* net); - virtual void getCreationRates(doublereal* cdot); - virtual void getDestructionRates(doublereal* ddot); - //! @} //! @name Reaction Mechanism Informational Query Routines //! @{ @@ -154,16 +123,11 @@ protected: Rate1 m_plog_rates; Rate1 m_cheb_rates; - ReactionStoichMgr m_rxnstoich; - std::vector m_fwdOrder; size_t m_nirrev; size_t m_nrev; - std::vector > m_rrxn; - std::vector > m_prxn; - /** * Difference between the input global reactants order * and the input global products order. Changed to a double @@ -178,9 +142,6 @@ protected: 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; diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index 1c4b87a35..46493d171 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -14,7 +14,6 @@ #include "cantera/base/utilities.h" #include "RateCoeffMgr.h" -#include "ReactionStoichMgr.h" namespace Cantera { @@ -123,10 +122,6 @@ public: //! @name Reaction Rates Of Progress //! @{ - virtual void getFwdRatesOfProgress(doublereal* fwdROP); - virtual void getRevRatesOfProgress(doublereal* revROP); - virtual void getNetRatesOfProgress(doublereal* netROP); - virtual void getEquilibriumConstants(doublereal* kc); /** values needed to convert from exchange current density to surface reaction rate. @@ -153,39 +148,12 @@ public: virtual void getDeltaSSEnthalpy(doublereal* deltaH); virtual void getDeltaSSEntropy(doublereal* deltaS); - //! @} - //! @name Species Production Rates - //! @{ - - virtual void getCreationRates(doublereal* cdot); - virtual void getDestructionRates(doublereal* ddot); - virtual void getNetProductionRates(doublereal* net); - //! @} //! @name Reaction Mechanism Informational Query Routines //! @{ - //! Provide a reactant stoichiometric coefficient - /*! - * @param[in] kSpecKin Species index within the kinetics object - * @param[in] irxn Reaction index - * - * @return Returns the reactant stoichiometic coefficient within the reaction - */ - virtual doublereal reactantStoichCoeff(size_t kSpecKin, size_t irxn) const; - - //! Provide a product stoichiometric coefficient - /*! - * @param[in] kSpecKin Species index within the kinetics object - * @param[in] irxn Reaction index - * - * @return Returns the product stoichiometic coefficient within the reaction - */ - virtual doublereal productStoichCoeff(size_t kSpecKin, size_t irxn) const; - virtual void getActivityConcentrations(doublereal* const conc); - //! Return the charge transfer rxn Beta parameter for the ith reaction /*! * Returns the beta parameter for a charge transfer reaction. This @@ -449,40 +417,12 @@ protected: */ std::vector m_irrev; - //! Stoichiometric manager for the reaction mechanism - /*! - * This is the manager for the kinetics mechanism that handles turning - * reaction extents into species production rates and also handles - * turning thermo properties into reaction thermo properties. - */ - ReactionStoichMgr m_rxnstoich; - //! Number of irreversible reactions in the mechanism size_t m_nirrev; //! Number of reversible reactions in the mechanism size_t m_nrev; - //! m_rrxn is a vector of maps, containing the reactant - //! stoichiometric coefficient information - /*! - * m_rrxn has a length equal to the total number of species in the - * kinetics object. For each species, there exists a map, with the - * reaction number being the key, and the reactant stoichiometric - * coefficient for the species being the value. - */ - std::vector > m_rrxn; - - //! m_prxn is a vector of maps, containing the reactant - //! stoichiometric coefficient information - /** - * m_prxn is a vector of maps. m_prxn has a length equal to the total - * number of species in the kinetics object. For each species, there - * exists a map, with the reaction number being the key, and the product - * stoichiometric coefficient for the species being the value. - */ - std::vector > m_prxn; - public: //! Vector of additional information about each reaction /*! @@ -688,9 +628,6 @@ protected: doublereal m_logp0; doublereal m_logc0; - vector_fp m_ropf; - vector_fp m_ropr; - vector_fp m_ropnet; bool m_ROP_ok; diff --git a/include/cantera/kinetics/Kinetics.h b/include/cantera/kinetics/Kinetics.h index 74850b796..5c9e373a1 100644 --- a/include/cantera/kinetics/Kinetics.h +++ b/include/cantera/kinetics/Kinetics.h @@ -11,6 +11,7 @@ #define CT_KINETICS_H #include "cantera/thermo/ThermoPhase.h" +#include "ReactionStoichMgr.h" #include "cantera/thermo/mix_defs.h" namespace Cantera @@ -401,9 +402,7 @@ public: * @param fwdROP Output vector containing forward rates * of progress of the reactions. Length: m_ii. */ - virtual void getFwdRatesOfProgress(doublereal* fwdROP) { - throw NotImplementedError("Kinetics::getFwdRatesOfProgress"); - } + virtual void getFwdRatesOfProgress(doublereal* fwdROP); //! Return the Reverse rates of progress of the reactions /*! @@ -413,9 +412,7 @@ public: * @param revROP Output vector containing reverse rates * of progress of the reactions. Length: m_ii. */ - virtual void getRevRatesOfProgress(doublereal* revROP) { - throw NotImplementedError("Kinetics::getRevRatesOfProgress"); - } + virtual void getRevRatesOfProgress(doublereal* revROP); /** * Net rates of progress. Return the net (forward - reverse) rates of @@ -424,9 +421,7 @@ public: * * @param netROP Output vector of the net ROP. Length: m_ii. */ - virtual void getNetRatesOfProgress(doublereal* netROP) { - throw NotImplementedError("Kinetics::getNetRatesOfProgress"); - } + virtual void getNetRatesOfProgress(doublereal* netROP); //! Return a vector of Equilibrium constants. /*! @@ -567,9 +562,7 @@ public: * * @param cdot Output vector of creation rates. Length: m_kk. */ - virtual void getCreationRates(doublereal* cdot) { - throw NotImplementedError("Kinetics::getCreationRates"); - } + virtual void getCreationRates(doublereal* cdot); /** * Species destruction rates [kmol/m^3/s or kmol/m^2/s]. Return the @@ -578,9 +571,7 @@ public: * * @param ddot Output vector of destruction rates. Length: m_kk. */ - virtual void getDestructionRates(doublereal* ddot) { - throw NotImplementedError("Kinetics::getDestructionRates"); - } + virtual void getDestructionRates(doublereal* ddot); /** * Species net production rates [kmol/m^3/s or kmol/m^2/s]. Return @@ -590,9 +581,7 @@ public: * * @param wdot Output vector of net production rates. Length: m_kk. */ - virtual void getNetProductionRates(doublereal* wdot) { - throw NotImplementedError("Kinetics::getNetProductionRates"); - } + virtual void getNetProductionRates(doublereal* wdot); //! @} //! @name Reaction Mechanism Informational Query Routines @@ -604,19 +593,14 @@ public: * @param k kinetic species index * @param i reaction index */ - virtual doublereal reactantStoichCoeff(size_t k, size_t i) const { - throw NotImplementedError("Kinetics::reactantStoichCoeff"); - } - + virtual double reactantStoichCoeff(size_t k, size_t i) const; /** * Stoichiometric coefficient of species k as a product in reaction i. * * @param k kinetic species index * @param i reaction index */ - virtual doublereal productStoichCoeff(size_t k, size_t i) const { - throw NotImplementedError("Kinetics::productStoichCoeff"); - } + virtual double productStoichCoeff(size_t k, size_t i) const; //! Reactant order of species k in reaction i. /*! @@ -872,6 +856,19 @@ public: doublereal* phase_data); protected: + // Update internal rate-of-progress variables #m_ropf and #m_ropr. + virtual void updateROP() { + throw NotImplementedError("Kinetics::updateROP"); + } + + //! Stoichiometric manager for the reaction mechanism + /*! + * This is the manager for the kinetics mechanism that handles turning + * reaction extents into species production rates and also handles + * turning thermo properties into reaction thermo properties. + */ + ReactionStoichMgr m_rxnstoich; + //! Number of reactions in the mechanism size_t m_ii; @@ -909,6 +906,26 @@ protected: */ std::vector > m_products; + //! m_rrxn is a vector of maps, containing the reactant + //! stoichiometric coefficient information + /*! + * m_rrxn has a length equal to the total number of species in the + * kinetics object. For each species, there exists a map, with the + * reaction number being the key, and the reactant stoichiometric + * coefficient for the species being the value. + */ + std::vector > m_rrxn; + + //! m_prxn is a vector of maps, containing the reactant + //! stoichiometric coefficient information + /** + * m_prxn is a vector of maps. m_prxn has a length equal to the total + * number of species in the kinetics object. For each species, there + * exists a map, with the reaction number being the key, and the product + * stoichiometric coefficient for the species being the value. + */ + std::vector > m_prxn; + std::vector m_rxntype; //! m_thermo is a vector of pointers to ThermoPhase objects that are @@ -967,6 +984,15 @@ protected: //! Representation of the product side of each reaction equation std::vector m_productStrings; + //! Forward rate-of-progress for each reaction + vector_fp m_ropf; + + //! Reverse rate-of-progress for each reaction + vector_fp m_ropr; + + //! Net rate-of-progress for each reaction + vector_fp m_ropnet; + private: std::map > m_rgroups; std::map > m_pgroups; diff --git a/src/kinetics/AqueousKinetics.cpp b/src/kinetics/AqueousKinetics.cpp index e9ca79cdf..980d719d7 100644 --- a/src/kinetics/AqueousKinetics.cpp +++ b/src/kinetics/AqueousKinetics.cpp @@ -57,20 +57,13 @@ AqueousKinetics& AqueousKinetics::operator=(const AqueousKinetics& right) m_rates = right.m_rates; m_irrev = right.m_irrev; - m_rxnstoich = right.m_rxnstoich; - m_fwdOrder = right.m_fwdOrder; m_nirrev = right.m_nirrev; m_nrev = right.m_nrev; m_rxntype = right.m_rxntype; - m_rrxn = right.m_rrxn; - m_prxn = right.m_prxn; m_dn = right.m_dn; m_revindex = right.m_revindex; - m_ropf = right.m_ropf; - m_ropr = right.m_ropr; - m_ropnet = right.m_ropnet; m_ROP_ok = right.m_ROP_ok; m_temp = right.m_temp; m_rfn = right.m_rfn; @@ -371,10 +364,6 @@ void AqueousKinetics::addElementaryReaction(ReactionData& r) void AqueousKinetics::installReagents(const ReactionData& r) { - - m_ropf.push_back(0.0); // extend by one for new rxn - m_ropr.push_back(0.0); - m_ropnet.push_back(0.0); size_t n, ns, m; doublereal nsFlt; doublereal reactantGlobalOrder = 0.0; diff --git a/src/kinetics/GasKinetics.cpp b/src/kinetics/GasKinetics.cpp index add49d375..64ed5c4e6 100644 --- a/src/kinetics/GasKinetics.cpp +++ b/src/kinetics/GasKinetics.cpp @@ -68,8 +68,6 @@ GasKinetics& GasKinetics::operator=(const GasKinetics& right) m_plog_rates = right.m_plog_rates; m_cheb_rates = right.m_cheb_rates; - m_rxnstoich = right.m_rxnstoich; - m_fwdOrder = right.m_fwdOrder; m_nirrev = right.m_nirrev; m_nrev = right.m_nrev; @@ -81,9 +79,6 @@ GasKinetics& GasKinetics::operator=(const GasKinetics& right) m_logp_ref = right.m_logp_ref; m_logc_ref = right.m_logc_ref; m_logStandConc = right.m_logStandConc; - m_ropf = right.m_ropf; - m_ropr = right.m_ropr; - m_ropnet = right.m_ropnet; m_rfn_low = right.m_rfn_low; m_rfn_high = right.m_rfn_high; m_ROP_ok = right.m_ROP_ok; @@ -315,24 +310,6 @@ void GasKinetics::getDeltaSSEntropy(doublereal* deltaS) m_rxnstoich.getReactionDelta(m_ii, &m_grt[0], deltaS); } -void GasKinetics::getNetProductionRates(doublereal* net) -{ - updateROP(); - m_rxnstoich.getNetProductionRates(m_kk, &m_ropnet[0], net); -} - -void GasKinetics::getCreationRates(doublereal* cdot) -{ - updateROP(); - m_rxnstoich.getCreationRates(m_kk, &m_ropf[0], &m_ropr[0], cdot); -} - -void GasKinetics::getDestructionRates(doublereal* ddot) -{ - updateROP(); - m_rxnstoich.getDestructionRates(m_kk, &m_ropf[0], &m_ropr[0], ddot); -} - void GasKinetics::processFalloffReactions() { // use m_ropr for temporary storage of reduced pressure @@ -581,9 +558,6 @@ void GasKinetics::addChebyshevReaction(ReactionData& r) void GasKinetics::installReagents(const ReactionData& r) { - m_ropf.push_back(0.0); // extend by one for new rxn - m_ropr.push_back(0.0); - m_ropnet.push_back(0.0); size_t n, ns, m; doublereal nsFlt; doublereal reactantGlobalOrder = 0.0; diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index 91e604aa2..87ad63dc6 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -122,11 +122,8 @@ InterfaceKinetics& InterfaceKinetics::operator=(const InterfaceKinetics& right) m_rates = right.m_rates; m_redo_rates = right.m_redo_rates; m_irrev = right.m_irrev; - m_rxnstoich = right.m_rxnstoich; m_nirrev = right.m_nirrev; m_nrev = right.m_nrev; - m_rrxn = right.m_rrxn; - m_prxn = right.m_prxn; m_conc = right.m_conc; m_actConc = right.m_actConc; m_mu0 = right.m_mu0; @@ -148,9 +145,6 @@ InterfaceKinetics& InterfaceKinetics::operator=(const InterfaceKinetics& right) m_ProdStanConcReac = right.m_ProdStanConcReac; m_logp0 = right.m_logp0; m_logc0 = right.m_logc0; - m_ropf = right.m_ropf; - m_ropr = right.m_ropr; - m_ropnet = right.m_ropnet; m_ROP_ok = right.m_ROP_ok; m_temp = right.m_temp; m_logtemp = right.m_logtemp; @@ -377,24 +371,6 @@ void InterfaceKinetics::checkPartialEquil() } } -void InterfaceKinetics::getFwdRatesOfProgress(doublereal* fwdROP) -{ - updateROP(); - std::copy(m_ropf.begin(), m_ropf.end(), fwdROP); -} - -void InterfaceKinetics::getRevRatesOfProgress(doublereal* revROP) -{ - updateROP(); - std::copy(m_ropr.begin(), m_ropr.end(), revROP); -} - -void InterfaceKinetics::getNetRatesOfProgress(doublereal* netROP) -{ - updateROP(); - std::copy(m_ropnet.begin(), m_ropnet.end(), netROP); -} - void InterfaceKinetics::getEquilibriumConstants(doublereal* kc) { updateMu0(); @@ -445,24 +421,6 @@ void InterfaceKinetics::updateExchangeCurrentQuantities() m_rxnstoich.multiplyReactants(DATA_PTR(m_StandardConc), DATA_PTR(m_ProdStanConcReac)); } -void InterfaceKinetics::getCreationRates(doublereal* cdot) -{ - updateROP(); - m_rxnstoich.getCreationRates(m_kk, &m_ropf[0], &m_ropr[0], cdot); -} - -void InterfaceKinetics::getDestructionRates(doublereal* ddot) -{ - updateROP(); - m_rxnstoich.getDestructionRates(m_kk, &m_ropf[0], &m_ropr[0], ddot); -} - -void InterfaceKinetics::getNetProductionRates(doublereal* net) -{ - updateROP(); - m_rxnstoich.getNetProductionRates(m_kk, &m_ropnet[0], net); -} - void InterfaceKinetics::applyVoltageKfwdCorrection(doublereal* const kf) { // Compute the electrical potential energy of each species @@ -1074,9 +1032,6 @@ void InterfaceKinetics::installReagents(const ReactionData& r) /* * extend temporary storage by one for this rxn. */ - m_ropf.push_back(0.0); - m_ropr.push_back(0.0); - m_ropnet.push_back(0.0); m_rkcn.push_back(0.0); /* @@ -1312,16 +1267,6 @@ int InterfaceKinetics::phaseStability(const size_t iphase) const return m_phaseIsStable[iphase]; } -doublereal InterfaceKinetics::reactantStoichCoeff(size_t kSpecKin, size_t irxn) const -{ - return getValue(m_rrxn[kSpecKin], irxn, 0.0); -} - -doublereal InterfaceKinetics::productStoichCoeff(size_t kSpecKin, size_t irxn) const -{ - return getValue(m_prxn[kSpecKin], irxn, 0.0); -} - void InterfaceKinetics::setPhaseStability(const size_t iphase, const int isStable) { if (iphase >= m_thermo.size()) { diff --git a/src/kinetics/Kinetics.cpp b/src/kinetics/Kinetics.cpp index 9d271b3c2..f8ff0ac70 100644 --- a/src/kinetics/Kinetics.cpp +++ b/src/kinetics/Kinetics.cpp @@ -60,11 +60,14 @@ Kinetics& Kinetics::operator=(const Kinetics& right) return *this; } + m_rxnstoich = right.m_rxnstoich; m_ii = right.m_ii; m_kk = right.m_kk; m_perturb = right.m_perturb; m_reactants = right.m_reactants; m_products = right.m_products; + m_rrxn = right.m_rrxn; + m_prxn = right.m_prxn; m_rxntype = right.m_rxntype; m_thermo = right.m_thermo; // DANGER -> shallow pointer copy @@ -79,6 +82,9 @@ Kinetics& Kinetics::operator=(const Kinetics& right) m_productStrings = right.m_productStrings; m_rgroups = right.m_rgroups; m_pgroups = right.m_pgroups; + m_ropf = right.m_ropf; + m_ropr = right.m_ropr; + m_ropnet = right.m_ropnet; return *this; } @@ -249,6 +255,54 @@ size_t Kinetics::speciesPhaseIndex(size_t k) return npos; } +double Kinetics::reactantStoichCoeff(size_t kSpec, size_t irxn) const +{ + return getValue(m_rrxn[kSpec], irxn, 0.0); +} + +double Kinetics::productStoichCoeff(size_t kSpec, size_t irxn) const +{ + return getValue(m_prxn[kSpec], irxn, 0.0); +} + +void Kinetics::getFwdRatesOfProgress(doublereal* fwdROP) +{ + updateROP(); + std::copy(m_ropf.begin(), m_ropf.end(), fwdROP); +} + +void Kinetics::getRevRatesOfProgress(doublereal* revROP) +{ + updateROP(); + std::copy(m_ropr.begin(), m_ropr.end(), revROP); +} + +void Kinetics::getNetRatesOfProgress(doublereal* netROP) +{ + updateROP(); + std::copy(m_ropnet.begin(), m_ropnet.end(), netROP); +} + + + +void Kinetics::getCreationRates(double* cdot) +{ + updateROP(); + m_rxnstoich.getCreationRates(m_kk, &m_ropf[0], &m_ropr[0], cdot); +} + +void Kinetics::getDestructionRates(doublereal* ddot) +{ + updateROP(); + m_rxnstoich.getDestructionRates(m_kk, &m_ropf[0], &m_ropr[0], ddot); +} + +void Kinetics::getNetProductionRates(doublereal* net) +{ + updateROP(); + m_rxnstoich.getNetProductionRates(m_kk, &m_ropnet[0], net); +} + void Kinetics::addPhase(thermo_t& thermo) { // if not the first thermo object, set the start position @@ -301,6 +355,9 @@ void Kinetics::addReaction(ReactionData& r) { m_reactantStrings.push_back(r.reactantString); m_productStrings.push_back(r.productString); m_rxntype.push_back(r.reactionType); + m_ropf.push_back(0.0); + m_ropr.push_back(0.0); + m_ropnet.push_back(0.0); } void Kinetics::installGroups(size_t irxn, const vector& r,