23 WaterSSTP::WaterSSTP() :
31 m_allowGasPhase(false)
43 m_allowGasPhase(false)
56 m_allowGasPhase(false)
66 EW_Offset(b.EW_Offset),
67 SW_Offset(b.SW_Offset),
69 m_allowGasPhase(b.m_allowGasPhase)
127 "could not create new substance object.");
149 m_mw = 2.0 * mw_H + mw_O;
157 doublereal T = 298.15;
161 doublereal presLow = 1.0E-2;
162 doublereal oneBar = 1.0E5;
163 doublereal dd =
m_sub->
density(T, presLow, WATER_GAS, 7.0E-8);
169 if (s != 188.835E3) {
177 if (h != -241.826E6) {
213 eosdata.
_require(
"model",
"PureLiquidWater");
271 int waterState = WATER_GAS;
274 waterState = WATER_LIQUID;
290 int waterState = WATER_GAS;
293 waterState = WATER_LIQUID;
309 doublereal rt =
_RT();
310 for (
size_t k = 0; k <
m_kk; k++) {
320 int waterState = WATER_GAS;
323 waterState = WATER_LIQUID;
343 int waterState = WATER_GAS;
346 waterState = WATER_LIQUID;
363 int waterState = WATER_GAS;
366 waterState = WATER_LIQUID;
386 int waterState = WATER_GAS;
389 waterState = WATER_LIQUID;
411 doublereal dens_save =
density();
413 double tt = T - 0.04;
414 doublereal dd =
m_sub->
density(tt, pres, WATER_LIQUID, dens_save);
416 throw CanteraError(
"WaterSSTP::dthermalExpansionCoeffdT",
417 "Unable to solve for the density at T = " +
fp2str(tt) +
", P = " +
fp2str(pres));
422 return (val2 - vald) / 0.04;
void _require(const std::string &a, const std::string &v) const
Require that the current xml node have an attribute named by the first argument, a, and that this attribute have the the string value listed in the second argument, v.
virtual doublereal density() const
Density (kg/m^3).
doublereal isothermalCompressibility() const
Returns the coefficient of isothermal compressibility for the state of the object.
XML_Node * findXMLPhase(XML_Node *root, const std::string &idtarget)
Search an XML_Node tree for a named phase XML_Node.
const doublereal OneAtm
One atmosphere [Pa].
doublereal Tcrit() const
Returns the critical temperature of water (Kelvin)
void setState_TR(doublereal temperature, doublereal rho)
Set the internal state of the object wrt temperature and density.
doublereal _RT() const
Return the Gas Constant multiplied by the current temperature.
const size_t npos
index returned by functions to indicate "no position"
doublereal cv() const
Calculate the constant volume heat capacity in mks units of J kmol-1 K-1 at the last temperature and ...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
doublereal density(doublereal temperature, doublereal pressure, int phase=-1, doublereal rhoguess=-1.0)
Calculates the density given the temperature and the pressure, and a guess at the density...
Class for calculating the equation of state of water.
doublereal atomicWeight(size_t m) const
Atomic weight of element m.
Class XML_Node is a tree-based representation of the contents of an XML file.
doublereal Gibbs() const
Calculate the Gibbs free energy in mks units of J kmol-1 K-1.
Header for a class used to house several approximation routines for properties of water...
doublereal coeffThermExp() const
Returns the coefficient of thermal expansion.
Base class for a phase with thermodynamic properties.
doublereal entropy() const
Calculate the entropy in mks units of J kmol-1 K-1.
bool importPhase(XML_Node &phase, ThermoPhase *th, SpeciesThermoFactory *spfactory)
Import a phase information into an empty thermophase object.
doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
The WaterProps class is used to house several approximation routines for properties of water...
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
doublereal enthalpy() const
Calculate the enthalpy in mks units of J kmol-1 using the last temperature and density.
Classes providing support for XML data files.
doublereal Rhocrit() const
Return the critical density of water (kg m-3)
doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
Base class for exceptions thrown by Cantera classes.
doublereal intEnergy() const
Calculate the internal energy in mks units of J kmol-1.
virtual void setMoleFractions(const doublereal *const x)
Set the mole fractions to the specified values There is no restriction on the sum of the mole fractio...
doublereal pressure() const
Calculates the pressure (Pascals), given the current value of the temperature and density...
virtual void initThermo()
void setMolecularWeight(const int k, const double mw)
Set the molecular weight of a single species to a given value.
doublereal temperature() const
Temperature (K).
doublereal Pcrit() const
Returns the critical pressure of water (22.064E6 Pa)
size_t elementIndex(const std::string &name) const
Return the index of element named 'name'.
virtual void setTemperature(const doublereal temp)
Set the internally stored temperature of the phase (K).
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Contains declarations for string manipulation functions within Cantera.
doublereal cp() const
Calculate the constant pressure heat capacity in mks units of J kmol-1 K-1 at the last temperature an...
size_t m_kk
Number of species in the phase.
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
SpeciesThermo * m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
The SingleSpeciesTP class is a filter class for ThermoPhase.
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase Note the density of a phase is an independent...
doublereal psat(doublereal temperature, int waterState=WATER_LIQUID)
This function returns the saturation pressure given the temperature as an input parameter, and sets the internal state to the saturated conditions.
Headers for a class for calculating the equation of state of water from the IAPWS 1995 Formulation ba...