Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GasKinetics.h
Go to the documentation of this file.
1 /**
2  * @file GasKinetics.h
3  *
4  * @ingroup chemkinetics
5  */
6 
7 // Copyright 2001 California Institute of Technology
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
22  * kinetics manager implements standard mass-action reaction rate
23  * expressions for low-density 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  return cGasKinetics;
42  }
43 
44  //! @}
45  //! @name Reaction Rates Of Progress
46  //! @{
47 
48  virtual void getEquilibriumConstants(doublereal* kc);
49  virtual void getFwdRateConstants(doublereal* kfwd);
50 
51  //! @}
52  //! @name Reaction Mechanism Setup Routines
53  //! @{
54  virtual void init();
55  virtual void addReaction(ReactionData& r);
56  virtual bool addReaction(shared_ptr<Reaction> r);
57  virtual void modifyReaction(size_t i, shared_ptr<Reaction> rNew);
58  virtual void finalize();
59  virtual bool ready() const;
60  //@}
61 
62  void updateROP();
63 
64  //! Update temperature-dependent portions of reaction rates and falloff
65  //! functions.
66  virtual void update_rates_T();
67 
68  //! Update properties that depend on concentrations.
69  //! Currently the enhanced collision partner concentrations are updated
70  //! here, as well as the pressure-dependent portion of P-log and Chebyshev
71  //! reactions.
72  virtual void update_rates_C();
73 
74 protected:
75  size_t m_nfall;
76 
77  //! Reaction index of each falloff reaction
78  std::vector<size_t> m_fallindx;
79 
80  //! Map of reaction index to falloff reaction index (i.e indices in
81  //! #m_falloff_low_rates and #m_falloff_high_rates)
82  std::map<size_t, size_t> m_rfallindx;
83 
84  //! Rate expressions for falloff reactions at the low-pressure limit
86 
87  //! Rate expressions for falloff reactions at the high-pressure limit
89 
90  FalloffMgr m_falloffn;
91 
92  ThirdBodyCalc m_3b_concm;
93  ThirdBodyCalc m_falloff_concm;
94 
95  Rate1<Plog> m_plog_rates;
96  Rate1<ChebyshevRate> m_cheb_rates;
97 
98  //! @name Reaction rate data
99  //!@{
100  doublereal m_logp_ref;
101  doublereal m_logc_ref;
102  doublereal m_logStandConc;
103  vector_fp m_rfn_low;
104  vector_fp m_rfn_high;
105 
106  doublereal m_pres; //!< Last pressure at which rates were evaluated
107  vector_fp falloff_work;
108  vector_fp concm_3b_values;
109  vector_fp concm_falloff_values;
110  //!@}
111 
112  void processFalloffReactions();
113 
114  void addThreeBodyReaction(ReactionData& r);
115  void addFalloffReaction(ReactionData& r);
116  void addPlogReaction(ReactionData& r);
117  void addChebyshevReaction(ReactionData& r);
118 
119  void addThreeBodyReaction(ThreeBodyReaction& r);
120  void addFalloffReaction(FalloffReaction& r);
121  void addPlogReaction(PlogReaction& r);
122  void addChebyshevReaction(ChebyshevReaction& r);
123 
124  void modifyThreeBodyReaction(size_t i, ThreeBodyReaction& r);
125  void modifyFalloffReaction(size_t i, FalloffReaction& r);
126  void modifyPlogReaction(size_t i, PlogReaction& r);
127  void modifyChebyshevReaction(size_t i, ChebyshevReaction& r);
128 
129  //! Update the equilibrium constants in molar units.
130  void updateKc();
131 
132  bool m_finalized;
133 };
134 }
135 
136 #endif
A falloff manager that implements any set of falloff functions.
Definition: FalloffMgr.h:21
A pressure-dependent reaction parameterized by a bi-variate Chebyshev polynomial in temperature and p...
Definition: Reaction.h:178
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:285
virtual void getFwdRateConstants(doublereal *kfwd)
Return the forward rate constants.
virtual void init()
Prepare the class for the addition of reactions.
This rate coefficient manager supports one parameterization of the rate constant of any type...
Definition: RateCoeffMgr.h:20
Calculate and apply third-body effects on reaction rates, including non- unity third-body efficiencie...
Definition: ThirdBodyCalc.h:16
A pressure-dependent reaction parameterized by logarithmically interpolating between Arrhenius rate e...
Definition: Reaction.h:166
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:32
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:97
Partial specialization of Kinetics for chemistry in a single bulk phase.
Definition: BulkKinetics.h:18
virtual void getEquilibriumConstants(doublereal *kc)
Return a vector of Equilibrium constants.
virtual bool ready() const
Returns true if the kinetics manager has been properly initialized and finalized. ...
Rate1< Arrhenius > m_falloff_high_rates
Rate expressions for falloff reactions at the high-pressure limit.
Definition: GasKinetics.h:88
void updateKc()
Update the equilibrium constants in molar units.
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:126
Public interface for kinetics managers.
Definition: Kinetics.h:128
Intermediate class which stores data about a reaction and its rate parameterization before adding the...
Definition: ReactionData.h:22
GasKinetics(thermo_t *thermo=0)
Constructor.
Definition: GasKinetics.cpp:15
std::vector< size_t > m_fallindx
Reaction index of each falloff reaction.
Definition: GasKinetics.h:78
virtual Kinetics * duplMyselfAsKinetics(const std::vector< thermo_t * > &tpVector) const
Duplication routine for objects which inherit from Kinetics.
Definition: GasKinetics.cpp:25
virtual void update_rates_C()
Update properties that depend on concentrations.
Definition: GasKinetics.cpp:70
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
virtual int type() const
Identifies the kinetics manager type.
Definition: GasKinetics.h:40
virtual void addReaction(ReactionData &r)
Add a single reaction to the mechanism.
doublereal m_pres
Last pressure at which rates were evaluated.
Definition: GasKinetics.h:106
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:82
A reaction with a non-reacting third body "M" that acts to add or remove energy from the reacting spe...
Definition: Reaction.h:110
virtual void modifyReaction(size_t i, shared_ptr< Reaction > rNew)
Modify the rate expression associated with a reaction.
Rate1< Arrhenius > m_falloff_low_rates
Rate expressions for falloff reactions at the low-pressure limit.
Definition: GasKinetics.h:85
virtual void finalize()
Finish adding reactions and prepare for use.