Cantera  2.3.0
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 http://www.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 Kinetics* duplMyselfAsKinetics(const std::vector<thermo_t*> & tpVector) const;
39 
40  virtual int type() const {
41  warn_deprecated("GasKinetics::type",
42  "To be removed after Cantera 2.3.");
43  return cGasKinetics;
44  }
45 
46  virtual std::string kineticsType() const {
47  return "Gas";
48  }
49 
50  //! @}
51  //! @name Reaction Rates Of Progress
52  //! @{
53 
54  virtual void getEquilibriumConstants(doublereal* kc);
55  virtual void getFwdRateConstants(doublereal* kfwd);
56 
57  //! @}
58  //! @name Reaction Mechanism Setup Routines
59  //! @{
60  virtual void init();
61  virtual bool addReaction(shared_ptr<Reaction> r);
62  virtual void modifyReaction(size_t i, shared_ptr<Reaction> rNew);
63  virtual void invalidateCache();
64  //@}
65 
66  void updateROP();
67 
68  //! Update temperature-dependent portions of reaction rates and falloff
69  //! functions.
70  virtual void update_rates_T();
71 
72  //! Update properties that depend on concentrations.
73  //! Currently the enhanced collision partner concentrations are updated
74  //! here, as well as the pressure-dependent portion of P-log and Chebyshev
75  //! reactions.
76  virtual void update_rates_C();
77 
78 protected:
79  //! Reaction index of each falloff reaction
80  std::vector<size_t> m_fallindx;
81 
82  //! Map of reaction index to falloff reaction index (i.e indices in
83  //! #m_falloff_low_rates and #m_falloff_high_rates)
84  std::map<size_t, size_t> m_rfallindx;
85 
86  //! Rate expressions for falloff reactions at the low-pressure limit
88 
89  //! Rate expressions for falloff reactions at the high-pressure limit
91 
92  FalloffMgr m_falloffn;
93 
94  ThirdBodyCalc m_3b_concm;
95  ThirdBodyCalc m_falloff_concm;
96 
97  Rate1<Plog> m_plog_rates;
98  Rate1<ChebyshevRate> m_cheb_rates;
99 
100  //! @name Reaction rate data
101  //!@{
102  doublereal m_logp_ref;
103  doublereal m_logc_ref;
104  doublereal m_logStandConc;
105  vector_fp m_rfn_low;
106  vector_fp m_rfn_high;
107 
108  doublereal m_pres; //!< Last pressure at which rates were evaluated
109  vector_fp falloff_work;
110  vector_fp concm_3b_values;
111  vector_fp concm_falloff_values;
112  //!@}
113 
114  void processFalloffReactions();
115 
116  void addThreeBodyReaction(ThreeBodyReaction& r);
117  void addFalloffReaction(FalloffReaction& r);
118  void addPlogReaction(PlogReaction& r);
119  void addChebyshevReaction(ChebyshevReaction& r);
120 
121  void modifyThreeBodyReaction(size_t i, ThreeBodyReaction& r);
122  void modifyFalloffReaction(size_t i, FalloffReaction& r);
123  void modifyPlogReaction(size_t i, PlogReaction& r);
124  void modifyChebyshevReaction(size_t i, ChebyshevReaction& r);
125 
126  //! Update the equilibrium constants in molar units.
127  void updateKc();
128 };
129 
130 }
131 
132 #endif
virtual std::string kineticsType() const
Identifies the Kinetics manager type.
Definition: GasKinetics.h:46
A falloff manager that implements any set of falloff functions.
Definition: FalloffMgr.h:22
A pressure-dependent reaction parameterized by a bi-variate Chebyshev polynomial in temperature and p...
Definition: Reaction.h:180
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:276
virtual void getFwdRateConstants(doublereal *kfwd)
Return the forward rate constants.
virtual void init()
Prepare the class for the addition of reactions, after all phases have been added.
This rate coefficient manager supports one parameterization of the rate constant of any type...
Definition: RateCoeffMgr.h:21
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
Calculate and apply third-body effects on reaction rates, including non- unity third-body efficiencie...
Definition: ThirdBodyCalc.h:19
A pressure-dependent reaction parameterized by logarithmically interpolating between Arrhenius rate e...
Definition: Reaction.h:168
Kinetics manager for elementary gas-phase chemistry.
Definition: GasKinetics.h:26
virtual void update_rates_T()
Update temperature-dependent portions of reaction rates and falloff functions.
Definition: GasKinetics.cpp:30
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
Partial specialization of Kinetics for chemistry in a single bulk phase.
Definition: BulkKinetics.h:21
virtual void getEquilibriumConstants(doublereal *kc)
Return a vector of Equilibrium constants.
Rate1< Arrhenius > m_falloff_high_rates
Rate expressions for falloff reactions at the high-pressure limit.
Definition: GasKinetics.h:90
void updateKc()
Update the equilibrium constants in molar units.
Definition: GasKinetics.cpp:98
A reaction that is first-order in [M] at low pressure, like a third-body reaction, but zeroth-order in [M] as pressure increases.
Definition: Reaction.h:128
Public interface for kinetics managers.
Definition: Kinetics.h:111
GasKinetics(thermo_t *thermo=0)
Constructor.
Definition: GasKinetics.cpp:14
virtual int type() const
Identifies the kinetics manager type.
Definition: GasKinetics.h:40
std::vector< size_t > m_fallindx
Reaction index of each falloff reaction.
Definition: GasKinetics.h:80
virtual bool addReaction(shared_ptr< Reaction > r)
Add a single reaction to the mechanism.
virtual void update_rates_C()
Update properties that depend on concentrations.
Definition: GasKinetics.cpp:68
virtual Kinetics * duplMyselfAsKinetics(const std::vector< thermo_t *> &tpVector) const
Duplication routine for objects which inherit from Kinetics.
Definition: GasKinetics.cpp:23
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:157
doublereal m_pres
Last pressure at which rates were evaluated.
Definition: GasKinetics.h:108
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:84
A reaction with a non-reacting third body "M" that acts to add or remove energy from the reacting spe...
Definition: Reaction.h:112
virtual void modifyReaction(size_t i, shared_ptr< Reaction > rNew)
Modify the rate expression associated with a reaction.
Namespace for the Cantera kernel.
Definition: application.cpp:29
Rate1< Arrhenius > m_falloff_low_rates
Rate expressions for falloff reactions at the low-pressure limit.
Definition: GasKinetics.h:87