23 m_allowGasPhase(false)
33 m_allowGasPhase(false)
39 const vector<std::string> phases = {
40 "gas",
"liquid",
"supercritical",
"unstable-liquid",
"unstable-gas"
66 m_mw = 2.0 * mw_H + mw_O;
70 doublereal T = 298.15;
74 doublereal presLow = 1.0E-2;
75 doublereal oneBar = 1.0E5;
76 doublereal dd =
m_sub.
density(T, presLow, WATER_GAS, 7.0E-8);
89 if (h != -241.826E6) {
107 eosdata.
_require(
"model",
"PureLiquidWater");
129 throw CanteraError(
"waterSSTP::getGibbs_RT",
"Phase not ready");
137 throw CanteraError(
"waterSSTP::getStandardChemPotentials",
157 int waterState = WATER_GAS;
160 waterState = WATER_LIQUID;
164 throw CanteraError(
"WaterSSTP::getEnthalpy_RT_ref",
"error");
176 int waterState = WATER_GAS;
179 waterState = WATER_LIQUID;
183 throw CanteraError(
"WaterSSTP::getGibbs_RT_ref",
"error");
194 for (
size_t k = 0; k <
m_kk; k++) {
204 int waterState = WATER_GAS;
207 waterState = WATER_LIQUID;
212 throw CanteraError(
"WaterSSTP::getEntropy_R_ref",
"error");
226 int waterState = WATER_GAS;
229 waterState = WATER_LIQUID;
246 int waterState = WATER_GAS;
249 waterState = WATER_LIQUID;
253 throw CanteraError(
"WaterSSTP::getStandardVolumes_ref",
"error");
269 int waterState = WATER_SUPERCRIT;
272 waterState = WATER_LIQUID;
276 "Model assumes liquid phase; pressure p = {} lies below\n"
277 "the saturation pressure (P_sat = {}).", p, pp);
301 doublereal dens_save =
density();
303 double tt = T - 0.04;
304 doublereal dd =
m_sub.
density(tt, pres, WATER_LIQUID, dens_save);
306 throw CanteraError(
"WaterSSTP::dthermalExpansionCoeffdT",
307 "Unable to solve for the density at T = {}, P = {}", tt, pres);
312 return (val2 - vald) / 0.04;
334 "Model assumes liquid phase; temperature T = {} lies below\n"
335 "the triple point temperature (T_triple = 273.16).", temp);
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Base class for exceptions thrown by Cantera classes.
size_t m_kk
Number of species in the phase.
doublereal atomicWeight(size_t m) const
Atomic weight of element m.
size_t elementIndex(const std::string &name) const
Return the index of element named 'name'.
virtual void setDensity(const double density_)
Set the internally stored density (kg/m^3) of the phase.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
virtual double density() const
Density (kg/m^3).
doublereal temperature() const
Temperature (K).
virtual void setTemperature(double temp)
Set the internally stored temperature of the phase (K).
void setMolecularWeight(const int k, const double mw)
Set the molecular weight of a single species to a given value.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
void initThermoFile(const std::string &inputFile, const std::string &id)
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
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 coeffThermExp() const
Returns the coefficient of thermal expansion.
doublereal cp() const
Calculate the constant pressure heat capacity in mks units of J kmol-1 K-1 at the last temperature an...
doublereal pressure() const
Calculates the pressure (Pascals), given the current value of the temperature and density.
doublereal enthalpy() const
Calculate the enthalpy in mks units of J kmol-1 using the last temperature and density.
doublereal Tcrit() const
Returns the critical temperature of water (Kelvin)
doublereal cv() const
Calculate the constant volume heat capacity in mks units of J kmol-1 K-1 at the last temperature and ...
doublereal entropy() const
Calculate the entropy in mks units of J kmol-1 K-1.
doublereal intEnergy() const
Calculate the internal energy in mks units of J kmol-1.
doublereal Rhocrit() const
Return the critical density of water (kg m-3)
doublereal Gibbs() const
Calculate the Gibbs free energy in mks units of J kmol-1 K-1.
doublereal psat(doublereal temperature, int waterState=WATER_LIQUID)
This function returns the saturation pressure given the temperature as an input parameter,...
void setState_TR(doublereal temperature, doublereal rho)
Set the internal state of the object wrt temperature and density.
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
doublereal isothermalCompressibility() const
Returns the coefficient of isothermal compressibility for the state of the object.
doublereal Pcrit() const
Returns the critical pressure of water (22.064E6 Pa)
The WaterProps class is used to house several approximation routines for properties of water.
Class XML_Node is a tree-based representation of the contents of an XML file.
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,...
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
const double OneAtm
One atmosphere [Pa].
const double GasConstant
Universal Gas Constant [J/kmol/K].
Contains declarations for string manipulation functions within Cantera.