Cantera 2.6.0
InterfaceRate.h
Go to the documentation of this file.
1/**
2 * @file InterfaceRate.h
3 * Header for reaction rates that occur at interfaces.
4 */
5
6// This file is part of Cantera. See License.txt in the top-level directory or
7// at https://cantera.org/license.txt for license and copyright information.
8
9#ifndef CT_INTERFACERATE_H
10#define CT_INTERFACERATE_H
11
12#include "cantera/base/global.h"
14#include "MultiRate.h"
15
16namespace Cantera
17{
18
19class AnyMap;
20
21/**
22 * @defgroup surfaceGroup Coverage-dependent rate parameterizations
23 *
24 * This section describes the parameterizations used to describe rate
25 * parameterization that involve interfaces.
26 *
27 * @ingroup chemkinetics
28 */
29
30
31//! Data container holding shared data for reaction rate specification with interfaces
32/**
33 * The data container InterfaceData holds precalculated data common to
34 * InterfaceRate and StickingRate objects.
35 *
36 * The data container inherits from BlowersMaselData, where density is used to
37 * hold the site density [kmol/m^2].
38 */
40{
42
43 virtual bool update(const ThermoPhase& bulk, const Kinetics& kin) override;
44
45 virtual void update(double T) override;
46
47 virtual void update(double T, const vector_fp& values) override;
48
50
51 virtual void perturbTemperature(double deltaT);
52
53 virtual void resize(size_t nSpecies, size_t nReactions, size_t nPhases) override {
54 coverages.resize(nSpecies, 0.);
55 logCoverages.resize(nSpecies, 0.);
56 partialMolarEnthalpies.resize(nSpecies, 0.);
57 electricPotentials.resize(nPhases, 0.);
58 standardChemPotentials.resize(nSpecies, 0.);
59 standardConcentrations.resize(nSpecies, 0.);
60 ready = true;
61 }
62
63 double sqrtT; //!< square root of temperature
64
65 vector_fp coverages; //!< surface coverages
66 vector_fp logCoverages; //!< logarithm of surface coverages
67 vector_fp electricPotentials; //!< electric potentials of phases
68 vector_fp standardChemPotentials; //!< standard state chemical potentials
69 vector_fp standardConcentrations; //!< standard state concentrations
70};
71
72
73//! Base class for rate parameterizations that involve interfaces
74/**
75 * Rate expressions defined for interfaces may include coverage dependent terms,
76 * where an example is given by [Kee, R. J., Coltrin, M. E., & Glarborg, P.(2003).
77 * Chemically reacting flow: theory and practice. John Wiley & Sons. Eq 11.113].
78 * Using Cantera nomenclature, this expression can be rewritten as
79 * \f[
80 * k_f = A T^b \exp \left( - \frac{E_a}{RT} \right)
81 * \prod_k 10^{a_k \theta_k} \theta_k^{m_k}
82 * \exp \left( \frac{- E_k \theta_k}{RT} \right)
83 * \f]
84 * It is evident that this expression combines a regular modified Arrhenius rate
85 * expression \f$ A T^b \exp \left( - \frac{E_a}{RT} \right) \f$ with coverage-related
86 * terms, where the parameters \f$ (a_k, E_k, m_k) \f$ describe the dependency on the
87 * surface coverage of species \f$ k, \theta_k \f$. The InterfaceRateBase class implements
88 * terms related to coverage only, which allows for combinations with arbitrary rate
89 * parameterizations (for example Arrhenius and BlowersMaselRate).
90 */
92{
93public:
95
96 //! Perform object setup based on AnyMap node information
97 //! @param node AnyMap object containing reaction rate specification
98 void setParameters(const AnyMap& node);
99
100 //! Store parameters needed to reconstruct an identical object
101 //! @param node AnyMap object receiving reaction rate specification
102 void getParameters(AnyMap& node) const;
103
104 //! Set coverage dependencies based on AnyMap node information
105 //! @param dependencies Coverage dependencies
106 //! @param units Unit system
107 void setCoverageDependencies(const AnyMap& dependencies,
108 const UnitSystem& units=UnitSystem());
109
110 //! Store parameters needed to reconstruct coverage dependencies
111 //! @param dependencies AnyMap receiving coverage information
112 //! @param asVector Optional boolean flag to override map output
113 //! @todo Remove vector version (which currently only serves testing purposes)
114 void getCoverageDependencies(AnyMap& dependencies, bool asVector=false) const;
115
116 //! Add a coverage dependency for species *sp*, with exponential dependence
117 //! *a*, power-law exponent *m*, and activation energy dependence *e*,
118 //! where *e* is in Kelvin, that is, energy divided by the molar gas constant.
119 void addCoverageDependence(const std::string& sp, double a, double m, double e);
120
121 //! Boolean indicating whether rate uses exchange current density formulation
123 return m_exchangeCurrentDensityFormulation;
124 }
125
126 //! Build rate-specific parameters based on Reaction and Kinetics context
127 //! @param rxn Reaction associated with rate parameterization
128 //! @param kin Kinetics object associated with rate parameterization
129 void setContext(const Reaction& rxn, const Kinetics& kin);
130
131 //! Set association with an ordered list of all species associated with a given
132 //! `Kinetics` object.
133 void setSpecies(const std::vector<std::string>& species);
134
135 //! Update reaction rate parameters
136 //! @param shared_data data shared by all reactions of a given type
137 void updateFromStruct(const InterfaceData& shared_data);
138
139 //! Calculate modifications for the forward reaction rate for interfacial charge
140 //! transfer reactions.
141 /*!
142 * For reactions that transfer charge across a potential difference, the
143 * activation energies are modified by the potential difference. The correction
144 * factor is based on the net electric potential energy change
145 * \f[
146 * \Delta E_{p,j} = \sum_i E_{p,i} \nu_{i,j}
147 * \f]
148 * where potential energies are calculated as \f$ E_{p,i} = F \phi_i z_i \f$.
149 * Here, \f$ F \f$ is Faraday's constant, \f$ \phi_i \f$ is the electric potential
150 * of the species phase and \f$ z_i \f$ is the charge of the species.
151 *
152 * When an electrode reaction rate is specified in terms of its exchange current
153 * density, the correction factor is adjusted to the standard reaction rate
154 * constant form and units. Specifically, this converts a reaction rate constant
155 * that was specified in units of A/m2 to kmol/m2/s.
156 *
157 * @warning The updated calculation of voltage corrections is an experimental
158 * part of the %Cantera API and may be changed or removed without notice.
159 */
160 double voltageCorrection() const {
161 // Calculate reaction rate correction. Only modify those with a non-zero
162 // activation energy.
163 double correction = 1.;
164 if (m_deltaPotential_RT != 0.) {
165 // Comments preserved from previous implementation:
166 // Below we decrease the activation energy below zero.
167 // NOTE, there is some discussion about this point. Should we decrease the
168 // activation energy below zero? I don't think this has been decided in any
169 // definitive way. The treatment below is numerically more stable, however.
170 correction = exp(-m_beta * m_deltaPotential_RT);
171 }
172
173 // Update correction if exchange current density formulation format is used.
174 if (m_exchangeCurrentDensityFormulation) {
175 // Comment preserved from previous implementation:
176 // We need to have the straight chemical reaction rate constant to
177 // come out of this calculation.
178 double tmp = exp(-m_beta * m_deltaGibbs0_RT);
180 correction *= tmp;
181 }
182 return correction;
183 }
184
185 //! Boolean indicating whether rate uses electrochemistry
186 /*!
187 * If this is true, the Butler-Volmer correction
188 * \f[
189 * f_{BV} = \exp ( - \beta * Delta E_{p,j} / R T )
190 * \f]
191 * is applied to the forward reaction rate, @see voltageCorrection.
192 */
194 return m_chargeTransfer;
195 }
196
197 //! Return the charge transfer beta parameter
198 double beta() const {
199 if (m_chargeTransfer) {
200 return m_beta;
201 }
202 return NAN;
203 }
204
205 //! Return site density [kmol/m^2]
206 /*!
207 * @warning This method is an experimental part of the %Cantera API and
208 * may be changed or removed without notice.
209 */
210 double siteDensity() const {
211 return m_siteDensity;
212 }
213
214 //! Set site density [kmol/m^2]
215 /*!
216 * @internal This method is used for testing purposes only as the site density
217 * is a property of InterfaceKinetics and will be overwritten during an update
218 * of the thermodynamic state.
219 *
220 * @warning This method is an experimental part of the %Cantera API and
221 * may be changed or removed without notice.
222 */
225 }
226
227protected:
228 double m_siteDensity; //!< Site density [kmol/m^2]
229 double m_acov; //!< Coverage contribution to pre-exponential factor
230 double m_ecov; //!< Coverage contribution to activation energy
231 double m_mcov; //!< Coverage term in reaction rate
232 bool m_chargeTransfer; //!< Boolean indicating use of electrochemistry
233 bool m_exchangeCurrentDensityFormulation; //! Electrochemistry only
234 double m_beta; //!< Forward value of apparent electrochemical transfer coefficient
235 double m_deltaPotential_RT; //!< Normalized electric potential energy change
236 double m_deltaGibbs0_RT; //!< Normalized standard state Gibbs free energy change
237 double m_prodStandardConcentrations; //!< Products of standard concentrations
238 std::map<size_t, size_t> m_indices; //!< Map holding indices of coverage species
239 std::vector<std::string> m_cov; //!< Vector holding names of coverage species
240 vector_fp m_ac; //!< Vector holding coverage-specific exponential dependence
241 vector_fp m_ec; //!< Vector holding coverage-specific activation energy dependence
242 vector_fp m_mc; //!< Vector holding coverage-specific power-law exponents
243
244private:
245 //! Pairs of species index and multiplers to calculate enthalpy change
246 std::vector<std::pair<size_t, double>> m_stoichCoeffs;
247
248 //! Pairs of phase index and net electric charges (same order as m_stoichCoeffs)
249 std::vector<std::pair<size_t, double>> m_netCharges;
250};
251
252
253//! Base class for rate parameterizations that implement sticking coefficients
254/**
255 * The StickingCoverage class enhances Coverage to accommodate sticking coefficients.
256 */
258{
259public:
261
262 //! Perform object setup based on AnyMap node information
263 //! @param node Sticking coefficient parameters
264 void setStickingParameters(const AnyMap& node);
265
266 //! Store parameters needed to reconstruct an identical object
267 //! @param node Sticking coefficient parameters
268 void getStickingParameters(AnyMap& node) const;
269
270 //! Get flag indicating whether sticking rate uses the correction factor developed
271 //! by Motz & Wise for reactions with high (near-unity) sticking coefficients.
272 //! Defaults to 'false'.
273 bool motzWiseCorrection() const {
274 return m_motzWise;
275 }
276
277 //! Set flag for Motz & Wise correction factor
278 void setMotzWiseCorrection(bool motz_wise) {
279 m_motzWise = motz_wise;
280 m_explicitMotzWise = true;
281 }
282
283 //! Get sticking species.
284 std::string stickingSpecies() const {
285 return m_stickingSpecies;
286 }
287
288 //! Set sticking species
289 /*!
290 * For reactions with multiple non-surface species, the sticking species needs
291 * to be explicitly identified. Note that species have to be specified prior
292 * to adding a reaction to a Kinetics object.
293 */
294 void setStickingSpecies(const std::string& stickingSpecies) {
296 m_explicitSpecies = true;
297 }
298
299 //! Get exponent applied to site density (sticking order)
300 double stickingOrder() {
301 return m_surfaceOrder;
302 }
303
304 //! Set exponent applied to site density (sticking order)
305 /*!
306 * @internal This method is used for testing purposes only as the value is
307 * determined automatically by setContext.
308 *
309 * @warning This method is an experimental part of the %Cantera API and
310 * may be changed or removed without notice.
311 */
312 void setStickingOrder(double order) {
313 m_surfaceOrder = order;
314 }
315
316 //! Get the molecular weight of the sticking species
317 double stickingWeight() {
318 return GasConstant / (2 * Pi * m_multiplier * m_multiplier);
319 }
320
321 //! Set the molecular weight of the sticking species
322 /*!
323 * @internal This method is used for testing purposes only as the value is
324 * determined automatically by setContext.
325 *
326 * @warning This method is an experimental part of the %Cantera API and
327 * may be changed or removed without notice.
328 */
329 void setStickingWeight(double weight) {
330 m_multiplier = sqrt(GasConstant / (2 * Pi * weight));
331 }
332
333 //! Build rate-specific parameters based on Reaction and Kinetics context
334 //! @param rxn Reaction associated with the sticking coefficient
335 //! @param kin Kinetics object associated with the sticking coefficient
336 //! Parameters can be accessed using the method stickingSpecies, stickingOrder
337 //! and stickingWeight.
338 void setContext(const Reaction& rxn, const Kinetics& kin);
339
340protected:
341 bool m_motzWise; //!< boolean indicating whether Motz & Wise correction is used
342 bool m_explicitMotzWise; //!< Correction cannot be overriden by default
343 std::string m_stickingSpecies; //!< string identifying sticking species
344 bool m_explicitSpecies; //!< Boolean flag
345 double m_surfaceOrder; //!< exponent applied to site density term
346 double m_multiplier; //!< multiplicative factor in rate expression
347 double m_factor; //!< cached factor
348};
349
350
351//! A class template for interface reaction rate specifications
352template <class RateType, class DataType>
353class InterfaceRate : public RateType, public InterfaceRateBase
354{
356
357public:
358 InterfaceRate() = default;
359 using RateType::RateType; // inherit constructors
360
361 //! Constructor based on AnyMap content
362 InterfaceRate(const AnyMap& node, const UnitStack& rate_units) {
363 setParameters(node, rate_units);
364 }
365 explicit InterfaceRate(const AnyMap& node) {
366 setParameters(node, {});
367 }
368
369 unique_ptr<MultiRateBase> newMultiRate() const override {
370 return unique_ptr<MultiRateBase>(
371 new MultiRate<InterfaceRate<RateType, DataType>, DataType>);
372 }
373
374 //! Identifier of reaction rate type
375 virtual const std::string type() const override {
376 return "interface-" + RateType::type();
377 }
378
379 virtual void setParameters(
380 const AnyMap& node, const UnitStack& rate_units) override
381 {
383 RateType::setParameters(node, rate_units);
384 }
385
386 virtual void getParameters(AnyMap& node) const override {
387 RateType::getParameters(node);
388 node["type"] = type();
390 }
391
392 virtual void setContext(const Reaction& rxn, const Kinetics& kin) override {
393 RateType::setContext(rxn, kin);
395 }
396
397 //! Update reaction rate parameters
398 //! @param shared_data data shared by all reactions of a given type
399 void updateFromStruct(const DataType& shared_data) {
400 _update(shared_data);
402 }
403
404 //! Evaluate reaction rate
405 //! @param shared_data data shared by all reactions of a given type
406 double evalFromStruct(const DataType& shared_data) const {
407 double out = RateType::evalRate(shared_data.logT, shared_data.recipT) *
408 std::exp(std::log(10.0) * m_acov - m_ecov * shared_data.recipT + m_mcov);
409 if (m_chargeTransfer) {
410 out *= voltageCorrection();
411 }
412 return out;
413 }
414
415 //! Evaluate derivative of reaction rate with respect to temperature
416 //! divided by reaction rate
417 //! @param shared_data data shared by all reactions of a given type
418 double ddTScaledFromStruct(const DataType& shared_data) const {
419 throw NotImplementedError("InterfaceRate<>::ddTScaledFromStruct");
420 }
421
422 virtual double preExponentialFactor() const override {
423 return RateType::preExponentialFactor() *
424 std::exp(std::log(10.0) * m_acov + m_mcov);
425 }
426
427 virtual double activationEnergy() const override {
428 return RateType::activationEnergy() + m_ecov * GasConstant;
429 }
430
431protected:
432 //! Helper function to process updates for rate types that implement the
433 //! `updateFromStruct` method.
434 template <typename T=RateType,
435 typename std::enable_if<has_update<T>::value, bool>::type = true>
436 void _update(const DataType& shared_data) {
437 T::updateFromStruct(shared_data);
438 }
439
440 //! Helper function for rate types that do not implement `updateFromStruct`.
441 //! Does nothing, but exists to allow generic implementations of update().
442 template <typename T=RateType,
443 typename std::enable_if<!has_update<T>::value, bool>::type = true>
444 void _update(const DataType& shared_data) {
445 }
446};
447
448using InterfaceArrheniusRate = InterfaceRate<ArrheniusRate, InterfaceData>;
449using InterfaceBlowersMaselRate = InterfaceRate<BlowersMaselRate, InterfaceData>;
450
451
452//! A class template for interface sticking rate specifications
453template <class RateType, class DataType>
454class StickingRate : public RateType, public StickingCoverage
455{
457
458public:
459 StickingRate() = default;
460 using RateType::RateType; // inherit constructors
461
462 //! Constructor based on AnyMap content
463 StickingRate(const AnyMap& node, const UnitStack& rate_units) {
464 // sticking coefficients are dimensionless
465 setParameters(node, Units(1.0));
466 }
467 explicit StickingRate(const AnyMap& node) {
468 // sticking coefficients are dimensionless
469 setParameters(node, Units(1.0));
470 }
471
472 unique_ptr<MultiRateBase> newMultiRate() const override {
473 return unique_ptr<MultiRateBase>(
474 new MultiRate<StickingRate<RateType, DataType>, DataType>);
475 }
476
477 //! Identifier of reaction rate type
478 virtual const std::string type() const override {
479 return "sticking-" + RateType::type();
480 }
481
482 virtual void setParameters(
483 const AnyMap& node, const UnitStack& rate_units) override
484 {
486 RateType::m_negativeA_ok = node.getBool("negative-A", false);
488 if (!node.hasKey("sticking-coefficient")) {
489 RateType::setRateParameters(AnyValue(), node.units(), rate_units);
490 return;
491 }
492 RateType::setRateParameters(
493 node["sticking-coefficient"], node.units(), rate_units);
494 }
495
496 virtual void getParameters(AnyMap& node) const override {
497 node["type"] = type();
498 if (RateType::m_negativeA_ok) {
499 node["negative-A"] = true;
500 }
501 AnyMap rateNode;
502 RateType::getRateParameters(rateNode);
504 if (!rateNode.empty()) {
505 // RateType object is configured
506 node["sticking-coefficient"] = std::move(rateNode);
507 }
509 }
510
511 virtual void setContext(const Reaction& rxn, const Kinetics& kin) override {
512 RateType::setContext(rxn, kin);
515 }
516
517 virtual void validate(const std::string &equation, const Kinetics& kin) override {
518 RateType::validate(equation, kin);
519 fmt::memory_buffer err_reactions;
520 double T[] = {200.0, 500.0, 1000.0, 2000.0, 5000.0, 10000.0};
521 for (size_t i=0; i < 6; i++) {
522 double k = RateType::evalRate(log(T[i]), 1 / T[i]);
523 if (k > 1) {
524 fmt_append(err_reactions,
525 "\n Sticking coefficient is greater than 1 for reaction '{}'\n"
526 " at T = {:.1f}\n", equation, T[i]);
527 }
528 }
529 if (err_reactions.size()) {
530 warn_user("StickingRate::validate", to_string(err_reactions));
531 }
532 }
533
534 //! Update reaction rate parameters
535 //! @param shared_data data shared by all reactions of a given type
536 void updateFromStruct(const DataType& shared_data) {
537 _update(shared_data);
540 }
541
542 //! Evaluate reaction rate
543 //! @param shared_data data shared by all reactions of a given type
544 double evalFromStruct(const DataType& shared_data) const {
545 double out = RateType::evalRate(shared_data.logT, shared_data.recipT) *
546 std::exp(std::log(10.0) * m_acov - m_ecov * shared_data.recipT + m_mcov);
547 if (m_chargeTransfer) {
548 // @todo the physical interpretation of a 'sticking' charge transfer
549 // reaction remains to be resolved.
550 out *= voltageCorrection();
551 }
552 if (m_motzWise) {
553 out /= 1 - 0.5 * out;
554 }
555 return out * m_factor * shared_data.sqrtT * m_multiplier;
556 }
557
558 //! Evaluate derivative of reaction rate with respect to temperature
559 //! divided by reaction rate
560 //! @param shared_data data shared by all reactions of a given type
561 double ddTScaledFromStruct(const DataType& shared_data) const {
562 throw NotImplementedError("StickingRate<>::ddTScaledFromStruct");
563 }
564
565 virtual double preExponentialFactor() const override {
566 return RateType::preExponentialFactor() *
567 std::exp(std::log(10.0) * m_acov + m_mcov);
568 }
569
570 virtual double activationEnergy() const override {
571 return RateType::activationEnergy() + m_ecov * GasConstant;
572 }
573
574protected:
575 //! Helper function to process updates for rate types that implement the
576 //! `updateFromStruct` method.
577 template <typename T=RateType,
578 typename std::enable_if<has_update<T>::value, bool>::type = true>
579 void _update(const DataType& shared_data) {
580 T::updateFromStruct(shared_data);
581 }
582
583 //! Helper function for rate types that do not implement `updateFromStruct`.
584 //! Does nothing, but exists to allow generic implementations of update().
585 template <typename T=RateType,
586 typename std::enable_if<!has_update<T>::value, bool>::type = true>
587 void _update(const DataType& shared_data) {
588 }
589};
590
591using StickingArrheniusRate = StickingRate<ArrheniusRate, InterfaceData>;
592using StickingBlowersMaselRate = StickingRate<BlowersMaselRate, InterfaceData>;
593
594}
595#endif
Header for Blowers-Masel reaction rates.
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
const UnitSystem & units() const
Return the default units that should be used to convert stored values.
Definition: AnyMap.h:598
bool getBool(const std::string &key, bool default_) const
If key exists, return it as a bool, otherwise return default_.
Definition: AnyMap.cpp:1487
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
Definition: AnyMap.cpp:1406
A wrapper for a variable whose type is determined at runtime.
Definition: AnyMap.h:84
Base class for rate parameterizations that involve interfaces.
Definition: InterfaceRate.h:92
double m_mcov
Coverage term in reaction rate.
void setCoverageDependencies(const AnyMap &dependencies, const UnitSystem &units=UnitSystem())
Set coverage dependencies based on AnyMap node information.
double m_beta
Electrochemistry only.
double m_ecov
Coverage contribution to activation energy.
void addCoverageDependence(const std::string &sp, double a, double m, double e)
Add a coverage dependency for species sp, with exponential dependence a, power-law exponent m,...
void setParameters(const AnyMap &node)
Perform object setup based on AnyMap node information.
double m_prodStandardConcentrations
Products of standard concentrations.
std::vector< std::pair< size_t, double > > m_netCharges
Pairs of phase index and net electric charges (same order as m_stoichCoeffs)
double m_deltaGibbs0_RT
Normalized standard state Gibbs free energy change.
vector_fp m_mc
Vector holding coverage-specific power-law exponents.
std::map< size_t, size_t > m_indices
Map holding indices of coverage species.
double beta() const
Return the charge transfer beta parameter.
vector_fp m_ec
Vector holding coverage-specific activation energy dependence.
bool exchangeCurrentDensityFormulation()
Boolean indicating whether rate uses exchange current density formulation.
bool usesElectrochemistry()
Boolean indicating whether rate uses electrochemistry.
vector_fp m_ac
Vector holding coverage-specific exponential dependence.
bool m_chargeTransfer
Boolean indicating use of electrochemistry.
double siteDensity() const
Return site density [kmol/m^2].
void getCoverageDependencies(AnyMap &dependencies, bool asVector=false) const
Store parameters needed to reconstruct coverage dependencies.
double m_acov
Coverage contribution to pre-exponential factor.
std::vector< std::pair< size_t, double > > m_stoichCoeffs
Pairs of species index and multiplers to calculate enthalpy change.
void setSpecies(const std::vector< std::string > &species)
Set association with an ordered list of all species associated with a given Kinetics object.
void getParameters(AnyMap &node) const
Store parameters needed to reconstruct an identical object.
double m_siteDensity
Site density [kmol/m^2].
void setContext(const Reaction &rxn, const Kinetics &kin)
Build rate-specific parameters based on Reaction and Kinetics context.
double voltageCorrection() const
Calculate modifications for the forward reaction rate for interfacial charge transfer reactions.
void updateFromStruct(const InterfaceData &shared_data)
Update reaction rate parameters.
std::vector< std::string > m_cov
Vector holding names of coverage species.
void setSiteDensity(double siteDensity)
Set site density [kmol/m^2].
double m_deltaPotential_RT
Normalized electric potential energy change.
A class template for interface reaction rate specifications.
double ddTScaledFromStruct(const DataType &shared_data) const
Evaluate derivative of reaction rate with respect to temperature divided by reaction rate.
InterfaceRate(const AnyMap &node, const UnitStack &rate_units)
Constructor based on AnyMap content.
void updateFromStruct(const DataType &shared_data)
Update reaction rate parameters.
void _update(const DataType &shared_data)
Helper function to process updates for rate types that implement the updateFromStruct method.
double evalFromStruct(const DataType &shared_data) const
Evaluate reaction rate.
virtual const std::string type() const override
Identifier of reaction rate type.
Public interface for kinetics managers.
Definition: Kinetics.h:114
An error indicating that an unimplemented function has been called.
Definition: ctexceptions.h:187
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition: Reaction.h:33
Base class for rate parameterizations that implement sticking coefficients.
void setStickingParameters(const AnyMap &node)
Perform object setup based on AnyMap node information.
bool m_explicitSpecies
Boolean flag.
std::string stickingSpecies() const
Get sticking species.
void setStickingWeight(double weight)
Set the molecular weight of the sticking species.
double m_factor
cached factor
std::string m_stickingSpecies
string identifying sticking species
void setStickingSpecies(const std::string &stickingSpecies)
Set sticking species.
void setStickingOrder(double order)
Set exponent applied to site density (sticking order)
bool m_explicitMotzWise
Correction cannot be overriden by default.
void setMotzWiseCorrection(bool motz_wise)
Set flag for Motz & Wise correction factor.
void getStickingParameters(AnyMap &node) const
Store parameters needed to reconstruct an identical object.
double m_multiplier
multiplicative factor in rate expression
bool m_motzWise
boolean indicating whether Motz & Wise correction is used
double m_surfaceOrder
exponent applied to site density term
void setContext(const Reaction &rxn, const Kinetics &kin)
Build rate-specific parameters based on Reaction and Kinetics context.
double stickingWeight()
Get the molecular weight of the sticking species.
bool motzWiseCorrection() const
Get flag indicating whether sticking rate uses the correction factor developed by Motz & Wise for rea...
double stickingOrder()
Get exponent applied to site density (sticking order)
A class template for interface sticking rate specifications.
double ddTScaledFromStruct(const DataType &shared_data) const
Evaluate derivative of reaction rate with respect to temperature divided by reaction rate.
StickingRate(const AnyMap &node, const UnitStack &rate_units)
Constructor based on AnyMap content.
void updateFromStruct(const DataType &shared_data)
Update reaction rate parameters.
void _update(const DataType &shared_data)
Helper function to process updates for rate types that implement the updateFromStruct method.
double evalFromStruct(const DataType &shared_data) const
Evaluate reaction rate.
virtual const std::string type() const override
Identifier of reaction rate type.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
Unit conversion utility.
Definition: Units.h:161
A representation of the units associated with a dimensional quantity.
Definition: Units.h:30
This file contains definitions for utility functions and text for modules, inputfiles,...
const double Pi
Pi.
Definition: ct_defs.h:52
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
const double Faraday
Faraday constant [C/kmol].
Definition: ct_defs.h:128
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
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:113
void warn_user(const std::string &method, const std::string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Definition: global.h:245
Data container holding shared data specific to BlowersMaselRate.
virtual void update(double T) override
Update data container based on temperature T
bool ready
boolean indicating whether vectors are accessible
vector_fp partialMolarEnthalpies
partial molar enthalpies
Data container holding shared data for reaction rate specification with interfaces.
Definition: InterfaceRate.h:40
virtual void resize(size_t nSpecies, size_t nReactions, size_t nPhases) override
Update number of species, reactions and phases.
Definition: InterfaceRate.h:53
vector_fp electricPotentials
electric potentials of phases
Definition: InterfaceRate.h:67
virtual bool update(const ThermoPhase &bulk, const Kinetics &kin) override
Update data container based on thermodynamic phase state.
vector_fp coverages
surface coverages
Definition: InterfaceRate.h:65
vector_fp logCoverages
logarithm of surface coverages
Definition: InterfaceRate.h:66
vector_fp standardChemPotentials
standard state chemical potentials
Definition: InterfaceRate.h:68
vector_fp standardConcentrations
standard state concentrations
Definition: InterfaceRate.h:69
double sqrtT
square root of temperature
Definition: InterfaceRate.h:63
Unit aggregation utility.
Definition: Units.h:99
#define CT_DEFINE_HAS_MEMBER(detector_name, func_name)
A macro for generating member function detectors, which can then be used in combination with std::ena...
Definition: utilities.h:193