diff --git a/include/cantera/kinetics/Reaction.h b/include/cantera/kinetics/Reaction.h index d266a4486..3df105a4c 100644 --- a/include/cantera/kinetics/Reaction.h +++ b/include/cantera/kinetics/Reaction.h @@ -9,6 +9,7 @@ #define CT_REACTION_H #include "cantera/base/utilities.h" +#include "cantera/base/AnyMap.h" #include "cantera/kinetics/RxnRates.h" #include "cantera/kinetics/Falloff.h" @@ -16,7 +17,6 @@ namespace Cantera { class Kinetics; -class AnyMap; //! Intermediate class which stores data about a reaction and its rate //! parameterization so that it can be added to a Kinetics object. @@ -72,6 +72,9 @@ public: //! True if negative reaction orders are allowed. Default is `false`. bool allow_negative_orders; + + //! Input data used for specific models + AnyMap input; }; diff --git a/src/kinetics/Reaction.cpp b/src/kinetics/Reaction.cpp index 8f294ce0b..6986914d7 100644 --- a/src/kinetics/Reaction.cpp +++ b/src/kinetics/Reaction.cpp @@ -12,6 +12,7 @@ #include "cantera/base/Array.h" #include "cantera/base/AnyMap.h" #include +#include #include @@ -509,6 +510,8 @@ void setupReaction(Reaction& R, const AnyMap& node) R.duplicate = node.getBool("duplicate", false); R.allow_negative_orders = node.getBool("negative-orders", false); R.allow_nonreactant_orders = node.getBool("nonreactant-orders", false); + + R.input = node; } void setupElementaryReaction(ElementaryReaction& R, const XML_Node& rxn_node) diff --git a/test/kinetics/kineticsFromYaml.cpp b/test/kinetics/kineticsFromYaml.cpp index f3b0ccf08..8ee96fd30 100644 --- a/test/kinetics/kineticsFromYaml.cpp +++ b/test/kinetics/kineticsFromYaml.cpp @@ -82,7 +82,8 @@ TEST(Reaction, FalloffFromYaml2) " type: falloff," " high-P-rate-constant: [6.00000E+14 cm^3/mol/s, 0, 0]," " low-P-rate-constant: {A: 1.04000E+26 cm^6/mol^2/s, b: -2.76, Ea: 1600}," - " Troe: {A: 0.562, T3: 91, T1: 5836}}"); + " Troe: {A: 0.562, T3: 91, T1: 5836}," + " source: somewhere}"); auto R = newReaction(rxn, gas); auto FR = dynamic_cast(*R); @@ -96,6 +97,7 @@ TEST(Reaction, FalloffFromYaml2) EXPECT_DOUBLE_EQ(params[0], 0.562); EXPECT_DOUBLE_EQ(params[1], 91.0); EXPECT_DOUBLE_EQ(params[3], 0.0); + EXPECT_EQ(R->input["source"].asString(), "somewhere"); } TEST(Reaction, ChemicallyActivatedFromYaml)