Go to the documentation of this file.
18 WaterSSTP::WaterSSTP() :
23 m_allowGasPhase(false)
32 m_allowGasPhase(false)
42 m_allowGasPhase(false)
48 const vector<std::string> phases = {
49 "gas",
"liquid",
"supercritical",
"unstable-liquid",
"unstable-gas"
75 m_mw = 2.0 * mw_H + mw_O;
79 doublereal T = 298.15;
83 doublereal presLow = 1.0E-2;
84 doublereal oneBar = 1.0E5;
85 doublereal dd =
m_sub.
density(T, presLow, WATER_GAS, 7.0E-8);
98 if (h != -241.826E6) {
116 eosdata.
_require(
"model",
"PureLiquidWater");
138 throw CanteraError(
"waterSSTP::getGibbs_RT",
"Phase not ready");
146 throw CanteraError(
"waterSSTP::getStandardChemPotentials",
166 int waterState = WATER_GAS;
169 waterState = WATER_LIQUID;
173 throw CanteraError(
"WaterSSTP::getEnthalpy_RT_ref",
"error");
185 int waterState = WATER_GAS;
188 waterState = WATER_LIQUID;
192 throw CanteraError(
"WaterSSTP::getGibbs_RT_ref",
"error");
203 for (
size_t k = 0; k <
m_kk; k++) {
213 int waterState = WATER_GAS;
216 waterState = WATER_LIQUID;
221 throw CanteraError(
"WaterSSTP::getEntropy_R_ref",
"error");
235 int waterState = WATER_GAS;
238 waterState = WATER_LIQUID;
255 int waterState = WATER_GAS;
258 waterState = WATER_LIQUID;
262 throw CanteraError(
"WaterSSTP::getStandardVolumes_ref",
"error");
278 int waterState = WATER_SUPERCRIT;
281 waterState = WATER_LIQUID;
285 "Model assumes liquid phase; pressure p = {} lies below\n"
286 "the saturation pressure (P_sat = {}).", p, pp);
310 doublereal dens_save =
density();
312 double tt = T - 0.04;
313 doublereal dd =
m_sub.
density(tt, pres, WATER_LIQUID, dens_save);
315 throw CanteraError(
"WaterSSTP::dthermalExpansionCoeffdT",
316 "Unable to solve for the density at T = {}, P = {}", tt, pres);
321 return (val2 - vald) / 0.04;
343 "Model assumes liquid phase; temperature T = {} lies below\n"
344 "the triple point temperature (T_triple = 273.16).", temp);
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
doublereal enthalpy() const
Calculate the enthalpy in mks units of J kmol-1 using the last temperature and density.
doublereal entropy() const
Calculate the entropy in mks units of J kmol-1 K-1.
doublereal Pcrit() const
Returns the critical pressure of water (22.064E6 Pa)
void setState_TR(doublereal temperature, doublereal rho)
Set the internal state of the object wrt temperature and density.
void setMolecularWeight(const int k, const double mw)
Set the molecular weight of a single species to a given value.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
virtual void setTemperature(const doublereal temp)
Set the internally stored temperature of the phase (K).
doublereal intEnergy() const
Calculate the internal energy in mks units of J kmol-1.
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.
doublereal isothermalCompressibility() const
Returns the coefficient of isothermal compressibility for the state of the object.
doublereal pressure() const
Calculates the pressure (Pascals), given the current value of the temperature and density.
size_t m_kk
Number of species in the phase.
doublereal Rhocrit() const
Return the critical density of water (kg m-3)
virtual double density() const
Density (kg/m^3).
doublereal cp() const
Calculate the constant pressure heat capacity in mks units of J kmol-1 K-1 at the last temperature an...
doublereal coeffThermExp() const
Returns the coefficient of thermal expansion.
Class XML_Node is a tree-based representation of the contents of an XML file.
const double OneAtm
One atmosphere [Pa].
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
The WaterProps class is used to house several approximation routines for properties of water.
size_t elementIndex(const std::string &name) const
Return the index of element named 'name'.
doublereal temperature() const
Temperature (K).
doublereal Tcrit() const
Returns the critical temperature of water (Kelvin)
virtual void setDensity(const double density_)
Set the internally stored density (kg/m^3) of the phase.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
doublereal Gibbs() const
Calculate the Gibbs free energy in mks units of J kmol-1 K-1.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
const double GasConstant
Universal Gas Constant [J/kmol/K].
doublereal cv() const
Calculate the constant volume heat capacity in mks units of J kmol-1 K-1 at the last temperature and ...
doublereal atomicWeight(size_t m) const
Atomic weight of element m.
doublereal psat(doublereal temperature, int waterState=WATER_LIQUID)
This function returns the saturation pressure given the temperature as an input parameter,...
Base class for exceptions thrown by Cantera classes.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
void _require(const std::string &a, const std::string &v) const
Require that the current XML node has an attribute named by the first argument, a,...
const size_t npos
index returned by functions to indicate "no position"
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
Namespace for the Cantera kernel.