Cantera 2.6.0

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