| Cantera 3.0.0

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