22 WaterSSTP::WaterSSTP() :
29 m_allowGasPhase(false)
40 m_allowGasPhase(false)
52 m_allowGasPhase(false)
62 EW_Offset(b.EW_Offset),
63 SW_Offset(b.SW_Offset),
65 m_allowGasPhase(b.m_allowGasPhase)
116 "could not create new substance object.");
138 m_mw = 2.0 * mw_H + mw_O;
146 doublereal T = 298.15;
150 doublereal presLow = 1.0E-2;
151 doublereal oneBar = 1.0E5;
152 doublereal dd =
m_sub->
density(T, presLow, WATER_GAS, 7.0E-8);
158 if (s != 188.835E3) {
165 if (h != -241.826E6) {
195 eosdata.
_require(
"model",
"PureLiquidWater");
245 int waterState = WATER_GAS;
248 waterState = WATER_LIQUID;
264 int waterState = WATER_GAS;
267 waterState = WATER_LIQUID;
283 doublereal rt =
_RT();
284 for (
size_t k = 0; k <
m_kk; k++) {
294 int waterState = WATER_GAS;
297 waterState = WATER_LIQUID;
317 int waterState = WATER_GAS;
320 waterState = WATER_LIQUID;
337 int waterState = WATER_GAS;
340 waterState = WATER_LIQUID;
359 int waterState = WATER_GAS;
362 waterState = WATER_LIQUID;
384 doublereal dens_save =
density();
386 double tt = T - 0.04;
387 doublereal dd =
m_sub->
density(tt, pres, WATER_LIQUID, dens_save);
389 throw CanteraError(
"WaterSSTP::dthermalExpansionCoeffdT",
390 "Unable to solve for the density at T = " +
fp2str(tt) +
", P = " +
fp2str(pres));
395 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.
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.
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...
void setMoleFractions(const doublereal *const x)
Mole fractions are fixed, with x[0] = 1.0.
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...