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