Cantera  2.4.0
Falloff.h
1 // This file is part of Cantera. See License.txt in the top-level directory or
2 // at http://www.cantera.org/license.txt for license and copyright information.
3 
4 #ifndef CT_FALLOFF_H
5 #define CT_FALLOFF_H
6 
8 
9 namespace Cantera
10 {
11 
12 /**
13  * @defgroup falloffGroup Falloff Parameterizations
14  *
15  * This section describes the parameterizations used to describe
16  * the fall-off in reaction rate constants due to intermolecular
17  * energy transfer.
18  * @ingroup chemkinetics
19  */
20 
21 /**
22  * Base class for falloff function calculators. Each instance of a subclass of
23  * Falloff computes one falloff function. This base class implements the
24  * trivial falloff function F = 1.0.
25  *
26  * @ingroup falloffGroup
27  */
28 class Falloff
29 {
30 public:
31  Falloff() {}
32  virtual ~Falloff() {}
33 
34  /**
35  * Initialize. Must be called before any other method is invoked.
36  *
37  * @param c Vector of coefficients of the parameterization. The number and
38  * meaning of these coefficients is subclass-dependent.
39  */
40  virtual void init(const vector_fp& c);
41 
42  /**
43  * Update the temperature-dependent portions of the falloff function, if
44  * any, and store them in the 'work' array. If not overloaded, the default
45  * behavior is to do nothing.
46  * @param T Temperature [K].
47  * @param work storage space for intermediate results.
48  */
49  virtual void updateTemp(doublereal T, doublereal* work) const {}
50 
51  /**
52  * The falloff function. This is defined so that the rate coefficient is
53  *
54  * \f[ k = F(Pr)\frac{Pr}{1 + Pr}. \f]
55  *
56  * Here \f$ Pr \f$ is the reduced pressure, defined by
57  *
58  * \f[
59  * Pr = \frac{k_0 [M]}{k_\infty}.
60  * \f]
61  *
62  * @param pr reduced pressure (dimensionless).
63  * @param work array of size workSize() containing cached
64  * temperature-dependent intermediate results from a prior call
65  * to updateTemp.
66  * @returns the value of the falloff function \f$ F \f$ defined above
67  */
68  virtual doublereal F(doublereal pr, const doublereal* work) const {
69  return 1.0;
70  }
71 
72  //! The size of the work array required.
73  virtual size_t workSize() {
74  return 0;
75  }
76 
77  //! Return an integer representing the type of the Falloff parameterization.
78  virtual int getType() const {
79  return SIMPLE_FALLOFF;
80  }
81 
82  //! Returns the number of parameters used by this parameterization. The
83  //! values of these parameters can be obtained from getParameters().
84  virtual size_t nParameters() const {
85  return 0;
86  }
87 
88  //! Get the values of the parameters for this object. *params* must be an
89  //! array of at least nParameters() elements.
90  virtual void getParameters(double* params) const {}
91 };
92 
93 
94 //! The 3- or 4-parameter Troe falloff parameterization.
95 /*!
96  * The falloff function defines the value of \f$ F \f$ in the following
97  * rate expression
98  *
99  * \f[ k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F \f]
100  * where
101  * \f[ P_r = \frac{k_0 [M]}{k_{\infty}} \f]
102  *
103  * This parameterization is defined by
104  *
105  * \f[ F = F_{cent}^{1/(1 + f_1^2)} \f]
106  * where
107  * \f[ F_{cent} = (1 - A)\exp(-T/T_3) + A \exp(-T/T_1) + \exp(-T_2/T) \f]
108  *
109  * \f[ f_1 = (\log_{10} P_r + C) /
110  * \left(N - 0.14 (\log_{10} P_r + C)\right) \f]
111  *
112  * \f[ C = -0.4 - 0.67 \log_{10} F_{cent} \f]
113  *
114  * \f[ N = 0.75 - 1.27 \log_{10} F_{cent} \f]
115  *
116  * - If \f$ T_3 \f$ is zero, then the corresponding term is set to zero.
117  * - If \f$ T_1 \f$ is zero, then the corresponding term is set to zero.
118  * - If \f$ T_2 \f$ is zero, then the corresponding term is set to zero.
119  *
120  * @ingroup falloffGroup
121  */
122 class Troe : public Falloff
123 {
124 public:
125  //! Constructor
126  Troe() : m_a(0.0), m_rt3(0.0), m_rt1(0.0), m_t2(0.0) {}
127 
128  //! Initialization of the object
129  /*!
130  * @param c Vector of three or four doubles: The doubles are the parameters,
131  * a, T_3, T_1, and (optionally) T_2 of the Troe parameterization
132  */
133  virtual void init(const vector_fp& c);
134 
135  //! Update the temperature parameters in the representation
136  /*!
137  * @param T Temperature (Kelvin)
138  * @param work Vector of working space, length 1, representing the
139  * temperature-dependent part of the parameterization.
140  */
141  virtual void updateTemp(doublereal T, doublereal* work) const;
142 
143  virtual doublereal F(doublereal pr, const doublereal* work) const;
144 
145  virtual size_t workSize() {
146  return 1;
147  }
148 
149  virtual int getType() const {
150  return TROE_FALLOFF;
151  }
152 
153  virtual size_t nParameters() const {
154  return 4;
155  }
156 
157  //! Sets params to contain, in order, \f[ (A, T_3, T_1, T_2) \f]
158  virtual void getParameters(double* params) const;
159 
160 protected:
161  //! parameter a in the 4-parameter Troe falloff function. Dimensionless
162  doublereal m_a;
163 
164  //! parameter 1/T_3 in the 4-parameter Troe falloff function. [K^-1]
165  doublereal m_rt3;
166 
167  //! parameter 1/T_1 in the 4-parameter Troe falloff function. [K^-1]
168  doublereal m_rt1;
169 
170  //! parameter T_2 in the 4-parameter Troe falloff function. [K]
171  doublereal m_t2;
172 };
173 
174 //! The SRI falloff function
175 /*!
176  * The falloff function defines the value of \f$ F \f$ in the following
177  * rate expression
178  *
179  * \f[ k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F \f]
180  * where
181  * \f[ P_r = \frac{k_0 [M]}{k_{\infty}} \f]
182  *
183  * \f[ F = {\left( a \; exp(\frac{-b}{T}) + exp(\frac{-T}{c})\right)}^n
184  * \; d \; T^e \f]
185  * where
186  * \f[ n = \frac{1.0}{1.0 + (\log_{10} P_r)^2} \f]
187  *
188  * \f$ c \f$ s required to greater than or equal to zero. If it is zero, then
189  * the corresponding term is set to zero.
190  *
191  * \f$ d \f$ is required to be greater than zero.
192  *
193  * @ingroup falloffGroup
194  */
195 class SRI : public Falloff
196 {
197 public:
198  //! Constructor
199  SRI() : m_a(-1.0), m_b(-1.0), m_c(-1.0), m_d(-1.0), m_e(-1.0) {}
200 
201  //! Initialization of the object
202  /*!
203  * @param c Vector of three or five doubles: The doubles are the parameters,
204  * a, b, c, d (optional; default 1.0), and e (optional; default
205  * 0.0) of the SRI parameterization
206  */
207  virtual void init(const vector_fp& c);
208 
209  //! Update the temperature parameters in the representation
210  /*!
211  * @param T Temperature (Kelvin)
212  * @param work Vector of working space, length 2, representing the
213  * temperature-dependent part of the parameterization.
214  */
215  virtual void updateTemp(doublereal T, doublereal* work) const;
216 
217  virtual doublereal F(doublereal pr, const doublereal* work) const;
218 
219  virtual size_t workSize() {
220  return 2;
221  }
222 
223  virtual int getType() const {
224  return SRI_FALLOFF;
225  }
226 
227  virtual size_t nParameters() const {
228  return 5;
229  }
230 
231  //! Sets params to contain, in order, \f[ (a, b, c, d, e) \f]
232  virtual void getParameters(double* params) const;
233 
234 protected:
235  //! parameter a in the 5-parameter SRI falloff function. Dimensionless.
236  doublereal m_a;
237 
238  //! parameter b in the 5-parameter SRI falloff function. [K]
239  doublereal m_b;
240 
241  //! parameter c in the 5-parameter SRI falloff function. [K]
242  doublereal m_c;
243 
244  //! parameter d in the 5-parameter SRI falloff function. Dimensionless.
245  doublereal m_d;
246 
247  //! parameter d in the 5-parameter SRI falloff function. Dimensionless.
248  doublereal m_e;
249 };
250 
251 }
252 
253 #endif
virtual void init(const vector_fp &c)
Initialization of the object.
Definition: Falloff.cpp:66
doublereal m_c
parameter c in the 5-parameter SRI falloff function. [K]
Definition: Falloff.h:242
doublereal m_rt1
parameter 1/T_1 in the 4-parameter Troe falloff function. [K^-1]
Definition: Falloff.h:168
virtual size_t workSize()
The size of the work array required.
Definition: Falloff.h:219
virtual void init(const vector_fp &c)
Initialization of the object.
Definition: Falloff.cpp:25
virtual void getParameters(double *params) const
Sets params to contain, in order, .
Definition: Falloff.cpp:59
doublereal m_t2
parameter T_2 in the 4-parameter Troe falloff function. [K]
Definition: Falloff.h:171
The SRI falloff function.
Definition: Falloff.h:195
virtual void getParameters(double *params) const
Sets params to contain, in order, .
Definition: Falloff.cpp:111
virtual int getType() const
Return an integer representing the type of the Falloff parameterization.
Definition: Falloff.h:223
The 3- or 4-parameter Troe falloff parameterization.
Definition: Falloff.h:122
doublereal m_rt3
parameter 1/T_3 in the 4-parameter Troe falloff function. [K^-1]
Definition: Falloff.h:165
virtual void init(const vector_fp &c)
Initialize.
Definition: Falloff.cpp:16
virtual size_t nParameters() const
Returns the number of parameters used by this parameterization.
Definition: Falloff.h:84
virtual doublereal F(doublereal pr, const doublereal *work) const
The falloff function.
Definition: Falloff.cpp:49
doublereal m_e
parameter d in the 5-parameter SRI falloff function. Dimensionless.
Definition: Falloff.h:248
virtual size_t workSize()
The size of the work array required.
Definition: Falloff.h:145
virtual size_t workSize()
The size of the work array required.
Definition: Falloff.h:73
This file defines some constants used to specify reaction types.
doublereal m_d
parameter d in the 5-parameter SRI falloff function. Dimensionless.
Definition: Falloff.h:245
virtual size_t nParameters() const
Returns the number of parameters used by this parameterization.
Definition: Falloff.h:227
virtual void getParameters(double *params) const
Get the values of the parameters for this object.
Definition: Falloff.h:90
SRI()
Constructor.
Definition: Falloff.h:199
Base class for falloff function calculators.
Definition: Falloff.h:28
virtual int getType() const
Return an integer representing the type of the Falloff parameterization.
Definition: Falloff.h:78
virtual int getType() const
Return an integer representing the type of the Falloff parameterization.
Definition: Falloff.h:149
virtual size_t nParameters() const
Returns the number of parameters used by this parameterization.
Definition: Falloff.h:153
virtual void updateTemp(doublereal T, doublereal *work) const
Update the temperature parameters in the representation.
Definition: Falloff.cpp:40
doublereal m_b
parameter b in the 5-parameter SRI falloff function. [K]
Definition: Falloff.h:239
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
virtual void updateTemp(doublereal T, doublereal *work) const
Update the temperature parameters in the representation.
Definition: Falloff.cpp:95
virtual void updateTemp(doublereal T, doublereal *work) const
Update the temperature-dependent portions of the falloff function, if any, and store them in the &#39;wor...
Definition: Falloff.h:49
doublereal m_a
parameter a in the 4-parameter Troe falloff function. Dimensionless
Definition: Falloff.h:162
virtual doublereal F(doublereal pr, const doublereal *work) const
The falloff function.
Definition: Falloff.h:68
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
virtual doublereal F(doublereal pr, const doublereal *work) const
The falloff function.
Definition: Falloff.cpp:104
Troe()
Constructor.
Definition: Falloff.h:126
doublereal m_a
parameter a in the 5-parameter SRI falloff function. Dimensionless.
Definition: Falloff.h:236