diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index 80ae935de..3ed245314 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -654,7 +654,13 @@ protected: */ std::vector m_revindex; - Rate1 m_rates; + //! Templated class containing the vector of reactions for this interface + /*! + * The templated class is described in RateCoeffMgr.h + * The class SurfaceArrhenius is described in RxnRates.h + */ + Rate1 m_rates; + bool m_redo_rates; /** diff --git a/include/cantera/kinetics/RateCoeffMgr.h b/include/cantera/kinetics/RateCoeffMgr.h index 6bc1df8cc..095797828 100644 --- a/include/cantera/kinetics/RateCoeffMgr.h +++ b/include/cantera/kinetics/RateCoeffMgr.h @@ -44,7 +44,7 @@ public: */ if (rdata.rateCoeffType != R::type()) throw CanteraError("Rate1::install", - "incorrect rate coefficient type: "+int2str(rdata.rateCoeffType)); + "incorrect rate coefficient type: "+int2str(rdata.rateCoeffType) + ". Was Expecting type: "+ int2str(R::type())); // Install a rate calculator and return the index of the calculator. m_rxn.push_back(rxnNumber); diff --git a/include/cantera/kinetics/ReactionData.h b/include/cantera/kinetics/ReactionData.h index cc58693c6..0bab6ce51 100644 --- a/include/cantera/kinetics/ReactionData.h +++ b/include/cantera/kinetics/ReactionData.h @@ -16,6 +16,7 @@ namespace Cantera class ReactionData { public: + //! Default constructor ReactionData() { reactionType = ELEMENTARY_RXN; number = 0; @@ -30,6 +31,8 @@ public: isReversibleWithFrac = false; beta = 0.0; } + + //! Destructor virtual ~ReactionData() {} //! type of the reaction @@ -53,15 +56,19 @@ public: //! True if the current reaction is reversible. False otherwise bool reversible; - //! type of the rate coefficient for the forward rate constant + //! Type of the rate coefficient for the forward rate constant /*! * The valid types are listed in the file, reaction_defs.h and they * all end in RATECOEFF_TYPE */ int rateCoeffType; + //! Vector of rate coefficient parameters vector_fp rateCoeffParameters; + + //! Vector of auxillary rate coefficient parameters vector_fp auxRateCoeffParameters; + int falloffType; vector_fp falloffParameters; int error; diff --git a/include/cantera/kinetics/RxnRates.h b/include/cantera/kinetics/RxnRates.h index 8d520efed..c8b11adc6 100644 --- a/include/cantera/kinetics/RxnRates.h +++ b/include/cantera/kinetics/RxnRates.h @@ -203,7 +203,7 @@ class SurfaceArrhenius public: static int type() { - return ARRHENIUS_REACTION_RATECOEFF_TYPE; + return SURF_ARRHENIUS_REACTION_RATECOEFF_TYPE; } SurfaceArrhenius() : diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index 3751ff3df..a49cc4376 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -1114,7 +1114,28 @@ void InterfaceKinetics::addElementaryReaction(ReactionData& r) for (size_t m = 0; m < ncov; m++) { rp.push_back(r.cov[m]); } + + /* + * Temporarily change the reaction rate coefficient type to surface arrhenius. + * This is what is expected. We'll handle exchange current types below by hand. + */ + int reactionRateCoeffType_orig = r.rateCoeffType; + if (r.rateCoeffType == EXCHANGE_CURRENT_REACTION_RATECOEFF_TYPE) { + r.rateCoeffType = SURF_ARRHENIUS_REACTION_RATECOEFF_TYPE; + } + if (r.rateCoeffType == ARRHENIUS_REACTION_RATECOEFF_TYPE) { + r.rateCoeffType = SURF_ARRHENIUS_REACTION_RATECOEFF_TYPE; + } + /* + * Install the reaction rate into the vector of reactions handled by this class + */ size_t iloc = m_rates.install(reactionNumber(), r); + + /* + * Change the reaction rate coefficient type back to its original value + */ + r.rateCoeffType = reactionRateCoeffType_orig; + // store activation energy m_E.push_back(r.rateCoeffParameters[2]);