www.mooseframework.org
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Water97FluidProperties Class Reference

Water (H2O) fluid properties as a function of pressure (Pa) and temperature (K) from IAPWS-IF97: Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. More...

#include <Water97FluidProperties.h>

Inheritance diagram for Water97FluidProperties:
[legend]

Public Member Functions

 Water97FluidProperties (const InputParameters &parameters)
 
virtual ~Water97FluidProperties ()
 
virtual std::string fluidName () const override
 Fluid name. More...
 
virtual Real molarMass () const override
 Molar mass [kg/mol]. More...
 
virtual Real criticalPressure () const override
 Critical pressure. More...
 
virtual Real criticalTemperature () const override
 Critical temperature. More...
 
virtual Real criticalDensity () const override
 Critical density. More...
 
virtual Real triplePointPressure () const override
 Triple point pressure. More...
 
virtual Real triplePointTemperature () const override
 Triple point temperature. More...
 
virtual Real rho_from_p_T (Real pressure, Real temperature) const override
 
virtual void rho_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
 
virtual Real e_from_p_T (Real pressure, Real temperature) const override
 Internal energy from pressure and temperature. More...
 
virtual void e_from_p_T (Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const override
 Internal energy and its derivatives from pressure and temperature. More...
 
virtual Real c_from_p_T (Real pressure, Real temperature) const override
 
virtual Real cp_from_p_T (Real pressure, Real temperature) const override
 
virtual Real cv_from_p_T (Real pressure, Real temperature) const override
 
virtual Real mu_from_p_T (Real pressure, Real temperature) const override
 
virtual void mu_from_p_T (Real pressure, Real temperature, Real &mu, Real &dmu_dp, Real &dmu_dT) const override
 
virtual Real mu_from_rho_T (Real density, Real temperature) const override
 
virtual void mu_from_rho_T (Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const override
 Dynamic viscosity and its derivatives wrt density and temperature TODO: this shouldn't need 3 input args - AD will assume/call the 2-input version. More...
 
virtual void rho_mu_from_p_T (Real pressure, Real temperature, Real &rho, Real &mu) const override
 
virtual void rho_mu_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &mu, Real &dmu_dp, Real &dmu_dT) const override
 Density and viscosity and their derivatives wrt pressure and temperature. More...
 
virtual Real k_from_p_T (Real pressure, Real temperature) const override
 
virtual void k_from_p_T (Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const override
 
virtual Real k_from_rho_T (Real density, Real temperature) const override
 
virtual Real s_from_p_T (Real pressure, Real temperature) const override
 
virtual void s_from_p_T (Real p, Real T, Real &s, Real &ds_dp, Real &ds_dT) const override
 
virtual Real h_from_p_T (Real pressure, Real temperature) const override
 
virtual void h_from_p_T (Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const override
 
virtual Real vaporPressure (Real temperature) const override
 Vapor pressure. More...
 
virtual void vaporPressure (Real temperature, Real &psat, Real &dpsat_dT) const override
 Vapor pressure. More...
 
Real vaporTemperature (Real pressure) const
 Saturation temperature as a function of pressure. More...
 
Real b23p (Real temperature) const
 Auxillary equation for the boundary between regions 2 and 3. More...
 
Real b23T (Real pressure) const
 Auxillary equation for the boundary between regions 2 and 3. More...
 
unsigned int inRegion (Real pressure, Real temperature) const
 Determines the phase region that the given pressure and temperature values lie in. More...
 
unsigned int subregion3 (Real pressure, Real temperature) const
 Provides the correct subregion index for a (P,T) point in region 3. More...
 
Real subregionVolume (Real pi, Real theta, Real a, Real b, Real c, Real d, Real e, unsigned int sid) const
 Specific volume in all subregions of region 3 EXCEPT subregion n (13). More...
 
Real densityRegion3 (Real pressure, Real temperature) const
 Density function for Region 3 - supercritical water and steam. More...
 
virtual Real temperature_from_ph (Real pressure, Real enthalpy) const
 Backwards equation T(p, h) From Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. More...
 
Real b2bc (Real pressure) const
 Boundary between subregions b and c in region 2. More...
 
Real b3ab (Real pressure) const
 Boundary between subregions a and b in region 3. More...
 
virtual Real rho (Real p, Real T) const
 Density from pressure and temperature. More...
 
e e e e s T T T T T rho v v T virtual e Real s (Real pressure, Real temperature) const
 
virtual Real beta_from_p_T (Real, Real) const
 
virtual void beta_from_p_T (Real, Real, Real &, Real &, Real &) const
 
virtual void rho_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const
 Density and its derivatives from pressure and temperature. More...
 
virtual Real v_from_p_T (Real p, Real T) const
 Specific volume from pressure and temperature. More...
 
virtual void v_from_p_T (Real p, Real T, Real &v, Real &dv_dp, Real &dv_dT) const
 Specific volume and its derivatives from pressure and temperature. More...
 
virtual Real e_spndl_from_v (Real v) const
 Specific internal energy from temperature and specific volume. More...
 
virtual void v_e_spndl_from_T (Real T, Real &v, Real &e) const
 Specific internal energy from temperature and specific volume. More...
 
virtual Real h (Real p, Real T) const
 Specific enthalpy from pressure and temperature. More...
 
virtual void h_dpT (Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const
 Specific enthalpy and its derivatives from pressure and temperature. More...
 
virtual Real e (Real pressure, Real temperature) const
 
virtual void e_dpT (Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const
 
virtual Real beta (Real pressure, Real temperature) const
 
virtual Real T_from_p_h (Real pressure, Real enthalpy) const
 Temperature from pressure and specific enthalpy. More...
 
virtual Real criticalInternalEnergy () const
 Critical specific internal energy. More...
 
virtual void rho_e_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const
 Density and internal energy and their derivatives wrt pressure and temperature. More...
 
virtual void rho_e_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const
 
virtual Real c (Real pressure, Real temperature) const
 
virtual Real gamma_from_v_e (Real v, Real e) const
 Adiabatic index - ratio of specific heats. More...
 
virtual Real gamma_from_p_T (Real pressure, Real temperature) const
 Adiabatic index - ratio of specific heats. More...
 
virtual Real mu (Real pressure, Real temperature) const
 Dynamic viscosity. More...
 
virtual void mu_dpT (Real pressure, Real temperature, Real &mu, Real &dmu_dp, Real &dmu_dT) const
 Dynamic viscosity and its derivatives wrt pressure and temperature. More...
 
virtual void mu_drhoT_from_rho_T (Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const
 
virtual void rho_mu (Real pressure, Real temperature, Real &rho, Real &mu) const
 Density and viscosity. More...
 
virtual void rho_mu_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &mu, Real &dmu_dp, Real &dmu_dT) const
 
virtual Real k (Real pressure, Real temperature) const
 Thermal conductivity. More...
 
virtual void k_dpT (Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const
 Thermal conductivity and its derivatives wrt pressure and temperature. More...
 
virtual Real henryConstant (Real temperature) const
 Henry's law constant for dissolution in water. More...
 
virtual void henryConstant (Real temperature, Real &Kh, Real &dKh_dT) const
 Henry's law constant for dissolution in water and derivative wrt temperature. More...
 
virtual void henryConstant_dT (Real temperature, Real &Kh, Real &dKh_dT) const
 
virtual void vaporPressure_dT (Real temperature, Real &psat, Real &dpsat_dT) const
 
virtual void execute () final
 
virtual void initialize () final
 
virtual void finalize () final
 
virtual void threadJoin (const UserObject &) final
 
virtual void subdomainSetup () final
 

Protected Types

enum  subregionEnum {
  AB, CD, GH, IJ,
  JK, MN, OP, QU,
  RX, UV, WX, EF
}
 Enum of subregion ids for region 3. More...
 

Protected Member Functions

Real gamma1 (Real pi, Real tau) const
 Gibbs free energy in Region 1 - single phase liquid region. More...
 
Real dgamma1_dpi (Real pi, Real tau) const
 Derivative of Gibbs free energy in Region 1 wrt pi. More...
 
Real d2gamma1_dpi2 (Real pi, Real tau) const
 Second derivative of Gibbs free energy in Region 1 wrt pi. More...
 
Real dgamma1_dtau (Real pi, Real tau) const
 Derivative of Gibbs free energy in Region 1 wrt tau. More...
 
Real d2gamma1_dtau2 (Real pi, Real tau) const
 Second derivative of Gibbs free energy in Region 1 wrt tau. More...
 
Real d2gamma1_dpitau (Real pi, Real tau) const
 Second derivative of Gibbs free energy in Region 1 wrt pi and tau. More...
 
Real gamma2 (Real pi, Real tau) const
 Gibbs free energy in Region 2 - superheated steam. More...
 
Real dgamma2_dpi (Real pi, Real tau) const
 Derivative of Gibbs free energy in Region 2 wrt pi. More...
 
Real d2gamma2_dpi2 (Real pi, Real tau) const
 Second derivative of Gibbs free energy in Region 2 wrt pi. More...
 
Real dgamma2_dtau (Real pi, Real tau) const
 Derivative of Gibbs free energy in Region 2 wrt tau. More...
 
Real d2gamma2_dtau2 (Real pi, Real tau) const
 Second derivative of Gibbs free energy in Region 2 wrt tau. More...
 
Real d2gamma2_dpitau (Real pi, Real tau) const
 Second derivative of Gibbs free energy in Region 2 wrt pi and tau. More...
 
Real phi3 (Real delta, Real tau) const
 Helmholtz free energy in Region 3. More...
 
Real dphi3_ddelta (Real delta, Real tau) const
 Derivative of Helmholtz free energy in Region 3 wrt delta. More...
 
Real d2phi3_ddelta2 (Real delta, Real tau) const
 Second derivative of Helmholtz free energy in Region 3 wrt delta. More...
 
Real dphi3_dtau (Real delta, Real tau) const
 Derivative of Helmholtz free energy in Region 3 wrt tau. More...
 
Real d2phi3_dtau2 (Real delta, Real tau) const
 Second derivative of Helmholtz free energy in Region 3 wrt tau. More...
 
Real d2phi3_ddeltatau (Real delta, Real tau) const
 Second derivative of Helmholtz free energy in Region 3 wrt delta and tau. More...
 
Real gamma5 (Real pi, Real tau) const
 Gibbs free energy in Region 5. More...
 
Real dgamma5_dpi (Real pi, Real tau) const
 Derivative of Gibbs free energy in Region 5 wrt pi. More...
 
Real d2gamma5_dpi2 (Real pi, Real tau) const
 Second derivative of Gibbs free energy in Region 5 wrt pi. More...
 
Real dgamma5_dtau (Real pi, Real tau) const
 Derivative of Gibbs free energy in Region 5 wrt tau. More...
 
Real d2gamma5_dtau2 (Real pi, Real tau) const
 Second derivative of Gibbs free energy in Region 5 wrt tau. More...
 
Real d2gamma5_dpitau (Real pi, Real tau) const
 Second derivative of Gibbs free energy in Region 5 wrt pi and tau. More...
 
Real tempXY (Real pressure, subregionEnum xy) const
 Boundaries between subregions in region 3. More...
 
unsigned int inRegionPH (Real pressure, Real enthalpy) const
 Determines the phase region that the given pressure and enthaply values lie in. More...
 
unsigned int subregion2ph (Real pressure, Real enthalpy) const
 Provides the correct subregion index for a (P,h) point in region 2. More...
 
unsigned int subregion3ph (Real pressure, Real enthalpy) const
 Provides the correct subregion index for a (P,h) point in region 3. More...
 
Real temperature_from_ph1 (Real pressure, Real enthalpy) const
 Backwards equation T(p, h) in Region 1 Eq. More...
 
Real temperature_from_ph2a (Real pressure, Real enthalpy) const
 Backwards equation T(p, h) in Region 2a Eq. More...
 
Real temperature_from_ph2b (Real pressure, Real enthalpy) const
 Backwards equation T(p, h) in Region 2b Eq. More...
 
Real temperature_from_ph2c (Real pressure, Real enthalpy) const
 Backwards equation T(p, h) in Region 2c Eq. More...
 
Real temperature_from_ph3a (Real pressure, Real enthalpy) const
 Backwards equation T(p, h) in Region 3a Eq. More...
 
Real temperature_from_ph3b (Real pressure, Real enthalpy) const
 Backwards equation T(p, h) in Region 3b Eq. More...
 
virtual Real henryConstantIAPWS (Real temperature, Real A, Real B, Real C) const
 IAPWS formulation of Henry's law constant for dissolution in water From Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H20 and D20 at high temperatures, IAPWS (2004) More...
 
virtual void henryConstantIAPWS (Real temperature, Real &Kh, Real &dKh_dT, Real A, Real B, Real C) const
 
virtual void henryConstantIAPWS_dT (Real temperature, Real &Kh, Real &dKh_dT, Real A, Real B, Real C) const
 

Protected Attributes

const Real _Mh2o
 Water molar mass (kg/mol) More...
 
const Real _Rw
 Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) More...
 
const Real _p_critical
 Critical pressure (Pa) More...
 
const Real _T_critical
 Critical temperature (K) More...
 
const Real _rho_critical
 Critical density (kg/m^3) More...
 
const Real _p_triple
 Triple point pressure (Pa) More...
 
const Real _T_triple
 Triple point temperature (K) More...
 
const std::array< Real, 34 > _n1
 Reference constants used in to calculate thermophysical properties of water. More...
 
const std::array< int, 34 > _I1
 
const std::array< int, 34 > _J1
 
const std::array< Real, 20 > _nph1
 
const std::array< int, 20 > _Iph1 {{0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6}}
 
const std::array< int, 20 > _Jph1
 
const std::array< Real, 9 > _n02
 Constants for region 2. More...
 
const std::array< Real, 43 > _n2
 
const std::array< int, 9 > _J02 {{0, 1, -5, -4, -3, -2, -1, 2, 3}}
 
const std::array< int, 43 > _I2
 
const std::array< int, 43 > _J2
 
const std::array< Real, 36 > _nph2a
 
const std::array< int, 36 > _Iph2a
 
const std::array< int, 36 > _Jph2a
 
const std::array< Real, 38 > _nph2b
 
const std::array< int, 38 > _Iph2b
 
const std::array< int, 38 > _Jph2b
 
const std::array< Real, 23 > _nph2c
 
const std::array< int, 23 > _Iph2c
 
const std::array< int, 23 > _Jph2c
 
const std::array< Real, 5 > _n23
 Constants for the boundary between regions 2 and 3. More...
 
const std::array< Real, 40 > _n3
 Constants for region 3. More...
 
const std::array< int, 40 > _I3
 
const std::array< int, 40 > _J3
 
const std::array< std::array< Real, 8 >, 26 > _par3
 
const std::array< unsigned int, 26 > _par3N
 
const std::vector< std::vector< Real > > _n3s
 Constants for all 26 subregions in region 3. More...
 
const std::vector< std::vector< int > > _I3s
 
const std::vector< std::vector< int > > _J3s
 
const std::array< Real, 31 > _nph3a
 
const std::array< int, 31 > _Iph3a
 
const std::array< int, 31 > _Jph3a
 
const std::array< Real, 33 > _nph3b
 
const std::array< int, 33 > _Iph3b
 
const std::array< int, 33 > _Jph3b
 
const std::array< Real, 10 > _n4
 Constants for region 4 (the saturation curve up to the critical point) More...
 
const std::array< int, 6 > _J05 {{0, 1, -3, -2, -1, 2}}
 Constants for region 5. More...
 
const std::array< Real, 6 > _n05
 
const std::array< int, 6 > _I5 {{1, 1, 1, 2, 2, 3}}
 
const std::array< int, 6 > _J5 {{1, 2, 3, 3, 9, 7}}
 
const std::array< Real, 6 > _n5
 
const std::vector< std::vector< int > > _tempXY_I
 Constnats for the tempXY() method. More...
 
const std::vector< std::vector< Real > > _tempXY_n
 
const std::array< int, 21 > _mu_I {{0, 1, 2, 3, 0, 1, 2, 3, 5, 0, 1, 2, 3, 4, 0, 1, 0, 3, 4, 3, 5}}
 Constants from Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance. More...
 
const std::array< int, 21 > _mu_J {{0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6}}
 
const std::array< Real, 4 > _mu_H0 {{1.67752, 2.20462, 0.6366564, -0.241605}}
 
const std::array< Real, 21 > _mu_H1
 
std::array< Real, 4 > _k_a {{0.0102811, 0.0299621, 0.0156146, -0.00422464}}
 Constants for thermal conductivity. More...
 
const std::array< Real, 5 > _T_star {{1386.0, 540.0, _T_critical, 1.0, 1000.0}}
 Temperature scale for each region. More...
 
const std::array< Real, 5 > _p_star {{16.53e6, 1.0e6, 1.0e6, 1.0e6, 1.0e6}}
 Pressure scale for each region. More...
 
const Real _R
 Universal gas constant (J/mol/K) More...
 
const Real _T_c2k
 Conversion of temperature from Celsius to Kelvin. More...
 
const bool _allow_imperfect_jacobians
 Flag to set unimplemented Jacobian entries to zero. More...
 
 propfunc (p, v, e) propfunc(T
 Compute a fluid property given for the state defined by two given properties. More...
 
e propfunc (c, v, e) propfunc(cp
 
e e propfunc (cv, v, e) propfunc(mu
 
e e e propfunc (k, v, e) propfunc(s
 
e e e e propfunc (s, h, p) propfunc(rho
 
e e e e s propfunc (e, v, h) propfunc(s
 
e e e e s T propfunc (pp_sat, p, T) propfunc(mu
 
e e e e s T T propfunc (k, rho, T) propfunc(c
 
e e e e s T T T propfunc (cp, p, T) propfunc(cv
 
e e e e s T T T T propfunc (mu, p, T) propfunc(k
 
e e e e s T T T T T propfunc (rho, p, T) propfunc(e
 
e e e e s T T T T T rho propfunc (e, T, v) propfunc(p
 
e e e e s T T T T T rho v propfunc (h, T, v) propfunc(s
 
e e e e s T T T T T rho v v propfunc (cv, T, v) propfunc(h
 
e e e e s T T T T T rho v v T propfunc (p, h, s) propfunc(g
 
 v
 
e v
 
e e v
 
e e e v
 
e e e e s T T T T T rho v v T v
 
e e e e p
 
e e e e s p
 
e e e e s T T p
 
e e e e s T T T p
 
e e e e s T T T T p
 
e e e e s T T T T T p
 
e e e e s T T T T T rho v v p
 
e e e e s T rho
 
e e e e s T T T T T rho T
 
e e e e s T T T T T rho v T
 

Detailed Description

Water (H2O) fluid properties as a function of pressure (Pa) and temperature (K) from IAPWS-IF97: Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam.

To avoid iteration in Region 3, the backwards equations from: Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam are implemented.

Water viscosity as a function of density (kg/m^3) and temperature (K) from: Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance.

Thermal conductivity as a function of density (kg/m^3) and temperature (K) from: Revised Release on the IAPS Formulation 1985 for the Thermal Conductivity of Ordinary Water Substance

Definition at line 43 of file Water97FluidProperties.h.

Member Enumeration Documentation

◆ subregionEnum

Constructor & Destructor Documentation

◆ Water97FluidProperties()

Water97FluidProperties::Water97FluidProperties ( const InputParameters &  parameters)

Definition at line 26 of file Water97FluidProperties.C.

27  : SinglePhaseFluidProperties(parameters),
28  _Mh2o(18.015e-3),
29  _Rw(461.526),
30  _p_critical(22.064e6),
31  _T_critical(647.096),
32  _rho_critical(322.0),
33  _p_triple(611.657),
34  _T_triple(273.16)
35 {
36 }
const Real _T_critical
Critical temperature (K)
const Real _p_critical
Critical pressure (Pa)
SinglePhaseFluidProperties(const InputParameters &parameters)
const Real _T_triple
Triple point temperature (K)
const Real _rho_critical
Critical density (kg/m^3)
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...
const Real _p_triple
Triple point pressure (Pa)
const Real _Mh2o
Water molar mass (kg/mol)
virtual Real e(Real pressure, Real temperature) const

◆ ~Water97FluidProperties()

Water97FluidProperties::~Water97FluidProperties ( )
virtual

Definition at line 38 of file Water97FluidProperties.C.

38 {}

Member Function Documentation

◆ b23p()

Real Water97FluidProperties::b23p ( Real  temperature) const

Auxillary equation for the boundary between regions 2 and 3.

Eq. (5) from Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
temperaturewater temperature (K)
Returns
pressure (Pa) on the boundary between region 2 and 3

Definition at line 862 of file Water97FluidProperties.C.

Referenced by b3ab(), and inRegion().

863 {
864  // Check whether the input temperature is within the region of validity of this equation.
865  // Valid for 623.15 K <= t <= 863.15 K
866  if (temperature < 623.15 || temperature > 863.15)
867  throw MooseException(name() +
868  ": b23p(): Temperature is outside range of 623.15 K <= T <= 863.15 K");
869 
870  return (_n23[0] + _n23[1] * temperature + _n23[2] * temperature * temperature) * 1.e6;
871 }
const std::array< Real, 5 > _n23
Constants for the boundary between regions 2 and 3.
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22

◆ b23T()

Real Water97FluidProperties::b23T ( Real  pressure) const

Auxillary equation for the boundary between regions 2 and 3.

Eq. (6) from Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
Returns
temperature (K) on the boundary between regions 2 and 3

Definition at line 874 of file Water97FluidProperties.C.

Referenced by inRegionPH().

875 {
876  // Check whether the input pressure is within the region of validity of this equation.
877  // Valid for 16.529 MPa <= p <= 100 MPa
878  if (pressure < 16.529e6 || pressure > 100.0e6)
879  throw MooseException(name() + ": b23T(): Pressure is outside range 16.529 MPa <= p <= 100 MPa");
880 
881  return _n23[3] + std::sqrt((pressure / 1.e6 - _n23[4]) / _n23[2]);
882 }
const std::array< Real, 5 > _n23
Constants for the boundary between regions 2 and 3.
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26

◆ b2bc()

Real Water97FluidProperties::b2bc ( Real  pressure) const

Boundary between subregions b and c in region 2.

Equation 21 from Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam.

Parameters
pressurewater pressure (Pa)
Returns
enthalpy at boundary (J/kg)

Definition at line 1645 of file Water97FluidProperties.C.

Referenced by subregion2ph().

1646 {
1647  // Check whether the input pressure is within the region of validity of this equation.
1648  if (pressure < 6.5467e6 || pressure > 100.0e6)
1649  throw MooseException(name() +
1650  ": b2bc(): Pressure is outside range of 6.5467 MPa <= p <= 100 MPa");
1651 
1652  Real pi = pressure / 1.0e6;
1653 
1654  return (0.26526571908428e4 + std::sqrt((pi - 0.45257578905948e1) / 0.12809002730136e-3)) * 1.0e3;
1655 }
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26
virtual Real e(Real pressure, Real temperature) const

◆ b3ab()

Real Water97FluidProperties::b3ab ( Real  pressure) const

Boundary between subregions a and b in region 3.

Equation 1 from Revised Supplementary Release on Backward Equations for the Functions T(p,h), v(p,h) and T(p,s), v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
Returns
enthalpy at boundary (J/kg)

Definition at line 1761 of file Water97FluidProperties.C.

Referenced by subregion3ph().

1762 {
1763  // Check whether the input pressure is within the region of validity of this equation.
1764  if (pressure < b23p(623.15) || pressure > 100.0e6)
1765  throw MooseException(name() +
1766  ": b3ab(): Pressure is outside range of 16.529 MPa <= p <= 100 MPa");
1767 
1768  Real pi = pressure / 1.0e6;
1769  Real eta = 0.201464004206875e4 + 0.374696550136983e1 * pi - 0.219921901054187e-1 * pi * pi +
1770  0.87513168600995e-4 * pi * pi * pi;
1771 
1772  return eta * 1.0e3;
1773 }
const std::string name
Definition: Setup.h:22
Real b23p(Real temperature) const
Auxillary equation for the boundary between regions 2 and 3.
const std::string pressure
Definition: NS.h:26

◆ beta()

Real SinglePhaseFluidProperties::beta ( Real  pressure,
Real  temperature 
) const
virtualinherited

Definition at line 154 of file SinglePhaseFluidProperties.C.

Referenced by SimpleFluidProperties::beta_from_p_T(), and vaporTemperature().

155 {
156  return beta_from_p_T(p, T);
157 }
virtual Real beta_from_p_T(Real, Real) const

◆ beta_from_p_T() [1/2]

Real SinglePhaseFluidProperties::beta_from_p_T ( Real  p,
Real  T 
) const
virtualinherited

Reimplemented in SimpleFluidProperties.

Definition at line 79 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::beta().

80 {
81  // The volumetric thermal expansion coefficient is defined as
82  // 1/v dv/dT)_p
83  // It is the fractional change rate of volume with respect to temperature change
84  // at constant pressure. Here it is coded as
85  // - 1/rho drho/dT)_p
86  // using chain rule with v = v(rho)
87 
88  Real rho, drho_dp, drho_dT;
89  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
90  return -drho_dT / rho;
91 }

◆ beta_from_p_T() [2/2]

void SinglePhaseFluidProperties::beta_from_p_T ( Real  ,
Real  ,
Real &  ,
Real &  ,
Real &   
) const
virtualinherited

Reimplemented in SimpleFluidProperties.

Definition at line 73 of file SinglePhaseFluidProperties.C.

74 {
75  mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented.");
76 }
const std::string name
Definition: Setup.h:22

◆ c()

Real SinglePhaseFluidProperties::c ( Real  pressure,
Real  temperature 
) const
virtualinherited

Definition at line 336 of file SinglePhaseFluidProperties.C.

Referenced by StiffenedGasFluidProperties::c_from_v_e(), IdealGasFluidProperties::c_from_v_e(), densityRegion3(), subregionVolume(), and vaporPressure().

337 {
338  mooseDeprecated(name(), ": c() is deprecated. Use c_from_p_T() instead");
339 
340  return c_from_p_T(p, T);
341 }
const std::string name
Definition: Setup.h:22

◆ c_from_p_T()

Real Water97FluidProperties::c_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 311 of file Water97FluidProperties.C.

312 {
313  Real speed2, pi, tau, delta;
314 
315  // Determine which region the point is in
316  unsigned int region = inRegion(pressure, temperature);
317  switch (region)
318  {
319  case 1:
320  pi = pressure / _p_star[0];
321  tau = _T_star[0] / temperature;
322  speed2 = _Rw * temperature * Utility::pow<2>(dgamma1_dpi(pi, tau)) /
323  (Utility::pow<2>(dgamma1_dpi(pi, tau) - tau * d2gamma1_dpitau(pi, tau)) /
324  (tau * tau * d2gamma1_dtau2(pi, tau)) -
325  d2gamma1_dpi2(pi, tau));
326  break;
327 
328  case 2:
329  pi = pressure / _p_star[1];
330  tau = _T_star[1] / temperature;
331  speed2 = _Rw * temperature * Utility::pow<2>(pi * dgamma2_dpi(pi, tau)) /
332  ((-pi * pi * d2gamma2_dpi2(pi, tau)) +
333  Utility::pow<2>(pi * dgamma2_dpi(pi, tau) - tau * pi * d2gamma2_dpitau(pi, tau)) /
334  (tau * tau * d2gamma2_dtau2(pi, tau)));
335  break;
336 
337  case 3:
338  {
339  // Calculate density first, then use that in Helmholtz free energy
340  Real density3 = densityRegion3(pressure, temperature);
341  delta = density3 / _rho_critical;
342  tau = _T_star[2] / temperature;
343  speed2 =
344  _Rw * temperature *
345  (2.0 * delta * dphi3_ddelta(delta, tau) + delta * delta * d2phi3_ddelta2(delta, tau) -
346  Utility::pow<2>(delta * dphi3_ddelta(delta, tau) -
347  delta * tau * d2phi3_ddeltatau(delta, tau)) /
348  (tau * tau * d2phi3_dtau2(delta, tau)));
349  break;
350  }
351 
352  case 5:
353  pi = pressure / _p_star[4];
354  tau = _T_star[4] / temperature;
355  speed2 = _Rw * temperature * Utility::pow<2>(pi * dgamma5_dpi(pi, tau)) /
356  ((-pi * pi * d2gamma5_dpi2(pi, tau)) +
357  Utility::pow<2>(pi * dgamma5_dpi(pi, tau) - tau * pi * d2gamma5_dpitau(pi, tau)) /
358  (tau * tau * d2gamma5_dtau2(pi, tau)));
359  break;
360 
361  default:
362  mooseError(name(), ": inRegion() has given an incorrect region");
363  }
364 
365  return std::sqrt(speed2);
366 }
Real d2gamma2_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt pi.
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real d2phi3_ddeltatau(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta and tau.
Real dgamma5_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt pi.
Real dgamma2_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt pi.
Real d2gamma1_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt pi and tau.
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
Real d2gamma5_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt pi and tau.
const std::string name
Definition: Setup.h:22
Real d2phi3_ddelta2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta.
Real d2phi3_dtau2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt tau.
Real dgamma1_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt pi.
Real d2gamma2_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt pi and tau.
const Real _rho_critical
Critical density (kg/m^3)
Real dphi3_ddelta(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt delta.
const std::string pressure
Definition: NS.h:26
Real d2gamma1_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt tau.
Real d2gamma1_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt pi.
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...
Real d2gamma5_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt pi.
Real d2gamma2_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt tau.
Real d2gamma5_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt tau.

◆ cp_from_p_T()

Real Water97FluidProperties::cp_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 369 of file Water97FluidProperties.C.

370 {
371  Real specific_heat, pi, tau, delta;
372 
373  // Determine which region the point is in
374  unsigned int region = inRegion(pressure, temperature);
375  switch (region)
376  {
377  case 1:
378  pi = pressure / _p_star[0];
379  tau = _T_star[0] / temperature;
380  specific_heat = -_Rw * tau * tau * d2gamma1_dtau2(pi, tau);
381  break;
382 
383  case 2:
384  pi = pressure / _p_star[1];
385  tau = _T_star[1] / temperature;
386  specific_heat = -_Rw * tau * tau * d2gamma2_dtau2(pi, tau);
387  break;
388 
389  case 3:
390  {
391  // Calculate density first, then use that in Helmholtz free energy
392  Real density3 = densityRegion3(pressure, temperature);
393  delta = density3 / _rho_critical;
394  tau = _T_star[2] / temperature;
395  specific_heat =
396  _Rw *
397  (-tau * tau * d2phi3_dtau2(delta, tau) +
398  (delta * dphi3_ddelta(delta, tau) - delta * tau * d2phi3_ddeltatau(delta, tau)) *
399  (delta * dphi3_ddelta(delta, tau) - delta * tau * d2phi3_ddeltatau(delta, tau)) /
400  (2.0 * delta * dphi3_ddelta(delta, tau) +
401  delta * delta * d2phi3_ddelta2(delta, tau)));
402  break;
403  }
404 
405  case 5:
406  pi = pressure / _p_star[4];
407  tau = _T_star[4] / temperature;
408  specific_heat = -_Rw * tau * tau * d2gamma5_dtau2(pi, tau);
409  break;
410 
411  default:
412  mooseError(name(), ": inRegion() has given an incorrect region");
413  }
414  return specific_heat;
415 }
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real d2phi3_ddeltatau(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta and tau.
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
const std::string name
Definition: Setup.h:22
Real d2phi3_ddelta2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta.
Real d2phi3_dtau2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt tau.
const Real _rho_critical
Critical density (kg/m^3)
Real dphi3_ddelta(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt delta.
const std::string pressure
Definition: NS.h:26
Real d2gamma1_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt tau.
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...
Real d2gamma2_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt tau.
Real d2gamma5_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt tau.

◆ criticalDensity()

Real Water97FluidProperties::criticalDensity ( ) const
overridevirtual

Critical density.

Returns
critical density (kg/m^3)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 65 of file Water97FluidProperties.C.

66 {
67  return _rho_critical;
68 }
const Real _rho_critical
Critical density (kg/m^3)

◆ criticalInternalEnergy()

Real SinglePhaseFluidProperties::criticalInternalEnergy ( ) const
virtualinherited

Critical specific internal energy.

Returns
specific internal energy (J/kg)

Reimplemented in StiffenedGasFluidProperties.

Definition at line 124 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e().

125 {
126  mooseError(name(), ": criticalInternalEnergy() is not implemented");
127 }
const std::string name
Definition: Setup.h:22

◆ criticalPressure()

Real Water97FluidProperties::criticalPressure ( ) const
overridevirtual

Critical pressure.

Returns
critical pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 53 of file Water97FluidProperties.C.

54 {
55  return _p_critical;
56 }
const Real _p_critical
Critical pressure (Pa)

◆ criticalTemperature()

Real Water97FluidProperties::criticalTemperature ( ) const
overridevirtual

Critical temperature.

Returns
critical temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 59 of file Water97FluidProperties.C.

60 {
61  return _T_critical;
62 }
const Real _T_critical
Critical temperature (K)

◆ cv_from_p_T()

Real Water97FluidProperties::cv_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 418 of file Water97FluidProperties.C.

419 {
420  Real specific_heat, pi, tau, delta;
421 
422  // Determine which region the point is in
423  unsigned int region = inRegion(pressure, temperature);
424  switch (region)
425  {
426  case 1:
427  pi = pressure / _p_star[0];
428  tau = _T_star[0] / temperature;
429  specific_heat =
430  _Rw * (-tau * tau * d2gamma1_dtau2(pi, tau) +
431  Utility::pow<2>(dgamma1_dpi(pi, tau) - tau * d2gamma1_dpitau(pi, tau)) /
432  d2gamma1_dpi2(pi, tau));
433  break;
434 
435  case 2:
436  pi = pressure / _p_star[1];
437  tau = _T_star[1] / temperature;
438  specific_heat =
439  _Rw * (-tau * tau * d2gamma2_dtau2(pi, tau) +
440  Utility::pow<2>(dgamma2_dpi(pi, tau) - tau * d2gamma2_dpitau(pi, tau)) /
441  d2gamma2_dpi2(pi, tau));
442  break;
443 
444  case 3:
445  {
446  // Calculate density first, then use that in Helmholtz free energy
447  Real density3 = densityRegion3(pressure, temperature);
448  delta = density3 / _rho_critical;
449  tau = _T_star[2] / temperature;
450  specific_heat = _Rw * (-tau * tau * d2phi3_dtau2(delta, tau));
451  break;
452  }
453 
454  case 5:
455  pi = pressure / _p_star[4];
456  tau = _T_star[4] / temperature;
457  specific_heat =
458  _Rw * (-tau * tau * d2gamma5_dtau2(pi, tau) +
459  Utility::pow<2>(dgamma5_dpi(pi, tau) - tau * d2gamma5_dpitau(pi, tau)) /
460  d2gamma5_dpi2(pi, tau));
461  break;
462 
463  default:
464  mooseError(name(), ": inRegion() has given an incorrect region");
465  }
466  return specific_heat;
467 }
Real d2gamma2_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt pi.
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real dgamma5_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt pi.
Real dgamma2_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt pi.
Real d2gamma1_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt pi and tau.
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
Real d2gamma5_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt pi and tau.
const std::string name
Definition: Setup.h:22
Real d2phi3_dtau2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt tau.
Real dgamma1_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt pi.
Real d2gamma2_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt pi and tau.
const Real _rho_critical
Critical density (kg/m^3)
const std::string pressure
Definition: NS.h:26
Real d2gamma1_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt tau.
Real d2gamma1_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt pi.
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...
Real d2gamma5_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt pi.
Real d2gamma2_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt tau.
Real d2gamma5_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt tau.

◆ d2gamma1_dpi2()

Real Water97FluidProperties::d2gamma1_dpi2 ( Real  pi,
Real  tau 
) const
protected

Second derivative of Gibbs free energy in Region 1 wrt pi.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
second derivative of Gibbs free energy wrt pi (-)

Definition at line 952 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cv_from_p_T(), e_from_p_T(), and rho_from_p_T().

953 {
954  Real sum = 0.0;
955  for (std::size_t i = 0; i < _n1.size(); ++i)
956  sum += _n1[i] * _I1[i] * (_I1[i] - 1) * MathUtils::pow(7.1 - pi, _I1[i] - 2) *
957  MathUtils::pow(tau - 1.222, _J1[i]);
958 
959  return sum;
960 }
const std::array< int, 34 > _J1
const std::array< Real, 34 > _n1
Reference constants used in to calculate thermophysical properties of water.
const std::array< int, 34 > _I1
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ d2gamma1_dpitau()

Real Water97FluidProperties::d2gamma1_dpitau ( Real  pi,
Real  tau 
) const
protected

Second derivative of Gibbs free energy in Region 1 wrt pi and tau.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
second derivative of Gibbs free energy wrt pi and tau (-)

Definition at line 985 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cv_from_p_T(), e_from_p_T(), h_from_p_T(), and rho_from_p_T().

986 {
987  Real dg = 0.0;
988  for (std::size_t i = 0; i < _n1.size(); ++i)
989  dg += -_n1[i] * _I1[i] * _J1[i] * MathUtils::pow(7.1 - pi, _I1[i] - 1) *
990  MathUtils::pow(tau - 1.222, _J1[i] - 1);
991 
992  return dg;
993 }
const std::array< int, 34 > _J1
const std::array< Real, 34 > _n1
Reference constants used in to calculate thermophysical properties of water.
const std::array< int, 34 > _I1
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ d2gamma1_dtau2()

Real Water97FluidProperties::d2gamma1_dtau2 ( Real  pi,
Real  tau 
) const
protected

Second derivative of Gibbs free energy in Region 1 wrt tau.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
second derivative of Gibbs free energy wrt tau (-)

Definition at line 974 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), cv_from_p_T(), e_from_p_T(), and h_from_p_T().

975 {
976  Real dg = 0.0;
977  for (std::size_t i = 0; i < _n1.size(); ++i)
978  dg += _n1[i] * _J1[i] * (_J1[i] - 1) * MathUtils::pow(7.1 - pi, _I1[i]) *
979  MathUtils::pow(tau - 1.222, _J1[i] - 2);
980 
981  return dg;
982 }
const std::array< int, 34 > _J1
const std::array< Real, 34 > _n1
Reference constants used in to calculate thermophysical properties of water.
const std::array< int, 34 > _I1
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ d2gamma2_dpi2()

Real Water97FluidProperties::d2gamma2_dpi2 ( Real  pi,
Real  tau 
) const
protected

Second derivative of Gibbs free energy in Region 2 wrt pi.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
second derivative of Gibbs free energy wrt pi (-)

Definition at line 1028 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cv_from_p_T(), e_from_p_T(), and rho_from_p_T().

1029 {
1030  // Ideal gas part of the Gibbs free energy
1031  Real dg0 = -1.0 / pi / pi;
1032 
1033  // Residual part of the Gibbs free energy
1034  Real dgr = 0.0;
1035  for (std::size_t i = 0; i < _n2.size(); ++i)
1036  dgr += _n2[i] * _I2[i] * (_I2[i] - 1) * MathUtils::pow(pi, _I2[i] - 2) *
1037  MathUtils::pow(tau - 0.5, _J2[i]);
1038 
1039  return dg0 + dgr;
1040 }
const std::array< Real, 43 > _n2
const std::array< int, 43 > _J2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 43 > _I2

◆ d2gamma2_dpitau()

Real Water97FluidProperties::d2gamma2_dpitau ( Real  pi,
Real  tau 
) const
protected

Second derivative of Gibbs free energy in Region 2 wrt pi and tau.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
second derivative of Gibbs free energy wrt pi and tau (-)

Definition at line 1076 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cv_from_p_T(), e_from_p_T(), h_from_p_T(), and rho_from_p_T().

1077 {
1078  // Ideal gas part of the Gibbs free energy
1079  Real dg0 = 0.0;
1080 
1081  // Residual part of the Gibbs free energy
1082  Real dgr = 0.0;
1083  for (std::size_t i = 0; i < _n2.size(); ++i)
1084  dgr += _n2[i] * _I2[i] * _J2[i] * MathUtils::pow(pi, _I2[i] - 1) *
1085  MathUtils::pow(tau - 0.5, _J2[i] - 1);
1086 
1087  return dg0 + dgr;
1088 }
const std::array< Real, 43 > _n2
const std::array< int, 43 > _J2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 43 > _I2

◆ d2gamma2_dtau2()

Real Water97FluidProperties::d2gamma2_dtau2 ( Real  pi,
Real  tau 
) const
protected

Second derivative of Gibbs free energy in Region 2 wrt tau.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
second derivative of Gibbs free energy wrt tau (-)

Definition at line 1059 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), cv_from_p_T(), e_from_p_T(), and h_from_p_T().

1060 {
1061  // Ideal gas part of the Gibbs free energy
1062  Real dg0 = 0.0;
1063  for (std::size_t i = 0; i < _n02.size(); ++i)
1064  dg0 += _n02[i] * _J02[i] * (_J02[i] - 1) * MathUtils::pow(tau, _J02[i] - 2);
1065 
1066  // Residual part of the Gibbs free energy
1067  Real dgr = 0.0;
1068  for (std::size_t i = 0; i < _n2.size(); ++i)
1069  dgr += _n2[i] * _J2[i] * (_J2[i] - 1) * MathUtils::pow(pi, _I2[i]) *
1070  MathUtils::pow(tau - 0.5, _J2[i] - 2);
1071 
1072  return dg0 + dgr;
1073 }
const std::array< Real, 43 > _n2
const std::array< int, 9 > _J02
const std::array< int, 43 > _J2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 9 > _n02
Constants for region 2.
const std::array< int, 43 > _I2

◆ d2gamma5_dpi2()

Real Water97FluidProperties::d2gamma5_dpi2 ( Real  pi,
Real  tau 
) const
protected

Second derivative of Gibbs free energy in Region 5 wrt pi.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
second derivative of Gibbs free energy wrt pi (-)

Definition at line 1186 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cv_from_p_T(), e_from_p_T(), and rho_from_p_T().

1187 {
1188  // Ideal gas part of the Gibbs free energy
1189  Real dg0 = -1.0 / pi / pi;
1190 
1191  // Residual part of the Gibbs free energy
1192  Real dgr = 0.0;
1193  for (std::size_t i = 0; i < _n5.size(); ++i)
1194  dgr += _n5[i] * _I5[i] * (_I5[i] - 1) * MathUtils::pow(pi, _I5[i] - 2) *
1195  MathUtils::pow(tau, _J5[i]);
1196 
1197  return dg0 + dgr;
1198 }
const std::array< int, 6 > _I5
const std::array< int, 6 > _J5
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 6 > _n5

◆ d2gamma5_dpitau()

Real Water97FluidProperties::d2gamma5_dpitau ( Real  pi,
Real  tau 
) const
protected

Second derivative of Gibbs free energy in Region 5 wrt pi and tau.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
second derivative of Gibbs free energy wrt pi and tau (-)

Definition at line 1234 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cv_from_p_T(), e_from_p_T(), h_from_p_T(), and rho_from_p_T().

1235 {
1236  // Ideal gas part of the Gibbs free energy
1237  Real dg0 = 0.0;
1238 
1239  // Residual part of the Gibbs free energy
1240  Real dgr = 0.0;
1241  for (std::size_t i = 0; i < _n5.size(); ++i)
1242  dgr +=
1243  _n5[i] * _I5[i] * _J5[i] * MathUtils::pow(pi, _I5[i] - 1) * MathUtils::pow(tau, _J5[i] - 1);
1244 
1245  return dg0 + dgr;
1246 }
const std::array< int, 6 > _I5
const std::array< int, 6 > _J5
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 6 > _n5

◆ d2gamma5_dtau2()

Real Water97FluidProperties::d2gamma5_dtau2 ( Real  pi,
Real  tau 
) const
protected

Second derivative of Gibbs free energy in Region 5 wrt tau.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
second derivative of Gibbs free energy wrt tau (-)

Definition at line 1217 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), cv_from_p_T(), e_from_p_T(), and h_from_p_T().

1218 {
1219  // Ideal gas part of the Gibbs free energy
1220  Real dg0 = 0.0;
1221  for (std::size_t i = 0; i < _n05.size(); ++i)
1222  dg0 += _n05[i] * _J05[i] * (_J05[i] - 1) * MathUtils::pow(tau, _J05[i] - 2);
1223 
1224  // Residual part of the Gibbs free energy
1225  Real dgr = 0.0;
1226  for (std::size_t i = 0; i < _n5.size(); ++i)
1227  dgr += _n5[i] * _J5[i] * (_J5[i] - 1) * MathUtils::pow(pi, _I5[i]) *
1228  MathUtils::pow(tau, _J5[i] - 2);
1229 
1230  return dg0 + dgr;
1231 }
const std::array< int, 6 > _I5
const std::array< int, 6 > _J5
const std::array< int, 6 > _J05
Constants for region 5.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 6 > _n5
const std::array< Real, 6 > _n05

◆ d2phi3_ddelta2()

Real Water97FluidProperties::d2phi3_ddelta2 ( Real  delta,
Real  tau 
) const
protected

Second derivative of Helmholtz free energy in Region 3 wrt delta.

Parameters
deltareduced density (-)
taureduced temperature (-)
Returns
second derivative of Helmholtz free energy wrt delta (-)

Definition at line 1111 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), e_from_p_T(), h_from_p_T(), and rho_from_p_T().

1112 {
1113  Real sum = 0.0;
1114  for (std::size_t i = 1; i < _n3.size(); ++i)
1115  sum += _n3[i] * _I3[i] * (_I3[i] - 1) * MathUtils::pow(delta, _I3[i] - 2) *
1116  MathUtils::pow(tau, _J3[i]);
1117 
1118  return -_n3[0] / delta / delta + sum;
1119 }
const std::array< int, 40 > _J3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 40 > _I3
const std::array< Real, 40 > _n3
Constants for region 3.

◆ d2phi3_ddeltatau()

Real Water97FluidProperties::d2phi3_ddeltatau ( Real  delta,
Real  tau 
) const
protected

Second derivative of Helmholtz free energy in Region 3 wrt delta and tau.

Parameters
deltareduced density (-)
taureduced temperature (-)
Returns
second derivative of Helmholtz free energy wrt delta and tau (-)

Definition at line 1143 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), e_from_p_T(), h_from_p_T(), and rho_from_p_T().

1144 {
1145  Real sum = 0.0;
1146  for (std::size_t i = 1; i < _n3.size(); ++i)
1147  sum += _n3[i] * _I3[i] * _J3[i] * MathUtils::pow(delta, _I3[i] - 1) *
1148  MathUtils::pow(tau, _J3[i] - 1);
1149 
1150  return sum;
1151 }
const std::array< int, 40 > _J3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 40 > _I3
const std::array< Real, 40 > _n3
Constants for region 3.

◆ d2phi3_dtau2()

Real Water97FluidProperties::d2phi3_dtau2 ( Real  delta,
Real  tau 
) const
protected

Second derivative of Helmholtz free energy in Region 3 wrt tau.

Parameters
deltareduced density (-)
taureduced temperature (-)
Returns
second derivative of Helmholtz free energy wrt tau (-)

Definition at line 1132 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), cv_from_p_T(), e_from_p_T(), and h_from_p_T().

1133 {
1134  Real sum = 0.0;
1135  for (std::size_t i = 1; i < _n3.size(); ++i)
1136  sum += _n3[i] * _J3[i] * (_J3[i] - 1) * MathUtils::pow(delta, _I3[i]) *
1137  MathUtils::pow(tau, _J3[i] - 2);
1138 
1139  return sum;
1140 }
const std::array< int, 40 > _J3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 40 > _I3
const std::array< Real, 40 > _n3
Constants for region 3.

◆ densityRegion3()

Real Water97FluidProperties::densityRegion3 ( Real  pressure,
Real  temperature 
) const

Density function for Region 3 - supercritical water and steam.

To avoid iteration, use the backwards equations for region 3 from Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam.

Parameters
pressurewater pressure (Pa)
temperaturewater temperature (K)
Returns
density (kg/m^3) in region 3

Definition at line 1512 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), cv_from_p_T(), e_from_p_T(), h_from_p_T(), rho_from_p_T(), and s_from_p_T().

1513 {
1514  // Region 3 is subdivided into 26 subregions, each with a given backwards equation
1515  // to directly calculate density from pressure and temperature without the need for
1516  // expensive iterations. Find the subregion id that the point is in:
1517  unsigned int sid = subregion3(pressure, temperature);
1518 
1519  Real vstar, pi, theta, a, b, c, d, e;
1520  unsigned int N;
1521 
1522  vstar = _par3[sid][0];
1523  pi = pressure / _par3[sid][1] / 1.0e6;
1524  theta = temperature / _par3[sid][2];
1525  a = _par3[sid][3];
1526  b = _par3[sid][4];
1527  c = _par3[sid][5];
1528  d = _par3[sid][6];
1529  e = _par3[sid][7];
1530  N = _par3N[sid];
1531 
1532  Real sum = 0.0;
1533  Real volume = 0.0;
1534 
1535  // Note that subregion 13 is the only different formulation
1536  if (sid == 13)
1537  {
1538  for (std::size_t i = 0; i < N; ++i)
1539  sum += _n3s[sid][i] * MathUtils::pow(pi - a, _I3s[sid][i]) *
1540  MathUtils::pow(theta - b, _J3s[sid][i]);
1541 
1542  volume = vstar * std::exp(sum);
1543  }
1544  else
1545  volume = vstar * subregionVolume(pi, theta, a, b, c, d, e, sid);
1546 
1547  // Density is the inverse of volume
1548  return 1.0 / volume;
1549 }
const std::array< std::array< Real, 8 >, 26 > _par3
unsigned int subregion3(Real pressure, Real temperature) const
Provides the correct subregion index for a (P,T) point in region 3.
const std::vector< std::vector< Real > > _n3s
Constants for all 26 subregions in region 3.
const std::string temperature
Definition: NS.h:27
const std::vector< std::vector< int > > _I3s
virtual Real c(Real pressure, Real temperature) const
Real subregionVolume(Real pi, Real theta, Real a, Real b, Real c, Real d, Real e, unsigned int sid) const
Specific volume in all subregions of region 3 EXCEPT subregion n (13).
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::string pressure
Definition: NS.h:26
const std::vector< std::vector< int > > _J3s
virtual Real e(Real pressure, Real temperature) const
const std::array< unsigned int, 26 > _par3N

◆ dgamma1_dpi()

Real Water97FluidProperties::dgamma1_dpi ( Real  pi,
Real  tau 
) const
protected

Derivative of Gibbs free energy in Region 1 wrt pi.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
derivative of Gibbs free energy wrt pi (-)

Definition at line 941 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cv_from_p_T(), e_from_p_T(), and rho_from_p_T().

942 {
943  Real sum = 0.0;
944  for (std::size_t i = 0; i < _n1.size(); ++i)
945  sum += -_n1[i] * _I1[i] * MathUtils::pow(7.1 - pi, _I1[i] - 1) *
946  MathUtils::pow(tau - 1.222, _J1[i]);
947 
948  return sum;
949 }
const std::array< int, 34 > _J1
const std::array< Real, 34 > _n1
Reference constants used in to calculate thermophysical properties of water.
const std::array< int, 34 > _I1
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ dgamma1_dtau()

Real Water97FluidProperties::dgamma1_dtau ( Real  pi,
Real  tau 
) const
protected

Derivative of Gibbs free energy in Region 1 wrt tau.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
derivative of Gibbs free energy wrt tau (-)

Definition at line 963 of file Water97FluidProperties.C.

Referenced by e_from_p_T(), h_from_p_T(), and s_from_p_T().

964 {
965  Real g = 0.0;
966  for (std::size_t i = 0; i < _n1.size(); ++i)
967  g += _n1[i] * _J1[i] * MathUtils::pow(7.1 - pi, _I1[i]) *
968  MathUtils::pow(tau - 1.222, _J1[i] - 1);
969 
970  return g;
971 }
const std::array< int, 34 > _J1
const std::array< Real, 34 > _n1
Reference constants used in to calculate thermophysical properties of water.
const std::array< int, 34 > _I1
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ dgamma2_dpi()

Real Water97FluidProperties::dgamma2_dpi ( Real  pi,
Real  tau 
) const
protected

Derivative of Gibbs free energy in Region 2 wrt pi.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
derivative of Gibbs free energy wrt pi (-)

Definition at line 1014 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cv_from_p_T(), e_from_p_T(), and rho_from_p_T().

1015 {
1016  // Ideal gas part of the Gibbs free energy
1017  Real dg0 = 1.0 / pi;
1018 
1019  // Residual part of the Gibbs free energy
1020  Real dgr = 0.0;
1021  for (std::size_t i = 0; i < _n2.size(); ++i)
1022  dgr += _n2[i] * _I2[i] * MathUtils::pow(pi, _I2[i] - 1) * MathUtils::pow(tau - 0.5, _J2[i]);
1023 
1024  return dg0 + dgr;
1025 }
const std::array< Real, 43 > _n2
const std::array< int, 43 > _J2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 43 > _I2

◆ dgamma2_dtau()

Real Water97FluidProperties::dgamma2_dtau ( Real  pi,
Real  tau 
) const
protected

Derivative of Gibbs free energy in Region 2 wrt tau.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
derivative of Gibbs free energy wrt tau (-)

Definition at line 1043 of file Water97FluidProperties.C.

Referenced by e_from_p_T(), h_from_p_T(), and s_from_p_T().

1044 {
1045  // Ideal gas part of the Gibbs free energy
1046  Real dg0 = 0.0;
1047  for (std::size_t i = 0; i < _n02.size(); ++i)
1048  dg0 += _n02[i] * _J02[i] * MathUtils::pow(tau, _J02[i] - 1);
1049 
1050  // Residual part of the Gibbs free energy
1051  Real dgr = 0.0;
1052  for (std::size_t i = 0; i < _n2.size(); ++i)
1053  dgr += _n2[i] * _J2[i] * MathUtils::pow(pi, _I2[i]) * MathUtils::pow(tau - 0.5, _J2[i] - 1);
1054 
1055  return dg0 + dgr;
1056 }
const std::array< Real, 43 > _n2
const std::array< int, 9 > _J02
const std::array< int, 43 > _J2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 9 > _n02
Constants for region 2.
const std::array< int, 43 > _I2

◆ dgamma5_dpi()

Real Water97FluidProperties::dgamma5_dpi ( Real  pi,
Real  tau 
) const
protected

Derivative of Gibbs free energy in Region 5 wrt pi.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
derivative of Gibbs free energy wrt pi (-)

Definition at line 1172 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cv_from_p_T(), e_from_p_T(), and rho_from_p_T().

1173 {
1174  // Ideal gas part of the Gibbs free energy
1175  Real dg0 = 1.0 / pi;
1176 
1177  // Residual part of the Gibbs free energy
1178  Real dgr = 0.0;
1179  for (std::size_t i = 0; i < _n5.size(); ++i)
1180  dgr += _n5[i] * _I5[i] * MathUtils::pow(pi, _I5[i] - 1) * MathUtils::pow(tau, _J5[i]);
1181 
1182  return dg0 + dgr;
1183 }
const std::array< int, 6 > _I5
const std::array< int, 6 > _J5
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 6 > _n5

◆ dgamma5_dtau()

Real Water97FluidProperties::dgamma5_dtau ( Real  pi,
Real  tau 
) const
protected

Derivative of Gibbs free energy in Region 5 wrt tau.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
derivative of Gibbs free energy wrt tau (-)

Definition at line 1201 of file Water97FluidProperties.C.

Referenced by e_from_p_T(), h_from_p_T(), and s_from_p_T().

1202 {
1203  // Ideal gas part of the Gibbs free energy
1204  Real dg0 = 0.0;
1205  for (std::size_t i = 0; i < _n05.size(); ++i)
1206  dg0 += _n05[i] * _J05[i] * MathUtils::pow(tau, _J05[i] - 1);
1207 
1208  // Residual part of the Gibbs free energy
1209  Real dgr = 0.0;
1210  for (std::size_t i = 0; i < _n5.size(); ++i)
1211  dgr += _n5[i] * _J5[i] * MathUtils::pow(pi, _I5[i]) * MathUtils::pow(tau, _J5[i] - 1);
1212 
1213  return dg0 + dgr;
1214 }
const std::array< int, 6 > _I5
const std::array< int, 6 > _J5
const std::array< int, 6 > _J05
Constants for region 5.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 6 > _n5
const std::array< Real, 6 > _n05

◆ dphi3_ddelta()

Real Water97FluidProperties::dphi3_ddelta ( Real  delta,
Real  tau 
) const
protected

Derivative of Helmholtz free energy in Region 3 wrt delta.

Parameters
deltareduced density (-)
taureduced temperature (-)
Returns
derivative of Helmholtz free energy wrt delta (-)

Definition at line 1101 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), e_from_p_T(), h_from_p_T(), and rho_from_p_T().

1102 {
1103  Real sum = 0.0;
1104  for (std::size_t i = 1; i < _n3.size(); ++i)
1105  sum += _n3[i] * _I3[i] * MathUtils::pow(delta, _I3[i] - 1) * MathUtils::pow(tau, _J3[i]);
1106 
1107  return _n3[0] / delta + sum;
1108 }
const std::array< int, 40 > _J3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 40 > _I3
const std::array< Real, 40 > _n3
Constants for region 3.

◆ dphi3_dtau()

Real Water97FluidProperties::dphi3_dtau ( Real  delta,
Real  tau 
) const
protected

Derivative of Helmholtz free energy in Region 3 wrt tau.

Parameters
deltareduced density (-)
taureduced temperature (-)
Returns
derivative of Helmholtz free energy wrt tau (-)

Definition at line 1122 of file Water97FluidProperties.C.

Referenced by e_from_p_T(), h_from_p_T(), and s_from_p_T().

1123 {
1124  Real sum = 0.0;
1125  for (std::size_t i = 1; i < _n3.size(); ++i)
1126  sum += _n3[i] * _J3[i] * MathUtils::pow(delta, _I3[i]) * MathUtils::pow(tau, _J3[i] - 1);
1127 
1128  return sum;
1129 }
const std::array< int, 40 > _J3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 40 > _I3
const std::array< Real, 40 > _n3
Constants for region 3.

◆ e()

Real SinglePhaseFluidProperties::e ( Real  pressure,
Real  temperature 
) const
virtualinherited

Definition at line 291 of file SinglePhaseFluidProperties.C.

Referenced by b2bc(), StiffenedGasFluidProperties::c_from_v_e(), IdealGasFluidProperties::c_from_v_e(), NaClFluidProperties::cp_from_p_T(), StiffenedGasFluidProperties::cp_from_v_e(), IdealGasFluidProperties::cp_from_v_e(), densityRegion3(), SinglePhaseFluidProperties::e_dpT(), StiffenedGasFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_rho(), HelmholtzFluidProperties::e_from_p_T(), e_from_p_T(), NaClFluidProperties::e_from_p_T(), IdealGasFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_p_T(), SimpleFluidProperties::e_from_p_T(), TabulatedFluidProperties::e_from_p_T(), SinglePhaseFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_T_v(), IdealGasFluidProperties::e_from_T_v(), IdealGasFluidProperties::e_from_v_h(), StiffenedGasFluidProperties::e_from_v_h(), IdealGasFluidProperties::g_from_v_e(), StiffenedGasFluidProperties::g_from_v_e(), SinglePhaseFluidProperties::gamma_from_v_e(), NaClFluidProperties::h_from_p_T(), NitrogenFluidProperties::mu_from_rho_T(), HydrogenFluidProperties::mu_from_rho_T(), CO2FluidProperties::mu_from_rho_T(), StiffenedGasFluidProperties::p_from_T_v(), StiffenedGasFluidProperties::p_from_v_e(), IdealGasFluidProperties::p_from_v_e(), SinglePhaseFluidProperties::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_from_p_T(), StiffenedGasFluidProperties::s_from_T_v(), StiffenedGasFluidProperties::s_from_v_e(), IdealGasFluidProperties::s_from_v_e(), subregion3(), subregionVolume(), SinglePhaseFluidProperties::T_from_p_h(), StiffenedGasFluidProperties::T_from_v_e(), IdealGasFluidProperties::T_from_v_e(), StiffenedGasFluidProperties::v_e_spndl_from_T(), and vaporTemperature().

292 {
293  mooseDeprecated(name(), ": e() is deprecated. Use e_from_p_T() instead");
294 
295  return e_from_p_T(p, T);
296 }
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
const std::string name
Definition: Setup.h:22

◆ e_dpT()

void SinglePhaseFluidProperties::e_dpT ( Real  pressure,
Real  temperature,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
virtualinherited

Definition at line 299 of file SinglePhaseFluidProperties.C.

300 {
301  mooseDeprecated(name(), ": e_dpT() is deprecated. Use e_from_p_T() instead");
302 
303  e_from_p_T(p, T, e, de_dp, de_dT);
304 }
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
const std::string name
Definition: Setup.h:22
virtual Real e(Real pressure, Real temperature) const

◆ e_from_p_T() [1/2]

Real Water97FluidProperties::e_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Internal energy from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
Returns
internal energy (J/kg)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 188 of file Water97FluidProperties.C.

Referenced by e_from_p_T().

189 {
190  Real internal_energy, pi, tau;
191 
192  // Determine which region the point is in
193  unsigned int region = inRegion(pressure, temperature);
194  switch (region)
195  {
196  case 1:
197  pi = pressure / _p_star[0];
198  tau = _T_star[0] / temperature;
200  _Rw * temperature * (tau * dgamma1_dtau(pi, tau) - pi * dgamma1_dpi(pi, tau));
201  break;
202 
203  case 2:
204  pi = pressure / _p_star[1];
205  tau = _T_star[1] / temperature;
207  _Rw * temperature * (tau * dgamma2_dtau(pi, tau) - pi * dgamma2_dpi(pi, tau));
208  break;
209 
210  case 3:
211  {
212  // Calculate density first, then use that in Helmholtz free energy
213  Real density3 = densityRegion3(pressure, temperature);
214  Real delta = density3 / _rho_critical;
215  tau = _T_star[2] / temperature;
216  internal_energy = _Rw * temperature * tau * dphi3_dtau(delta, tau);
217  break;
218  }
219 
220  case 5:
221  pi = pressure / _p_star[4];
222  tau = _T_star[4] / temperature;
224  _Rw * temperature * (tau * dgamma5_dtau(pi, tau) - pi * dgamma5_dpi(pi, tau));
225  break;
226 
227  default:
228  mooseError(name(), ": inRegion() has given an incorrect region");
229  }
230  // Output in J/kg
231  return internal_energy;
232 }
Real dgamma5_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt tau.
Real dphi3_dtau(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt tau.
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real dgamma5_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt pi.
Real dgamma2_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt pi.
Real dgamma2_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt tau.
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
const std::string name
Definition: Setup.h:22
Real dgamma1_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt pi.
const Real _rho_critical
Critical density (kg/m^3)
Real dgamma1_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt tau.
const std::string pressure
Definition: NS.h:26
const std::string internal_energy
Definition: NS.h:30
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...

◆ e_from_p_T() [2/2]

void Water97FluidProperties::e_from_p_T ( Real  p,
Real  T,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
overridevirtual

Internal energy and its derivatives from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
[out]einternal energy (J/kg)
[out]de_dpderivative of internal energy w.r.t. pressure
[out]de_dTderivative of internal energy w.r.t. temperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 235 of file Water97FluidProperties.C.

237 {
238  Real pi, tau, dinternal_energy_dp, dinternal_energy_dT;
239 
240  // Determine which region the point is in
241  unsigned int region = inRegion(pressure, temperature);
242  switch (region)
243  {
244  case 1:
245  {
246  pi = pressure / _p_star[0];
247  tau = _T_star[0] / temperature;
248  Real dgdp = dgamma1_dpi(pi, tau);
249  Real d2gdpt = d2gamma1_dpitau(pi, tau);
250  dinternal_energy_dp =
251  _Rw * temperature * (tau * d2gdpt - dgdp - pi * d2gamma1_dpi2(pi, tau)) / _p_star[0];
252  dinternal_energy_dT =
253  _Rw * (pi * tau * d2gdpt - tau * tau * d2gamma1_dtau2(pi, tau) - pi * dgdp);
254  break;
255  }
256 
257  case 2:
258  {
259  pi = pressure / _p_star[1];
260  tau = _T_star[1] / temperature;
261  Real dgdp = dgamma2_dpi(pi, tau);
262  Real d2gdpt = d2gamma2_dpitau(pi, tau);
263  dinternal_energy_dp =
264  _Rw * temperature * (tau * d2gdpt - dgdp - pi * d2gamma2_dpi2(pi, tau)) / _p_star[1];
265  dinternal_energy_dT =
266  _Rw * (pi * tau * d2gdpt - tau * tau * d2gamma2_dtau2(pi, tau) - pi * dgdp);
267  break;
268  }
269 
270  case 3:
271  {
272  // Calculate density first, then use that in Helmholtz free energy
273  Real density3 = densityRegion3(pressure, temperature);
274  Real delta = density3 / _rho_critical;
275  tau = _T_star[2] / temperature;
276  Real dpdd = dphi3_ddelta(delta, tau);
277  Real d2pddt = d2phi3_ddeltatau(delta, tau);
278  Real d2pdd2 = d2phi3_ddelta2(delta, tau);
279  dinternal_energy_dp =
280  _T_star[2] * d2pddt / _rho_critical /
281  (2.0 * temperature * delta * dpdd + temperature * delta * delta * d2pdd2);
282  dinternal_energy_dT =
283  -_Rw * (delta * tau * d2pddt * (dpdd - tau * d2pddt) / (2.0 * dpdd + delta * d2pdd2) +
284  tau * tau * d2phi3_dtau2(delta, tau));
285  break;
286  }
287 
288  case 5:
289  {
290  pi = pressure / _p_star[4];
291  tau = _T_star[4] / temperature;
292  Real dgdp = dgamma5_dpi(pi, tau);
293  Real d2gdpt = d2gamma5_dpitau(pi, tau);
294  dinternal_energy_dp =
295  _Rw * temperature * (tau * d2gdpt - dgdp - pi * d2gamma5_dpi2(pi, tau)) / _p_star[4];
296  dinternal_energy_dT =
297  _Rw * (pi * tau * d2gdpt - tau * tau * d2gamma5_dtau2(pi, tau) - pi * dgdp);
298  break;
299  }
300 
301  default:
302  mooseError(name(), ": inRegion has given an incorrect region");
303  }
304 
305  e = this->e_from_p_T(pressure, temperature);
306  de_dp = dinternal_energy_dp;
307  de_dT = dinternal_energy_dT;
308 }
Real d2gamma2_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt pi.
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real d2phi3_ddeltatau(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta and tau.
virtual Real e_from_p_T(Real pressure, Real temperature) const override
Internal energy from pressure and temperature.
Real dgamma5_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt pi.
Real dgamma2_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt pi.
Real d2gamma1_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt pi and tau.
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
Real d2gamma5_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt pi and tau.
const std::string name
Definition: Setup.h:22
Real d2phi3_ddelta2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta.
Real d2phi3_dtau2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt tau.
Real dgamma1_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt pi.
Real d2gamma2_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt pi and tau.
const Real _rho_critical
Critical density (kg/m^3)
Real dphi3_ddelta(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt delta.
const std::string pressure
Definition: NS.h:26
Real d2gamma1_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt tau.
Real d2gamma1_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt pi.
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...
Real d2gamma5_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt pi.
Real d2gamma2_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt tau.
Real d2gamma5_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt tau.
virtual Real e(Real pressure, Real temperature) const

◆ e_spndl_from_v()

Real SinglePhaseFluidProperties::e_spndl_from_v ( Real  v) const
virtualinherited

Specific internal energy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in StiffenedGasFluidProperties.

Definition at line 451 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e().

452 {
453  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
454 }
const std::string name
Definition: Setup.h:22

◆ execute()

virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Definition at line 35 of file FluidProperties.h.

35 {}

◆ finalize()

virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Definition at line 37 of file FluidProperties.h.

37 {}

◆ fluidName()

std::string Water97FluidProperties::fluidName ( ) const
overridevirtual

Fluid name.

Returns
string representing fluid name

Reimplemented from SinglePhaseFluidProperties.

Definition at line 41 of file Water97FluidProperties.C.

42 {
43  return "water";
44 }

◆ gamma1()

Real Water97FluidProperties::gamma1 ( Real  pi,
Real  tau 
) const
protected

Gibbs free energy in Region 1 - single phase liquid region.

From Eq. (7) From Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam, IAPWS 2007.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
Gibbs free energy (-)

Definition at line 931 of file Water97FluidProperties.C.

Referenced by s_from_p_T().

932 {
933  Real sum = 0.0;
934  for (std::size_t i = 0; i < _n1.size(); ++i)
935  sum += _n1[i] * MathUtils::pow(7.1 - pi, _I1[i]) * MathUtils::pow(tau - 1.222, _J1[i]);
936 
937  return sum;
938 }
const std::array< int, 34 > _J1
const std::array< Real, 34 > _n1
Reference constants used in to calculate thermophysical properties of water.
const std::array< int, 34 > _I1
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ gamma2()

Real Water97FluidProperties::gamma2 ( Real  pi,
Real  tau 
) const
protected

Gibbs free energy in Region 2 - superheated steam.

From Eq. (15) From Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam, IAPWS 2007.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
Gibbs free energy (-)

Definition at line 996 of file Water97FluidProperties.C.

Referenced by s_from_p_T().

997 {
998  // Ideal gas part of the Gibbs free energy
999  Real sum0 = 0.0;
1000  for (std::size_t i = 0; i < _n02.size(); ++i)
1001  sum0 += _n02[i] * MathUtils::pow(tau, _J02[i]);
1002 
1003  Real g0 = std::log(pi) + sum0;
1004 
1005  // Residual part of the Gibbs free energy
1006  Real gr = 0.0;
1007  for (std::size_t i = 0; i < _n2.size(); ++i)
1008  gr += _n2[i] * MathUtils::pow(pi, _I2[i]) * MathUtils::pow(tau - 0.5, _J2[i]);
1009 
1010  return g0 + gr;
1011 }
const std::array< Real, 43 > _n2
const std::array< int, 9 > _J02
const std::array< int, 43 > _J2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 9 > _n02
Constants for region 2.
const std::array< int, 43 > _I2

◆ gamma5()

Real Water97FluidProperties::gamma5 ( Real  pi,
Real  tau 
) const
protected

Gibbs free energy in Region 5.

From Eq. (32) From Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam, IAPWS 2007.

Parameters
pireduced pressure (-)
taureduced temperature (-)
Returns
Gibbs free energy (-)

Definition at line 1154 of file Water97FluidProperties.C.

Referenced by s_from_p_T().

1155 {
1156  // Ideal gas part of the Gibbs free energy
1157  Real sum0 = 0.0;
1158  for (std::size_t i = 0; i < _n05.size(); ++i)
1159  sum0 += _n05[i] * MathUtils::pow(tau, _J05[i]);
1160 
1161  Real g0 = std::log(pi) + sum0;
1162 
1163  // Residual part of the Gibbs free energy
1164  Real gr = 0.0;
1165  for (std::size_t i = 0; i < _n5.size(); ++i)
1166  gr += _n5[i] * MathUtils::pow(pi, _I5[i]) * MathUtils::pow(tau, _J5[i]);
1167 
1168  return g0 + gr;
1169 }
const std::array< int, 6 > _I5
const std::array< int, 6 > _J5
const std::array< int, 6 > _J05
Constants for region 5.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 6 > _n5
const std::array< Real, 6 > _n05

◆ gamma_from_p_T()

Real SinglePhaseFluidProperties::gamma_from_p_T ( Real  pressure,
Real  temperature 
) const
virtualinherited

Adiabatic index - ratio of specific heats.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
gamma (-)

Reimplemented in IdealGasFluidProperties.

Definition at line 148 of file SinglePhaseFluidProperties.C.

149 {
150  return cp_from_p_T(p, T) / cv_from_p_T(p, T);
151 }

◆ gamma_from_v_e()

Real SinglePhaseFluidProperties::gamma_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Adiabatic index - ratio of specific heats.

Parameters
vspecific volume
especific internal energy
Returns
gamma (-)

Reimplemented in IdealGasFluidProperties.

Definition at line 142 of file SinglePhaseFluidProperties.C.

143 {
144  return cp_from_v_e(v, e) / cv_from_v_e(v, e);
145 }
virtual Real e(Real pressure, Real temperature) const

◆ h()

Real SinglePhaseFluidProperties::h ( Real  p,
Real  T 
) const
virtualinherited

◆ h_dpT()

void SinglePhaseFluidProperties::h_dpT ( Real  pressure,
Real  temperature,
Real &  h,
Real &  dh_dp,
Real &  dh_dT 
) const
virtualinherited

Specific enthalpy and its derivatives from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
[out]hspecific enthalpy (J/kg)
[out]dh_dpderivative of specific enthalpy w.r.t. pressure
[out]dh_dTderivative of specific enthalpy w.r.t. temperature

Definition at line 436 of file SinglePhaseFluidProperties.C.

437 {
438  mooseDeprecated(name(), ": h_dpT() is deprecated. Use h_from_p_T() instead");
439 
440  h_from_p_T(p, T, h, dh_dp, dh_dT);
441 }
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.
const std::string name
Definition: Setup.h:22

◆ h_from_p_T() [1/2]

Real Water97FluidProperties::h_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 683 of file Water97FluidProperties.C.

Referenced by inRegionPH().

684 {
685  Real enthalpy, pi, tau, delta;
686 
687  // Determine which region the point is in
688  unsigned int region = inRegion(pressure, temperature);
689  switch (region)
690  {
691  case 1:
692  pi = pressure / _p_star[0];
693  tau = _T_star[0] / temperature;
694  enthalpy = _Rw * _T_star[0] * dgamma1_dtau(pi, tau);
695  break;
696 
697  case 2:
698  pi = pressure / _p_star[1];
699  tau = _T_star[1] / temperature;
700  enthalpy = _Rw * _T_star[1] * dgamma2_dtau(pi, tau);
701  break;
702 
703  case 3:
704  {
705  // Calculate density first, then use that in Helmholtz free energy
706  Real density3 = densityRegion3(pressure, temperature);
707  delta = density3 / _rho_critical;
708  tau = _T_star[2] / temperature;
709  enthalpy =
710  _Rw * temperature * (tau * dphi3_dtau(delta, tau) + delta * dphi3_ddelta(delta, tau));
711  break;
712  }
713 
714  case 5:
715  pi = pressure / _p_star[4];
716  tau = _T_star[4] / temperature;
717  enthalpy = _Rw * _T_star[4] * dgamma5_dtau(pi, tau);
718  break;
719 
720  default:
721  mooseError("Water97FluidProperties::inRegion has given an incorrect region");
722  }
723  return enthalpy;
724 }
Real dgamma5_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt tau.
Real dphi3_dtau(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt tau.
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real dgamma2_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt tau.
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
const std::string enthalpy
Definition: NS.h:28
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
const Real _rho_critical
Critical density (kg/m^3)
Real dgamma1_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt tau.
Real dphi3_ddelta(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt delta.
const std::string pressure
Definition: NS.h:26
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...

◆ h_from_p_T() [2/2]

void Water97FluidProperties::h_from_p_T ( Real  pressure,
Real  temperature,
Real &  h,
Real &  dh_dp,
Real &  dh_dT 
) const
overridevirtual

Definition at line 727 of file Water97FluidProperties.C.

729 {
730  Real enthalpy, pi, tau, delta, denthalpy_dp, denthalpy_dT;
731 
732  // Determine which region the point is in
733  unsigned int region = inRegion(pressure, temperature);
734  switch (region)
735  {
736  case 1:
737  pi = pressure / _p_star[0];
738  tau = _T_star[0] / temperature;
739  enthalpy = _Rw * _T_star[0] * dgamma1_dtau(pi, tau);
740  denthalpy_dp = _Rw * _T_star[0] * d2gamma1_dpitau(pi, tau) / _p_star[0];
741  denthalpy_dT = -_Rw * tau * tau * d2gamma1_dtau2(pi, tau);
742  break;
743 
744  case 2:
745  pi = pressure / _p_star[1];
746  tau = _T_star[1] / temperature;
747  enthalpy = _Rw * _T_star[1] * dgamma2_dtau(pi, tau);
748  denthalpy_dp = _Rw * _T_star[1] * d2gamma2_dpitau(pi, tau) / _p_star[1];
749  denthalpy_dT = -_Rw * tau * tau * d2gamma2_dtau2(pi, tau);
750  break;
751 
752  case 3:
753  {
754  // Calculate density first, then use that in Helmholtz free energy
755  Real density3 = densityRegion3(pressure, temperature);
756  delta = density3 / _rho_critical;
757  tau = _T_star[2] / temperature;
758  Real dpdd = dphi3_ddelta(delta, tau);
759  Real d2pddt = d2phi3_ddeltatau(delta, tau);
760  Real d2pdd2 = d2phi3_ddelta2(delta, tau);
761  enthalpy = _Rw * temperature * (tau * dphi3_dtau(delta, tau) + delta * dpdd);
762  denthalpy_dp = (d2pddt + dpdd + delta * d2pdd2) / _rho_critical /
763  (2.0 * delta * dpdd + delta * delta * d2pdd2);
764  denthalpy_dT = _Rw * delta * dpdd * (1.0 - tau * d2pddt / dpdd) *
765  (1.0 - tau * d2pddt / dpdd) / (2.0 + delta * d2pdd2 / dpdd) -
766  _Rw * tau * tau * d2phi3_dtau2(delta, tau);
767  break;
768  }
769 
770  case 5:
771  pi = pressure / _p_star[4];
772  tau = _T_star[4] / temperature;
773  enthalpy = _Rw * _T_star[4] * dgamma5_dtau(pi, tau);
774  denthalpy_dp = _Rw * _T_star[4] * d2gamma5_dpitau(pi, tau) / _p_star[4];
775  denthalpy_dT = -_Rw * tau * tau * d2gamma5_dtau2(pi, tau);
776  break;
777 
778  default:
779  mooseError("Water97FluidProperties::inRegion has given an incorrect region");
780  }
781  h = enthalpy;
782  dh_dp = denthalpy_dp;
783  dh_dT = denthalpy_dT;
784 }
Real dgamma5_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt tau.
Real dphi3_dtau(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt tau.
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real d2phi3_ddeltatau(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta and tau.
Real dgamma2_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt tau.
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.
Real d2gamma1_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt pi and tau.
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
const std::string enthalpy
Definition: NS.h:28
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
Real d2gamma5_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt pi and tau.
Real d2phi3_ddelta2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta.
Real d2phi3_dtau2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt tau.
Real d2gamma2_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt pi and tau.
const Real _rho_critical
Critical density (kg/m^3)
Real dgamma1_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt tau.
Real dphi3_ddelta(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt delta.
const std::string pressure
Definition: NS.h:26
Real d2gamma1_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt tau.
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...
Real d2gamma2_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt tau.
Real d2gamma5_dtau2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt tau.

◆ henryConstant() [1/2]

Real SinglePhaseFluidProperties::henryConstant ( Real  temperature) const
virtualinherited

Henry's law constant for dissolution in water.

Parameters
temperaturefluid temperature (K)
Returns
Henry's constant

Reimplemented in CO2FluidProperties, TabulatedFluidProperties, SimpleFluidProperties, IdealGasFluidProperties, HydrogenFluidProperties, NitrogenFluidProperties, and MethaneFluidProperties.

Definition at line 243 of file SinglePhaseFluidProperties.C.

Referenced by PorousFlowWaterNCG::enthalpyOfDissolution(), PorousFlowWaterNCG::equilibriumMassFractions(), TabulatedFluidProperties::henryConstant(), PorousFlowBrineCO2::henryConstant(), and SinglePhaseFluidProperties::henryConstant_dT().

244 {
245  mooseError(name(), ": henryConstant() is not implemented");
246 }
const std::string name
Definition: Setup.h:22

◆ henryConstant() [2/2]

void SinglePhaseFluidProperties::henryConstant ( Real  temperature,
Real &  Kh,
Real &  dKh_dT 
) const
virtualinherited

Henry's law constant for dissolution in water and derivative wrt temperature.

Parameters
temperaturefluid temperature (K)
[out]KhHenry's constant
[out]dKh_dTderivative of Kh wrt temperature

Reimplemented in CO2FluidProperties, TabulatedFluidProperties, SimpleFluidProperties, IdealGasFluidProperties, HydrogenFluidProperties, NitrogenFluidProperties, and MethaneFluidProperties.

Definition at line 249 of file SinglePhaseFluidProperties.C.

250 {
251  mooseError(name(), ": henryConstant() is not implemented");
252 }
const std::string name
Definition: Setup.h:22

◆ henryConstant_dT()

void SinglePhaseFluidProperties::henryConstant_dT ( Real  temperature,
Real &  Kh,
Real &  dKh_dT 
) const
virtualinherited

Definition at line 255 of file SinglePhaseFluidProperties.C.

256 {
257  mooseDeprecated(name(), ": henryConstant_dT() is deprecated. Use henryConstant() instead");
258 
259  henryConstant(T, Kh, dKh_dT);
260 }
const std::string name
Definition: Setup.h:22
virtual Real henryConstant(Real temperature) const
Henry&#39;s law constant for dissolution in water.

◆ henryConstantIAPWS() [1/2]

Real SinglePhaseFluidProperties::henryConstantIAPWS ( Real  temperature,
Real  A,
Real  B,
Real  C 
) const
protectedvirtualinherited

IAPWS formulation of Henry's law constant for dissolution in water From Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H20 and D20 at high temperatures, IAPWS (2004)

Definition at line 160 of file SinglePhaseFluidProperties.C.

Referenced by MethaneFluidProperties::henryConstant(), NitrogenFluidProperties::henryConstant(), HydrogenFluidProperties::henryConstant(), CO2FluidProperties::henryConstant(), and SinglePhaseFluidProperties::henryConstantIAPWS_dT().

161 {
162  const Real Tr = T / 647.096;
163  const Real tau = 1.0 - Tr;
164 
165  const Real lnkh =
166  A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
167 
168  // The vapor pressure used in this formulation
169  const std::vector<Real> a{
170  -7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
171  const std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
172  Real sum = 0.0;
173 
174  for (std::size_t i = 0; i < a.size(); ++i)
175  sum += a[i] * std::pow(tau, b[i]);
176 
177  return 22.064e6 * std::exp(sum / Tr) * std::exp(lnkh);
178 }
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ henryConstantIAPWS() [2/2]

void SinglePhaseFluidProperties::henryConstantIAPWS ( Real  temperature,
Real &  Kh,
Real &  dKh_dT,
Real  A,
Real  B,
Real  C 
) const
protectedvirtualinherited

Definition at line 181 of file SinglePhaseFluidProperties.C.

183 {
184  const Real pc = 22.064e6;
185  const Real Tc = 647.096;
186 
187  const Real Tr = T / Tc;
188  const Real tau = 1.0 - Tr;
189 
190  const Real lnkh =
191  A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
192  const Real dlnkh_dT =
193  (-A / Tr / Tr - B * std::pow(tau, 0.355) / Tr / Tr - 0.355 * B * std::pow(tau, -0.645) / Tr -
194  0.41 * C * std::pow(Tr, -1.41) * std::exp(tau) - C * std::pow(Tr, -0.41) * std::exp(tau)) /
195  Tc;
196 
197  // The vapor pressure used in this formulation
198  const std::vector<Real> a{
199  -7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
200  const std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
201  Real sum = 0.0;
202  Real dsum = 0.0;
203 
204  for (std::size_t i = 0; i < a.size(); ++i)
205  {
206  sum += a[i] * std::pow(tau, b[i]);
207  dsum += a[i] * b[i] * std::pow(tau, b[i] - 1.0);
208  }
209 
210  const Real p = pc * std::exp(sum / Tr);
211  const Real dp_dT = -p / Tc / Tr * (sum / Tr + dsum);
212 
213  // Henry's constant and its derivative wrt temperature
214  Kh = p * std::exp(lnkh);
215  dKh_dT = (p * dlnkh_dT + dp_dT) * std::exp(lnkh);
216 }
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ henryConstantIAPWS_dT()

void SinglePhaseFluidProperties::henryConstantIAPWS_dT ( Real  temperature,
Real &  Kh,
Real &  dKh_dT,
Real  A,
Real  B,
Real  C 
) const
protectedvirtualinherited

Definition at line 219 of file SinglePhaseFluidProperties.C.

221 {
222  mooseDeprecated(name(),
223  ":henryConstantIAPWS_dT() is deprecated. Use henryConstantIAPWS() instead");
224 
225  henryConstantIAPWS(T, Kh, dKh_dT, A, B, C);
226 }
const std::string name
Definition: Setup.h:22
virtual Real henryConstantIAPWS(Real temperature, Real A, Real B, Real C) const
IAPWS formulation of Henry&#39;s law constant for dissolution in water From Guidelines on the Henry&#39;s con...

◆ initialize()

virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Definition at line 36 of file FluidProperties.h.

36 {}

◆ inRegion()

unsigned int Water97FluidProperties::inRegion ( Real  pressure,
Real  temperature 
) const

Determines the phase region that the given pressure and temperature values lie in.

Parameters
pressurewater pressure (Pa)
temperaturewater temperature (K)
Returns
region phase region index

Definition at line 885 of file Water97FluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), cv_from_p_T(), e_from_p_T(), h_from_p_T(), rho_from_p_T(), and s_from_p_T().

886 {
887  // Valid for 273.15 K <= T <= 1073.15 K, p <= 100 MPa
888  // 1073.15 K <= T <= 2273.15 K, p <= 50 Mpa
889  if (temperature >= 273.15 && temperature <= 1073.15)
890  {
891  if (pressure < vaporPressure(273.15) || pressure > 100.0e6)
892  throw MooseException("Pressure " + Moose::stringify(pressure) + " is out of range in " +
893  name() + ": inRegion()");
894  }
895  else if (temperature > 1073.15 && temperature <= 2273.15)
896  {
897  if (pressure < 0.0 || pressure > 50.0e6)
898  throw MooseException("Pressure " + Moose::stringify(pressure) + " is out of range in " +
899  name() + ": inRegion()");
900  }
901  else
902  throw MooseException("Temperature " + Moose::stringify(temperature) + " is out of range in " +
903  name() + ": inRegion()");
904 
905  // Determine the phase region that the (P, T) point lies in
906  unsigned int region;
907 
908  if (temperature >= 273.15 && temperature <= 623.15)
909  {
910  if (pressure > vaporPressure(temperature) && pressure <= 100.0e6)
911  region = 1;
912  else
913  region = 2;
914  }
915  else if (temperature > 623.15 && temperature <= 863.15)
916  {
917  if (pressure <= b23p(temperature))
918  region = 2;
919  else
920  region = 3;
921  }
922  else if (temperature > 863.15 && temperature <= 1073.15)
923  region = 2;
924  else
925  region = 5;
926 
927  return region;
928 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
Real b23p(Real temperature) const
Auxillary equation for the boundary between regions 2 and 3.
const std::string pressure
Definition: NS.h:26
virtual Real vaporPressure(Real temperature) const override
Vapor pressure.

◆ inRegionPH()

unsigned int Water97FluidProperties::inRegionPH ( Real  pressure,
Real  enthalpy 
) const
protected

Determines the phase region that the given pressure and enthaply values lie in.

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
region phase region index

Definition at line 1552 of file Water97FluidProperties.C.

Referenced by temperature_from_ph().

1553 {
1554  unsigned int region;
1555 
1556  // Need to calculate enthalpies at the boundaries to delineate regions
1557  Real p273 = vaporPressure(273.15);
1558  Real p623 = vaporPressure(623.15);
1559 
1560  if (pressure >= p273 && pressure <= p623)
1561  {
1562  if (enthalpy >= h_from_p_T(pressure, 273.15) &&
1564  region = 1;
1566  enthalpy <= h_from_p_T(pressure, 1073.15))
1567  region = 2;
1568  else if (enthalpy > h_from_p_T(pressure, 1073.15) && enthalpy <= h_from_p_T(pressure, 2273.15))
1569  region = 5;
1570  else
1571  throw MooseException("Enthalpy " + Moose::stringify(enthalpy) + " is out of range in " +
1572  name() + ": inRegionPH()");
1573  }
1574  else if (pressure > p623 && pressure <= 50.0e6)
1575  {
1576  if (enthalpy >= h_from_p_T(pressure, 273.15) && enthalpy <= h_from_p_T(pressure, 623.15))
1577  region = 1;
1578  else if (enthalpy > h_from_p_T(pressure, 623.15) &&
1580  region = 3;
1581  else if (enthalpy > h_from_p_T(pressure, b23T(pressure)) &&
1582  enthalpy <= h_from_p_T(pressure, 1073.15))
1583  region = 2;
1584  else if (enthalpy > h_from_p_T(pressure, 1073.15) && enthalpy <= h_from_p_T(pressure, 2273.15))
1585  region = 5;
1586  else
1587  throw MooseException("Enthalpy " + Moose::stringify(enthalpy) + " is out of range in " +
1588  name() + ": inRegionPH()");
1589  }
1590  else if (pressure > 50.0e6 && pressure <= 100.0e6)
1591  {
1592  if (enthalpy >= h_from_p_T(pressure, 273.15) && enthalpy <= h_from_p_T(pressure, 623.15))
1593  region = 1;
1594  else if (enthalpy > h_from_p_T(pressure, 623.15) &&
1596  region = 3;
1597  else if (enthalpy > h_from_p_T(pressure, b23T(pressure)) &&
1598  enthalpy <= h_from_p_T(pressure, 1073.15))
1599  region = 2;
1600  else
1601  throw MooseException("Enthalpy " + Moose::stringify(enthalpy) + " is out of range in " +
1602  name() + ": inRegionPH()");
1603  }
1604  else
1605  throw MooseException("Pressure " + Moose::stringify(pressure) + " is out of range in " +
1606  name() + ": inRegionPH()");
1607 
1608  return region;
1609 }
Real b23T(Real pressure) const
Auxillary equation for the boundary between regions 2 and 3.
virtual Real h_from_p_T(Real pressure, Real temperature) const override
const std::string enthalpy
Definition: NS.h:28
const std::string name
Definition: Setup.h:22
Real vaporTemperature(Real pressure) const
Saturation temperature as a function of pressure.
const std::string pressure
Definition: NS.h:26
virtual Real vaporPressure(Real temperature) const override
Vapor pressure.

◆ k()

Real SinglePhaseFluidProperties::k ( Real  pressure,
Real  temperature 
) const
virtualinherited

Thermal conductivity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
thermal conductivity (W/m/K)

Definition at line 404 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::k_dpT(), MethaneFluidProperties::k_from_p_T(), SimpleFluidProperties::k_from_p_T(), NitrogenFluidProperties::k_from_p_T(), HydrogenFluidProperties::k_from_p_T(), NaClFluidProperties::k_from_p_T(), IdealGasFluidProperties::k_from_p_T(), StiffenedGasFluidProperties::k_from_p_T(), TabulatedFluidProperties::k_from_p_T(), and CO2FluidProperties::k_from_p_T().

405 {
406  mooseDeprecated(name(), ": k() is deprecated. Use k_from_p_T() instead");
407 
408  return k_from_p_T(p, T);
409 }
const std::string name
Definition: Setup.h:22

◆ k_dpT()

void SinglePhaseFluidProperties::k_dpT ( Real  pressure,
Real  temperature,
Real &  k,
Real &  dk_dp,
Real &  dk_dT 
) const
virtualinherited

Thermal conductivity and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]thermalconductivity (W/m/K)
[out]derivativeof thermal conductivity wrt pressure
[out]derivativeof thermal conductivity wrt temperature

Definition at line 412 of file SinglePhaseFluidProperties.C.

413 {
414  mooseDeprecated(name(), ": k_dpT() is deprecated. Use k_from_p_T() instead");
415 
416  k_from_p_T(p, T, k, dk_dp, dk_dT);
417 }
virtual Real k(Real pressure, Real temperature) const
Thermal conductivity.
const std::string name
Definition: Setup.h:22

◆ k_from_p_T() [1/2]

Real Water97FluidProperties::k_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 588 of file Water97FluidProperties.C.

589 {
590  Real rho = this->rho_from_p_T(pressure, temperature);
591  return this->k_from_rho_T(rho, temperature);
592 }
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
virtual Real k_from_rho_T(Real density, Real temperature) const override
virtual Real rho_from_p_T(Real pressure, Real temperature) const override

◆ k_from_p_T() [2/2]

void Water97FluidProperties::k_from_p_T ( Real  pressure,
Real  temperature,
Real &  k,
Real &  dk_dp,
Real &  dk_dT 
) const
overridevirtual

Definition at line 595 of file Water97FluidProperties.C.

596 {
597  mooseError(name(), ": k_from_p_T() is not implemented.");
598 }
const std::string name
Definition: Setup.h:22

◆ k_from_rho_T()

Real Water97FluidProperties::k_from_rho_T ( Real  density,
Real  temperature 
) const
overridevirtual

Definition at line 601 of file Water97FluidProperties.C.

Referenced by k_from_p_T().

602 {
603  // Scale the density and temperature. Note that the scales are slightly
604  // different to the critical values used in IAPWS-IF97
605  Real Tbar = temperature / 647.26;
606  Real rhobar = density / 317.7;
607 
608  // Ideal gas component
609  Real sum0 = 0.0;
610 
611  for (std::size_t i = 0; i < _k_a.size(); ++i)
612  sum0 += _k_a[i] * MathUtils::pow(Tbar, i);
613 
614  Real lambda0 = std::sqrt(Tbar) * sum0;
615 
616  // The contribution due to finite density
617  Real lambda1 = -0.39707 + 0.400302 * rhobar +
618  1.06 * std::exp(-0.171587 * Utility::pow<2>(rhobar + 2.392190));
619 
620  // Critical enhancement
621  Real DeltaT = std::abs(Tbar - 1.0) + 0.00308976;
622  Real Q = 2.0 + 0.0822994 / std::pow(DeltaT, 0.6);
623  Real S = (Tbar >= 1.0 ? 1.0 / DeltaT : 10.0932 / std::pow(DeltaT, 0.6));
624 
625  Real lambda2 =
626  (0.0701309 / Utility::pow<10>(Tbar) + 0.011852) * std::pow(rhobar, 1.8) *
627  std::exp(0.642857 * (1.0 - std::pow(rhobar, 2.8))) +
628  0.00169937 * S * std::pow(rhobar, Q) *
629  std::exp((Q / (1.0 + Q)) * (1.0 - std::pow(rhobar, 1.0 + Q))) -
630  1.02 * std::exp(-4.11717 * std::pow(Tbar, 1.5) - 6.17937 / Utility::pow<5>(rhobar));
631 
632  return lambda0 + lambda1 + lambda2;
633 }
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::array< Real, 4 > _k_a
Constants for thermal conductivity.

◆ molarMass()

Real Water97FluidProperties::molarMass ( ) const
overridevirtual

Molar mass [kg/mol].

Returns
molar mass

Reimplemented from SinglePhaseFluidProperties.

Definition at line 47 of file Water97FluidProperties.C.

48 {
49  return _Mh2o;
50 }
const Real _Mh2o
Water molar mass (kg/mol)

◆ mu()

Real SinglePhaseFluidProperties::mu ( Real  pressure,
Real  temperature 
) const
virtualinherited

◆ mu_dpT()

void SinglePhaseFluidProperties::mu_dpT ( Real  pressure,
Real  temperature,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
virtualinherited

Dynamic viscosity and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]muviscosity (Pa.s)
[out]dmu_dpderivative of viscosity wrt pressure
[out]dmu_dTderivative of viscosity wrt temperature

Definition at line 352 of file SinglePhaseFluidProperties.C.

353 {
354  mooseDeprecated(name(), ": mu_dpT() is deprecated. Use mu_from_p_T() instead");
355 
356  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
357 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string name
Definition: Setup.h:22

◆ mu_drhoT_from_rho_T()

void SinglePhaseFluidProperties::mu_drhoT_from_rho_T ( Real  density,
Real  temperature,
Real  ddensity_dT,
Real &  mu,
Real &  dmu_drho,
Real &  dmu_dT 
) const
virtualinherited

Definition at line 235 of file SinglePhaseFluidProperties.C.

237 {
238  mooseDeprecated(name(), ":mu_drhoT_from_rho_T() is deprecated. Use mu_from_rho_T() instead");
239 
240  mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
241 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string name
Definition: Setup.h:22
virtual void mu_from_rho_T(Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const
Dynamic viscosity and its derivatives wrt density and temperature TODO: this shouldn&#39;t need 3 input a...

◆ mu_from_p_T() [1/2]

Real Water97FluidProperties::mu_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 470 of file Water97FluidProperties.C.

471 {
472  Real rho = this->rho_from_p_T(pressure, temperature);
473  return this->mu_from_rho_T(rho, temperature);
474 }
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real mu_from_rho_T(Real density, Real temperature) const override

◆ mu_from_p_T() [2/2]

void Water97FluidProperties::mu_from_p_T ( Real  pressure,
Real  temperature,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
overridevirtual

Definition at line 477 of file Water97FluidProperties.C.

479 {
480  Real rho, drho_dp, drho_dT;
481  this->rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
482  Real dmu_drho;
483  this->mu_from_rho_T(rho, temperature, drho_dT, mu, dmu_drho, dmu_dT);
484  dmu_dp = dmu_drho * drho_dp;
485 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real mu_from_rho_T(Real density, Real temperature) const override

◆ mu_from_rho_T() [1/2]

Real Water97FluidProperties::mu_from_rho_T ( Real  density,
Real  temperature 
) const
overridevirtual

Definition at line 488 of file Water97FluidProperties.C.

Referenced by mu_from_p_T(), and rho_mu_from_p_T().

489 {
490  Real mu_star = 1.e-6;
491  Real rhobar = density / _rho_critical;
492  Real Tbar = temperature / _T_critical;
493 
494  // Viscosity in limit of zero density
495  Real sum0 = 0.0;
496  for (std::size_t i = 0; i < _mu_H0.size(); ++i)
497  sum0 += _mu_H0[i] / MathUtils::pow(Tbar, i);
498 
499  Real mu0 = 100.0 * std::sqrt(Tbar) / sum0;
500 
501  // Residual component due to finite density
502  Real sum1 = 0.0;
503  for (std::size_t i = 0; i < _mu_H1.size(); ++i)
504  sum1 += MathUtils::pow(1.0 / Tbar - 1.0, _mu_I[i]) * _mu_H1[i] *
505  MathUtils::pow(rhobar - 1.0, _mu_J[i]);
506 
507  Real mu1 = std::exp(rhobar * sum1);
508 
509  // The water viscosity (in Pa.s) is then given by
510  return mu_star * mu0 * mu1;
511 }
const Real _T_critical
Critical temperature (K)
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const std::array< int, 21 > _mu_J
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _rho_critical
Critical density (kg/m^3)
const std::array< int, 21 > _mu_I
Constants from Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance...
const std::array< Real, 21 > _mu_H1
const std::array< Real, 4 > _mu_H0

◆ mu_from_rho_T() [2/2]

void Water97FluidProperties::mu_from_rho_T ( Real  density,
Real  temperature,
Real  ddensity_dT,
Real &  mu,
Real &  dmu_drho,
Real &  dmu_dT 
) const
overridevirtual

Dynamic viscosity and its derivatives wrt density and temperature TODO: this shouldn't need 3 input args - AD will assume/call the 2-input version.

Parameters
densityfluid density (kg/m^3)
temperaturefluid temperature (K)
ddensity_dTderivative of density wrt temperature
[out]muviscosity (Pa.s)
[out]dmu_drhoderivative of viscosity wrt density
[out]dmu_dTderivative of viscosity wrt temperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 514 of file Water97FluidProperties.C.

520 {
521  Real mu_star = 1.0e-6;
522  Real rhobar = density / _rho_critical;
523  Real Tbar = temperature / _T_critical;
524  Real drhobar_drho = 1.0 / _rho_critical;
525  Real dTbar_dT = 1.0 / _T_critical;
526 
527  // Limit of zero density. Derivative wrt rho is 0
528  Real sum0 = 0.0, dsum0_dTbar = 0.0;
529  for (std::size_t i = 0; i < _mu_H0.size(); ++i)
530  {
531  sum0 += _mu_H0[i] / MathUtils::pow(Tbar, i);
532  dsum0_dTbar -= i * _mu_H0[i] / MathUtils::pow(Tbar, i + 1);
533  }
534 
535  Real mu0 = 100.0 * std::sqrt(Tbar) / sum0;
536  Real dmu0_dTbar =
537  50.0 / std::sqrt(Tbar) / sum0 - 100.0 * std::sqrt(Tbar) * dsum0_dTbar / sum0 / sum0;
538 
539  // Residual component due to finite density
540  Real sum1 = 0.0, dsum1_drho = 0.0, dsum1_dTbar = 0.0;
541  for (std::size_t i = 0; i < _mu_H1.size(); ++i)
542  {
543  sum1 += MathUtils::pow(1.0 / Tbar - 1.0, _mu_I[i]) * _mu_H1[i] *
544  MathUtils::pow(rhobar - 1.0, _mu_J[i]);
545  dsum1_drho += MathUtils::pow(1.0 / Tbar - 1.0, _mu_I[i]) * _mu_H1[i] * _mu_J[i] *
546  MathUtils::pow(rhobar - 1.0, _mu_J[i] - 1);
547  dsum1_dTbar -= _mu_I[i] * MathUtils::pow(1.0 / Tbar - 1.0, _mu_I[i] - 1) * _mu_H1[i] *
548  MathUtils::pow(rhobar - 1.0, _mu_J[i]) / Tbar / Tbar;
549  }
550 
551  Real mu1 = std::exp(rhobar * sum1);
552  Real dmu1_drho = (sum1 + rhobar * dsum1_drho) * mu1;
553  Real dmu1_dTbar = (rhobar * dsum1_dTbar) * mu1;
554 
555  // Viscosity and its derivatives are then
556  mu = mu_star * mu0 * mu1;
557  dmu_drho = mu_star * mu0 * dmu1_drho * drhobar_drho;
558  dmu_dT = mu_star * (dmu0_dTbar * mu1 + mu0 * dmu1_dTbar) * dTbar_dT + dmu_drho * ddensity_dT;
559 }
const Real _T_critical
Critical temperature (K)
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const std::array< int, 21 > _mu_J
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _rho_critical
Critical density (kg/m^3)
const std::array< int, 21 > _mu_I
Constants from Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance...
const std::array< Real, 21 > _mu_H1
const std::array< Real, 4 > _mu_H0

◆ phi3()

Real Water97FluidProperties::phi3 ( Real  delta,
Real  tau 
) const
protected

Helmholtz free energy in Region 3.

From Eq. (28) From Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam, IAPWS 2007.

Parameters
deltareduced density (-)
taureduced temperature (-)
Returns
Helmholtz free energy (-)

Definition at line 1091 of file Water97FluidProperties.C.

Referenced by s_from_p_T().

1092 {
1093  Real sum = 0.0;
1094  for (std::size_t i = 1; i < _n3.size(); ++i)
1095  sum += _n3[i] * MathUtils::pow(delta, _I3[i]) * MathUtils::pow(tau, _J3[i]);
1096 
1097  return _n3[0] * std::log(delta) + sum;
1098 }
const std::array< int, 40 > _J3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 40 > _I3
const std::array< Real, 40 > _n3
Constants for region 3.

◆ propfunc() [1/15]

SinglePhaseFluidProperties::propfunc ( p  ,
v  ,
e   
)
inherited

Compute a fluid property given for the state defined by two given properties.

For all functions, the first two arguments are the given properties that define the fluid state. For the two-argument variants, the desired property is the return value. The five-argument variants also provide partial derivatives dx/da and dx/db where x is the desired property being computed, a is the first given property, and b is the second given property. The desired property, dx/da, and dx/db are stored into the 3rd, 4th, and 5th arguments respectively.

Properties/parameters used in these function are listed below with their units:

p pressure [Pa] T temperature [K] e specific internal energy [J/kg] v specific volume [m^3/kg] rho density [kg/m^3] h specific enthalpy [J/kg] s specific entropy [J/(kg*K)] mu viscosity [Pa*s] k thermal conductivity [W/(m*K)] c speed of sound [m/s] cp constant-pressure specific heat [J/K] cv constant-volume specific heat [J/K] beta volumetric thermal expansion coefficient [1/K] g Gibbs free energy [J] pp_sat partial pressure at saturation [Pa]

As an example:

// calculate pressure given specific vol and energy: auto pressure = your_fluid_properties_object.p_from_v_e(specific_vol, specific_energy);

// or use the derivative variant: Real dp_dv = 0; // derivative will be stored into here Real dp_de = 0; // derivative will be stored into here your_fluid_properties_object.p_from_v_e(specific_vol, specific_energy, pressure, dp_dv, dp_de);

Automatic differentiation (AD) support is provided through x_from_a_b(DualReal a, DualReal b) versions of the functions where a and b must be ADReal/DualNumber's calculated using all AD-supporting values:

auto v = 1/rho; // rho must be an AD non-linear variable. auto e = rhoE/rho - vel_energy; // rhoE and vel_energy must be AD variables/numbers also. auto pressure = your_fluid_properties_object.p_from_v_e(v, e); // pressure now contains partial derivatives w.r.t. all degrees of freedom

◆ propfunc() [2/15]

e SinglePhaseFluidProperties::propfunc ( c  ,
v  ,
e   
)
inherited

◆ propfunc() [3/15]

e e SinglePhaseFluidProperties::propfunc ( cv  ,
v  ,
e   
)
inherited

◆ propfunc() [4/15]

e e e SinglePhaseFluidProperties::propfunc ( k  ,
v  ,
e   
)
inherited

◆ propfunc() [5/15]

e e e e SinglePhaseFluidProperties::propfunc ( s  ,
h  ,
p   
)
inherited

◆ propfunc() [6/15]

e e e e s SinglePhaseFluidProperties::propfunc ( e  ,
v  ,
h   
)
inherited

◆ propfunc() [7/15]

e e e e s T SinglePhaseFluidProperties::propfunc ( pp_sat  ,
p  ,
T   
)
inherited

◆ propfunc() [8/15]

e e e e s T T SinglePhaseFluidProperties::propfunc ( k  ,
rho  ,
T   
)
inherited

◆ propfunc() [9/15]

e e e e s T T T SinglePhaseFluidProperties::propfunc ( cp  ,
p  ,
T   
)
inherited

◆ propfunc() [10/15]

e e e e s T T T T SinglePhaseFluidProperties::propfunc ( mu  ,
p  ,
T   
)
inherited

◆ propfunc() [11/15]

e e e e s T T T T T SinglePhaseFluidProperties::propfunc ( rho  ,
p  ,
T   
)
inherited

◆ propfunc() [12/15]

e e e e s T T T T T rho SinglePhaseFluidProperties::propfunc ( e  ,
T  ,
v   
)
inherited

◆ propfunc() [13/15]

e e e e s T T T T T rho v SinglePhaseFluidProperties::propfunc ( h  ,
T  ,
v   
)
inherited

◆ propfunc() [14/15]

e e e e s T T T T T rho v v SinglePhaseFluidProperties::propfunc ( cv  ,
T  ,
v   
)
inherited

◆ propfunc() [15/15]

e e e e s T T T T T rho v v T SinglePhaseFluidProperties::propfunc ( p  ,
h  ,
s   
)
inherited

◆ rho()

virtual Real SinglePhaseFluidProperties::rho ( Real  p,
Real  T 
) const
virtualinherited

Density from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
Returns
density (kg/m^3)

◆ rho_dpT()

void SinglePhaseFluidProperties::rho_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
virtualinherited

Density and its derivatives from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
[out]rhodensity (kg/m^3)
[out]drho_dpderivative of density w.r.t. pressure
[out]drho_dTderivative of density w.r.t. temperature

Definition at line 282 of file SinglePhaseFluidProperties.C.

284 {
285  mooseDeprecated(name(), ": rho_dpT() is deprecated. Use rho_from_p_T() instead");
286 
287  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
288 }
const std::string name
Definition: Setup.h:22

◆ rho_e_dpT()

void SinglePhaseFluidProperties::rho_e_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
virtualinherited

Definition at line 321 of file SinglePhaseFluidProperties.C.

329 {
330  mooseDeprecated(name(), ": rho_e_dpT() is deprecated. Use rho_e_from_p_T() instead");
331 
332  rho_e_from_p_T(p, T, rho, drho_dp, drho_dT, e, de_dp, de_dT);
333 }
virtual void rho_e_from_p_T(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const
Density and internal energy and their derivatives wrt pressure and temperature.
const std::string name
Definition: Setup.h:22
virtual Real e(Real pressure, Real temperature) const

◆ rho_e_from_p_T()

void SinglePhaseFluidProperties::rho_e_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
virtualinherited

Density and internal energy and their derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]rhodensity (kg/m^3)
[out]drho_dpderivative of density wrt pressure
[out]drho_dTderivative of density wrt temperature
[out]einternal energy (J/kg)
[out]de_dpderivative of internal energy wrt pressure
[out]de_dTderivative of internal energy wrt temperature

Definition at line 307 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::rho_e_dpT().

315 {
316  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
317  e_from_p_T(p, T, e, de_dp, de_dT);
318 }
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
virtual Real e(Real pressure, Real temperature) const

◆ rho_from_p_T() [1/2]

Real Water97FluidProperties::rho_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 83 of file Water97FluidProperties.C.

Referenced by k_from_p_T(), mu_from_p_T(), rho_from_p_T(), and rho_mu_from_p_T().

84 {
85  Real density, pi, tau;
86 
87  // Determine which region the point is in
88  unsigned int region = inRegion(pressure, temperature);
89 
90  switch (region)
91  {
92  case 1:
93  pi = pressure / _p_star[0];
94  tau = _T_star[0] / temperature;
95  density = pressure / (pi * _Rw * temperature * dgamma1_dpi(pi, tau));
96  break;
97 
98  case 2:
99  pi = pressure / _p_star[1];
100  tau = _T_star[1] / temperature;
101  density = pressure / (pi * _Rw * temperature * dgamma2_dpi(pi, tau));
102  break;
103 
104  case 3:
106  break;
107 
108  case 5:
109  pi = pressure / _p_star[4];
110  tau = _T_star[4] / temperature;
111  density = pressure / (pi * _Rw * temperature * dgamma5_dpi(pi, tau));
112  break;
113 
114  default:
115  mooseError(name(), ": inRegion() has given an incorrect region");
116  }
117  return density;
118 }
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real dgamma5_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt pi.
Real dgamma2_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt pi.
const std::string density
Definition: NS.h:17
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
const std::string name
Definition: Setup.h:22
Real dgamma1_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt pi.
const std::string pressure
Definition: NS.h:26
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...

◆ rho_from_p_T() [2/2]

void Water97FluidProperties::rho_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
overridevirtual

Definition at line 121 of file Water97FluidProperties.C.

123 {
124  Real pi, tau, ddensity_dp, ddensity_dT;
125 
126  // Determine which region the point is in
127  unsigned int region = inRegion(pressure, temperature);
128 
129  switch (region)
130  {
131  case 1:
132  {
133  pi = pressure / _p_star[0];
134  tau = _T_star[0] / temperature;
135  Real dgdp = dgamma1_dpi(pi, tau);
136  ddensity_dp = -d2gamma1_dpi2(pi, tau) / (_Rw * temperature * dgdp * dgdp);
137  ddensity_dT = -pressure * (dgdp - tau * d2gamma1_dpitau(pi, tau)) /
138  (_Rw * pi * temperature * temperature * dgdp * dgdp);
139  break;
140  }
141 
142  case 2:
143  {
144  pi = pressure / _p_star[1];
145  tau = _T_star[1] / temperature;
146  Real dgdp = dgamma2_dpi(pi, tau);
147  ddensity_dp = -d2gamma2_dpi2(pi, tau) / (_Rw * temperature * dgdp * dgdp);
148  ddensity_dT = -pressure * (dgdp - tau * d2gamma2_dpitau(pi, tau)) /
149  (_Rw * pi * temperature * temperature * dgdp * dgdp);
150  break;
151  }
152 
153  case 3:
154  {
155  // Calculate density first, then use that in Helmholtz free energy
157  Real delta = density / _rho_critical;
158  tau = _T_star[2] / temperature;
159  Real dpdd = dphi3_ddelta(delta, tau);
160  Real d2pdd2 = d2phi3_ddelta2(delta, tau);
161  ddensity_dp = 1.0 / (_Rw * temperature * delta * (2.0 * dpdd + delta * d2pdd2));
162  ddensity_dT = density * (tau * d2phi3_ddeltatau(delta, tau) - dpdd) / temperature /
163  (2.0 * dpdd + delta * d2pdd2);
164  break;
165  }
166 
167  case 5:
168  {
169  pi = pressure / _p_star[4];
170  tau = _T_star[4] / temperature;
171  Real dgdp = dgamma5_dpi(pi, tau);
172  ddensity_dp = -d2gamma5_dpi2(pi, tau) / (_Rw * temperature * dgdp * dgdp);
173  ddensity_dT = -pressure * (dgdp - tau * d2gamma5_dpitau(pi, tau)) /
174  (_Rw * pi * temperature * temperature * dgdp * dgdp);
175  break;
176  }
177 
178  default:
179  mooseError(name(), ": inRegion() has given an incorrect region");
180  }
181 
183  drho_dp = ddensity_dp;
184  drho_dT = ddensity_dT;
185 }
Real d2gamma2_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt pi.
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real d2phi3_ddeltatau(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta and tau.
Real dgamma5_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt pi.
Real dgamma2_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt pi.
const std::string density
Definition: NS.h:17
Real d2gamma1_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt pi and tau.
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
Real d2gamma5_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt pi and tau.
const std::string name
Definition: Setup.h:22
Real d2phi3_ddelta2(Real delta, Real tau) const
Second derivative of Helmholtz free energy in Region 3 wrt delta.
Real dgamma1_dpi(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt pi.
Real d2gamma2_dpitau(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 2 wrt pi and tau.
const Real _rho_critical
Critical density (kg/m^3)
Real dphi3_ddelta(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt delta.
const std::string pressure
Definition: NS.h:26
Real d2gamma1_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 1 wrt pi.
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
Real d2gamma5_dpi2(Real pi, Real tau) const
Second derivative of Gibbs free energy in Region 5 wrt pi.

◆ rho_mu()

void SinglePhaseFluidProperties::rho_mu ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  mu 
) const
virtualinherited

Density and viscosity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]rhodensity (kg/m^3)
[out]muviscosity (Pa.s)

Definition at line 360 of file SinglePhaseFluidProperties.C.

361 {
362  mooseDeprecated(name(), ": rho_mu() is deprecated. Use rho_mu_from_p_T() instead");
363 
364  rho_mu_from_p_T(p, T, rho, mu);
365 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string name
Definition: Setup.h:22
virtual void rho_mu_from_p_T(Real pressure, Real temperature, Real &rho, Real &mu) const

◆ rho_mu_dpT()

void SinglePhaseFluidProperties::rho_mu_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
virtualinherited

Definition at line 375 of file SinglePhaseFluidProperties.C.

383 {
384  mooseDeprecated(name(), ": rho_mu_dpT() is deprecated. Use rho_mu_from_p_T() instead");
385 
386  rho_mu_from_p_T(p, T, rho, drho_dp, drho_dT, mu, dmu_dp, dmu_dT);
387 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string name
Definition: Setup.h:22
virtual void rho_mu_from_p_T(Real pressure, Real temperature, Real &rho, Real &mu) const

◆ rho_mu_from_p_T() [1/2]

void Water97FluidProperties::rho_mu_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  mu 
) const
overridevirtual

Reimplemented from SinglePhaseFluidProperties.

Definition at line 562 of file Water97FluidProperties.C.

566 {
568  mu = this->mu_from_rho_T(rho, temperature);
569 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real mu_from_rho_T(Real density, Real temperature) const override

◆ rho_mu_from_p_T() [2/2]

void Water97FluidProperties::rho_mu_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
overridevirtual

Density and viscosity and their derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]rhodensity (kg/m^3)
[out]drho_dpderivative of density wrt pressure
[out]drho_dTderivative of density wrt temperature
[out]muviscosity (Pa.s)
[out]dmu_dpderivative of viscosity wrt pressure
[out]dmu_dTderivative of viscosity wrt temperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 572 of file Water97FluidProperties.C.

580 {
581  this->rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
582  Real dmu_drho;
583  this->mu_from_rho_T(rho, temperature, drho_dT, mu, dmu_drho, dmu_dT);
584  dmu_dp = dmu_drho * drho_dp;
585 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real mu_from_rho_T(Real density, Real temperature) const override

◆ s()

Real SinglePhaseFluidProperties::s ( Real  pressure,
Real  temperature 
) const
virtualinherited

◆ s_from_p_T() [1/2]

Real Water97FluidProperties::s_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 636 of file Water97FluidProperties.C.

637 {
638  Real entropy, pi, tau, density3, delta;
639 
640  // Determine which region the point is in
641  unsigned int region = inRegion(pressure, temperature);
642  switch (region)
643  {
644  case 1:
645  pi = pressure / _p_star[0];
646  tau = _T_star[0] / temperature;
647  entropy = _Rw * (tau * dgamma1_dtau(pi, tau) - gamma1(pi, tau));
648  break;
649 
650  case 2:
651  pi = pressure / _p_star[1];
652  tau = _T_star[1] / temperature;
653  entropy = _Rw * (tau * dgamma2_dtau(pi, tau) - gamma2(pi, tau));
654  break;
655 
656  case 3:
657  // Calculate density first, then use that in Helmholtz free energy
658  density3 = densityRegion3(pressure, temperature);
659  delta = density3 / _rho_critical;
660  tau = _T_star[2] / temperature;
661  entropy = _Rw * (tau * dphi3_dtau(delta, tau) - phi3(delta, tau));
662  break;
663 
664  case 5:
665  pi = pressure / _p_star[4];
666  tau = _T_star[4] / temperature;
667  entropy = _Rw * (tau * dgamma5_dtau(pi, tau) - gamma5(pi, tau));
668  break;
669 
670  default:
671  mooseError(name(), ": inRegion() has given an incorrect region");
672  }
673  return entropy;
674 }
Real dgamma5_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 5 wrt tau.
Real dphi3_dtau(Real delta, Real tau) const
Derivative of Helmholtz free energy in Region 3 wrt tau.
unsigned int inRegion(Real pressure, Real temperature) const
Determines the phase region that the given pressure and temperature values lie in.
Real gamma5(Real pi, Real tau) const
Gibbs free energy in Region 5.
Real dgamma2_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 2 wrt tau.
Real densityRegion3(Real pressure, Real temperature) const
Density function for Region 3 - supercritical water and steam.
const std::string temperature
Definition: NS.h:27
Real phi3(Real delta, Real tau) const
Helmholtz free energy in Region 3.
const std::array< Real, 5 > _p_star
Pressure scale for each region.
const std::array< Real, 5 > _T_star
Temperature scale for each region.
const std::string name
Definition: Setup.h:22
const Real _rho_critical
Critical density (kg/m^3)
Real dgamma1_dtau(Real pi, Real tau) const
Derivative of Gibbs free energy in Region 1 wrt tau.
const std::string pressure
Definition: NS.h:26
Real gamma2(Real pi, Real tau) const
Gibbs free energy in Region 2 - superheated steam.
Real gamma1(Real pi, Real tau) const
Gibbs free energy in Region 1 - single phase liquid region.
const Real _Rw
Specific gas constant for H2O (universal gas constant / molar mass of water - J/kg/K) ...

◆ s_from_p_T() [2/2]

void Water97FluidProperties::s_from_p_T ( Real  p,
Real  T,
Real &  s,
Real &  ds_dp,
Real &  ds_dT 
) const
overridevirtual

Definition at line 677 of file Water97FluidProperties.C.

678 {
679  SinglePhaseFluidProperties::s_from_p_T(p, T, s, ds_dp, ds_dT);
680 }
e e e e s T T T T T rho v v T virtual e Real s(Real pressure, Real temperature) const

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Definition at line 40 of file FluidProperties.h.

40 {}

◆ subregion2ph()

unsigned int Water97FluidProperties::subregion2ph ( Real  pressure,
Real  enthalpy 
) const
protected

Provides the correct subregion index for a (P,h) point in region 2.

From Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
subregion index

Definition at line 1612 of file Water97FluidProperties.C.

Referenced by temperature_from_ph().

1613 {
1614  unsigned int subregion;
1615 
1616  if (pressure <= 4.0e6)
1617  subregion = 1;
1618  else if (pressure > 4.0e6 && pressure < 6.5467e6)
1619  subregion = 2;
1620  else
1621  {
1622  if (enthalpy >= b2bc(pressure))
1623  subregion = 2;
1624  else
1625  subregion = 3;
1626  }
1627 
1628  return subregion;
1629 }
Real b2bc(Real pressure) const
Boundary between subregions b and c in region 2.
const std::string enthalpy
Definition: NS.h:28
const std::string pressure
Definition: NS.h:26

◆ subregion3()

unsigned int Water97FluidProperties::subregion3 ( Real  pressure,
Real  temperature 
) const

Provides the correct subregion index for a (P,T) point in region 3.

From Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
temperaturewater temperature (K)
Returns
subregion index

Definition at line 1249 of file Water97FluidProperties.C.

Referenced by densityRegion3().

1250 {
1251  Real pMPa = pressure / 1.0e6;
1252  const Real P3cd = 19.00881189173929;
1253  unsigned int subregion = 0;
1254 
1255  if (pMPa > 40.0 && pMPa <= 100.0)
1256  {
1257  if (temperature <= tempXY(pressure, AB))
1258  subregion = 0;
1259  else // (temperature > tempXY(pressure, AB))
1260  subregion = 1;
1261  }
1262  else if (pMPa > 25.0 && pMPa <= 40.0)
1263  {
1264  if (temperature <= tempXY(pressure, CD))
1265  subregion = 2;
1266  else if (temperature > tempXY(pressure, CD) && temperature <= tempXY(pressure, AB))
1267  subregion = 3;
1268  else if (temperature > tempXY(pressure, AB) && temperature <= tempXY(pressure, EF))
1269  subregion = 4;
1270  else // (temperature > tempXY(pressure, EF))
1271  subregion = 5;
1272  }
1273  else if (pMPa > 23.5 && pMPa <= 25.0)
1274  {
1275  if (temperature <= tempXY(pressure, CD))
1276  subregion = 2;
1277  else if (temperature > tempXY(pressure, CD) && temperature <= tempXY(pressure, GH))
1278  subregion = 6;
1279  else if (temperature > tempXY(pressure, GH) && temperature <= tempXY(pressure, EF))
1280  subregion = 7;
1281  else if (temperature > tempXY(pressure, EF) && temperature <= tempXY(pressure, IJ))
1282  subregion = 8;
1283  else if (temperature > tempXY(pressure, IJ) && temperature <= tempXY(pressure, JK))
1284  subregion = 9;
1285  else // (temperature > tempXY(pressure, JK))
1286  subregion = 10;
1287  }
1288  else if (pMPa > 23.0 && pMPa <= 23.5)
1289  {
1290  if (temperature <= tempXY(pressure, CD))
1291  subregion = 2;
1292  else if (temperature > tempXY(pressure, CD) && temperature <= tempXY(pressure, GH))
1293  subregion = 11;
1294  else if (temperature > tempXY(pressure, GH) && temperature <= tempXY(pressure, EF))
1295  subregion = 7;
1296  else if (temperature > tempXY(pressure, EF) && temperature <= tempXY(pressure, IJ))
1297  subregion = 8;
1298  else if (temperature > tempXY(pressure, IJ) && temperature <= tempXY(pressure, JK))
1299  subregion = 9;
1300  else // (temperature > tempXY(pressure, JK))
1301  subregion = 10;
1302  }
1303  else if (pMPa > 22.5 && pMPa <= 23.0)
1304  {
1305  if (temperature <= tempXY(pressure, CD))
1306  subregion = 2;
1307  else if (temperature > tempXY(pressure, CD) && temperature <= tempXY(pressure, GH))
1308  subregion = 11;
1309  else if (temperature > tempXY(pressure, GH) && temperature <= tempXY(pressure, MN))
1310  subregion = 12;
1311  else if (temperature > tempXY(pressure, MN) && temperature <= tempXY(pressure, EF))
1312  subregion = 13;
1313  else if (temperature > tempXY(pressure, EF) && temperature <= tempXY(pressure, OP))
1314  subregion = 14;
1315  else if (temperature > tempXY(pressure, OP) && temperature <= tempXY(pressure, IJ))
1316  subregion = 15;
1317  else if (temperature > tempXY(pressure, IJ) && temperature <= tempXY(pressure, JK))
1318  subregion = 9;
1319  else // (temperature > tempXY(pressure, JK))
1320  subregion = 10;
1321  }
1322  else if (pMPa > vaporPressure(643.15) * 1.0e-6 &&
1323  pMPa <= 22.5) // vaporPressure(643.15) = 21.04 MPa
1324  {
1325  if (temperature <= tempXY(pressure, CD))
1326  subregion = 2;
1327  else if (temperature > tempXY(pressure, CD) && temperature <= tempXY(pressure, QU))
1328  subregion = 16;
1329  else if (temperature > tempXY(pressure, QU) && temperature <= tempXY(pressure, RX))
1330  {
1331  if (pMPa > 22.11 && pMPa <= 22.5)
1332  {
1333  if (temperature <= tempXY(pressure, UV))
1334  subregion = 20;
1335  else if (temperature > tempXY(pressure, UV) && temperature <= tempXY(pressure, EF))
1336  subregion = 21;
1337  else if (temperature > tempXY(pressure, EF) && temperature <= tempXY(pressure, WX))
1338  subregion = 22;
1339  else // (temperature > tempXY(pressure, WX) && temperature <= tempXY(pressure, RX))
1340  subregion = 23;
1341  }
1342  else if (pMPa > 22.064 && pMPa <= 22.11)
1343  {
1344  if (temperature <= tempXY(pressure, UV))
1345  subregion = 20;
1346  else if (temperature > tempXY(pressure, UV) && temperature <= tempXY(pressure, EF))
1347  subregion = 24;
1348  else if (temperature > tempXY(pressure, EF) && temperature <= tempXY(pressure, WX))
1349  subregion = 25;
1350  else // (temperature > tempXY(pressure, WX) && temperature <= tempXY(pressure, RX))
1351  subregion = 23;
1352  }
1353  else if (temperature <= vaporTemperature(pressure))
1354  {
1355  if (pMPa > 21.93161551 && pMPa <= 22.064)
1357  subregion = 20;
1358  else
1359  subregion = 24;
1360  else // (pMPa > vaporPressure(643.15) * 1.0e-6 && pMPa <= 21.93161551)
1361  subregion = 20;
1362  }
1364  {
1365  if (pMPa > 21.90096265 && pMPa <= 22.064)
1366  {
1367  if (temperature <= tempXY(pressure, WX))
1368  subregion = 25;
1369  else
1370  subregion = 23;
1371  }
1372  else
1373  subregion = 23;
1374  }
1375  }
1376  else if (temperature > tempXY(pressure, RX) && temperature <= tempXY(pressure, JK))
1377  subregion = 17;
1378  else
1379  subregion = 10;
1380  }
1381  else if (pMPa > 20.5 &&
1382  pMPa <= vaporPressure(643.15) * 1.0e-6) // vaporPressure(643.15) = 21.04 MPa
1383  {
1384  if (temperature <= tempXY(pressure, CD))
1385  subregion = 2;
1387  subregion = 16;
1389  subregion = 17;
1390  else // (temperature > tempXY(pressure, JK))
1391  subregion = 10;
1392  }
1393  else if (pMPa > P3cd && pMPa <= 20.5) // P3cd = 19.00881189173929
1394  {
1395  if (temperature <= tempXY(pressure, CD))
1396  subregion = 2;
1398  subregion = 18;
1399  else
1400  subregion = 19;
1401  }
1402  else if (pMPa > vaporPressure(623.15) * 1.0e-6 && pMPa <= P3cd)
1403  {
1405  subregion = 2;
1406  else
1407  subregion = 19;
1408  }
1409  else if (pMPa > 22.11 && pMPa <= 22.5)
1410  {
1412  subregion = 20;
1413  else if (temperature > tempXY(pressure, UV) && temperature <= tempXY(pressure, EF))
1414  subregion = 21;
1415  else if (temperature > tempXY(pressure, EF) && temperature <= tempXY(pressure, WX))
1416  subregion = 22;
1417  else // (temperature > tempXY(pressure, WX) && temperature <= tempXY(pressure, RX))
1418  subregion = 23;
1419  }
1420  else if (pMPa > 22.064 && pMPa <= 22.11)
1421  {
1423  subregion = 20;
1424  else if (temperature > tempXY(pressure, UV) && temperature <= tempXY(pressure, EF))
1425  subregion = 24;
1426  else if (temperature > tempXY(pressure, EF) && temperature <= tempXY(pressure, WX))
1427  subregion = 25;
1428  else // (temperature > tempXY(pressure, WX) && temperature <= tempXY(pressure, RX))
1429  subregion = 23;
1430  }
1431  else
1432  mooseError(name(), ": subregion3(): Shouldn't have got here!");
1433 
1434  return subregion;
1435 }
const std::string temperature
Definition: NS.h:27
Real tempXY(Real pressure, subregionEnum xy) const
Boundaries between subregions in region 3.
const std::string name
Definition: Setup.h:22
Real vaporTemperature(Real pressure) const
Saturation temperature as a function of pressure.
const std::string pressure
Definition: NS.h:26
virtual Real vaporPressure(Real temperature) const override
Vapor pressure.
virtual Real e(Real pressure, Real temperature) const

◆ subregion3ph()

unsigned int Water97FluidProperties::subregion3ph ( Real  pressure,
Real  enthalpy 
) const
protected

Provides the correct subregion index for a (P,h) point in region 3.

From Revised Supplementary Release on Backward Equations for the Functions T(p,h), v(p,h) and T(p,s), v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
subregion index

Definition at line 1632 of file Water97FluidProperties.C.

Referenced by temperature_from_ph().

1633 {
1634  unsigned int subregion;
1635 
1636  if (enthalpy <= b3ab(pressure))
1637  subregion = 1;
1638  else
1639  subregion = 2;
1640 
1641  return subregion;
1642 }
const std::string enthalpy
Definition: NS.h:28
Real b3ab(Real pressure) const
Boundary between subregions a and b in region 3.
const std::string pressure
Definition: NS.h:26

◆ subregionVolume()

Real Water97FluidProperties::subregionVolume ( Real  pi,
Real  theta,
Real  a,
Real  b,
Real  c,
Real  d,
Real  e,
unsigned int  sid 
) const

Specific volume in all subregions of region 3 EXCEPT subregion n (13).

Parameters
piscaled water pressure
thetascaled water temperature
ato e constants
sidsubregion ID of the subregion
Returns
volume water specific volume (m^3/kg)

Definition at line 1499 of file Water97FluidProperties.C.

Referenced by densityRegion3().

1501 {
1502  Real sum = 0.0;
1503 
1504  for (std::size_t i = 0; i < _n3s[sid].size(); ++i)
1505  sum += _n3s[sid][i] * MathUtils::pow(std::pow(pi - a, c), _I3s[sid][i]) *
1506  MathUtils::pow(std::pow(theta - b, d), _J3s[sid][i]);
1507 
1508  return std::pow(sum, e);
1509 }
const std::vector< std::vector< Real > > _n3s
Constants for all 26 subregions in region 3.
const std::vector< std::vector< int > > _I3s
virtual Real c(Real pressure, Real temperature) const
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::vector< std::vector< int > > _J3s
virtual Real e(Real pressure, Real temperature) const

◆ T_from_p_h()

Real SinglePhaseFluidProperties::T_from_p_h ( Real  pressure,
Real  enthalpy 
) const
virtualinherited

Temperature from pressure and specific enthalpy.

Parameters
[in]pressurepressure (Pa)
[in]enthalpyenthalpy (J/kg)
Returns
Temperature (K)

Reimplemented in IdealGasFluidProperties.

Definition at line 463 of file SinglePhaseFluidProperties.C.

464 {
465  const Real s = s_from_h_p(h, p);
466  const Real rho = rho_from_p_s(p, s);
467  const Real v = 1. / rho;
468  const Real e = e_from_v_h(v, h);
469  return T_from_v_e(v, e);
470 }
e e e e s T T T T T rho v v T virtual e Real s(Real pressure, Real temperature) const
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.
virtual Real e(Real pressure, Real temperature) const

◆ temperature_from_ph()

Real Water97FluidProperties::temperature_from_ph ( Real  pressure,
Real  enthalpy 
) const
virtual

Backwards equation T(p, h) From Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam.

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
temperature water temperature (K)

Definition at line 1658 of file Water97FluidProperties.C.

1659 {
1660  Real temperature = 0.0;
1661 
1662  // Determine which region the point is in
1663  unsigned int region = inRegionPH(pressure, enthalpy);
1664 
1665  switch (region)
1666  {
1667  case 1:
1669  break;
1670 
1671  case 2:
1672  {
1673  // First, determine which subregion the point is in:
1674  unsigned int subregion = subregion2ph(pressure, enthalpy);
1675 
1676  if (subregion == 1)
1678  else if (subregion == 2)
1680  else
1682  break;
1683  }
1684 
1685  case 3:
1686  {
1687  // First, determine which subregion the point is in:
1688  unsigned int subregion = subregion3ph(pressure, enthalpy);
1689 
1690  if (subregion == 1)
1692  else
1694  break;
1695  }
1696 
1697  case 5:
1698  mooseError(name(), ": temperature_from_ph() not implemented for region 5");
1699  break;
1700 
1701  default:
1702  mooseError(name(), ": inRegionPH() has given an incorrect region");
1703  }
1704 
1705  return temperature;
1706 }
const std::string temperature
Definition: NS.h:27
unsigned int subregion2ph(Real pressure, Real enthalpy) const
Provides the correct subregion index for a (P,h) point in region 2.
const std::string enthalpy
Definition: NS.h:28
Real temperature_from_ph2a(Real pressure, Real enthalpy) const
Backwards equation T(p, h) in Region 2a Eq.
Real temperature_from_ph1(Real pressure, Real enthalpy) const
Backwards equation T(p, h) in Region 1 Eq.
const std::string name
Definition: Setup.h:22
unsigned int subregion3ph(Real pressure, Real enthalpy) const
Provides the correct subregion index for a (P,h) point in region 3.
Real temperature_from_ph2b(Real pressure, Real enthalpy) const
Backwards equation T(p, h) in Region 2b Eq.
Real temperature_from_ph3b(Real pressure, Real enthalpy) const
Backwards equation T(p, h) in Region 3b Eq.
const std::string pressure
Definition: NS.h:26
Real temperature_from_ph3a(Real pressure, Real enthalpy) const
Backwards equation T(p, h) in Region 3a Eq.
unsigned int inRegionPH(Real pressure, Real enthalpy) const
Determines the phase region that the given pressure and enthaply values lie in.
Real temperature_from_ph2c(Real pressure, Real enthalpy) const
Backwards equation T(p, h) in Region 2c Eq.

◆ temperature_from_ph1()

Real Water97FluidProperties::temperature_from_ph1 ( Real  pressure,
Real  enthalpy 
) const
protected

Backwards equation T(p, h) in Region 1 Eq.

(11) from Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
temperature water temperature (K)

Definition at line 1709 of file Water97FluidProperties.C.

Referenced by temperature_from_ph().

1710 {
1711  Real pi = pressure / 1.0e6;
1712  Real eta = enthalpy / 2500.0e3;
1713  Real sum = 0.0;
1714 
1715  for (std::size_t i = 0; i < _nph1.size(); ++i)
1716  sum += _nph1[i] * MathUtils::pow(pi, _Iph1[i]) * MathUtils::pow(eta + 1.0, _Jph1[i]);
1717 
1718  return sum;
1719 }
const std::array< int, 20 > _Iph1
const std::string enthalpy
Definition: NS.h:28
const std::array< int, 20 > _Jph1
const std::array< Real, 20 > _nph1
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::string pressure
Definition: NS.h:26

◆ temperature_from_ph2a()

Real Water97FluidProperties::temperature_from_ph2a ( Real  pressure,
Real  enthalpy 
) const
protected

Backwards equation T(p, h) in Region 2a Eq.

(22) from Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
temperature water temperature (K)

Definition at line 1722 of file Water97FluidProperties.C.

Referenced by temperature_from_ph().

1723 {
1724  Real pi = pressure / 1.0e6;
1725  Real eta = enthalpy / 2000.0e3;
1726  Real sum = 0.0;
1727 
1728  for (std::size_t i = 0; i < _nph2a.size(); ++i)
1729  sum += _nph2a[i] * MathUtils::pow(pi, _Iph2a[i]) * MathUtils::pow(eta - 2.1, _Jph2a[i]);
1730 
1731  return sum;
1732 }
const std::array< Real, 36 > _nph2a
const std::array< int, 36 > _Jph2a
const std::string enthalpy
Definition: NS.h:28
const std::array< int, 36 > _Iph2a
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::string pressure
Definition: NS.h:26

◆ temperature_from_ph2b()

Real Water97FluidProperties::temperature_from_ph2b ( Real  pressure,
Real  enthalpy 
) const
protected

Backwards equation T(p, h) in Region 2b Eq.

(23) from Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
temperature water temperature (K)

Definition at line 1735 of file Water97FluidProperties.C.

Referenced by temperature_from_ph().

1736 {
1737  Real pi = pressure / 1.0e6;
1738  Real eta = enthalpy / 2000.0e3;
1739  Real sum = 0.0;
1740 
1741  for (std::size_t i = 0; i < _nph2b.size(); ++i)
1742  sum += _nph2b[i] * MathUtils::pow(pi - 2.0, _Iph2b[i]) * MathUtils::pow(eta - 2.6, _Jph2b[i]);
1743 
1744  return sum;
1745 }
const std::array< Real, 38 > _nph2b
const std::string enthalpy
Definition: NS.h:28
const std::array< int, 38 > _Jph2b
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< int, 38 > _Iph2b
const std::string pressure
Definition: NS.h:26

◆ temperature_from_ph2c()

Real Water97FluidProperties::temperature_from_ph2c ( Real  pressure,
Real  enthalpy 
) const
protected

Backwards equation T(p, h) in Region 2c Eq.

(24) from Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
temperature water temperature (K)

Definition at line 1748 of file Water97FluidProperties.C.

Referenced by temperature_from_ph().

1749 {
1750  Real pi = pressure / 1.0e6;
1751  Real eta = enthalpy / 2000.0e3;
1752  Real sum = 0.0;
1753 
1754  for (std::size_t i = 0; i < _nph2c.size(); ++i)
1755  sum += _nph2c[i] * MathUtils::pow(pi + 25.0, _Iph2c[i]) * MathUtils::pow(eta - 1.8, _Jph2c[i]);
1756 
1757  return sum;
1758 }
const std::array< int, 23 > _Jph2c
const std::string enthalpy
Definition: NS.h:28
const std::array< int, 23 > _Iph2c
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::string pressure
Definition: NS.h:26
const std::array< Real, 23 > _nph2c

◆ temperature_from_ph3a()

Real Water97FluidProperties::temperature_from_ph3a ( Real  pressure,
Real  enthalpy 
) const
protected

Backwards equation T(p, h) in Region 3a Eq.

(2) from Revised Supplementary Release on Backward Equations for the Functions T(p,h), v(p,h) and T(p,s), v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
temperature water temperature (K)

Definition at line 1776 of file Water97FluidProperties.C.

Referenced by temperature_from_ph().

1777 {
1778  Real pi = pressure / 100.0e6;
1779  Real eta = enthalpy / 2300.0e3;
1780  Real sum = 0.0;
1781 
1782  for (std::size_t i = 0; i < _nph3a.size(); ++i)
1783  sum +=
1784  _nph3a[i] * MathUtils::pow(pi + 0.24, _Iph3a[i]) * MathUtils::pow(eta - 0.615, _Jph3a[i]);
1785 
1786  return sum * 760.0;
1787 }
const std::string enthalpy
Definition: NS.h:28
const std::array< int, 31 > _Jph3a
const std::array< int, 31 > _Iph3a
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 31 > _nph3a
const std::string pressure
Definition: NS.h:26

◆ temperature_from_ph3b()

Real Water97FluidProperties::temperature_from_ph3b ( Real  pressure,
Real  enthalpy 
) const
protected

Backwards equation T(p, h) in Region 3b Eq.

(3) from Revised Supplementary Release on Backward Equations for the Functions T(p,h), v(p,h) and T(p,s), v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
enthalpywater enthalpy (J/kg)
Returns
temperature water temperature (K)

Definition at line 1790 of file Water97FluidProperties.C.

Referenced by temperature_from_ph().

1791 {
1792  Real pi = pressure / 100.0e6;
1793  Real eta = enthalpy / 2800.0e3;
1794  Real sum = 0.0;
1795 
1796  for (std::size_t i = 0; i < _nph3b.size(); ++i)
1797  sum +=
1798  _nph3b[i] * MathUtils::pow(pi + 0.298, _Iph3b[i]) * MathUtils::pow(eta - 0.72, _Jph3b[i]);
1799 
1800  return sum * 860.0;
1801 }
const std::array< int, 33 > _Jph3b
const std::array< Real, 33 > _nph3b
const std::array< int, 33 > _Iph3b
const std::string enthalpy
Definition: NS.h:28
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::string pressure
Definition: NS.h:26

◆ tempXY()

Real Water97FluidProperties::tempXY ( Real  pressure,
subregionEnum  xy 
) const
protected

Boundaries between subregions in region 3.

From Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam

Parameters
pressurewater pressure (Pa)
xystring to select the boundary between two subregions
Returns
temperature (K) along the boundary

Definition at line 1438 of file Water97FluidProperties.C.

Referenced by subregion3().

1439 {
1440  Real pi = pressure / 1.0e6;
1441 
1442  // Choose the constants based on the string xy
1443  unsigned int row;
1444 
1445  switch (xy)
1446  {
1447  case AB:
1448  row = 0;
1449  break;
1450  case CD:
1451  row = 1;
1452  break;
1453  case GH:
1454  row = 2;
1455  break;
1456  case IJ:
1457  row = 3;
1458  break;
1459  case JK:
1460  row = 4;
1461  break;
1462  case MN:
1463  row = 5;
1464  break;
1465  case OP:
1466  row = 6;
1467  break;
1468  case QU:
1469  row = 7;
1470  break;
1471  case RX:
1472  row = 8;
1473  break;
1474  case UV:
1475  row = 9;
1476  break;
1477  case WX:
1478  row = 10;
1479  break;
1480  default:
1481  row = 0;
1482  }
1483 
1484  Real sum = 0.0;
1485 
1486  if (xy == AB || xy == OP || xy == WX)
1487  for (std::size_t i = 0; i < _tempXY_n[row].size(); ++i)
1488  sum += _tempXY_n[row][i] * MathUtils::pow(std::log(pi), _tempXY_I[row][i]);
1489  else if (xy == EF)
1490  sum += 3.727888004 * (pi - _p_critical / 1.0e6) + _T_critical;
1491  else
1492  for (std::size_t i = 0; i < _tempXY_n[row].size(); ++i)
1493  sum += _tempXY_n[row][i] * MathUtils::pow(pi, _tempXY_I[row][i]);
1494 
1495  return sum;
1496 }
const Real _T_critical
Critical temperature (K)
const Real _p_critical
Critical pressure (Pa)
const std::vector< std::vector< Real > > _tempXY_n
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::string pressure
Definition: NS.h:26
const std::vector< std::vector< int > > _tempXY_I
Constnats for the tempXY() method.

◆ threadJoin()

virtual void FluidProperties::threadJoin ( const UserObject &  )
inlinefinalvirtualinherited

Definition at line 39 of file FluidProperties.h.

39 {}

◆ triplePointPressure()

Real Water97FluidProperties::triplePointPressure ( ) const
overridevirtual

Triple point pressure.

Returns
triple point pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 71 of file Water97FluidProperties.C.

72 {
73  return _p_triple;
74 }
const Real _p_triple
Triple point pressure (Pa)

◆ triplePointTemperature()

Real Water97FluidProperties::triplePointTemperature ( ) const
overridevirtual

Triple point temperature.

Returns
triple point temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 77 of file Water97FluidProperties.C.

78 {
79  return _T_triple;
80 }
const Real _T_triple
Triple point temperature (K)

◆ v_e_spndl_from_T()

void SinglePhaseFluidProperties::v_e_spndl_from_T ( Real  T,
Real &  v,
Real &  e 
) const
virtualinherited

Specific internal energy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in StiffenedGasFluidProperties.

Definition at line 457 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::v_from_p_T().

458 {
459  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
460 }
const std::string name
Definition: Setup.h:22

◆ v_from_p_T() [1/2]

Real SinglePhaseFluidProperties::v_from_p_T ( Real  p,
Real  T 
) const
virtualinherited

◆ v_from_p_T() [2/2]

void SinglePhaseFluidProperties::v_from_p_T ( Real  p,
Real  T,
Real &  v,
Real &  dv_dp,
Real &  dv_dT 
) const
virtualinherited

Specific volume and its derivatives from pressure and temperature.

Parameters
[in]ppressure
[in]Ttemperature
[out]vspecific volume
[out]dv_dpderivative of specific volume w.r.t. pressure
[out]dv_dTderivative of specific volume w.r.t. temperature

Definition at line 60 of file SinglePhaseFluidProperties.C.

61 {
62  Real rho, drho_dp, drho_dT;
63  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
64 
65  v = 1.0 / rho;
66  const Real dv_drho = -1.0 / (rho * rho);
67 
68  dv_dp = dv_drho * drho_dp;
69  dv_dT = dv_drho * drho_dT;
70 }