22 const vector<string> phases = {
23 "gas",
"liquid",
"supercritical",
"unstable-liquid",
"unstable-gas"
49 m_mw = 2.0 * mw_H + mw_O;
57 double presLow = 1.0E-2;
58 double oneBar = 1.0E5;
59 double dd =
m_sub.
density(T, presLow, WATER_GAS, 7.0E-8);
72 if (h != -241.826E6) {
108 throw CanteraError(
"waterSSTP::getGibbs_RT",
"Phase not ready");
116 throw CanteraError(
"waterSSTP::getStandardChemPotentials",
136 int waterState = WATER_GAS;
139 waterState = WATER_LIQUID;
143 throw CanteraError(
"WaterSSTP::getEnthalpy_RT_ref",
"error");
155 int waterState = WATER_GAS;
158 waterState = WATER_LIQUID;
162 throw CanteraError(
"WaterSSTP::getGibbs_RT_ref",
"error");
173 for (
size_t k = 0; k <
m_kk; k++) {
183 int waterState = WATER_GAS;
186 waterState = WATER_LIQUID;
191 throw CanteraError(
"WaterSSTP::getEntropy_R_ref",
"error");
205 int waterState = WATER_GAS;
208 waterState = WATER_LIQUID;
225 int waterState = WATER_GAS;
228 waterState = WATER_LIQUID;
232 throw CanteraError(
"WaterSSTP::getStandardVolumes_ref",
"error");
248 int waterState = WATER_SUPERCRIT;
251 waterState = WATER_LIQUID;
255 "Model assumes liquid phase; pressure p = {} lies below\n"
256 "the saturation pressure (P_sat = {}).", p, pp);
282 double tt = T - 0.04;
283 double dd =
m_sub.
density(tt, pres, WATER_LIQUID, dens_save);
285 throw CanteraError(
"WaterSSTP::dthermalExpansionCoeffdT",
286 "Unable to solve for the density at T = {}, P = {}", tt, pres);
291 return (val2 - vald) / 0.04;
313 "Model assumes liquid phase; temperature T = {} lies below\n"
314 "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.
double temperature() const
Temperature (K).
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
size_t elementIndex(const string &name) const
Return the index of element named 'name'.
double atomicWeight(size_t m) const
Atomic weight of element m.
virtual void setDensity(const double density_)
Set the internally stored density (kg/m^3) of the phase.
virtual double density() const
Density (kg/m^3).
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.
double enthalpy_mole() const override
Molar enthalpy. Units: J/kmol.
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
double RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
double coeffThermExp() const
Returns the coefficient of thermal expansion.
double density(double temperature, double pressure, int phase=-1, double rhoguess=-1.0)
Calculates the density given the temperature and the pressure, and a guess at the density.
double pressure() const
Calculates the pressure (Pascals), given the current value of the temperature and density.
double gibbs_mass() const
Get the Gibbs free energy (J/kg) at the current temperature and density.
double isothermalCompressibility() const
Returns the coefficient of isothermal compressibility for the state of the object.
double psat(double temperature, int waterState=WATER_LIQUID)
This function returns the saturation pressure given the temperature as an input parameter,...
double Pcrit() const
Returns the critical pressure of water (22.064E6 Pa)
double cv_mass() const
Get the constant volume heat capacity (J/kg/K) at the current temperature and density.
double entropy_mass() const
Get the entropy (J/kg/K) at the current temperature and density.
double Rhocrit() const
Return the critical density of water (kg m-3)
double Tcrit() const
Returns the critical temperature of water (Kelvin)
double cp_mass() const
Get the constant pressure heat capacity (J/kg/K) at the current temperature and density.
double intEnergy_mass() const
Get the internal energy (J/kg) at the current temperature and density.
void setState_TD(double temperature, double 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.
double enthalpy_mass() const
Get the enthalpy (J/kg) at the current temperature and density.
const double OneAtm
One atmosphere [Pa].
const double GasConstant
Universal Gas Constant [J/kmol/K].
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
Contains declarations for string manipulation functions within Cantera.