From d3d303c4e996205665da496ee51c6eee7c3bb317 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 24 Apr 2015 16:43:37 -0400 Subject: [PATCH] [Kinetics] Add Plog::rates() for informational purposes --- include/cantera/kinetics/RxnRates.h | 4 ++++ src/kinetics/RxnRates.cpp | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/cantera/kinetics/RxnRates.h b/include/cantera/kinetics/RxnRates.h index e49ad18d9..11a76b926 100644 --- a/include/cantera/kinetics/RxnRates.h +++ b/include/cantera/kinetics/RxnRates.h @@ -409,6 +409,10 @@ public: //! has a negative pre-exponential factor. void validate(const std::string& equation); + //! Return the pressures and Arrhenius expressions which comprise this + //! reaction. + std::vector > rates() const; + protected: //! log(p) to (index range) in the rates_ vector std::map > pressures_; diff --git a/src/kinetics/RxnRates.cpp b/src/kinetics/RxnRates.cpp index c6fd84680..aa16d17ff 100644 --- a/src/kinetics/RxnRates.cpp +++ b/src/kinetics/RxnRates.cpp @@ -228,6 +228,22 @@ void Plog::validate(const std::string& equation) } } +std::vector > Plog::rates() const +{ + std::vector > R; + for (std::map >::const_iterator iter = ++pressures_.begin(); + iter != pressures_.end(); + ++iter) { + for (size_t i = iter->second.first; + i < iter->second.second; + i++) { + R.push_back(std::make_pair(std::exp(iter->first), rates_[i])); + } + } + R.pop_back(); // remove the last rate (introduced for P > P_max) + return R; +} + ChebyshevRate::ChebyshevRate(const ReactionData& rdata) : nP_(rdata.chebDegreeP) , nT_(rdata.chebDegreeT)