Cantera 2.6.0

RateCoeffMgr.h
Go to the documentation of this file.
1/**
2 * @file RateCoeffMgr.h
3 *
4 * @deprecated Deprecated in Cantera 2.6 and removed thereafter. Replaced by
5 * ReactionRate objects managed by MultiRate evaluators.
6 */
7
8// This file is part of Cantera. See License.txt in the top-level directory or
9// at https://cantera.org/license.txt for license and copyright information.
10
11#ifndef CT_RATECOEFF_MGR_H
12#define CT_RATECOEFF_MGR_H
13
14#include "RxnRates.h"
15
16 namespace Cantera
17{
18
19/**
20 * This rate coefficient manager supports one parameterization of
21 * the rate constant of any type.
22 *
23 * @deprecated Deprecated in Cantera 2.6 and removed thereafter. Replaced by
24 * ReactionRate objects managed by MultiRate evaluators.
25 */
26 template<class R>
27 class Rate1
28{
29 public:
30 Rate1() {}
31 virtual ~Rate1() {}
32
33 /**
34 * Install a rate coefficient calculator.
35 * @param rxnNumber the reaction number
36 * @param rate rate coefficient specification for the reaction
37 */
38 void install(size_t rxnNumber, const R& rate) {
39 m_rxn.push_back(rxnNumber);
40 m_rates.push_back(rate);
41 m_indices[rxnNumber] = m_rxn.size() - 1;
42 }
43
44 //! Replace an existing rate coefficient calculator
45 void replace(size_t rxnNumber, const R& rate) {
46 size_t i = m_indices[rxnNumber];
47 m_rates[i] = rate;
48 }
49
50 /**
51 * Update the concentration-dependent parts of the rate coefficient, if any.
52 * Used by class SurfaceArrhenius to compute coverage-dependent
53 * modifications to the Arrhenius parameters. The array c should contain
54 * whatever data the particular rate coefficient class needs to update its
55 * rates. Note that this method does not return anything. To get the
56 * updated rates, method update must be called after the call to update_C.
57 */
58 void update_C(const doublereal* c) {
59 for (size_t i = 0; i != m_rates.size(); i++) {
60 m_rates[i].update_C(c);
61 }
62 }
63
64 /**
65 * Write the rate coefficients into array values. Each calculator writes one
66 * entry in values, at the location specified by the reaction number when it
67 * was installed. Note that nothing will be done for reactions that have
68 * constant rates. The array values should be preloaded with the constant
69 * rate coefficients.
70 */
71 void update(doublereal T, doublereal logT, doublereal* values) {
72 doublereal recipT = 1.0/T;
73 for (size_t i = 0; i != m_rates.size(); i++) {
74 values[m_rxn[i]] = m_rates[i].updateRC(logT, recipT);
75 }
76 }
77
78 size_t nReactions() const {
79 return m_rates.size();
80 }
81
82 //! Return effective preexponent for the specified reaction.
83 /*!
84 * Returns effective preexponent, accounting for surface coverage
85 * dependencies. Used in InterfaceKinetics.
86 *
87 * @param irxn Reaction number in the kinetics mechanism
88 * @return Effective preexponent
89 */
90 double effectivePreExponentialFactor(size_t irxn) {
91 return m_rates[irxn].preExponentialFactor();
92 }
93
94 //! Return effective activation energy for the specified reaction.
95 /*!
96 * Returns effective activation energy, accounting for surface coverage
97 * dependencies. Used in InterfaceKinetics.
98 *
99 * @param irxn Reaction number in the kinetics mechanism
100 * @return Effective activation energy divided by the gas constant
101 */
102 double effectiveActivationEnergy_R(size_t irxn) {
103 return m_rates[irxn].activationEnergy_R();
104 }
105
106 //! Return effective temperature exponent for the specified reaction.
107 /*!
108 * Returns effective temperature exponent, accounting for surface coverage
109 * dependencies. Used in InterfaceKinetics. Current parameterization in
110 * SurfaceArrhenius does not change this parameter with the change in
111 * surface coverages.
112 *
113 * @param irxn Reaction number in the kinetics mechanism
114 * @return Effective temperature exponent
115 */
116 double effectiveTemperatureExponent(size_t irxn) {
117 return m_rates[irxn].temperatureExponent();
118 }
119
120 protected:
121 std::vector<R> m_rates;
122 std::vector<size_t> m_rxn;
123
124 //! map reaction number to index in m_rxn / m_rates
125 std::map<size_t, size_t> m_indices;
126};
127
128}
129
130#endif
RxnRates.h
Cantera::Rate1
This rate coefficient manager supports one parameterization of the rate constant of any type.
Definition: RateCoeffMgr.h:28
Cantera::Rate1::effectiveTemperatureExponent
double effectiveTemperatureExponent(size_t irxn)
Return effective temperature exponent for the specified reaction.
Definition: RateCoeffMgr.h:116
Cantera::Rate1::update_C
void update_C(const doublereal *c)
Update the concentration-dependent parts of the rate coefficient, if any.
Definition: RateCoeffMgr.h:58
Cantera::Rate1::m_indices
std::map< size_t, size_t > m_indices
map reaction number to index in m_rxn / m_rates
Definition: RateCoeffMgr.h:125
Cantera::Rate1::replace
void replace(size_t rxnNumber, const R &rate)
Replace an existing rate coefficient calculator.
Definition: RateCoeffMgr.h:45
Cantera::Rate1::update
void update(doublereal T, doublereal logT, doublereal *values)
Write the rate coefficients into array values.
Definition: RateCoeffMgr.h:71
Cantera::Rate1::effectiveActivationEnergy_R
double effectiveActivationEnergy_R(size_t irxn)
Return effective activation energy for the specified reaction.
Definition: RateCoeffMgr.h:102
Cantera::Rate1::effectivePreExponentialFactor
double effectivePreExponentialFactor(size_t irxn)
Return effective preexponent for the specified reaction.
Definition: RateCoeffMgr.h:90
Cantera::Rate1::install
void install(size_t rxnNumber, const R &rate)
Install a rate coefficient calculator.
Definition: RateCoeffMgr.h:38
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557