8 #ifndef CT_SIMPLETHERMO_H
9 #define CT_SIMPLETHERMO_H
134 virtual void install(
const std::string& name,
size_t index,
int type,
const doublereal* c,
135 doublereal minTemp_, doublereal maxTemp_, doublereal refPressure_) {
138 m_t0.push_back(c[0]);
145 doublereal tlow = minTemp_;
146 doublereal thigh = maxTemp_;
155 if (
m_tlow.size() < index + 1) {
156 m_tlow.resize(index + 1, tlow);
157 m_thigh.resize(index + 1, thigh);
164 }
else if (fabs(
m_p0 - refPressure_) > 0.1) {
165 std::string logmsg =
" WARNING SimpleThermo: New Species, " + name +
166 ", has a different reference pressure, "
167 +
fp2str(refPressure_) +
", than existing reference pressure, " +
fp2str(
m_p0) +
"\n";
169 logmsg =
" This is now a fatal error\n";
171 throw CanteraError(
"install()",
"Species have different reference pressures");
180 virtual void update(doublereal t, doublereal* cp_R,
181 doublereal* h_RT, doublereal* s_R)
const {
183 doublereal logt = log(t);
184 doublereal rt = 1.0/t;
201 virtual void update_one(
size_t k, doublereal t, doublereal* cp_R,
202 doublereal* h_RT, doublereal* s_R)
const {
203 doublereal logt = log(t);
204 doublereal rt = 1.0/t;
205 size_t loc =
m_loc[k];
251 doublereal& minTemp_,
252 doublereal& maxTemp_,
253 doublereal& refPressure_)
const {
255 size_t loc =
m_loc[index];
267 #ifdef H298MODIFY_CAPABILITY
268 virtual doublereal reportOneHf298(
int k)
const {
272 virtual void modifyOneHf298(
const int k,
const doublereal Hf298New) {
273 throw CanteraError(
"reportHF298",
"unimplemented");
285 mutable std::map<size_t, size_t>
m_loc;
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
virtual void install(const std::string &name, size_t index, int type, const doublereal *c, doublereal minTemp_, doublereal maxTemp_, doublereal refPressure_)
Install a new species thermodynamic property parameterization for one species.
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for species k.
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
vector_fp m_s0_R
Vector of base dimensionless Entropies.
const size_t npos
index returned by functions to indicate "no position"
vector_fp m_logt0
Vector of base log temperatures (kelvin)
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, HTML_logs (see Input File Handling, Diagnostic Output, Writing messages to the screen and Writing HTML Logfiles).
virtual SpeciesThermo * duplMyselfAsSpeciesThermo() const
Duplication routine for objects derived from SpeciesThermo.
SimpleThermo & operator=(const SimpleThermo &right)
Assignment operator.
Pure Virtual base class for the species thermo manager classes.
std::map< size_t, size_t > m_loc
Mapping between the species index and the vector index where the coefficients are kept...
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
doublereal m_tlow_max
Maximum value of the low temperature limit.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
vector_fp m_tlow
Vector of low temperature limits (species index)
doublereal m_p0
Reference pressure (Pa)
virtual void install_STIT(SpeciesThermoInterpType *stit_ptr)
Install a new species thermodynamic property parameterization for one species.
virtual void update_one(size_t k, doublereal t, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Like update(), but only updates the single species k.
Base class for exceptions thrown by Cantera classes.
#define SIMPLE
Constant Cp thermo.
virtual void reportParams(size_t index, int &type, doublereal *const c, doublereal &minTemp_, doublereal &maxTemp_, doublereal &refPressure_) const
const int ID
The type of parameterization.
SimpleThermo()
Constructor.
size_t m_nspData
Number of species data points in the object.
This file contains descriptions of templated subclasses of the virtual base class, SpeciesThermo, which includes SpeciesThermoDuo (see Managers for Calculating Reference-State Thermodynamics and class SpeciesThermoDuo)
doublereal m_thigh_min
Minimum value of the high temperature limit.
SimpleThermo(const SimpleThermo &right)
Copy constructor.
vector_fp m_cp0_R
Vector of base dimensionless heat capacities.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
std::vector< size_t > m_index
Map between the vector index where the coefficients are kept and the species index.
vector_fp m_h0_R
Vector of base dimensionless Enthalpies.
void writelog(const std::string &msg)
Write a message to the screen.
virtual void update(doublereal t, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
vector_fp m_thigh
Vector of low temperature limits (species index)
vector_fp m_t0
Vector of base temperatures (kelvin)
virtual int reportType(size_t index) const
This utility function reports the type of parameterization used for the species with index number ind...