Cantera 2.6.0

Reaction.h
Go to the documentation of this file.
1/**
2 * @file Reaction.h
3 */
4
5// This file is part of Cantera. See License.txt in the top-level directory or
6// at https://cantera.org/license.txt for license and copyright information.
7
8#ifndef CT_REACTION_H
9#define CT_REACTION_H
10
11#include "cantera/base/AnyMap.h"
12#include "cantera/kinetics/ReactionRate.h"
13#include "cantera/kinetics/RxnRates.h"
14#include "cantera/base/Units.h"
15#include "ChebyshevRate.h"
16#include "InterfaceRate.h"
17#include "Custom.h"
18
19 namespace Cantera
20{
21
22 class Kinetics;
23 class FalloffRate;
24 class XML_Node;
25 class ThirdBody;
26
27//! @defgroup reactionGroup Reactions and reaction rates
28
29//! Abstract base class which stores data about a reaction and its rate
30//! parameterization so that it can be added to a Kinetics object.
31//! @ingroup reactionGroup
32 class Reaction
33{
34 public:
35 Reaction();
36 Reaction(const Composition& reactants, const Composition& products,
37 shared_ptr<ReactionRate> rate={});
38
39 //! Construct a Reaction and it's corresponding ReactionRate based on AnyMap (YAML)
40 //! input.
41 Reaction(const AnyMap& node, const Kinetics& kin);
42
43 //! @deprecated To be removed after Cantera 2.6.
44 explicit Reaction(int type);
45 //! @deprecated To be removed after Cantera 2.6.
46 Reaction(int type, const Composition& reactants,
47 const Composition& products);
48 virtual ~Reaction() {}
49
50 //! The reactant side of the chemical equation for this reaction
51 virtual std::string reactantString() const;
52
53 //! The product side of the chemical equation for this reaction
54 virtual std::string productString() const;
55
56 //! The chemical equation for this reaction
57 std::string equation() const;
58
59 //! Set the reactants and products based on the reaction equation. If a Kinetics
60 //! object is provided, it is used to check that all reactants and products exist.
61 virtual void setEquation(const std::string& equation, const Kinetics* kin=0);
62
63 //! The type of reaction
64 virtual std::string type() const;
65
66 //! Calculate the units of the rate constant. These are determined by the units
67 //! of the standard concentration of the reactant species' phases and the phase
68 //! where the reaction occurs. Sets the value of #rate_units.
69 virtual void calculateRateCoeffUnits(const Kinetics& kin);
70
71 //! Calculate the units of the rate constant. These are determined by the units
72 //! of the standard concentration of the reactant species' phases and the phase
73 //! where the reaction occurs. Sets the value of #rate_units.
74 UnitStack calculateRateCoeffUnits3(const Kinetics& kin);
75
76 //! Ensure that the rate constant and other parameters for this reaction are
77 //! valid.
78 virtual void validate();
79
80 //! Perform validation checks that need access to a complete Kinetics objects, for
81 // example to retrieve information about reactant / product species.
82 virtual void validate(Kinetics& kin) {
83 if (m_rate) {
84 m_rate->validate(equation(), kin);
85 }
86 }
87
88 //! Return the parameters such that an identical Reaction could be reconstructed
89 //! using the newReaction() function. Behavior specific to derived classes is
90 //! handled by the getParameters() method.
91 //! @param withInput If true, include additional input data fields associated
92 //! with the object, such as user-defined fields from a YAML input file, as
93 //! contained in the #input attribute.
94 AnyMap parameters(bool withInput=true) const;
95
96 //! Set up reaction based on AnyMap *node*
97 virtual void setParameters(const AnyMap& node, const Kinetics& kin);
98
99 //! Get validity flag of reaction
100 bool valid() const {
101 return m_valid;
102 }
103
104 //! Set validity flag of reaction
105 void setValid(bool valid) {
106 m_valid = valid;
107 }
108
109 //! Check that the specified reaction is balanced (same number of atoms for
110 //! each element in the reactants and products). Raises an exception if the
111 //! reaction is not balanced. Used by checkSpecies.
112 //! @param kin Kinetics object
113 void checkBalance(const Kinetics& kin) const;
114
115 //! Verify that all species involved in the reaction are defined in the Kinetics
116 //! object. The function returns true if all species are found, and raises an
117 //! exception unless the kinetics object is configured to skip undeclared species,
118 //! in which case false is returned.
119 //! @param kin Kinetics object
120 bool checkSpecies(const Kinetics& kin) const;
121
122 //! Check whether reaction uses electrochemistry
123 //! @param kin Kinetics object
124 bool usesElectrochemistry(const Kinetics& kin) const;
125
126 //! Type of the reaction. The valid types are listed in the file,
127 //! reaction_defs.h, with constants ending in `RXN`.
128 /*!
129 * @deprecated To be removed in Cantera 2.6.
130 * Superseded by Reaction::type().
131 */
132 int reaction_type;
133
134 //! Reactant species and stoichiometric coefficients
135 Composition reactants;
136
137 //! Product species and stoichiometric coefficients
138 Composition products;
139
140 //! Forward reaction order with respect to specific species. By default,
141 //! mass-action kinetics is assumed, with the reaction order equal to each
142 //! reactant's stoichiometric coefficient.
143 Composition orders;
144
145 //! An identification string for the reaction, used in some filtering
146 //! operations
147 std::string id;
148
149 //! True if the current reaction is reversible. False otherwise
150 bool reversible;
151
152 //! True if the current reaction is marked as duplicate
153 bool duplicate;
154
155 //! True if reaction orders can be specified for non-reactant species.
156 //! Default is `false`.
157 bool allow_nonreactant_orders;
158
159 //! True if negative reaction orders are allowed. Default is `false`.
160 bool allow_negative_orders;
161
162 //! Input data used for specific models
163 AnyMap input;
164
165 //! The units of the rate constant. These are determined by the units of the
166 //! standard concentration of the reactant species' phases of the phase
167 //! where the reaction occurs.
168 Units rate_units;
169
170 //! Get reaction rate pointer
171 shared_ptr<ReactionRate> rate() {
172 return m_rate;
173 }
174
175 //! Set reaction rate pointer
176 void setRate(shared_ptr<ReactionRate> rate);
177
178 //! Get pointer to third-body
179 shared_ptr<ThirdBody> thirdBody() {
180 return m_third_body;
181 }
182
183 //! Indicate whether object uses legacy framework
184 bool usesLegacy() const {
185 return !m_rate;
186 }
187
188 protected:
189 //! Store the parameters of a Reaction needed to reconstruct an identical
190 //! object using the newReaction(AnyMap&, Kinetics&) function. Does not
191 //! include user-defined fields available in the #input map.
192 virtual void getParameters(AnyMap& reactionNode) const;
193
194 //! Flag indicating whether reaction is set up correctly
195 bool m_valid;
196
197 //! @internal Helper function returning vector of undeclared third body species
198 //! and a boolean expression indicating whether the third body is specified.
199 //! The function is used by the checkSpecies method and only needed as long as
200 //! there is no unified approach to handle third body collision partners.
201 //! @param kin Kinetics object
202 virtual std::pair<std::vector<std::string>, bool>
203 undeclaredThirdBodies(const Kinetics& kin) const;
204
205 //! Reaction rate used by generic reactions
206 shared_ptr<ReactionRate> m_rate;
207
208 //! Relative efficiencies of third-body species in enhancing the reaction
209 //! rate (if applicable)
210 shared_ptr<ThirdBody> m_third_body;
211};
212
213
214//! A reaction which follows mass-action kinetics with a modified Arrhenius
215//! reaction rate.
216 class ElementaryReaction2 : public Reaction
217{
218 public:
219 ElementaryReaction2();
220 ElementaryReaction2(const Composition& reactants, const Composition products,
221 const Arrhenius2& rate);
222
223 virtual void validate();
224 using Reaction::validate;
225 virtual void getParameters(AnyMap& reactionNode) const;
226
227 virtual std::string type() const {
228 return "elementary-legacy";
229 }
230
231 Arrhenius2 rate;
232 bool allow_negative_pre_exponential_factor;
233};
234
235
236//! A class for managing third-body efficiencies, including default values
237 class ThirdBody
238{
239 public:
240 explicit ThirdBody(double default_efficiency=1.0);
241
242 ThirdBody(const AnyMap& node);
243
244 //! Set third-body efficiencies from AnyMap *node*
245 void setEfficiencies(const AnyMap& node);
246
247 //! Get the third-body efficiency for species *k*
248 double efficiency(const std::string& k) const;
249
250 //! Map of species to third body efficiency
251 Composition efficiencies;
252
253 //! The default third body efficiency for species not listed in
254 //! #efficiencies.
255 double default_efficiency;
256
257 //! Input explicitly specifies collision partner
258 bool specified_collision_partner;
259
260 //! Third body is used by law of mass action
261 //! (`true` for three-body reactions, `false` for falloff reactions)
262 bool mass_action;
263};
264
265
266//! A reaction with a non-reacting third body "M" that acts to add or remove
267//! energy from the reacting species
268 class ThreeBodyReaction2 : public ElementaryReaction2
269{
270 public:
271 ThreeBodyReaction2();
272 ThreeBodyReaction2(const Composition& reactants, const Composition& products,
273 const Arrhenius2& rate, const ThirdBody& tbody);
274
275 virtual std::string type() const {
276 return "three-body-legacy";
277 }
278
279 virtual std::string reactantString() const;
280 virtual std::string productString() const;
281 virtual void calculateRateCoeffUnits(const Kinetics& kin);
282 virtual void getParameters(AnyMap& reactionNode) const;
283
284 //! Relative efficiencies of third-body species in enhancing the reaction
285 //! rate.
286 ThirdBody third_body;
287
288 protected:
289 virtual std::pair<std::vector<std::string>, bool>
290 undeclaredThirdBodies(const Kinetics& kin) const;
291};
292
293
294//! A reaction that is first-order in [M] at low pressure, like a third-body
295//! reaction, but zeroth-order in [M] as pressure increases.
296 class FalloffReaction2 : public Reaction
297{
298 public:
299 FalloffReaction2();
300 FalloffReaction2(const Composition& reactants, const Composition& products,
301 const Arrhenius2& low_rate, const Arrhenius2& high_rate,
302 const ThirdBody& tbody);
303
304 virtual std::string type() const {
305 return "falloff-legacy";
306 }
307
308 virtual std::string reactantString() const;
309 virtual std::string productString() const;
310
311 virtual void validate();
312 using Reaction::validate;
313 virtual void calculateRateCoeffUnits(const Kinetics& kin);
314 virtual void getParameters(AnyMap& reactionNode) const;
315
316 //! The rate constant in the low-pressure limit
317 Arrhenius2 low_rate;
318
319 //! The rate constant in the high-pressure limit
320 Arrhenius2 high_rate;
321
322 //! Relative efficiencies of third-body species in enhancing the reaction rate
323 ThirdBody third_body;
324
325 //! Falloff function which determines how low_rate and high_rate are
326 //! combined to determine the rate constant for the reaction.
327 shared_ptr<FalloffRate> falloff;
328
329 bool allow_negative_pre_exponential_factor;
330
331 //! The units of the low-pressure rate constant. The units of the
332 //! high-pressure rate constant are stored in #rate_units.
333 Units low_rate_units;
334
335 protected:
336 virtual std::pair<std::vector<std::string>, bool> undeclaredThirdBodies(
337 const Kinetics& kin) const;
338};
339
340
341//! A reaction where the rate decreases as pressure increases due to collisional
342//! stabilization of a reaction intermediate. Like a FalloffReaction2, except
343//! that the forward rate constant is written as being proportional to the low-
344//! pressure rate constant.
345 class ChemicallyActivatedReaction2 : public FalloffReaction2
346{
347 public:
348 ChemicallyActivatedReaction2();
349 ChemicallyActivatedReaction2(const Composition& reactants,
350 const Composition& products, const Arrhenius2& low_rate,
351 const Arrhenius2& high_rate, const ThirdBody& tbody);
352
353 virtual std::string type() const {
354 return "chemically-activated-legacy";
355 }
356
357 virtual void calculateRateCoeffUnits(const Kinetics& kin);
358 virtual void getParameters(AnyMap& reactionNode) const;
359};
360
361
362//! A pressure-dependent reaction parameterized by logarithmically interpolating
363//! between Arrhenius rate expressions at various pressures.
364 class PlogReaction2 : public Reaction
365{
366 public:
367 PlogReaction2();
368 PlogReaction2(const Composition& reactants, const Composition& products,
369 const Plog& rate);
370
371 virtual std::string type() const {
372 return "pressure-dependent-Arrhenius-legacy";
373 }
374
375 virtual void validate();
376 using Reaction::validate;
377 virtual void getParameters(AnyMap& reactionNode) const;
378
379 Plog rate;
380};
381
382
383//! A pressure-dependent reaction parameterized by a bi-variate Chebyshev
384//! polynomial in temperature and pressure
385 class ChebyshevReaction2 : public Reaction
386{
387 public:
388 ChebyshevReaction2();
389 ChebyshevReaction2(const Composition& reactants, const Composition& products,
390 const ChebyshevRate& rate);
391 virtual void getParameters(AnyMap& reactionNode) const;
392
393 virtual std::string type() const {
394 return "Chebyshev-legacy";
395 }
396
397 ChebyshevRate rate;
398};
399
400
401//! Modifications to an InterfaceReaction2 rate based on a surface species
402//! coverage.
403 struct CoverageDependency
404{
405 //! Constructor
406 //! @param a_ coefficient for exponential dependence on coverage [dimensionless]
407 //! @param E_ modification to the activation energy [K]
408 //! @param m_ exponent for power law dependence on coverage [dimensionless]
409 CoverageDependency(double a_, double E_, double m_) : a(a_), E(E_), m(m_) {}
410 CoverageDependency() {}
411 double a; //!< coefficient for exponential dependence on coverage [dimensionless]
412 double E; //!< modification to the activation energy [K]
413 double m; //!< exponent for power law dependence on coverage [dimensionless]
414};
415
416
417//! A reaction occurring on an interface (for example, a SurfPhase or an EdgePhase)
418 class InterfaceReaction2 : public ElementaryReaction2
419{
420 public:
421 InterfaceReaction2();
422 InterfaceReaction2(const Composition& reactants, const Composition& products,
423 const Arrhenius2& rate, bool isStick=false);
424 virtual void calculateRateCoeffUnits(const Kinetics& kin);
425 virtual void getParameters(AnyMap& reactionNode) const;
426
427 virtual void validate(Kinetics& kin);
428 using Reaction::validate;
429
430 virtual std::string type() const {
431 return "interface-legacy";
432 }
433
434 //! Adjustments to the Arrhenius rate expression dependent on surface
435 //! species coverages. Three coverage parameters (a, E, m) are used for each
436 //! species on which the rate depends. See SurfaceArrhenius for details on
437 //! the parameterization.
438 std::map<std::string, CoverageDependency> coverage_deps;
439
440 //! Set to true if `rate` is a parameterization of the sticking coefficient
441 //! rather than the forward rate constant
442 bool is_sticking_coefficient;
443
444 //! Set to true if `rate` is a sticking coefficient which should be
445 //! translated into a rate coefficient using the correction factor developed
446 //! by Motz & Wise for reactions with high (near-unity) sticking
447 //! coefficients. Defaults to 'false'.
448 bool use_motz_wise_correction;
449
450 //! For reactions with multiple non-surface species, the sticking species
451 //! needs to be explicitly identified.
452 std::string sticking_species;
453};
454
455
456//! An interface reaction which involves charged species
457 class ElectrochemicalReaction2 : public InterfaceReaction2
458{
459 public:
460 ElectrochemicalReaction2();
461 ElectrochemicalReaction2(const Composition& reactants,
462 const Composition& products, const Arrhenius2& rate);
463 virtual void getParameters(AnyMap& reactionNode) const;
464
465 //! Forward value of the apparent Electrochemical transfer coefficient
466 doublereal beta;
467
468 bool exchange_current_density_formulation;
469};
470
471
472//! A reaction with a non-reacting third body "M" that acts to add or remove
473//! energy from the reacting species
474 class ThreeBodyReaction3 : public Reaction
475{
476 public:
477 ThreeBodyReaction3();
478 ThreeBodyReaction3(const Composition& reactants, const Composition& products,
479 const ArrheniusRate& rate, const ThirdBody& tbody);
480
481 ThreeBodyReaction3(const AnyMap& node, const Kinetics& kin);
482
483 virtual std::string type() const {
484 return "three-body";
485 }
486
487 virtual void setEquation(const std::string& equation, const Kinetics* kin=0);
488 bool detectEfficiencies();
489 virtual void setParameters(const AnyMap& node, const Kinetics& kin);
490 virtual void getParameters(AnyMap& reactionNode) const;
491
492 virtual std::string reactantString() const;
493 virtual std::string productString() const;
494};
495
496
497//! A falloff reaction that is first-order in [M] at low pressure, like a third-body
498//! reaction, but zeroth-order in [M] as pressure increases.
499//! In addition, the class supports chemically-activated reactions where the rate
500//! decreases as pressure increases due to collisional stabilization of a reaction
501//! intermediate; in this case, the forward rate constant is written as being
502//! proportional to the low-pressure rate constant.
503 class FalloffReaction3 : public Reaction
504{
505 public:
506 FalloffReaction3();
507 FalloffReaction3(const Composition& reactants, const Composition& products,
508 const ReactionRate& rate, const ThirdBody& tbody);
509
510 FalloffReaction3(const AnyMap& node, const Kinetics& kin);
511
512 virtual std::string type() const;
513
514 virtual void setEquation(const std::string& equation, const Kinetics* kin);
515 virtual void setParameters(const AnyMap& node, const Kinetics& kin);
516 virtual void getParameters(AnyMap& reactionNode) const;
517
518 virtual std::string reactantString() const;
519 virtual std::string productString() const;
520};
521
522
523//! A reaction which follows mass-action kinetics with a custom reaction rate
524//! defined in Python.
525/**
526 * @warning This class is an experimental part of the %Cantera API and
527 * may be changed or removed without notice.
528 */
529 class CustomFunc1Reaction : public Reaction
530{
531 public:
532 CustomFunc1Reaction();
533 CustomFunc1Reaction(const Composition& reactants, const Composition& products,
534 const CustomFunc1Rate& rate);
535
536 CustomFunc1Reaction(const AnyMap& node, const Kinetics& kin);
537
538 virtual std::string type() const {
539 return "custom-rate-function";
540 }
541};
542
543
544#ifdef CT_NO_LEGACY_REACTIONS_26
545 typedef ThreeBodyReaction3 ThreeBodyReaction;
546 typedef FalloffReaction3 FalloffReaction;
547#else
548 typedef ElementaryReaction2 ElementaryReaction;
549 typedef ThreeBodyReaction2 ThreeBodyReaction;
550 typedef FalloffReaction2 FalloffReaction;
551 typedef ChemicallyActivatedReaction2 ChemicallyActivatedReaction;
552 typedef PlogReaction2 PlogReaction;
553 typedef ChebyshevReaction2 ChebyshevReaction;
554 typedef InterfaceReaction2 InterfaceReaction;
555 typedef ElectrochemicalReaction2 ElectrochemicalReaction;
556#endif
557
558//! Create a new empty Reaction object
559/*!
560 * @param type string identifying type of reaction.
561 * @deprecated To be removed after Cantera 2.6. Only used for legacy reaction types.
562 */
563unique_ptr<Reaction> newReaction(const std::string& type);
564
565//! Create a new Reaction object for the reaction defined in `rxn_node`
566/*!
567 * @param rxn_node XML node describing reaction.
568 */
569unique_ptr<Reaction> newReaction(const XML_Node& rxn_node);
570
571//! Create a new Reaction object using the specified parameters
572/*!
573 * @param rxn_node AnyMap node describing reaction.
574 * @param kin kinetics manager
575 */
576unique_ptr<Reaction> newReaction(const AnyMap& rxn_node,
577 const Kinetics& kin);
578
579//! Create Reaction objects for all `<reaction>` nodes in an XML document.
580//!
581//! The `<reaction>` nodes are assumed to be children of the `<reactionData>`
582//! node in an XML document with a `<ctml>` root node, as in the case of XML
583//! files produced by conversion from CTI files.
584//!
585//! This function can be used in combination with get_XML_File() and
586//! get_XML_from_string() to get Reaction objects from either a file or a
587//! string, respectively, where the string or file is formatted as either CTI
588//! or XML.
589//!
590//! If Reaction objects are being created from a CTI definition that does not
591//! contain corresponding phase definitions, then one of the following must be
592//! true, or the resulting rate constants will be incorrect:
593//!
594//! - The rate constants are expressed in (kmol, meter, second) units
595//! - A `units` directive is included **and** all reactions take place in
596//! bulk (for example, gas) phases
597//!
598//! @deprecated The XML input format is deprecated and will be removed in
599//! Cantera 3.0.
600 std::vector<shared_ptr<Reaction> > getReactions(const XML_Node& node);
601
602//! Create Reaction objects for each item (an AnyMap) in `items`. The species
603//! involved in these reactions must exist in the phases associated with the
604//! Kinetics object `kinetics`.
605 std::vector<shared_ptr<Reaction>> getReactions(const AnyValue& items,
606 Kinetics& kinetics);
607
608//! Parse reaction equation
609 void parseReactionEquation(Reaction& R, const std::string& equation,
610 const AnyBase& reactionNode, const Kinetics* kin);
611
612// declarations of setup functions
613 void setupReaction(Reaction& R, const XML_Node& rxn_node);
614
615 void setupElementaryReaction(ElementaryReaction2&, const XML_Node&);
616//! @internal May be changed without notice in future versions
617 void setupElementaryReaction(ElementaryReaction2&, const AnyMap&,
618 const Kinetics&);
619
620 void setupThreeBodyReaction(ThreeBodyReaction2&, const XML_Node&);
621//! @deprecated Cantera 2.6 (replaced by setParameters)
622 void setupThreeBodyReaction(ThreeBodyReaction2&, const AnyMap&,
623 const Kinetics&);
624
625 void setupFalloffReaction(FalloffReaction2&, const XML_Node&);
626//! @deprecated Cantera 2.6 (replaced by setParameters)
627 void setupFalloffReaction(FalloffReaction2&, const AnyMap&,
628 const Kinetics&);
629
630//! @deprecated Cantera 2.6 (replaced by setParameters)
631 void setupChemicallyActivatedReaction(ChemicallyActivatedReaction2&,
632 const XML_Node&);
633
634 void setupPlogReaction(PlogReaction2&, const XML_Node&);
635//! @deprecated Cantera 2.6 (replaced by setParameters)
636 void setupPlogReaction(PlogReaction2&, const AnyMap&, const Kinetics&);
637
638 void setupChebyshevReaction(ChebyshevReaction2&, const XML_Node&);
639//! @deprecated Cantera 2.6 (replaced by setParameters)
640 void setupChebyshevReaction(ChebyshevReaction2&, const AnyMap&,
641 const Kinetics&);
642
643 void setupInterfaceReaction(InterfaceReaction2&, const XML_Node&);
644//! @internal May be changed without notice in future versions
645 void setupInterfaceReaction(InterfaceReaction2&, const AnyMap&,
646 const Kinetics&);
647
648 void setupElectrochemicalReaction(ElectrochemicalReaction2&,
649 const XML_Node&);
650//! @internal May be changed without notice in future versions
651 void setupElectrochemicalReaction(ElectrochemicalReaction2&,
652 const AnyMap&, const Kinetics&);
653}
654#endif
AnyMap.h
ChebyshevRate.h
Custom.h
InterfaceRate.h
Header for reaction rates that occur at interfaces.
ReactionRate.h
RxnRates.h
Units.h
Header for unit conversion utilities, which are used to translate user input from input files (See In...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
Cantera::Arrhenius2
Arrhenius reaction rate type depends only on temperature.
Definition: RxnRates.h:42
Cantera::ArrheniusRate
Arrhenius reaction rate type depends only on temperature.
Definition: Arrhenius.h:192
Cantera::ChebyshevRate
Pressure-dependent rate expression where the rate coefficient is expressed as a bivariate Chebyshev p...
Definition: ChebyshevRate.h:90
Cantera::ChebyshevReaction2
A pressure-dependent reaction parameterized by a bi-variate Chebyshev polynomial in temperature and p...
Definition: Reaction.h:386
Cantera::ChebyshevReaction2::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.h:393
Cantera::ChebyshevReaction2::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:875
Cantera::ChemicallyActivatedReaction2
A reaction where the rate decreases as pressure increases due to collisional stabilization of a react...
Definition: Reaction.h:346
Cantera::ChemicallyActivatedReaction2::calculateRateCoeffUnits
virtual void calculateRateCoeffUnits(const Kinetics &kin)
Calculate the units of the rate constant.
Definition: Reaction.cpp:825
Cantera::ChemicallyActivatedReaction2::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.h:353
Cantera::ChemicallyActivatedReaction2::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:833
Cantera::CustomFunc1Rate
Custom reaction rate depending only on temperature.
Definition: Custom.h:37
Cantera::CustomFunc1Reaction
A reaction which follows mass-action kinetics with a custom reaction rate defined in Python.
Definition: Reaction.h:530
Cantera::CustomFunc1Reaction::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.h:538
Cantera::ElectrochemicalReaction2
An interface reaction which involves charged species.
Definition: Reaction.h:458
Cantera::ElectrochemicalReaction2::beta
doublereal beta
Forward value of the apparent Electrochemical transfer coefficient.
Definition: Reaction.h:466
Cantera::ElectrochemicalReaction2::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:969
Cantera::ElementaryReaction2
A reaction which follows mass-action kinetics with a modified Arrhenius reaction rate.
Definition: Reaction.h:217
Cantera::ElementaryReaction2::validate
virtual void validate()
Ensure that the rate constant and other parameters for this reaction are valid.
Definition: Reaction.cpp:588
Cantera::ElementaryReaction2::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.h:227
Cantera::ElementaryReaction2::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:599
Cantera::FalloffReaction2
A reaction that is first-order in [M] at low pressure, like a third-body reaction,...
Definition: Reaction.h:297
Cantera::FalloffReaction2::reactantString
virtual std::string reactantString() const
The reactant side of the chemical equation for this reaction.
Definition: Reaction.cpp:738
Cantera::FalloffReaction2::calculateRateCoeffUnits
virtual void calculateRateCoeffUnits(const Kinetics &kin)
Calculate the units of the rate constant.
Definition: Reaction.cpp:776
Cantera::FalloffReaction2::falloff
shared_ptr< FalloffRate > falloff
Falloff function which determines how low_rate and high_rate are combined to determine the rate const...
Definition: Reaction.h:327
Cantera::FalloffReaction2::validate
virtual void validate()
Ensure that the rate constant and other parameters for this reaction are valid.
Definition: Reaction.cpp:760
Cantera::FalloffReaction2::productString
virtual std::string productString() const
The product side of the chemical equation for this reaction.
Definition: Reaction.cpp:749
Cantera::FalloffReaction2::low_rate_units
Units low_rate_units
The units of the low-pressure rate constant.
Definition: Reaction.h:333
Cantera::FalloffReaction2::high_rate
Arrhenius2 high_rate
The rate constant in the high-pressure limit.
Definition: Reaction.h:320
Cantera::FalloffReaction2::third_body
ThirdBody third_body
Relative efficiencies of third-body species in enhancing the reaction rate.
Definition: Reaction.h:323
Cantera::FalloffReaction2::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.h:304
Cantera::FalloffReaction2::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:784
Cantera::FalloffReaction2::low_rate
Arrhenius2 low_rate
The rate constant in the low-pressure limit.
Definition: Reaction.h:317
Cantera::FalloffReaction2::undeclaredThirdBodies
virtual std::pair< std::vector< std::string >, bool > undeclaredThirdBodies(const Kinetics &kin) const
Definition: Reaction.cpp:803
Cantera::FalloffReaction3
A falloff reaction that is first-order in [M] at low pressure, like a third-body reaction,...
Definition: Reaction.h:504
Cantera::FalloffReaction3::setParameters
virtual void setParameters(const AnyMap &node, const Kinetics &kin)
Set up reaction based on AnyMap node
Definition: Reaction.cpp:1176
Cantera::FalloffReaction3::reactantString
virtual std::string reactantString() const
The reactant side of the chemical equation for this reaction.
Definition: Reaction.cpp:1156
Cantera::FalloffReaction3::productString
virtual std::string productString() const
The product side of the chemical equation for this reaction.
Definition: Reaction.cpp:1166
Cantera::FalloffReaction3::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.cpp:1146
Cantera::FalloffReaction3::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:1232
Cantera::FalloffReaction3::setEquation
virtual void setEquation(const std::string &equation, const Kinetics *kin)
Set the reactants and products based on the reaction equation.
Definition: Reaction.cpp:1189
Cantera::InterfaceReaction2
A reaction occurring on an interface (for example, a SurfPhase or an EdgePhase)
Definition: Reaction.h:419
Cantera::InterfaceReaction2::is_sticking_coefficient
bool is_sticking_coefficient
Set to true if rate is a parameterization of the sticking coefficient rather than the forward rate co...
Definition: Reaction.h:442
Cantera::InterfaceReaction2::coverage_deps
std::map< std::string, CoverageDependency > coverage_deps
Adjustments to the Arrhenius rate expression dependent on surface species coverages.
Definition: Reaction.h:438
Cantera::InterfaceReaction2::calculateRateCoeffUnits
virtual void calculateRateCoeffUnits(const Kinetics &kin)
Calculate the units of the rate constant.
Definition: Reaction.cpp:900
Cantera::InterfaceReaction2::validate
virtual void validate()
Ensure that the rate constant and other parameters for this reaction are valid.
Definition: Reaction.cpp:124
Cantera::InterfaceReaction2::sticking_species
std::string sticking_species
For reactions with multiple non-surface species, the sticking species needs to be explicitly identifi...
Definition: Reaction.h:452
Cantera::InterfaceReaction2::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.h:430
Cantera::InterfaceReaction2::use_motz_wise_correction
bool use_motz_wise_correction
Set to true if rate is a sticking coefficient which should be translated into a rate coefficient usin...
Definition: Reaction.h:448
Cantera::InterfaceReaction2::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:908
Cantera::Kinetics
Public interface for kinetics managers.
Definition: Kinetics.h:114
Cantera::PlogRate
Pressure-dependent reaction rate expressed by logarithmically interpolating between Arrhenius rate ex...
Definition: PlogRate.h:78
Cantera::PlogReaction2
A pressure-dependent reaction parameterized by logarithmically interpolating between Arrhenius rate e...
Definition: Reaction.h:365
Cantera::PlogReaction2::validate
virtual void validate()
Ensure that the rate constant and other parameters for this reaction are valid.
Definition: Reaction.cpp:1835
Cantera::PlogReaction2::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.h:371
Cantera::PlogReaction2::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:853
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::Reaction
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition: Reaction.h:33
Cantera::Reaction::setParameters
virtual void setParameters(const AnyMap &node, const Kinetics &kin)
Set up reaction based on AnyMap node
Definition: Reaction.cpp:216
Cantera::Reaction::reactantString
virtual std::string reactantString() const
The reactant side of the chemical equation for this reaction.
Definition: Reaction.cpp:266
Cantera::Reaction::checkBalance
void checkBalance(const Kinetics &kin) const
Check that the specified reaction is balanced (same number of atoms for each element in the reactants...
Definition: Reaction.cpp:409
Cantera::Reaction::rate_units
Units rate_units
The units of the rate constant.
Definition: Reaction.h:168
Cantera::Reaction::valid
bool valid() const
Get validity flag of reaction.
Definition: Reaction.h:100
Cantera::Reaction::calculateRateCoeffUnits
virtual void calculateRateCoeffUnits(const Kinetics &kin)
Calculate the units of the rate constant.
Definition: Reaction.cpp:315
Cantera::Reaction::rate
shared_ptr< ReactionRate > rate()
Get reaction rate pointer.
Definition: Reaction.h:171
Cantera::Reaction::orders
Composition orders
Forward reaction order with respect to specific species.
Definition: Reaction.h:143
Cantera::Reaction::validate
virtual void validate()
Ensure that the rate constant and other parameters for this reaction are valid.
Definition: Reaction.cpp:124
Cantera::Reaction::checkSpecies
bool checkSpecies(const Kinetics &kin) const
Verify that all species involved in the reaction are defined in the Kinetics object.
Definition: Reaction.cpp:479
Cantera::Reaction::setRate
void setRate(shared_ptr< ReactionRate > rate)
Set reaction rate pointer.
Definition: Reaction.cpp:243
Cantera::Reaction::m_third_body
shared_ptr< ThirdBody > m_third_body
Relative efficiencies of third-body species in enhancing the reaction rate (if applicable)
Definition: Reaction.h:210
Cantera::Reaction::parameters
AnyMap parameters(bool withInput=true) const
Return the parameters such that an identical Reaction could be reconstructed using the newReaction() ...
Definition: Reaction.cpp:162
Cantera::Reaction::validate
virtual void validate(Kinetics &kin)
Perform validation checks that need access to a complete Kinetics objects, for.
Definition: Reaction.h:82
Cantera::Reaction::setEquation
virtual void setEquation(const std::string &equation, const Kinetics *kin=0)
Set the reactants and products based on the reaction equation.
Definition: Reaction.cpp:305
Cantera::Reaction::productString
virtual std::string productString() const
The product side of the chemical equation for this reaction.
Definition: Reaction.cpp:281
Cantera::Reaction::thirdBody
shared_ptr< ThirdBody > thirdBody()
Get pointer to third-body.
Definition: Reaction.h:179
Cantera::Reaction::m_valid
bool m_valid
Flag indicating whether reaction is set up correctly.
Definition: Reaction.h:195
Cantera::Reaction::reversible
bool reversible
True if the current reaction is reversible. False otherwise.
Definition: Reaction.h:150
Cantera::Reaction::allow_nonreactant_orders
bool allow_nonreactant_orders
True if reaction orders can be specified for non-reactant species.
Definition: Reaction.h:157
Cantera::Reaction::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.cpp:310
Cantera::Reaction::m_rate
shared_ptr< ReactionRate > m_rate
Reaction rate used by generic reactions.
Definition: Reaction.h:206
Cantera::Reaction::usesLegacy
bool usesLegacy() const
Indicate whether object uses legacy framework.
Definition: Reaction.h:184
Cantera::Reaction::usesElectrochemistry
bool usesElectrochemistry(const Kinetics &kin) const
Check whether reaction uses electrochemistry.
Definition: Reaction.cpp:540
Cantera::Reaction::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:184
Cantera::Reaction::allow_negative_orders
bool allow_negative_orders
True if negative reaction orders are allowed. Default is false.
Definition: Reaction.h:160
Cantera::Reaction::products
Composition products
Product species and stoichiometric coefficients.
Definition: Reaction.h:138
Cantera::Reaction::reactants
Composition reactants
Reactant species and stoichiometric coefficients.
Definition: Reaction.h:135
Cantera::Reaction::input
AnyMap input
Input data used for specific models.
Definition: Reaction.h:163
Cantera::Reaction::duplicate
bool duplicate
True if the current reaction is marked as duplicate.
Definition: Reaction.h:153
Cantera::Reaction::calculateRateCoeffUnits3
UnitStack calculateRateCoeffUnits3(const Kinetics &kin)
Calculate the units of the rate constant.
Definition: Reaction.cpp:345
Cantera::Reaction::reaction_type
int reaction_type
Type of the reaction.
Definition: Reaction.h:132
Cantera::Reaction::equation
std::string equation() const
The chemical equation for this reaction.
Definition: Reaction.cpp:296
Cantera::Reaction::undeclaredThirdBodies
virtual std::pair< std::vector< std::string >, bool > undeclaredThirdBodies(const Kinetics &kin) const
Definition: Reaction.cpp:398
Cantera::Reaction::id
std::string id
An identification string for the reaction, used in some filtering operations.
Definition: Reaction.h:147
Cantera::Reaction::setValid
void setValid(bool valid)
Set validity flag of reaction.
Definition: Reaction.h:105
Cantera::ThirdBody
A class for managing third-body efficiencies, including default values.
Definition: Reaction.h:238
Cantera::ThirdBody::specified_collision_partner
bool specified_collision_partner
Input explicitly specifies collision partner.
Definition: Reaction.h:258
Cantera::ThirdBody::setEfficiencies
void setEfficiencies(const AnyMap &node)
Set third-body efficiencies from AnyMap node
Definition: Reaction.cpp:624
Cantera::ThirdBody::default_efficiency
double default_efficiency
The default third body efficiency for species not listed in efficiencies.
Definition: Reaction.h:255
Cantera::ThirdBody::efficiency
double efficiency(const std::string &k) const
Get the third-body efficiency for species k
Definition: Reaction.cpp:632
Cantera::ThirdBody::efficiencies
Composition efficiencies
Map of species to third body efficiency.
Definition: Reaction.h:251
Cantera::ThirdBody::mass_action
bool mass_action
Third body is used by law of mass action (true for three-body reactions, false for falloff reactions)
Definition: Reaction.h:262
Cantera::ThreeBodyReaction2
A reaction with a non-reacting third body "M" that acts to add or remove energy from the reacting spe...
Definition: Reaction.h:269
Cantera::ThreeBodyReaction2::reactantString
virtual std::string reactantString() const
The reactant side of the chemical equation for this reaction.
Definition: Reaction.cpp:652
Cantera::ThreeBodyReaction2::calculateRateCoeffUnits
virtual void calculateRateCoeffUnits(const Kinetics &kin)
Calculate the units of the rate constant.
Definition: Reaction.cpp:672
Cantera::ThreeBodyReaction2::productString
virtual std::string productString() const
The product side of the chemical equation for this reaction.
Definition: Reaction.cpp:662
Cantera::ThreeBodyReaction2::third_body
ThirdBody third_body
Relative efficiencies of third-body species in enhancing the reaction rate.
Definition: Reaction.h:286
Cantera::ThreeBodyReaction2::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.h:275
Cantera::ThreeBodyReaction2::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:693
Cantera::ThreeBodyReaction2::undeclaredThirdBodies
virtual std::pair< std::vector< std::string >, bool > undeclaredThirdBodies(const Kinetics &kin) const
Definition: Reaction.cpp:706
Cantera::ThreeBodyReaction3
A reaction with a non-reacting third body "M" that acts to add or remove energy from the reacting spe...
Definition: Reaction.h:475
Cantera::ThreeBodyReaction3::setParameters
virtual void setParameters(const AnyMap &node, const Kinetics &kin)
Set up reaction based on AnyMap node
Definition: Reaction.cpp:1062
Cantera::ThreeBodyReaction3::reactantString
virtual std::string reactantString() const
The reactant side of the chemical equation for this reaction.
Definition: Reaction.cpp:1087
Cantera::ThreeBodyReaction3::setEquation
virtual void setEquation(const std::string &equation, const Kinetics *kin=0)
Set the reactants and products based on the reaction equation.
Definition: Reaction.cpp:1046
Cantera::ThreeBodyReaction3::productString
virtual std::string productString() const
The product side of the chemical equation for this reaction.
Definition: Reaction.cpp:1097
Cantera::ThreeBodyReaction3::type
virtual std::string type() const
The type of reaction.
Definition: Reaction.h:483
Cantera::ThreeBodyReaction3::getParameters
virtual void getParameters(AnyMap &reactionNode) const
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(An...
Definition: Reaction.cpp:1074
Cantera::Units
A representation of the units associated with a dimensional quantity.
Definition: Units.h:30
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::setupChemicallyActivatedReaction
void setupChemicallyActivatedReaction(ChemicallyActivatedReaction2 &R, const XML_Node &rxn_node)
Definition: Reaction.cpp:1783
Cantera::parseReactionEquation
void parseReactionEquation(Reaction &R, const std::string &equation, const AnyBase &reactionNode, const Kinetics *kin)
Parse reaction equation.
Definition: Reaction.cpp:1560
Cantera::getReactions
std::vector< shared_ptr< Reaction > > getReactions(const XML_Node &node)
Create Reaction objects for all <reaction> nodes in an XML document.
Definition: Reaction.cpp:2000
Cantera::Composition
std::map< std::string, double > Composition
Map from string names to doubles.
Definition: ct_defs.h:180
Cantera::newReaction
unique_ptr< Reaction > newReaction(const std::string &type)
Create a new empty Reaction object.
Definition: Reaction.cpp:1307
Cantera::CoverageDependency
Modifications to an InterfaceReaction2 rate based on a surface species coverage.
Definition: Reaction.h:404
Cantera::CoverageDependency::a
double a
coefficient for exponential dependence on coverage [dimensionless]
Definition: Reaction.h:411
Cantera::CoverageDependency::E
double E
modification to the activation energy [K]
Definition: Reaction.h:412
Cantera::CoverageDependency::m
double m
exponent for power law dependence on coverage [dimensionless]
Definition: Reaction.h:413
Cantera::CoverageDependency::CoverageDependency
CoverageDependency(double a_, double E_, double m_)
Constructor.
Definition: Reaction.h:409
Cantera::UnitStack
Unit aggregation utility.
Definition: Units.h:99