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