Cantera  2.1.2
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 
11 namespace Cantera
12 {
13 
14 //! Intermediate class which stores data about a reaction and its rate
15 //! parameterization before adding the reaction to a Kinetics object.
17 {
18 public:
19  ReactionData() {
21  validate = false;
22  number = 0;
23  rxn_number = 0;
24  reversible = true;
25  rateCoeffType = ARRHENIUS_REACTION_RATECOEFF_TYPE;
26  falloffType = NONE;
27  error = 0;
28  equation = "";
29  default_3b_eff = 1.0;
30  global = false;
31  isReversibleWithFrac = false;
32  beta = 0.0;
33  }
34 
35  virtual ~ReactionData() {}
36 
37  //! Type of the reaction. The valid types are listed in the file,
38  //! reaction_defs.h, with constants ending in `RXN`.
40 
41  bool validate; //!< Perform validation of the rate coefficient data
42  int number; //!< Index of this reaction within the mechanism
43  int rxn_number; //!< @deprecated duplicate of #number
44  std::vector<size_t> reactants; //!< Indices of reactant species
45  std::vector<size_t> products; //!< Indices of product species
46 
47  //! Reaction order with respect to each reactant species, in the order
48  //! given by #reactants. Usually the same as the stoichiometric
49  //! coefficients.
51 
52  //! Reaction order of the reverse reaction with respect to each product
53  //! species, in the order given by #products. Usually the same as the
54  //! stoichiometric coefficients.
56 
57  //! Reactant stoichiometric coefficients, in the order given by
58  //! #reactants.
60 
61  //! Product stoichiometric coefficients, in the order given by #products.
63 
64  std::vector<grouplist_t> rgroups; //!< Optional data used in reaction path diagrams
65  std::vector<grouplist_t> pgroups; //!< Optional data used in reaction path diagrams
66 
67  //! Map of species index to third body efficiency
68  std::map<size_t, doublereal> thirdBodyEfficiencies;
69 
70  //! Net stoichiometric coefficients for participating species. Used for
71  //! duplicate reaction detection. Key is `-1-k` for reactants, `1+k` for
72  //! products.
73  std::map<int, doublereal> net_stoich;
74 
75  //! True if the current reaction is reversible. False otherwise
76  bool reversible;
77 
78  //! True if the current reaction is marked as duplicate
79  bool duplicate;
80 
81  //! Type of the rate coefficient for the forward rate constant
82  /*!
83  * The valid types are listed in the file, reaction_defs.h and they
84  * all end in RATECOEFF_TYPE
85  */
87 
88  //! Vector of rate coefficient parameters. For elementary reactions, these
89  //! are the pre- exponential factor, temperature exponent, and activation
90  //! energy in the Arrhenius expression.
92 
93  //! Vector of auxiliary rate coefficient parameters. This is used for
94  //! the alternate Arrhenius parameters used in falloff and chemically
95  //! activated reactions.
97 
98  //! Type of falloff parameterization to use. Values are defined in
99  //! reaction_defs.h, with names ending in `FALLOFF`.
101 
102  //! Values used in the falloff parameterization. Meaning of each parameter
103  //! depends on #falloffType.
105 
106  int error; //!< @deprecated unused
107 
108  //! The reaction equation. Used only for display purposes.
109  std::string equation;
110 
111  //! The default third body efficiency for species not listed in
112  //! #thirdBodyEfficiencies.
113  doublereal default_3b_eff;
114 
115  //! Adjustments to the Arrhenius rate expression dependent on surface
116  //! species coverages. Contains 4 elements for each coverage dependency:
117  //! the species index, and the three coverage parameters (a, E, m). See
118  //! SurfaceArrhenius for details on the parameterization.
120 
121  //! True for "global" reactions which do not follow elementary mass action
122  //! kinetics, i.e. reactions for which the reaction order is not given by
123  //! the stoichiometric coefficients.
124  bool global;
125 
126  //! Some reactions can be elementary reactions but have fractional
127  //! stoichiometries with respect to some products and reactants. An
128  //! example of these are solid reactions involving phase transformations.
129  //! Species with fractional stoichiometries must be from single-species
130  //! phases with unity activities.
132 
133  doublereal beta; //!< for electrochemical reactions
134 
135  //! Arrhenius parameters for P-log reactions.
136  //! The keys are the pressures corresponding to each Arrhenius expression.
137  //! Multiple sets of Arrhenius parameters may be specified at a given
138  //! pressure.
139  std::multimap<double, vector_fp> plogParameters;
140 
141  double chebTmin; //!< Minimum temperature for Chebyshev fit
142  double chebTmax; //!< Maximum temperature for Chebyshev fit
143  double chebPmin; //!< Minimum pressure for Chebyshev fit
144  double chebPmax; //!< Maximum pressure for Chebyshev fit
145  size_t chebDegreeT; //!< Degree of Chebyshev fit in T
146  size_t chebDegreeP; //!< Degree of Chebyshev fit in P
147 
148  //! Chebyshev coefficients. length chebDegreeT * chebDegreeP
150 
151  //! Get the actual third-body efficiency for species *k*
152  double efficiency(size_t k) const {
153  std::map<size_t, doublereal>::const_iterator iter = thirdBodyEfficiencies.find(k);
154  if (iter != thirdBodyEfficiencies.end()) {
155  return iter->second;
156  } else {
157  return default_3b_eff;
158  }
159  }
160 };
161 }
162 
163 #endif
std::vector< grouplist_t > rgroups
Optional data used in reaction path diagrams.
Definition: ReactionData.h:64
double efficiency(size_t k) const
Get the actual third-body efficiency for species k
Definition: ReactionData.h:152
vector_fp falloffParameters
Values used in the falloff parameterization.
Definition: ReactionData.h:104
std::multimap< double, vector_fp > plogParameters
Arrhenius parameters for P-log reactions.
Definition: ReactionData.h:139
double chebPmin
Minimum pressure for Chebyshev fit.
Definition: ReactionData.h:143
int reactionType
Type of the reaction.
Definition: ReactionData.h:39
vector_fp auxRateCoeffParameters
Vector of auxiliary rate coefficient parameters.
Definition: ReactionData.h:96
bool duplicate
True if the current reaction is marked as duplicate.
Definition: ReactionData.h:79
int falloffType
Type of falloff parameterization to use.
Definition: ReactionData.h:100
vector_fp cov
Adjustments to the Arrhenius rate expression dependent on surface species coverages.
Definition: ReactionData.h:119
doublereal beta
for electrochemical reactions
Definition: ReactionData.h:133
vector_fp pstoich
Product stoichiometric coefficients, in the order given by products.
Definition: ReactionData.h:62
vector_fp porder
Reaction order of the reverse reaction with respect to each product species, in the order given by pr...
Definition: ReactionData.h:55
bool validate
Perform validation of the rate coefficient data.
Definition: ReactionData.h:41
bool isReversibleWithFrac
Some reactions can be elementary reactions but have fractional stoichiometries with respect to some p...
Definition: ReactionData.h:131
vector_fp rateCoeffParameters
Vector of rate coefficient parameters.
Definition: ReactionData.h:91
std::map< size_t, doublereal > thirdBodyEfficiencies
Map of species index to third body efficiency.
Definition: ReactionData.h:68
size_t chebDegreeT
Degree of Chebyshev fit in T.
Definition: ReactionData.h:145
std::string equation
The reaction equation. Used only for display purposes.
Definition: ReactionData.h:109
std::vector< size_t > products
Indices of product species.
Definition: ReactionData.h:45
double chebPmax
Maximum pressure for Chebyshev fit.
Definition: ReactionData.h:144
std::vector< grouplist_t > pgroups
Optional data used in reaction path diagrams.
Definition: ReactionData.h:65
This file defines some constants used to specify reaction types.
int number
Index of this reaction within the mechanism.
Definition: ReactionData.h:42
doublereal default_3b_eff
The default third body efficiency for species not listed in thirdBodyEfficiencies.
Definition: ReactionData.h:113
size_t chebDegreeP
Degree of Chebyshev fit in P.
Definition: ReactionData.h:146
Intermediate class which stores data about a reaction and its rate parameterization before adding the...
Definition: ReactionData.h:16
std::map< int, doublereal > net_stoich
Net stoichiometric coefficients for participating species.
Definition: ReactionData.h:73
std::vector< size_t > reactants
Indices of reactant species.
Definition: ReactionData.h:44
vector_fp rstoich
Reactant stoichiometric coefficients, in the order given by reactants.
Definition: ReactionData.h:59
bool reversible
True if the current reaction is reversible. False otherwise.
Definition: ReactionData.h:76
int rateCoeffType
Type of the rate coefficient for the forward rate constant.
Definition: ReactionData.h:86
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:165
const int ELEMENTARY_RXN
A reaction with a rate coefficient that depends only on temperature.
Definition: reaction_defs.h:26
bool global
True for "global" reactions which do not follow elementary mass action kinetics, i.e.
Definition: ReactionData.h:124
double chebTmax
Maximum temperature for Chebyshev fit.
Definition: ReactionData.h:142
vector_fp chebCoeffs
Chebyshev coefficients. length chebDegreeT * chebDegreeP.
Definition: ReactionData.h:149
vector_fp rorder
Reaction order with respect to each reactant species, in the order given by reactants.
Definition: ReactionData.h:50
double chebTmin
Minimum temperature for Chebyshev fit.
Definition: ReactionData.h:141