From cb862a028bcde74fe26dd31de1950c9bc33ecea3 Mon Sep 17 00:00:00 2001 From: 12Chao Date: Thu, 25 Mar 2021 16:07:39 -0400 Subject: [PATCH] change 'BMInterfaceReaction' to 'BlowersMaselInterfaceReaction' --- include/cantera/kinetics/InterfaceKinetics.h | 6 +++--- include/cantera/kinetics/Reaction.h | 8 ++++---- interfaces/cython/cantera/_cantera.pxd | 2 +- interfaces/cython/cantera/reaction.pyx | 18 +++++++++--------- src/kinetics/InterfaceKinetics.cpp | 8 ++++---- src/kinetics/Reaction.cpp | 8 ++++---- src/kinetics/ReactionFactory.cpp | 4 ++-- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index a20c6876d..581bb6983 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -19,7 +19,7 @@ namespace Cantera class SurfPhase; class ImplicitSurfChem; class InterfaceReaction; -class BMInterfaceReaction; +class BlowersMaselInterfaceReaction; //! A kinetics manager for heterogeneous reaction mechanisms. The reactions are //! assumed to occur at a 2D interface between two 3D phases. @@ -393,8 +393,8 @@ protected: //! @todo This function duplicated most of the code from buildSurfaceArrhenius //! to return a slightly different reaction rate class and could be refactored in the //! future. - BMSurfaceArrhenius buildBMSurfaceArrhenius(size_t i, BMInterfaceReaction& r, - bool replace); + BMSurfaceArrhenius buildBMSurfaceArrhenius(size_t i, BlowersMaselInterfaceReaction& r, + bool replace); //! Temporary work vector of length m_kk vector_fp m_grt; diff --git a/include/cantera/kinetics/Reaction.h b/include/cantera/kinetics/Reaction.h index 71fe18fa8..841e85d77 100644 --- a/include/cantera/kinetics/Reaction.h +++ b/include/cantera/kinetics/Reaction.h @@ -436,11 +436,11 @@ public: //! A reaction occurring on an interface (i.e. a SurfPhase or an EdgePhase) //! with the rate calculated with Blowers-Masel approximation. -class BMInterfaceReaction : public BlowersMaselReaction +class BlowersMaselInterfaceReaction : public BlowersMaselReaction { public: - BMInterfaceReaction(); - BMInterfaceReaction(const Composition& reactants, const Composition& products, + BlowersMaselInterfaceReaction(); + BlowersMaselInterfaceReaction(const Composition& reactants, const Composition& products, const BlowersMasel& rate, bool isStick=false); virtual std::string type() const { @@ -542,7 +542,7 @@ void setupElectrochemicalReaction(ElectrochemicalReaction&, void setupBlowersMaselReaction(BlowersMaselReaction&, const AnyMap&, const Kinetics&); //! @internal May be changed without notice in future versions -void setupBMInterfaceReaction(BMInterfaceReaction&, +void setupBlowersMaselInterfaceReaction(BlowersMaselInterfaceReaction&, const AnyMap&, const Kinetics&); } diff --git a/interfaces/cython/cantera/_cantera.pxd b/interfaces/cython/cantera/_cantera.pxd index b005984b7..6254a6ced 100644 --- a/interfaces/cython/cantera/_cantera.pxd +++ b/interfaces/cython/cantera/_cantera.pxd @@ -479,7 +479,7 @@ cdef extern from "cantera/kinetics/Reaction.h" namespace "Cantera": cbool use_motz_wise_correction string sticking_species - cdef cppclass CxxBMInterfaceReaction "Cantera::BMInterfaceReaction" (CxxBlowersMaselReaction): + cdef cppclass CxxBlowersMaselInterfaceReaction "Cantera::BlowersMaselInterfaceReaction" (CxxBlowersMaselReaction): stdmap[string, CxxCoverageDependency] coverage_deps cbool is_sticking_coefficient cbool use_motz_wise_correction diff --git a/interfaces/cython/cantera/reaction.pyx b/interfaces/cython/cantera/reaction.pyx index 053fd6ff6..36528dfa9 100644 --- a/interfaces/cython/cantera/reaction.pyx +++ b/interfaces/cython/cantera/reaction.pyx @@ -1162,7 +1162,7 @@ cdef class InterfaceReaction(ElementaryReaction): cdef CxxInterfaceReaction* r = self.reaction r.sticking_species = stringify(species) -cdef class BMInterfaceReaction(BlowersMaselReaction): +cdef class BlowersMaselInterfaceReaction(BlowersMaselReaction): """ A reaction occurring on an `Interface` (i.e. a surface or an edge) """ reaction_type = "surface-Blowers-Masel" @@ -1176,7 +1176,7 @@ cdef class BMInterfaceReaction(BlowersMaselReaction): and the activation energy [J/kmol], respectively. """ def __get__(self): - cdef CxxBMInterfaceReaction* r = self.reaction + cdef CxxBlowersMaselInterfaceReaction* r = self.reaction deps = {} cdef pair[string,CxxCoverageDependency] item for item in r.coverage_deps: @@ -1184,7 +1184,7 @@ cdef class BMInterfaceReaction(BlowersMaselReaction): item.second.E * gas_constant) return deps def __set__(self, deps): - cdef CxxBMInterfaceReaction* r = self.reaction + cdef CxxBlowersMaselInterfaceReaction* r = self.reaction r.coverage_deps.clear() cdef str species for species, D in deps.items(): @@ -1198,10 +1198,10 @@ cdef class BMInterfaceReaction(BlowersMaselReaction): constant. """ def __get__(self): - cdef CxxBMInterfaceReaction* r = self.reaction + cdef CxxBlowersMaselInterfaceReaction* r = self.reaction return r.is_sticking_coefficient def __set__(self, stick): - cdef CxxBMInterfaceReaction* r = self.reaction + cdef CxxBlowersMaselInterfaceReaction* r = self.reaction r.is_sticking_coefficient = stick property use_motz_wise_correction: @@ -1212,10 +1212,10 @@ cdef class BMInterfaceReaction(BlowersMaselReaction): coefficient. """ def __get__(self): - cdef CxxBMInterfaceReaction* r = self.reaction + cdef CxxBlowersMaselInterfaceReaction* r = self.reaction return r.use_motz_wise_correction def __set__(self, mw): - cdef CxxBMInterfaceReaction* r = self.reaction + cdef CxxBlowersMaselInterfaceReaction* r = self.reaction r.use_motz_wise_correction = mw property sticking_species: @@ -1225,8 +1225,8 @@ cdef class BMInterfaceReaction(BlowersMaselReaction): ambiguous. """ def __get__(self): - cdef CxxBMInterfaceReaction* r = self.reaction + cdef CxxBlowersMaselInterfaceReaction* r = self.reaction return pystr(r.sticking_species) def __set__(self, species): - cdef CxxBMInterfaceReaction* r = self.reaction + cdef CxxBlowersMaselInterfaceReaction* r = self.reaction r.sticking_species = stringify(species) diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index eeea03152..c95e6309d 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -510,7 +510,7 @@ bool InterfaceKinetics::addReaction(shared_ptr r_base) return false; } if (r_base->reaction_type == BMINTERFACE_RXN) { - BMInterfaceReaction& r = dynamic_cast(*r_base); + BlowersMaselInterfaceReaction& r = dynamic_cast(*r_base); BMSurfaceArrhenius rate = buildBMSurfaceArrhenius(i, r, false); m_blowers_masel_rates.install(i, rate); @@ -590,7 +590,7 @@ void InterfaceKinetics::modifyReaction(size_t i, shared_ptr r_base) { Kinetics::modifyReaction(i, r_base); if (r_base->reaction_type == BMINTERFACE_RXN) { - BMInterfaceReaction& r = dynamic_cast(*r_base); + BlowersMaselInterfaceReaction& r = dynamic_cast(*r_base); BMSurfaceArrhenius rate = buildBMSurfaceArrhenius(i, r, true); m_blowers_masel_rates.replace(i, rate); } else { @@ -696,9 +696,9 @@ SurfaceArrhenius InterfaceKinetics::buildSurfaceArrhenius( } BMSurfaceArrhenius InterfaceKinetics::buildBMSurfaceArrhenius( - size_t i, BMInterfaceReaction& r, bool replace) + size_t i, BlowersMaselInterfaceReaction& r, bool replace) { - if (r. is_sticking_coefficient) { + if (r.is_sticking_coefficient) { // Identify the interface phase size_t iInterface = npos; size_t min_dim = 4; diff --git a/src/kinetics/Reaction.cpp b/src/kinetics/Reaction.cpp index bae362990..8399ce2d3 100644 --- a/src/kinetics/Reaction.cpp +++ b/src/kinetics/Reaction.cpp @@ -638,14 +638,14 @@ BlowersMaselReaction::BlowersMaselReaction(const Composition& reactants_, reaction_type = BLOWERSMASEL_RXN; } -BMInterfaceReaction::BMInterfaceReaction() +BlowersMaselInterfaceReaction::BlowersMaselInterfaceReaction() : is_sticking_coefficient(false) , use_motz_wise_correction(false) { reaction_type = BMINTERFACE_RXN; } -BMInterfaceReaction::BMInterfaceReaction(const Composition& reactants_, +BlowersMaselInterfaceReaction::BlowersMaselInterfaceReaction(const Composition& reactants_, const Composition& products_, const BlowersMasel& rate_, bool isStick) @@ -1266,7 +1266,7 @@ void setupBlowersMaselReaction(BlowersMaselReaction& R, const AnyMap& node, R.rate = readBlowersMasel(R, node["rate-constant"], kin, node.units()); } -void setupBMInterfaceReaction(BMInterfaceReaction& R, const AnyMap& node, +void setupBlowersMaselInterfaceReaction(BlowersMaselInterfaceReaction& R, const AnyMap& node, const Kinetics& kin) { setupReaction(R, node, kin); @@ -1282,7 +1282,7 @@ void setupBMInterfaceReaction(BMInterfaceReaction& R, const AnyMap& node, kin.thermo().input().getBool("Motz-Wise", false)); R.sticking_species = node.getString("sticking-species", ""); } else { - throw InputFileError("setupBMInterfaceReaction", node, + throw InputFileError("setupBlowersMaselInterfaceReaction", node, "Reaction must include either a 'rate-constant' or" " 'sticking-coefficient' node."); } diff --git a/src/kinetics/ReactionFactory.cpp b/src/kinetics/ReactionFactory.cpp index b920f13fd..7376c3a30 100644 --- a/src/kinetics/ReactionFactory.cpp +++ b/src/kinetics/ReactionFactory.cpp @@ -152,10 +152,10 @@ ReactionFactory::ReactionFactory() }); // register surface Blowers Masel reactions - reg("surface-Blowers-Masel", []() { return new BMInterfaceReaction(); }); + reg("surface-Blowers-Masel", []() { return new BlowersMaselInterfaceReaction(); }); reg_AnyMap("surface-Blowers-Masel", [](Reaction* R, const AnyMap& node, const Kinetics& kin) { - setupBMInterfaceReaction(*(BMInterfaceReaction*)R, node, kin); + setupBlowersMaselInterfaceReaction(*(BlowersMaselInterfaceReaction*)R, node, kin); }); }