Cantera
Loading...
Searching...
No Matches
Falloff.h
1// This file is part of Cantera. See License.txt in the top-level directory or
2// at https://cantera.org/license.txt for license and copyright information.
3
4#ifndef CT_FALLOFF_H
5#define CT_FALLOFF_H
6
8#include "MultiRate.h"
9
10namespace Cantera
11{
12
13class AnyMap;
14
15//! Data container holding shared data specific to Falloff rates
16/**
17 * The data container `FalloffData` holds precalculated data common to
18 * all Falloff related reaction rate classes.
19 */
20struct FalloffData : public ReactionData
21{
22 FalloffData();
23
24 bool update(const ThermoPhase& phase, const Kinetics& kin) override;
25
26 void update(double T) override;
27
28 void update(double T, double M) override;
29
31
32 //! Perturb third-body concentration vector of data container
33 /**
34 * The method is used for the evaluation of numerical derivatives.
35 * @param deltaM relative third-body perturbation
36 */
37 void perturbThirdBodies(double deltaM);
38
39 void restore() override;
40 void resize(Kinetics& kin) override;
41
42 void invalidateCache() override {
44 molar_density = NAN;
45 }
46
47 bool ready = false; //!< boolean indicating whether vectors are accessible
48 double molar_density = NAN; //!< used to determine if updates are needed
49 vector<double> conc_3b; //!< vector of effective third-body concentrations
50
51protected:
52 //! integer that is incremented when composition changes
54 //! boolean indicating whether 3-rd body values are perturbed
55 bool m_perturbed = false;
56 vector<double> m_conc_3b_buf; //!< buffered third-body concentrations
57};
58
59
60/**
61 * Base class for falloff rate calculators.
62 * Each instance of a subclass of FalloffRate calculates the falloff reaction rate
63 * based on specific implementations of the falloff function.
64 *
65 * The falloff function @f$ F(P_r, T) @f$ is implemented by FalloffRate specializations,
66 * and is defined so that the rate coefficient is
67 * @f[
68 * k = k_\infty \frac{P_r}{1 + P_r} F(P_r,T)
69 * @f]
70 *
71 * Here @f$ P_r @f$ is the reduced pressure, defined by
72 * @f[
73 * P_r = \frac{k_0 [M]}{k_\infty}.
74 * @f]
75 * @ingroup falloffGroup
76 */
77class FalloffRate : public ReactionRate
78{
79public:
80 FalloffRate() = default;
81
82 FalloffRate(const AnyMap& node, const UnitStack& rate_units={});
83
84 /**
85 * Set coefficients of the falloff parameterization.
86 *
87 * @param c Vector of coefficients of the parameterization. The number and
88 * meaning of these coefficients is subclass-dependent.
89 */
90 virtual void setFalloffCoeffs(span<const double> c);
91
92 /**
93 * Retrieve coefficients of the falloff parameterization.
94 *
95 * @param c Vector of coefficients of the parameterization. The number (obtained
96 * with the nParameters() method) and meaning of these coefficients is
97 * subclass-dependent.
98 */
99 virtual void getFalloffCoeffs(span<double> c) const {};
100
101
102 /**
103 * Update the temperature-dependent portions of the falloff function, if
104 * any, and store them in the 'work' array. If not overloaded, the default
105 * behavior is to do nothing.
106 * @param T Temperature [K].
107 * @param work storage space for intermediate results.
108 */
109 virtual void updateTemp(double T, span<double> work) const {}
110
111 /**
112 * The falloff function.
113 *
114 * @param pr reduced pressure (dimensionless).
115 * @param work array of size workSize() containing cached
116 * temperature-dependent intermediate results from a prior call
117 * to updateTemp.
118 * @returns the value of the falloff function @f$ F @f$ defined above
119 */
120 virtual double F(double pr, span<const double> work) const {
121 return 1.0;
122 }
123
124 //! Evaluate falloff function at current conditions
125 double evalF(double T, double conc3b) {
126 updateTemp(T, m_work);
127 double logT = std::log(T);
128 double recipT = 1. / T;
129 m_rc_low = m_lowRate.evalRate(logT, recipT);
130 m_rc_high = m_highRate.evalRate(logT, recipT);
131 double pr = conc3b * m_rc_low / (m_rc_high + SmallNumber);
132 return F(pr, m_work);
133 }
134
135 const string type() const override {
137 return "chemically-activated";
138 }
139 return "falloff";
140 }
141
142 //! Returns the number of parameters used by this parameterization. The
143 //! values of these parameters can be obtained from getParameters().
144 virtual size_t nParameters() const {
145 return 0;
146 }
147
148 void setParameters(const AnyMap& node, const UnitStack& rate_units) override;
149
150 void getParameters(AnyMap& node) const override;
151
152 //! Evaluate reaction rate
153 //! @param shared_data data shared by all reactions of a given type
154 double evalFromStruct(const FalloffData& shared_data) {
155 updateTemp(shared_data.temperature, m_work);
156 m_rc_low = m_lowRate.evalRate(shared_data.logT, shared_data.recipT);
157 m_rc_high = m_highRate.evalRate(shared_data.logT, shared_data.recipT);
158 double thirdBodyConcentration;
159 if (shared_data.ready) {
160 thirdBodyConcentration = shared_data.conc_3b[m_rate_index];
161 } else {
162 thirdBodyConcentration = shared_data.conc_3b[0];
163 }
164 double pr = thirdBodyConcentration * m_rc_low / (m_rc_high + SmallNumber);
165
166 // Apply falloff function
168 // 1 / (1 + Pr) * F
169 pr = F(pr, m_work) / (1.0 + pr);
170 return pr * m_rc_low;
171 }
172
173 // Pr / (1 + Pr) * F
174 pr *= F(pr, m_work) / (1.0 + pr);
175 return pr * m_rc_high;
176 }
177
178 void check(const string& equation) override;
179 void validate(const string& equation, const Kinetics& kin) override;
180
181 //! Get flag indicating whether negative A values are permitted
183 return m_negativeA_ok;
184 }
185
186 //! Set flag indicating whether negative A values are permitted
188 m_negativeA_ok = value;
189 }
190
191 //! Get flag indicating whether reaction is chemically activated
192 bool chemicallyActivated() const {
194 }
195
196 //! Set flag indicating whether reaction is chemically activated
197 void setChemicallyActivated(bool activated) {
198 m_chemicallyActivated = activated;
199 }
200
201 //! Get reaction rate in the low-pressure limit
203 return m_lowRate;
204 }
205
206 //! Get reaction rate in the low-pressure limit
207 const ArrheniusRate& lowRate() const {
208 return m_lowRate;
209 }
210
211 //! Set reaction rate in the low-pressure limit
212 void setLowRate(const ArrheniusRate& low);
213
214 //! Get reaction rate in the high-pressure limit
216 return m_highRate;
217 }
218
219 //! Get reaction rate in the high-pressure limit
220 const ArrheniusRate& highRate() const {
221 return m_highRate;
222 }
223
224 //! Set reaction rate in the high-pressure limit
225 void setHighRate(const ArrheniusRate& high);
226
227protected:
228 ArrheniusRate m_lowRate; //!< The reaction rate in the low-pressure limit
229 ArrheniusRate m_highRate; //!< The reaction rate in the high-pressure limit
230
231 //! Flag labeling reaction as chemically activated
233 //! Flag indicating whether negative A values are permitted
234 bool m_negativeA_ok = false;
235
236 double m_rc_low = NAN; //!< Evaluated reaction rate in the low-pressure limit
237 double m_rc_high = NAN; //!< Evaluated reaction rate in the high-pressure limit
238 vector<double> m_work; //!< Work vector
239};
240
241
242//! The Lindemann falloff parameterization.
243/**
244 * This class implements the trivial falloff function F = 1.0 @cite lindemann1922.
245 *
246 * @ingroup falloffGroup
247 */
248class LindemannRate final : public FalloffRate
249{
250public:
251 LindemannRate() = default;
252
253 LindemannRate(const AnyMap& node, const UnitStack& rate_units={});
254
255 LindemannRate(const ArrheniusRate& low, const ArrheniusRate& high,
256 span<const double> c);
257
258 unique_ptr<MultiRateBase> newMultiRate() const override{
259 return make_unique<MultiRate<LindemannRate, FalloffData>>();
260 }
261
262 const string subType() const override {
263 return "Lindemann";
264 }
265};
266
267
268//! The 3- or 4-parameter Troe falloff parameterization.
269/*!
270 * The falloff function defines the value of @f$ F @f$ in the following
271 * rate expression @cite gilbert1983
272 *
273 * @f[
274 * k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F(T, P_r)
275 * @f]
276 * where
277 * @f[
278 * P_r = \frac{k_0 [M]}{k_{\infty}}
279 * @f]
280 *
281 * This parameterization is defined by
282 *
283 * @f[
284 * \log_{10} F(T, P_r) = \frac{\log_{10} F_{cent}(T)}{1 + f_1^2}
285 * @f]
286 * where
287 * @f[
288 * F_{cent}(T) = (1 - A)\exp\left(\frac{-T}{T_3}\right)
289 * + A \exp\left(\frac{-T}{T_1}\right) + \exp\left(\frac{-T_2}{T}\right)
290 * @f]
291 *
292 * @f[
293 * f_1 = \frac{\log_{10} P_r + C}{N - 0.14 (\log_{10} P_r + C)}
294 * @f]
295 *
296 * @f[
297 * C = -0.4 - 0.67 \log_{10} F_{cent}
298 * @f]
299 *
300 * @f[
301 * N = 0.75 - 1.27 \log_{10} F_{cent}
302 * @f]
303 *
304 * - If @f$ T_3 @f$ is zero, then the corresponding term is set to zero.
305 * - If @f$ T_1 @f$ is zero, then the corresponding term is set to zero.
306 * - If @f$ T_2 @f$ is zero, then the corresponding term is set to zero.
307 *
308 * @ingroup falloffGroup
309 */
310class TroeRate final : public FalloffRate
311{
312public:
313 //! Constructor
314 TroeRate() : m_a(NAN), m_rt3(0.0), m_rt1(0.0), m_t2(0.0) {
315 m_work.resize(1);
316 }
317
318 TroeRate(const AnyMap& node, const UnitStack& rate_units={});
319 TroeRate(const ArrheniusRate& low, const ArrheniusRate& high,
320 span<const double> c);
321
322 unique_ptr<MultiRateBase> newMultiRate() const override {
323 return make_unique<MultiRate<TroeRate, FalloffData>>();
324 }
325
326 //! Set coefficients used by parameterization
327 /*!
328 * @param c Vector of three or four doubles: The doubles are the parameters,
329 * a, T_3, T_1, and (optionally) T_2 of the Troe parameterization
330 */
331 void setFalloffCoeffs(span<const double> c) override;
332
333 void getFalloffCoeffs(span<double> c) const override;
334
335 //! Update the temperature parameters in the representation
336 /*!
337 * @param T Temperature (Kelvin)
338 * @param work Vector of working space, length 1, representing the
339 * temperature-dependent part of the parameterization.
340 */
341 void updateTemp(double T, span<double> work) const override;
342
343 double F(double pr, span<const double> work) const override;
344
345 const string subType() const override {
346 return "Troe";
347 }
348
349 size_t nParameters() const override {
350 return (m_t2 == 0) ? 3 : 4;
351 }
352
353 void setParameters(const AnyMap& node, const UnitStack& rate_units) override;
354
355 void getParameters(AnyMap& node) const override;
356
357protected:
358 //! parameter a in the 4-parameter Troe falloff function. Dimensionless
359 double m_a;
360
361 //! parameter 1/T_3 in the 4-parameter Troe falloff function. [K^-1]
362 double m_rt3;
363
364 //! parameter 1/T_1 in the 4-parameter Troe falloff function. [K^-1]
365 double m_rt1;
366
367 //! parameter T_2 in the 4-parameter Troe falloff function. [K]
368 double m_t2;
369};
370
371//! The SRI falloff function
372/*!
373 * This falloff function is based on the one originally due to Stewart et al.
374 * @cite stewart1989, which required three parameters @f$ a @f$, @f$ b @f$, and
375 * @f$ c @f$. Kee et al. @cite kee1989 generalized this slightly by adding two more
376 * parameters @f$ d @f$ and @f$ e @f$. (The original form corresponds to @f$ d = 1 @f$
377 * and @f$ e = 0 @f$.) In keeping with the nomenclature of Kee et al. @cite kee1989,
378 * the rate is referred to as the *SRI falloff function*.
379 *
380 * The falloff function defines the value of @f$ F @f$ in the following
381 * rate expression
382 * @f[
383 * k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F
384 * @f]
385 * where
386 * @f[
387 * P_r = \frac{k_0 [M]}{k_{\infty}}
388 * @f]
389 *
390 * @f[
391 * F(T, P_r) = {\left[ a \; \exp\left(\frac{-b}{T}\right)
392 * + \exp\left(\frac{-T}{c}\right)\right]}^n \; d \; T^e
393 * @f]
394 * where
395 * @f[
396 * n = \frac{1.0}{1.0 + (\log_{10} P_r)^2}
397 * @f]
398 *
399 * @f$ c @f$ is required to be greater than or equal to zero. If it is zero, then the
400 * corresponding term is set to zero. @f$ d @f$ is required to be greater than zero.
401 *
402 * @ingroup falloffGroup
403 */
404class SriRate final : public FalloffRate
405{
406public:
407 //! Constructor
408 SriRate() : m_a(NAN), m_b(-1.0), m_c(-1.0), m_d(-1.0), m_e(-1.0) {
409 m_work.resize(2);
410 }
411
412 SriRate(const AnyMap& node, const UnitStack& rate_units={});
413
414 SriRate(const ArrheniusRate& low, const ArrheniusRate& high, span<const double> c)
415 : SriRate()
416 {
417 m_lowRate = low;
418 m_highRate = high;
420 }
421
422 unique_ptr<MultiRateBase> newMultiRate() const override {
423 return make_unique<MultiRate<SriRate, FalloffData>>();
424 }
425
426 //! Set coefficients used by parameterization
427 /*!
428 * @param c Vector of three or five doubles: The doubles are the parameters,
429 * a, b, c, d (optional; default 1.0), and e (optional; default
430 * 0.0) of the SRI parameterization
431 */
432 void setFalloffCoeffs(span<const double> c) override;
433
434 void getFalloffCoeffs(span<double> c) const override;
435
436 //! Update the temperature parameters in the representation
437 /*!
438 * @param T Temperature (Kelvin)
439 * @param work Vector of working space, length 2, representing the
440 * temperature-dependent part of the parameterization.
441 */
442 void updateTemp(double T, span<double> work) const override;
443
444 double F(double pr, span<const double> work) const override;
445
446 const string subType() const override {
447 return "SRI";
448 }
449
450 size_t nParameters() const override {
451 return (m_d == 1.0 && m_e == 0.0) ? 3 : 5;
452 }
453
454 void setParameters(const AnyMap& node, const UnitStack& rate_units) override;
455 void getParameters(AnyMap& node) const override;
456
457protected:
458 //! parameter a in the 5-parameter SRI falloff function. Dimensionless.
459 double m_a;
460
461 //! parameter b in the 5-parameter SRI falloff function. [K]
462 double m_b;
463
464 //! parameter c in the 5-parameter SRI falloff function. [K]
465 double m_c;
466
467 //! parameter d in the 5-parameter SRI falloff function. Dimensionless.
468 double m_d;
469
470 //! parameter e in the 5-parameter SRI falloff function. Dimensionless.
471 double m_e;
472};
473
474//! The 1- or 2-parameter Tsang falloff parameterization.
475/*!
476 * The Tsang falloff model is adapted from that of Troe.
477 * It provides a constant or linear in temperature value for @f$ F_{cent} @f$:
478 * @f[ F_{cent} = A + B*T @f]
479 *
480 * The value of @f$ F_{cent} @f$ is then applied to Troe's model for the
481 * determination of the value of @f$ F(T, P_r) @f$:
482 * @f[ \log_{10} F(T, P_r) = \frac{\log_{10} F_{cent}(T)}{1 + f_1^2} @f]
483 * where
484 * @f[ f_1 = \frac{\log_{10} P_r + C}{N - 0.14 (\log_{10} P_r + C)} @f]
485 *
486 * @f[ C = -0.4 - 0.67 \log_{10} F_{cent} @f]
487 *
488 * @f[ N = 0.75 - 1.27 \log_{10} F_{cent} @f]
489 *
490 * References:
491 * * Example of reaction database developed by Tsang utilizing this format
492 * @cite tsang1991
493 * * Example of Chemkin implementation of Tsang format (supplemental materials)
494 * @cite lucassen2011
495 *
496 * @ingroup falloffGroup
497 */
498class TsangRate final : public FalloffRate
499{
500public:
501 //! Constructor
502 TsangRate() : m_a(NAN), m_b(0.0) {
503 m_work.resize(1);
504 }
505
506 TsangRate(const AnyMap& node, const UnitStack& rate_units={});
507
508 TsangRate(const ArrheniusRate& low, const ArrheniusRate& high, span<const double> c)
509 : TsangRate()
510 {
511 m_lowRate = low;
512 m_highRate = high;
514 }
515
516 unique_ptr<MultiRateBase> newMultiRate() const override {
517 return make_unique<MultiRate<TsangRate, FalloffData>>();
518 }
519
520 //! Set coefficients used by parameterization
521 /*!
522 * @param c Vector of one or two doubles: The doubles are the parameters,
523 * a and (optionally) b of the Tsang F_cent parameterization
524 */
525 void setFalloffCoeffs(span<const double> c) override;
526
527 void getFalloffCoeffs(span<double> c) const override;
528
529 //! Update the temperature parameters in the representation
530 /*!
531 * @param T Temperature (Kelvin)
532 * @param work Vector of working space, length 1, representing the
533 * temperature-dependent part of the parameterization.
534 */
535 void updateTemp(double T, span<double> work) const override;
536
537 double F(double pr, span<const double> work) const override;
538
539 const string subType() const override {
540 return "Tsang";
541 }
542
543 size_t nParameters() const override {
544 return (m_b == 0.0) ? 1 : 2;
545 }
546
547 void setParameters(const AnyMap& node, const UnitStack& rate_units) override;
548
549 void getParameters(AnyMap& node) const override;
550
551protected:
552 //! parameter a in the Tsang F_cent formulation. Dimensionless
553 double m_a;
554
555 //! parameter b in the Tsang F_cent formulation. [K^-1]
556 double m_b;
557};
558
559typedef FalloffRate Falloff;
560typedef LindemannRate Lindemann;
561typedef TroeRate Troe;
562typedef SriRate SRI;
563typedef TsangRate Tsang;
564
565}
566
567#endif
Header for reaction rates that involve Arrhenius-type kinetics.
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
Arrhenius reaction rate type depends only on temperature.
Definition Arrhenius.h:170
Base class for falloff rate calculators.
Definition Falloff.h:78
ArrheniusRate & highRate()
Get reaction rate in the high-pressure limit.
Definition Falloff.h:215
double evalFromStruct(const FalloffData &shared_data)
Evaluate reaction rate.
Definition Falloff.h:154
void setAllowNegativePreExponentialFactor(bool value)
Set flag indicating whether negative A values are permitted.
Definition Falloff.h:187
virtual size_t nParameters() const
Returns the number of parameters used by this parameterization.
Definition Falloff.h:144
void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
Definition Falloff.cpp:130
double m_rc_low
Evaluated reaction rate in the low-pressure limit.
Definition Falloff.h:236
void setHighRate(const ArrheniusRate &high)
Set reaction rate in the high-pressure limit.
Definition Falloff.cpp:107
vector< double > m_work
Work vector.
Definition Falloff.h:238
ArrheniusRate m_highRate
The reaction rate in the high-pressure limit.
Definition Falloff.h:229
void validate(const string &equation, const Kinetics &kin) override
Validate the reaction rate expression.
Definition Falloff.cpp:195
virtual void getFalloffCoeffs(span< double > c) const
Retrieve coefficients of the falloff parameterization.
Definition Falloff.h:99
const ArrheniusRate & lowRate() const
Get reaction rate in the low-pressure limit.
Definition Falloff.h:207
double evalF(double T, double conc3b)
Evaluate falloff function at current conditions.
Definition Falloff.h:125
bool chemicallyActivated() const
Get flag indicating whether reaction is chemically activated.
Definition Falloff.h:192
ArrheniusRate & lowRate()
Get reaction rate in the low-pressure limit.
Definition Falloff.h:202
ArrheniusRate m_lowRate
The reaction rate in the low-pressure limit.
Definition Falloff.h:228
virtual void updateTemp(double T, span< double > work) const
Update the temperature-dependent portions of the falloff function, if any, and store them in the 'wor...
Definition Falloff.h:109
bool m_chemicallyActivated
Flag labeling reaction as chemically activated.
Definition Falloff.h:232
void getParameters(AnyMap &node) const override
Get parameters.
Definition Falloff.cpp:163
bool allowNegativePreExponentialFactor() const
Get flag indicating whether negative A values are permitted.
Definition Falloff.h:182
bool m_negativeA_ok
Flag indicating whether negative A values are permitted.
Definition Falloff.h:234
const ArrheniusRate & highRate() const
Get reaction rate in the high-pressure limit.
Definition Falloff.h:220
double m_rc_high
Evaluated reaction rate in the high-pressure limit.
Definition Falloff.h:237
virtual double F(double pr, span< const double > work) const
The falloff function.
Definition Falloff.h:120
void check(const string &equation) override
Check basic syntax and settings of reaction rate expression.
Definition Falloff.cpp:180
const string type() const override
String identifying reaction rate specialization.
Definition Falloff.h:135
void setLowRate(const ArrheniusRate &low)
Set reaction rate in the low-pressure limit.
Definition Falloff.cpp:94
virtual void setFalloffCoeffs(span< const double > c)
Set coefficients of the falloff parameterization.
Definition Falloff.cpp:120
void setChemicallyActivated(bool activated)
Set flag indicating whether reaction is chemically activated.
Definition Falloff.h:197
Public interface for kinetics managers.
Definition Kinetics.h:124
The Lindemann falloff parameterization.
Definition Falloff.h:249
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
Definition Falloff.h:258
const string subType() const override
String identifying sub-type of reaction rate specialization.
Definition Falloff.h:262
size_t m_rate_index
Index of reaction rate within kinetics evaluator.
The SRI falloff function.
Definition Falloff.h:405
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
Definition Falloff.h:422
const string subType() const override
String identifying sub-type of reaction rate specialization.
Definition Falloff.h:446
void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
Definition Falloff.cpp:405
double F(double pr, span< const double > work) const override
The falloff function.
Definition Falloff.cpp:398
double m_d
parameter d in the 5-parameter SRI falloff function. Dimensionless.
Definition Falloff.h:468
void getParameters(AnyMap &node) const override
Get parameters.
Definition Falloff.cpp:430
void getFalloffCoeffs(span< double > c) const override
Retrieve coefficients of the falloff parameterization.
Definition Falloff.cpp:377
double m_a
parameter a in the 5-parameter SRI falloff function. Dimensionless.
Definition Falloff.h:459
void setFalloffCoeffs(span< const double > c) override
Set coefficients used by parameterization.
Definition Falloff.cpp:347
void updateTemp(double T, span< double > work) const override
Update the temperature parameters in the representation.
Definition Falloff.cpp:389
double m_c
parameter c in the 5-parameter SRI falloff function. [K]
Definition Falloff.h:465
double m_b
parameter b in the 5-parameter SRI falloff function. [K]
Definition Falloff.h:462
SriRate()
Constructor.
Definition Falloff.h:408
double m_e
parameter e in the 5-parameter SRI falloff function. Dimensionless.
Definition Falloff.h:471
size_t nParameters() const override
Returns the number of parameters used by this parameterization.
Definition Falloff.h:450
Base class for a phase with thermodynamic properties.
The 3- or 4-parameter Troe falloff parameterization.
Definition Falloff.h:311
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
Definition Falloff.h:322
const string subType() const override
String identifying sub-type of reaction rate specialization.
Definition Falloff.h:345
void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
Definition Falloff.cpp:302
double m_t2
parameter T_2 in the 4-parameter Troe falloff function. [K]
Definition Falloff.h:368
double F(double pr, span< const double > work) const override
The falloff function.
Definition Falloff.cpp:292
void getParameters(AnyMap &node) const override
Get parameters.
Definition Falloff.cpp:324
double m_rt1
parameter 1/T_1 in the 4-parameter Troe falloff function. [K^-1]
Definition Falloff.h:365
void getFalloffCoeffs(span< double > c) const override
Retrieve coefficients of the falloff parameterization.
Definition Falloff.cpp:272
double m_a
parameter a in the 4-parameter Troe falloff function. Dimensionless
Definition Falloff.h:359
void setFalloffCoeffs(span< const double > c) override
Set coefficients used by parameterization.
Definition Falloff.cpp:235
TroeRate()
Constructor.
Definition Falloff.h:314
void updateTemp(double T, span< double > work) const override
Update the temperature parameters in the representation.
Definition Falloff.cpp:283
double m_rt3
parameter 1/T_3 in the 4-parameter Troe falloff function. [K^-1]
Definition Falloff.h:362
size_t nParameters() const override
Returns the number of parameters used by this parameterization.
Definition Falloff.h:349
The 1- or 2-parameter Tsang falloff parameterization.
Definition Falloff.h:499
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
Definition Falloff.h:516
const string subType() const override
String identifying sub-type of reaction rate specialization.
Definition Falloff.h:539
void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
Definition Falloff.cpp:496
double F(double pr, span< const double > work) const override
The falloff function.
Definition Falloff.cpp:486
TsangRate()
Constructor.
Definition Falloff.h:502
void getParameters(AnyMap &node) const override
Get parameters.
Definition Falloff.cpp:514
void getFalloffCoeffs(span< double > c) const override
Retrieve coefficients of the falloff parameterization.
Definition Falloff.cpp:471
double m_a
parameter a in the Tsang F_cent formulation. Dimensionless
Definition Falloff.h:553
void setFalloffCoeffs(span< const double > c) override
Set coefficients used by parameterization.
Definition Falloff.cpp:454
void updateTemp(double T, span< double > work) const override
Update the temperature parameters in the representation.
Definition Falloff.cpp:480
double m_b
parameter b in the Tsang F_cent formulation. [K^-1]
Definition Falloff.h:556
size_t nParameters() const override
Returns the number of parameters used by this parameterization.
Definition Falloff.h:543
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
const double SmallNumber
smallest number to compare to zero.
Definition ct_defs.h:161
Data container holding shared data specific to Falloff rates.
Definition Falloff.h:21
int m_state_mf_number
integer that is incremented when composition changes
Definition Falloff.h:53
vector< double > m_conc_3b_buf
buffered third-body concentrations
Definition Falloff.h:56
void perturbThirdBodies(double deltaM)
Perturb third-body concentration vector of data container.
Definition Falloff.cpp:58
bool update(const ThermoPhase &phase, const Kinetics &kin) override
Update data container based on thermodynamic phase state.
Definition Falloff.cpp:38
bool ready
boolean indicating whether vectors are accessible
Definition Falloff.h:47
vector< double > conc_3b
vector of effective third-body concentrations
Definition Falloff.h:49
double molar_density
used to determine if updates are needed
Definition Falloff.h:48
void restore() override
Restore data container after a perturbation.
Definition Falloff.cpp:71
void invalidateCache() override
Force shared data and reaction rates to be updated next time.
Definition Falloff.h:42
void resize(Kinetics &kin) override
Update array sizes that depend on number of species, reactions and phases.
Definition Falloff.cpp:82
bool m_perturbed
boolean indicating whether 3-rd body values are perturbed
Definition Falloff.h:55
double recipT
inverse of temperature
virtual void update(double T)
Update data container based on temperature T.
double temperature
temperature
double logT
logarithm of temperature
virtual void invalidateCache()
Force shared data and reaction rates to be updated next time.
Unit aggregation utility.
Definition Units.h:105