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