From a9c6eb6fda0227dacbb6e0319a06d4fb0c5703b5 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 24 Apr 2015 18:53:02 -0400 Subject: [PATCH] [Kinetics] Add methods for inspecting ChebyshevRate objects --- include/cantera/kinetics/RxnRates.h | 41 +++++++++++++++++++++++++++++ src/kinetics/RxnRates.cpp | 12 +++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/include/cantera/kinetics/RxnRates.h b/include/cantera/kinetics/RxnRates.h index 6c175000e..abe7ec8ed 100644 --- a/include/cantera/kinetics/RxnRates.h +++ b/include/cantera/kinetics/RxnRates.h @@ -521,7 +521,48 @@ public: return false; } + //! Minimum valid temperature [K] + double Tmin() const { + return Tmin_; + } + + //! Maximum valid temperature [K] + double Tmax() const { + return Tmax_; + } + + //! Minimum valid pressure [Pa] + double Pmin() const { + return Pmin_; + } + + //! Maximum valid pressure [Pa] + double Pmax() const { + return Pmax_; + } + + //! Number of points in the pressure direction + size_t nPressure() const { + return nP_; + } + + //! Number of points in the temperature direction + size_t nTemperature() const { + return nT_; + } + + //! Access the Chebyshev coefficients. + /*! + * \f$ \alpha_{t,p} = \mathrm{coeffs}[N_P*t + p] \f$ where + * \f$ 0 <= t < N_T \f$ and \f$ 0 <= p < N_P \f$. + */ + const vector_fp& coeffs() const { + return chebCoeffs_; + } + protected: + double Tmin_, Tmax_; //!< valid temperature range + double Pmin_, Pmax_; //!< valid pressure range double TrNum_, TrDen_; //!< terms appearing in the reduced temperature double PrNum_, PrDen_; //!< terms appearing in the reduced pressure diff --git a/src/kinetics/RxnRates.cpp b/src/kinetics/RxnRates.cpp index aa16d17ff..43f4dd19c 100644 --- a/src/kinetics/RxnRates.cpp +++ b/src/kinetics/RxnRates.cpp @@ -245,7 +245,11 @@ std::vector > Plog::rates() const } ChebyshevRate::ChebyshevRate(const ReactionData& rdata) - : nP_(rdata.chebDegreeP) + : Tmin_(rdata.chebTmin) + , Tmax_(rdata.chebTmax) + , Pmin_(rdata.chebPmin) + , Pmax_(rdata.chebPmax) + , nP_(rdata.chebDegreeP) , nT_(rdata.chebDegreeT) , chebCoeffs_(rdata.chebCoeffs) , dotProd_(rdata.chebDegreeT) @@ -263,7 +267,11 @@ ChebyshevRate::ChebyshevRate(const ReactionData& rdata) ChebyshevRate::ChebyshevRate(double Pmin, double Pmax, double Tmin, double Tmax, const Array2D& coeffs) - : nP_(coeffs.nColumns()) + : Tmin_(Tmin) + , Tmax_(Tmax) + , Pmin_(Pmin) + , Pmax_(Pmax) + , nP_(coeffs.nColumns()) , nT_(coeffs.nRows()) , chebCoeffs_(coeffs.nColumns() * coeffs.nRows(), 0.0) , dotProd_(coeffs.nRows())