Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReactionData.h
Go to the documentation of this file.
1 /**
2  * @file ReactionData.h
3  */
4 // Copyright 2001 California Institute of Technology
5 
6 #ifndef CT_REACTION_DATA_H
7 #define CT_REACTION_DATA_H
8 
10 #include "cantera/base/utilities.h"
11 
12 namespace Cantera
13 {
14 
15 //! Intermediate class which stores data about a reaction and its rate
16 //! parameterization before adding the reaction to a Kinetics object.
17 /*!
18  * All data in this class is public.
19  * @deprecated Use class Reaction and its children. To be removed after
20  * Cantera 2.2.
21  */
23 {
24 public:
25  ReactionData() :
27  validate(false),
28  number(0),
29  rxn_number(0),
30  filmResistivity(0.0),
32  affinityPower(1.0),
33  reversible(true),
34  duplicate(false),
35  rateCoeffType(ARRHENIUS_REACTION_RATECOEFF_TYPE),
36  falloffType(NONE),
37  error(0),
38  equation(""),
39  default_3b_eff(1.0),
40  global(false),
41  isReversibleWithFrac(false),
42  beta(0.0),
43  chebTmin(-1.0),
44  chebTmax(-1.0),
45  chebPmin(-1.0),
46  chebPmax(-1.0),
47  chebDegreeT(0),
48  chebDegreeP(0)
49  {
50  warn_deprecated("class ReactionData",
51  "To be removed after Cantera 2.2.");
52  }
53 
54  virtual ~ReactionData() {}
55 
56  //! Type of the reaction. The valid types are listed in the file,
57  //! reaction_defs.h, with constants ending in `RXN`.
59 
60  bool validate; //!< Perform validation of the rate coefficient data
61  int number; //!< Index of this reaction within the mechanism
62  int rxn_number; //!< @deprecated duplicate of #number
63  std::vector<size_t> reactants; //!< Indices of reactant species
64  std::vector<size_t> products; //!< Indices of product species
65 
66  //! Reaction order with respect to each reactant species, in the order
67  //! given by #reactants. Usually the same as the stoichiometric coefficients.
68  /*!
69  * Length is equal to the number of reactants defined in the reaction
70  * The order of species is given by the reactants vectors.
71  */
73 
74  //! Reaction order of the reverse reaction with respect to each product
75  //! species, in the order given by #products. Usually the same as the stoichiometric coefficients.
76  /*!
77  * Length is equal to the number of products defined in the reaction.
78  * The order of species is given by the products vectors.
79  */
81 
82  //! Reaction order for the forward direction of the reaction
83  /*!
84  * Length is equal to the number of kinetic species defined in the kinetics object
85  * The order of species is given by kinetics species vector.
86  */
88 
89  //! Reactant stoichiometric coefficients, in the order given by #reactants.
90  /*!
91  * Length is equal to the number of products defined in the reaction.
92  * The order of species is given by the products vectors.
93  */
95 
96  //! Product stoichiometric coefficients, in the order given by #products.
97  /*!
98  * Length is equal to the number of products defined in the reaction.
99  * The order of species is given by the products vectors.
100  */
102 
103  std::vector<grouplist_t> rgroups; //!< Optional data used in reaction path diagrams
104  std::vector<grouplist_t> pgroups; //!< Optional data used in reaction path diagrams
105 
106  //! Map of species index to third body efficiency
107  std::map<size_t, doublereal> thirdBodyEfficiencies;
108 
109  //! Net stoichiometric coefficients for participating species. Used for
110  //! duplicate reaction detection. Key is `-1-k` for reactants, `1+k` for
111  //! products.
112  std::map<int, doublereal> net_stoich;
113 
114  //! Film Resistivity value
115  /*!
116  * Only valid for Butler-Volmer formulations.
117  * Units are in ohms m2.
118  * default = 0.0 ohms m2
119  */
120  doublereal filmResistivity;
121 
122  //! Power of the equilibrium constant within the Affinity representation
123  /*!
124  * Only valid for Affinity representation.
125  * default = 1.0
126  */
128 
129  //! Power of the "One minus Affinity" term within the Affinity representation
130  /*!
131  * Only value for Affinity representation
132  * default = 1.0
133  */
134  doublereal affinityPower;
135 
136  //! True if the current reaction is reversible. False otherwise
138 
139  //! True if the current reaction is marked as duplicate
140  bool duplicate;
141 
142  //! Type of the rate coefficient for the forward rate constant
143  /*!
144  * The valid types are listed in the file, reaction_defs.h and they
145  * all end in RATECOEFF_TYPE
146  */
148 
149  //! Vector of rate coefficient parameters. For elementary reactions, these
150  //! are the pre- exponential factor, temperature exponent, and activation
151  //! energy in the Arrhenius expression.
153 
154  //! Vector of auxiliary rate coefficient parameters. This is used for
155  //! the alternate Arrhenius parameters used in falloff and chemically
156  //! activated reactions.
158 
159  //! Type of falloff parameterization to use. Values are defined in
160  //! reaction_defs.h, with names ending in `FALLOFF`.
162 
163  //! Values used in the falloff parameterization. Meaning of each parameter
164  //! depends on #falloffType.
166 
167  int error; //!< @deprecated unused. To be removed after Cantera 2.2.
168 
169  //! The reaction equation. Used only for display purposes.
170  std::string equation;
171 
172  //! The reactants half of the reaction equation, used for display purposes.
173  std::string reactantString;
174 
175  //! The products half of the reaction equation, used for display purposes.
176  std::string productString;
177 
178  //! The default third body efficiency for species not listed in
179  //! #thirdBodyEfficiencies.
180  doublereal default_3b_eff;
181 
182  //! Adjustments to the Arrhenius rate expression dependent on surface
183  //! species coverages. Contains 4 elements for each coverage dependency:
184  //! the species index, and the three coverage parameters (a, E, m). See
185  //! SurfaceArrhenius for details on the parameterization.
187 
188  //! True for "global" reactions which do not follow elementary mass action
189  //! kinetics, i.e. reactions for which the reaction order is not given by
190  //! the stoichiometric coefficients.
191  bool global;
192 
193  //! Some reactions can be elementary reactions but have fractional
194  //! stoichiometries with respect to some products and reactants. An
195  //! example of these are solid reactions involving phase transformations.
196  //! Species with fractional stoichiometries must be from single-species
197  //! phases with unity activities.
199 
200  //! Forward value of the apparent Electrochemical transfer coefficient
201  doublereal beta;
202 
203  //! Arrhenius parameters for P-log reactions.
204  //! The keys are the pressures corresponding to each Arrhenius expression.
205  //! Multiple sets of Arrhenius parameters may be specified at a given
206  //! pressure.
207  std::multimap<double, vector_fp> plogParameters;
208 
209  double chebTmin; //!< Minimum temperature for Chebyshev fit
210  double chebTmax; //!< Maximum temperature for Chebyshev fit
211  double chebPmin; //!< Minimum pressure for Chebyshev fit
212  double chebPmax; //!< Maximum pressure for Chebyshev fit
213  size_t chebDegreeT; //!< Degree of Chebyshev fit in T
214  size_t chebDegreeP; //!< Degree of Chebyshev fit in P
215 
216  //! Chebyshev coefficients. length chebDegreeT * chebDegreeP
218 
219  //! Get the actual third-body efficiency for species *k*
220  double efficiency(size_t k) const {
222  }
223 };
224 }
225 
226 #endif
std::vector< grouplist_t > rgroups
Optional data used in reaction path diagrams.
Definition: ReactionData.h:103
double efficiency(size_t k) const
Get the actual third-body efficiency for species k
Definition: ReactionData.h:220
vector_fp falloffParameters
Values used in the falloff parameterization.
Definition: ReactionData.h:165
std::multimap< double, vector_fp > plogParameters
Arrhenius parameters for P-log reactions.
Definition: ReactionData.h:207
double chebPmin
Minimum pressure for Chebyshev fit.
Definition: ReactionData.h:211
int reactionType
Type of the reaction.
Definition: ReactionData.h:58
doublereal affinityPower
Power of the "One minus Affinity" term within the Affinity representation.
Definition: ReactionData.h:134
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
vector_fp forwardFullOrder_
Reaction order for the forward direction of the reaction.
Definition: ReactionData.h:87
vector_fp auxRateCoeffParameters
Vector of auxiliary rate coefficient parameters.
Definition: ReactionData.h:157
bool duplicate
True if the current reaction is marked as duplicate.
Definition: ReactionData.h:140
int falloffType
Type of falloff parameterization to use.
Definition: ReactionData.h:161
vector_fp cov
Adjustments to the Arrhenius rate expression dependent on surface species coverages.
Definition: ReactionData.h:186
doublereal beta
Forward value of the apparent Electrochemical transfer coefficient.
Definition: ReactionData.h:201
vector_fp pstoich
Product stoichiometric coefficients, in the order given by products.
Definition: ReactionData.h:101
vector_fp porder
Reaction order of the reverse reaction with respect to each product species, in the order given by pr...
Definition: ReactionData.h:80
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:78
bool validate
Perform validation of the rate coefficient data.
Definition: ReactionData.h:60
bool isReversibleWithFrac
Some reactions can be elementary reactions but have fractional stoichiometries with respect to some p...
Definition: ReactionData.h:198
vector_fp rateCoeffParameters
Vector of rate coefficient parameters.
Definition: ReactionData.h:152
std::map< size_t, doublereal > thirdBodyEfficiencies
Map of species index to third body efficiency.
Definition: ReactionData.h:107
size_t chebDegreeT
Degree of Chebyshev fit in T.
Definition: ReactionData.h:213
std::string equation
The reaction equation. Used only for display purposes.
Definition: ReactionData.h:170
std::vector< size_t > products
Indices of product species.
Definition: ReactionData.h:64
double chebPmax
Maximum pressure for Chebyshev fit.
Definition: ReactionData.h:212
std::vector< grouplist_t > pgroups
Optional data used in reaction path diagrams.
Definition: ReactionData.h:104
doublereal filmResistivity
Film Resistivity value.
Definition: ReactionData.h:120
This file defines some constants used to specify reaction types.
int number
Index of this reaction within the mechanism.
Definition: ReactionData.h:61
doublereal default_3b_eff
The default third body efficiency for species not listed in thirdBodyEfficiencies.
Definition: ReactionData.h:180
size_t chebDegreeP
Degree of Chebyshev fit in P.
Definition: ReactionData.h:214
Intermediate class which stores data about a reaction and its rate parameterization before adding the...
Definition: ReactionData.h:22
const U & getValue(const std::map< T, U > &m, const T &key)
Const accessor for a value in a std::map.
Definition: utilities.h:714
std::map< int, doublereal > net_stoich
Net stoichiometric coefficients for participating species.
Definition: ReactionData.h:112
std::vector< size_t > reactants
Indices of reactant species.
Definition: ReactionData.h:63
vector_fp rstoich
Reactant stoichiometric coefficients, in the order given by reactants.
Definition: ReactionData.h:94
bool reversible
True if the current reaction is reversible. False otherwise.
Definition: ReactionData.h:137
int rateCoeffType
Type of the rate coefficient for the forward rate constant.
Definition: ReactionData.h:147
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
doublereal equilibriumConstantPower
Power of the equilibrium constant within the Affinity representation.
Definition: ReactionData.h:127
const int ELEMENTARY_RXN
A reaction with a rate coefficient that depends only on temperature and voltage that also obeys mass-...
Definition: reaction_defs.h:30
bool global
True for "global" reactions which do not follow elementary mass action kinetics, i.e.
Definition: ReactionData.h:191
std::string productString
The products half of the reaction equation, used for display purposes.
Definition: ReactionData.h:176
double chebTmax
Maximum temperature for Chebyshev fit.
Definition: ReactionData.h:210
vector_fp chebCoeffs
Chebyshev coefficients. length chebDegreeT * chebDegreeP.
Definition: ReactionData.h:217
vector_fp rorder
Reaction order with respect to each reactant species, in the order given by reactants.
Definition: ReactionData.h:72
std::string reactantString
The reactants half of the reaction equation, used for display purposes.
Definition: ReactionData.h:173
double chebTmin
Minimum temperature for Chebyshev fit.
Definition: ReactionData.h:209