Skip to content

Commit

Permalink
[kinetics] Added some non-virtual methods to get effective rate param…
Browse files Browse the repository at this point in the history
…eters from SurfaceArrhenius throug InterfaceKinetics.
  • Loading branch information
imitrichev committed Oct 24, 2015
1 parent 02ee03f commit d366f9c
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 10 deletions.
12 changes: 12 additions & 0 deletions include/cantera/kinetics/InterfaceKinetics.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ class InterfaceKinetics : public Kinetics
virtual void getRevRateConstants(doublereal* krev,
bool doIrreversible = false);

doublereal getEffectivePreExponentialFactor(int rnum) {
return m_rates.getEffectivePreExponentialFactor(rnum);
}

doublereal getEffectiveActivationEnergy_R(int rnum) {
return m_rates.getEffectiveActivationEnergy_R(rnum);
}

doublereal getEffectiveTemperatureExponent(int rnum) {
return m_rates.getEffectiveTemperatureExponent(rnum);
}

//! @}
//! @name Reaction Mechanism Construction
//! @{
Expand Down
12 changes: 12 additions & 0 deletions include/cantera/kinetics/RateCoeffMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ class Rate1
return m_rates.size();
}

doublereal getEffectivePreExponentialFactor(int rnum) {
return m_rates[rnum].preExponentialFactor();
}

doublereal getEffectiveTemperatureExponent(int rnum) {
return m_rates[rnum].temperatureExponent();
}

doublereal getEffectiveActivationEnergy_R(int rnum) {
return m_rates[rnum].activationEnergy_R();
}

protected:
std::vector<R> m_rates;
std::vector<size_t> m_rxn;
Expand Down
39 changes: 32 additions & 7 deletions include/cantera/kinetics/RxnRates.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Arrhenius
* For this class, there are no
* concentration-dependent parts, so this method does nothing.
*/
void update_C(const doublereal* c) {
void update_C(const doublereal* theta) {
}

/**
Expand All @@ -72,18 +72,18 @@ class Arrhenius

//! Return the pre-exponential factor *A* (in m, kmol, s to powers depending
//! on the reaction order)
double preExponentialFactor() const {
doublereal preExponentialFactor() const {
return m_A;
}

//! Return the temperature exponent *b*
double temperatureExponent() const {
doublereal temperatureExponent() const {
return m_b;
}

//! Return the activation energy divided by the gas constant (i.e. the
//! activation temperature) [K]
doublereal activationEnergy_R() const {
virtual doublereal activationEnergy_R() const {
return m_E;
}

Expand Down Expand Up @@ -118,9 +118,9 @@ class SurfaceArrhenius
explicit SurfaceArrhenius(double A, double b, double Ta);

//! Add a coverage dependency for species *k*, with pre-exponential
//! dependence *a*, temperature exponent dependence *m* and activation
//! energy dependence *e*, where *e* is in Kelvin, i.e. energy divided by
//! the molar gas constant.
//! dependence *a*, rate constant exponential dependency *m* on coverage
//! and activation energy dependence *e*, where *e* is in Kelvin,
//! i.e. energy divided by the molar gas constant.
void addCoverageDependence(size_t k, doublereal a,
doublereal m, doublereal e);

Expand All @@ -142,6 +142,14 @@ class SurfaceArrhenius
}
}

/**
* Update the value of the natural logarithm of the rate constant.
*/
doublereal updateLog(doublereal logT, doublereal recipT) const {
return m_logA + std::log(10.0)*m_acov + m_b*logT -
(m_E + m_ecov)*recipT + m_mcov;
}

/**
* Update the value the rate constant.
*
Expand All @@ -153,6 +161,23 @@ class SurfaceArrhenius
(m_E + m_ecov)*recipT + m_mcov);
}

//! Return the pre-exponential factor *A* (in m, kmol, s to powers depending
//! on the reaction order) accounting coverage dependence
/*! Returns reaction prexponent accounting for both *a* and *m*,
* since *m* is not temperature-dependent and shouldn't be included in
* temperature exponent
*/
doublereal preExponentialFactor() const {
return m_A * std::exp(std::log(10.0)*m_acov + m_mcov);
}

//! Return effective temperature exponent
doublereal temperatureExponent() const {
return m_b;
}

//! Return the activation energy divided by the gas constant (i.e. the
//! activation temperature) [K], accounting coverage dependence
doublereal activationEnergy_R() const {
return m_E + m_ecov;
}
Expand Down
10 changes: 7 additions & 3 deletions src/kinetics/RxnRates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Arrhenius::Arrhenius(doublereal A, doublereal b, doublereal E)
if (m_A <= 0.0) {
m_logA = -1.0E300;
} else {
m_logA = log(m_A);
m_logA = std::log(m_A);
}
}

Expand All @@ -39,8 +39,7 @@ SurfaceArrhenius::SurfaceArrhenius()
}

SurfaceArrhenius::SurfaceArrhenius(double A, double b, double Ta)
: m_logA(std::log(A))
, m_b(b)
: m_b(b)
, m_E(Ta)
, m_A(A)
, m_acov(0.0)
Expand All @@ -49,6 +48,11 @@ SurfaceArrhenius::SurfaceArrhenius(double A, double b, double Ta)
, m_ncov(0)
, m_nmcov(0)
{
if (m_A <= 0.0) {
m_logA = -1.0E300;
} else {
m_logA = std::log(m_A);
}
}

void SurfaceArrhenius::addCoverageDependence(size_t k, doublereal a,
Expand Down

0 comments on commit d366f9c

Please sign in to comment.