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)