8 #ifndef CT_SIMPLETHERMO_H
9 #define CT_SIMPLETHERMO_H
64 "Cantera 2.2. Use GeneralSpeciesThermo instead.");
96 SpeciesThermo::operator=(right);
141 virtual void install(
const std::string& name,
size_t index,
int type,
const doublereal* c,
142 doublereal minTemp_, doublereal maxTemp_, doublereal refPressure_) {
145 "Incompatible thermo parameterization: Got " +
150 m_t0.push_back(c[0]);
157 doublereal tlow = minTemp_;
158 doublereal thigh = maxTemp_;
162 if (
m_tlow.size() < index + 1) {
163 m_tlow.resize(index + 1, tlow);
164 m_thigh.resize(index + 1, thigh);
171 }
else if (fabs(
m_p0 - refPressure_) > 0.1) {
172 std::string logmsg =
" WARNING SimpleThermo: New Species, " + name +
173 ", has a different reference pressure, "
174 +
fp2str(refPressure_) +
", than existing reference pressure, " +
fp2str(
m_p0) +
"\n";
176 logmsg =
" This is now a fatal error\n";
178 throw CanteraError(
"install()",
"Species have different reference pressures");
185 shared_ptr<SpeciesThermoInterpType> stit_ptr) {
189 virtual void update(doublereal t, doublereal* cp_R,
190 doublereal* h_RT, doublereal* s_R)
const {
192 doublereal logt = log(t);
193 doublereal rt = 1.0/t;
210 virtual void update_one(
size_t k, doublereal t, doublereal* cp_R,
211 doublereal* h_RT, doublereal* s_R)
const {
212 doublereal logt = log(t);
213 doublereal rt = 1.0/t;
259 doublereal& minTemp_,
260 doublereal& maxTemp_,
261 doublereal& refPressure_)
const {
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
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.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
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)
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).
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.
virtual void install_STIT(size_t index, shared_ptr< SpeciesThermoInterpType > stit_ptr)
Install a new species thermodynamic property parameterization for one species.
std::map< size_t, size_t > m_loc
Mapping between the species index and the vector index where the coefficients are kept...
void markInstalled(size_t k)
Mark species k as having its thermodynamic data installed.
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.
virtual doublereal reportOneHf298(const size_t k) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) ...
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 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.
const U & getValue(const std::map< T, U > &m, const T &key)
Const accessor for a value in a std::map.
#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].
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J ...
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...