Cantera  2.5.1
GasKinetics.h
Go to the documentation of this file.
1 /**
2  * @file GasKinetics.h
3  * @ingroup chemkinetics
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_GASKINETICS_H
10 #define CT_GASKINETICS_H
11 
12 #include "BulkKinetics.h"
13 #include "ThirdBodyCalc.h"
14 #include "FalloffMgr.h"
15 #include "Reaction.h"
16 
17 namespace Cantera
18 {
19 
20 /**
21  * Kinetics manager for elementary gas-phase chemistry. This kinetics manager
22  * implements standard mass-action reaction rate expressions for low-density
23  * gases.
24  * @ingroup kinetics
25  */
26 class GasKinetics : public BulkKinetics
27 {
28 public:
29  //! @name Constructors and General Information
30  //! @{
31 
32  //! Constructor.
33  /*!
34  * @param thermo Pointer to the gas ThermoPhase (optional)
35  */
37 
38  virtual std::string kineticsType() const {
39  return "Gas";
40  }
41 
42  //! @}
43  //! @name Reaction Rates Of Progress
44  //! @{
45 
46  virtual void getEquilibriumConstants(doublereal* kc);
47  virtual void getFwdRateConstants(doublereal* kfwd);
48 
49  //! @}
50  //! @name Reaction Mechanism Setup Routines
51  //! @{
52  virtual void init();
53  virtual bool addReaction(shared_ptr<Reaction> r);
54  virtual void modifyReaction(size_t i, shared_ptr<Reaction> rNew);
55  virtual void invalidateCache();
56  //@}
57 
58  void updateROP();
59 
60  //! Update temperature-dependent portions of reaction rates and falloff
61  //! functions.
62  virtual void update_rates_T();
63 
64  //! Update properties that depend on concentrations.
65  //! Currently the enhanced collision partner concentrations are updated
66  //! here, as well as the pressure-dependent portion of P-log and Chebyshev
67  //! reactions.
68  virtual void update_rates_C();
69 
70 protected:
71  //! Reaction index of each falloff reaction
72  std::vector<size_t> m_fallindx;
73 
74  //! Map of reaction index to falloff reaction index (i.e indices in
75  //! #m_falloff_low_rates and #m_falloff_high_rates)
76  std::map<size_t, size_t> m_rfallindx;
77 
78  //! Rate expressions for falloff reactions at the low-pressure limit
80 
81  //! Rate expressions for falloff reactions at the high-pressure limit
83 
84  FalloffMgr m_falloffn;
85 
86  ThirdBodyCalc m_3b_concm;
87  ThirdBodyCalc m_falloff_concm;
88 
89  Rate1<Plog> m_plog_rates;
90  Rate1<ChebyshevRate> m_cheb_rates;
91 
92  //! @name Reaction rate data
93  //!@{
94  doublereal m_logp_ref;
95  doublereal m_logc_ref;
96  doublereal m_logStandConc;
97  vector_fp m_rfn_low;
98  vector_fp m_rfn_high;
99 
100  doublereal m_pres; //!< Last pressure at which rates were evaluated
101  vector_fp falloff_work;
102  vector_fp concm_3b_values;
103  vector_fp concm_falloff_values;
104  //!@}
105 
106  void processFalloffReactions();
107 
108  void addThreeBodyReaction(ThreeBodyReaction& r);
109  void addFalloffReaction(FalloffReaction& r);
110  void addPlogReaction(PlogReaction& r);
111  void addChebyshevReaction(ChebyshevReaction& r);
112 
113  void modifyThreeBodyReaction(size_t i, ThreeBodyReaction& r);
114  void modifyFalloffReaction(size_t i, FalloffReaction& r);
115  void modifyPlogReaction(size_t i, PlogReaction& r);
116  void modifyChebyshevReaction(size_t i, ChebyshevReaction& r);
117 
118  //! Update the equilibrium constants in molar units.
119  void updateKc();
120 };
121 
122 }
123 
124 #endif
Partial specialization of Kinetics for chemistry in a single bulk phase.
Definition: BulkKinetics.h:22
A pressure-dependent reaction parameterized by a bi-variate Chebyshev polynomial in temperature and p...
Definition: Reaction.h:187
A falloff manager that implements any set of falloff functions.
Definition: FalloffMgr.h:23
A reaction that is first-order in [M] at low pressure, like a third-body reaction,...
Definition: Reaction.h:133
Kinetics manager for elementary gas-phase chemistry.
Definition: GasKinetics.h:27
virtual void init()
Prepare the class for the addition of reactions, after all phases have been added.
std::map< size_t, size_t > m_rfallindx
Map of reaction index to falloff reaction index (i.e indices in m_falloff_low_rates and m_falloff_hig...
Definition: GasKinetics.h:76
doublereal m_pres
Last pressure at which rates were evaluated.
Definition: GasKinetics.h:100
Rate1< Arrhenius > m_falloff_high_rates
Rate expressions for falloff reactions at the high-pressure limit.
Definition: GasKinetics.h:82
virtual void getFwdRateConstants(doublereal *kfwd)
Return the forward rate constants.
GasKinetics(thermo_t *thermo=0)
Constructor.
Definition: GasKinetics.cpp:14
virtual bool addReaction(shared_ptr< Reaction > r)
Add a single reaction to the mechanism.
void updateKc()
Update the equilibrium constants in molar units.
Definition: GasKinetics.cpp:91
virtual void modifyReaction(size_t i, shared_ptr< Reaction > rNew)
Modify the rate expression associated with a reaction.
virtual void update_rates_C()
Update properties that depend on concentrations.
Definition: GasKinetics.cpp:61
virtual void update_rates_T()
Update temperature-dependent portions of reaction rates and falloff functions.
Definition: GasKinetics.cpp:23
std::vector< size_t > m_fallindx
Reaction index of each falloff reaction.
Definition: GasKinetics.h:72
Rate1< Arrhenius > m_falloff_low_rates
Rate expressions for falloff reactions at the low-pressure limit.
Definition: GasKinetics.h:79
virtual void getEquilibriumConstants(doublereal *kc)
Return a vector of Equilibrium constants.
virtual std::string kineticsType() const
Identifies the Kinetics manager type.
Definition: GasKinetics.h:38
thermo_t & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
Definition: Kinetics.h:227
A pressure-dependent reaction parameterized by logarithmically interpolating between Arrhenius rate e...
Definition: Reaction.h:175
This rate coefficient manager supports one parameterization of the rate constant of any type.
Definition: RateCoeffMgr.h:22
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
Calculate and apply third-body effects on reaction rates, including non- unity third-body efficiencie...
Definition: ThirdBodyCalc.h:20
A reaction with a non-reacting third body "M" that acts to add or remove energy from the reacting spe...
Definition: Reaction.h:117
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:180
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:264