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

Methane (CH4) fluid properties as a function of pressure (Pa) and temperature (K). More...

#include <MethaneFluidProperties.h>

Inheritance diagram for MethaneFluidProperties:
[legend]

Public Member Functions

 MethaneFluidProperties (const InputParameters &parameters)
 
virtual ~MethaneFluidProperties ()
 
virtual std::string fluidName () const override
 Fluid name. More...
 
virtual Real molarMass () const override
 Molar mass [kg/mol]. More...
 
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 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 henryConstant (Real temperature) const override
 Henry's law constant for dissolution in water. More...
 
virtual void henryConstant (Real temperature, Real &Kh, Real &dKh_dT) const override
 Henry's law constant for dissolution in water and derivative wrt temperature. 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 vaporPressure (Real temperature) const override
 Vapor pressure. More...
 
virtual void vaporPressure (Real temperature, Real &psat, Real &dpsat_dT) const override
 Vapor pressure. More...
 
Real saturatedLiquidDensity (Real temperature) const
 Saturated liquid density of CH4 Valid for temperatures between the triple point temperature and critical temperature. More...
 
Real saturatedVaporDensity (Real temperature) const
 Saturated vapor density of CH4 Valid for temperatures between the triple point temperature and critical 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 p, Real T, 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 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 p, Real T, Real &h, Real &dh_dp, Real &dh_dT) const override
 
virtual Real p_from_rho_T (Real rho, Real T) const
 Pressure as a function of density and temperature. 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 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't need 3 input args - AD will assume/call the 2-input version. More...
 
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_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_from_p_T (Real pressure, Real temperature, Real &rho, Real &mu) const
 
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
 Density and viscosity and their derivatives wrt pressure and temperature. 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 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 Member Functions

virtual Real alpha (Real delta, Real tau) const override
 Helmholtz free energy. More...
 
virtual Real dalpha_ddelta (Real delta, Real tau) const override
 Derivative of Helmholtz free energy wrt delta. More...
 
virtual Real dalpha_dtau (Real delta, Real tau) const override
 Derivative of Helmholtz free energy wrt tau. More...
 
virtual Real d2alpha_ddelta2 (Real delta, Real tau) const override
 Second derivative of Helmholtz free energy wrt delta. More...
 
virtual Real d2alpha_dtau2 (Real delta, Real tau) const override
 Second derivative of Helmholtz free energy wrt tau. More...
 
virtual Real d2alpha_ddeltatau (Real delta, Real tau) const override
 Second derivative of Helmholtz free energy wrt delta and tau. 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 _Mch4
 Methane molar mass (kg/mol) 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, 5 > _a0 {{0.008449, 4.6942, 3.4865, 1.6572, 1.4115}}
 Coefficients for ideal gas component of the Helmholtz free energy. More...
 
const std::array< Real, 5 > _b0 {{3.4004324, 10.26951575, 20.43932747, 29.93744884, 79.13351945}}
 
const std::array< Real, 13 > _N1
 Coefficients for residual component of the Helmholtz free energy. More...
 
const std::array< Real, 13 > _t1
 
const std::array< unsigned int, 13 > _d1 {{1, 1, 1, 2, 2, 2, 2, 3, 4, 4, 8, 9, 10}}
 
const std::array< Real, 23 > _N2
 
const std::array< Real, 23 > _t2
 
const std::array< unsigned int, 23 > _c2
 
const std::array< unsigned int, 23 > _d2
 
const std::array< Real, 4 > _N3
 
const std::array< Real, 4 > _t3 {{2.0, 0.0, 1.0, 2.0}}
 
const std::array< int, 4 > _d3 {{2, 0, 0, 0}}
 
const std::array< Real, 4 > _alpha3 {{20.0, 40.0, 40.0, 40.0}}
 
const std::array< Real, 4 > _beta3 {{200.0, 250.0, 250.0, 250.0}}
 
const std::array< Real, 4 > _gamma3 {{1.07, 1.11, 1.11, 1.11}}
 
const std::array< Real, 4 > _D3 {{1.0, 1.0, 1.0, 1.0}}
 
const std::array< Real, 6 > _a
 Coefficients for viscosity. More...
 
const std::array< Real, 7 > _b
 Coefficients for thermal conductivity. More...
 
const Real _R
 Universal gas constant (J/mol/K) More...
 
const Real _T_c2k
 Conversion of temperature from Celsius to Kelvin. 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

Methane (CH4) fluid properties as a function of pressure (Pa) and temperature (K).

Thermodynamic properties calculated from: Setzmann and Wagner, A new equation of state and tables of thermodynamic properties for methane covering the range from the melting line to 625 K at pressures up to 100 MPa, Journal of Physical and Chemical Reference Data, 20, 1061–1155 (1991)

Viscosity and thermal conductivity calculated from Irvine Jr, T. F. and Liley, P. E. (1984) Steam and Gas Tables with Computer Equations.

Definition at line 35 of file MethaneFluidProperties.h.

Constructor & Destructor Documentation

◆ MethaneFluidProperties()

MethaneFluidProperties::MethaneFluidProperties ( const InputParameters &  parameters)

Definition at line 26 of file MethaneFluidProperties.C.

27  : HelmholtzFluidProperties(parameters),
28  _Mch4(16.0425e-3),
29  _p_critical(4.5992e6),
30  _T_critical(190.564),
31  _rho_critical(162.66),
32  _p_triple(1.169e4),
33  _T_triple(90.6941)
34 {
35 }
const Real _T_triple
Triple point temperature (K)
const Real _p_triple
Triple point pressure (Pa)
HelmholtzFluidProperties(const InputParameters &parameters)
const Real _rho_critical
Critical density (kg/m^3)
const Real _T_critical
Critical temperature (K)
const Real _Mch4
Methane molar mass (kg/mol)
const Real _p_critical
Critical pressure (Pa)
virtual Real e(Real pressure, Real temperature) const

◆ ~MethaneFluidProperties()

MethaneFluidProperties::~MethaneFluidProperties ( )
virtual

Definition at line 37 of file MethaneFluidProperties.C.

37 {}

Member Function Documentation

◆ alpha()

Real MethaneFluidProperties::alpha ( Real  delta,
Real  tau 
) const
overrideprotectedvirtual

Helmholtz free energy.

Parameters
deltascaled density (-)
tauscaled temperature (-)
Returns
alpha Helmholtz free energy

Implements HelmholtzFluidProperties.

Definition at line 214 of file MethaneFluidProperties.C.

215 {
216  // Ideal gas component of the Helmholtz free energy
217  Real alpha0 = std::log(delta) + 9.91243972 - 6.33270087 * tau + 3.0016 * std::log(tau);
218 
219  for (std::size_t i = 0; i < _a0.size(); ++i)
220  alpha0 += _a0[i] * std::log(1.0 - std::exp(-_b0[i] * tau));
221 
222  // Residual component of the Helmholtz free energy
223  Real alphar = 0.0;
224 
225  for (std::size_t i = 0; i < _t1.size(); ++i)
226  alphar += _N1[i] * MathUtils::pow(delta, _d1[i]) * std::pow(tau, _t1[i]);
227 
228  for (std::size_t i = 0; i < _t2.size(); ++i)
229  alphar += _N2[i] * MathUtils::pow(delta, _d2[i]) * std::pow(tau, _t2[i]) *
230  std::exp(-MathUtils::pow(delta, _c2[i]));
231 
232  for (std::size_t i = 0; i < _t3.size(); ++i)
233  alphar += _N3[i] * MathUtils::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
234  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _D3[i]) -
235  _beta3[i] * Utility::pow<2>(tau - _gamma3[i]));
236 
237  // The Helmholtz free energy is the sum of these two
238  return alpha0 + alphar;
239 }
const std::array< Real, 4 > _t3
const std::array< Real, 5 > _a0
Coefficients for ideal gas component of the Helmholtz free energy.
const std::array< Real, 5 > _b0
const std::array< Real, 4 > _D3
const std::array< unsigned int, 23 > _d2
const std::array< Real, 4 > _beta3
const std::array< Real, 13 > _t1
const std::array< Real, 4 > _N3
const std::array< Real, 13 > _N1
Coefficients for residual component of the Helmholtz free energy.
const std::array< Real, 4 > _gamma3
const std::array< unsigned int, 23 > _c2
const std::array< Real, 23 > _t2
const std::array< int, 4 > _d3
const std::array< Real, 4 > _alpha3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< unsigned int, 13 > _d1
const std::array< Real, 23 > _N2

◆ beta()

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

◆ beta_from_p_T() [1/2]

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

Reimplemented in SimpleFluidProperties.

Definition at line 86 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::beta().

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

◆ 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 80 of file SinglePhaseFluidProperties.C.

81 {
82  mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented.");
83 }
const std::string name
Definition: Setup.h:22

◆ c()

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

Definition at line 337 of file SinglePhaseFluidProperties.C.

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

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

◆ c_from_p_T()

Real HelmholtzFluidProperties::c_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtualinherited

Definition at line 100 of file HelmholtzFluidProperties.C.

101 {
102  // Require density first
103  const Real density = rho_from_p_T(pressure, temperature);
104  // Scale the input density and temperature
105  const Real delta = density / criticalDensity();
106  const Real tau = criticalTemperature() / temperature;
107 
108  const Real da_dd = dalpha_ddelta(delta, tau);
109 
110  Real w = 2.0 * delta * da_dd + delta * delta * d2alpha_ddelta2(delta, tau);
111  w -= Utility::pow<2>(delta * da_dd - delta * tau * d2alpha_ddeltatau(delta, tau)) /
112  (tau * tau * d2alpha_dtau2(delta, tau));
113 
114  return std::sqrt(_R * temperature * w / molarMass());
115 }
virtual Real d2alpha_ddeltatau(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta and tau.
virtual Real d2alpha_dtau2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt tau.
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
virtual Real d2alpha_ddelta2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta.
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real dalpha_ddelta(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt delta.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ cp_from_p_T()

Real HelmholtzFluidProperties::cp_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtualinherited

Definition at line 118 of file HelmholtzFluidProperties.C.

119 {
120  // Require density first
121  const Real density = rho_from_p_T(pressure, temperature);
122  // Scale the input density and temperature
123  const Real delta = density / criticalDensity();
124  const Real tau = criticalTemperature() / temperature;
125 
126  const Real da_dd = dalpha_ddelta(delta, tau);
127 
128  const Real cp = _R *
129  (-tau * tau * d2alpha_dtau2(delta, tau) +
130  Utility::pow<2>(delta * da_dd - delta * tau * d2alpha_ddeltatau(delta, tau)) /
131  (2.0 * delta * da_dd + delta * delta * d2alpha_ddelta2(delta, tau))) /
132  molarMass();
133 
134  return cp;
135 }
virtual Real d2alpha_ddeltatau(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta and tau.
virtual Real d2alpha_dtau2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt tau.
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
virtual Real d2alpha_ddelta2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta.
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real dalpha_ddelta(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt delta.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ criticalDensity()

Real MethaneFluidProperties::criticalDensity ( ) const
overridevirtual

Critical density.

Returns
critical density (kg/m^3)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 64 of file MethaneFluidProperties.C.

65 {
66  return _rho_critical;
67 }
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 131 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e().

132 {
133  mooseError(name(), ": criticalInternalEnergy() is not implemented");
134 }
const std::string name
Definition: Setup.h:22

◆ criticalPressure()

Real MethaneFluidProperties::criticalPressure ( ) const
overridevirtual

Critical pressure.

Returns
critical pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 52 of file MethaneFluidProperties.C.

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

◆ criticalTemperature()

Real MethaneFluidProperties::criticalTemperature ( ) const
overridevirtual

Critical temperature.

Returns
critical temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 58 of file MethaneFluidProperties.C.

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

◆ cv_from_p_T()

Real HelmholtzFluidProperties::cv_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtualinherited

Definition at line 138 of file HelmholtzFluidProperties.C.

139 {
140  // Require density first
141  const Real density = rho_from_p_T(pressure, temperature);
142  // Scale the input density and temperature
143  const Real delta = density / criticalDensity();
144  const Real tau = criticalTemperature() / temperature;
145 
146  return -_R * tau * tau * d2alpha_dtau2(delta, tau) / molarMass();
147 }
virtual Real d2alpha_dtau2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt tau.
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ d2alpha_ddelta2()

Real MethaneFluidProperties::d2alpha_ddelta2 ( Real  delta,
Real  tau 
) const
overrideprotectedvirtual

Second derivative of Helmholtz free energy wrt delta.

Parameters
deltascaled density (-)
tauscaled temperature (-)
Returns
second derivative of Helmholtz free energy wrt delta

Implements HelmholtzFluidProperties.

Definition at line 298 of file MethaneFluidProperties.C.

299 {
300  // Ideal gas component of the Helmholtz free energy
301  Real dalpha0 = -1.0 / delta / delta;
302 
303  // Residual component of the Helmholtz free energy
304  Real dalphar = 0.0;
305 
306  for (std::size_t i = 0; i < _t1.size(); ++i)
307  dalphar +=
308  _N1[i] * _d1[i] * (_d1[i] - 1.0) * MathUtils::pow(delta, _d1[i]) * std::pow(tau, _t1[i]);
309 
310  for (std::size_t i = 0; i < _t2.size(); ++i)
311  dalphar += _N2[i] * MathUtils::pow(delta, _d2[i]) * std::pow(tau, _t2[i]) *
312  std::exp(-MathUtils::pow(delta, _c2[i])) *
313  ((_d2[i] - _c2[i] * MathUtils::pow(delta, _c2[i])) *
314  (_d2[i] - 1.0 - _c2[i] * MathUtils::pow(delta, _c2[i])) -
315  _c2[i] * _c2[i] * MathUtils::pow(delta, _c2[i]));
316 
317  for (std::size_t i = 0; i < _t3.size(); ++i)
318  dalphar += _N3[i] * std::pow(tau, _t3[i]) *
319  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _D3[i]) -
320  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
321  (-2.0 * _alpha3[i] * MathUtils::pow(delta, _d3[i] + 2) +
322  4.0 * _alpha3[i] * _alpha3[i] * MathUtils::pow(delta, _d3[i] + 2) *
323  MathUtils::pow(delta - _D3[i], 2) -
324  4.0 * _d3[i] * _alpha3[i] * MathUtils::pow(delta, _d3[i] + 1) * (delta - _D3[i]) +
325  _d3[i] * (_d3[i] - 1) * MathUtils::pow(delta, _d3[i]));
326 
327  // The Helmholtz free energy is the sum of these two
328  return dalpha0 + dalphar / delta / delta;
329 }
const std::array< Real, 4 > _t3
const std::array< Real, 4 > _D3
const std::array< unsigned int, 23 > _d2
const std::array< Real, 4 > _beta3
const std::array< Real, 13 > _t1
const std::array< Real, 4 > _N3
const std::array< Real, 13 > _N1
Coefficients for residual component of the Helmholtz free energy.
const std::array< Real, 4 > _gamma3
const std::array< unsigned int, 23 > _c2
const std::array< Real, 23 > _t2
const std::array< int, 4 > _d3
const std::array< Real, 4 > _alpha3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< unsigned int, 13 > _d1
const std::array< Real, 23 > _N2

◆ d2alpha_ddeltatau()

Real MethaneFluidProperties::d2alpha_ddeltatau ( Real  delta,
Real  tau 
) const
overrideprotectedvirtual

Second derivative of Helmholtz free energy wrt delta and tau.

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

Implements HelmholtzFluidProperties.

Definition at line 366 of file MethaneFluidProperties.C.

367 {
368  // Residual component of the Helmholtz free energy
369  Real dalphar = 0.0;
370 
371  for (std::size_t i = 0; i < _t1.size(); ++i)
372  dalphar += _N1[i] * _d1[i] * _t1[i] * std::pow(delta, _d1[i]) * std::pow(tau, _t1[i]);
373 
374  for (std::size_t i = 0; i < _t2.size(); ++i)
375  dalphar += _N2[i] * _t2[i] * std::pow(delta, _d2[i]) * std::pow(tau, _t2[i]) *
376  std::exp(-MathUtils::pow(delta, _c2[i])) *
377  (_d2[i] - _c2[i] * MathUtils::pow(delta, _c2[i]));
378 
379  for (std::size_t i = 0; i < _t3.size(); ++i)
380  dalphar += _N3[i] * std::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
381  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _D3[i]) -
382  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
383  (_d3[i] - 2.0 * _alpha3[i] * delta * (delta - _D3[i]) *
384  (_t3[i] - 2.0 * _beta3[i] * tau * (tau - _gamma3[i])));
385 
386  // The Helmholtz free energy is the sum of these two
387  return dalphar / delta / tau;
388 }
const std::array< Real, 4 > _t3
const std::array< Real, 4 > _D3
const std::array< unsigned int, 23 > _d2
const std::array< Real, 4 > _beta3
const std::array< Real, 13 > _t1
const std::array< Real, 4 > _N3
const std::array< Real, 13 > _N1
Coefficients for residual component of the Helmholtz free energy.
const std::array< Real, 4 > _gamma3
const std::array< unsigned int, 23 > _c2
const std::array< Real, 23 > _t2
const std::array< int, 4 > _d3
const std::array< Real, 4 > _alpha3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< unsigned int, 13 > _d1
const std::array< Real, 23 > _N2

◆ d2alpha_dtau2()

Real MethaneFluidProperties::d2alpha_dtau2 ( Real  delta,
Real  tau 
) const
overrideprotectedvirtual

Second derivative of Helmholtz free energy wrt tau.

Parameters
deltascaled density (-)
tauscaled temperature (-)
Returns
second derivative of Helmholtz free energy wrt tau

Implements HelmholtzFluidProperties.

Definition at line 332 of file MethaneFluidProperties.C.

333 {
334  // Ideal gas component of the Helmholtz free energy
335  Real dalpha0 = -3.0016 / tau / tau;
336 
337  for (std::size_t i = 0; i < _a0.size(); ++i)
338  {
339  Real exptau = std::exp(-_b0[i] * tau);
340  dalpha0 -= _a0[i] * (_b0[i] * _b0[i] * exptau / (1.0 - exptau) / (1.0 - exptau));
341  }
342 
343  // Residual component of the Helmholtz free energy
344  Real dalphar = 0.0;
345 
346  for (std::size_t i = 0; i < _t1.size(); ++i)
347  dalphar +=
348  _N1[i] * _t1[i] * (_t1[i] - 1.0) * MathUtils::pow(delta, _d1[i]) * std::pow(tau, _t1[i]);
349 
350  for (std::size_t i = 0; i < _t2.size(); ++i)
351  dalphar += _N2[i] * _t2[i] * (_t2[i] - 1.0) * MathUtils::pow(delta, _d2[i]) *
352  std::pow(tau, _t2[i]) * std::exp(-MathUtils::pow(delta, _c2[i]));
353 
354  for (std::size_t i = 0; i < _t3.size(); ++i)
355  dalphar += _N3[i] * MathUtils::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
356  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _D3[i]) -
357  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
358  (tau * _t3[i] - _beta3[i] * tau * tau * MathUtils::pow(tau - _gamma3[i], 2) -
359  _t3[i] - 2.0 * tau * tau * _beta3[i]);
360 
361  // The Helmholtz free energy is the sum of these two
362  return dalpha0 + dalphar / tau / tau;
363 }
const std::array< Real, 4 > _t3
const std::array< Real, 5 > _a0
Coefficients for ideal gas component of the Helmholtz free energy.
const std::array< Real, 5 > _b0
const std::array< Real, 4 > _D3
const std::array< unsigned int, 23 > _d2
const std::array< Real, 4 > _beta3
const std::array< Real, 13 > _t1
const std::array< Real, 4 > _N3
const std::array< Real, 13 > _N1
Coefficients for residual component of the Helmholtz free energy.
const std::array< Real, 4 > _gamma3
const std::array< unsigned int, 23 > _c2
const std::array< Real, 23 > _t2
const std::array< int, 4 > _d3
const std::array< Real, 4 > _alpha3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< unsigned int, 13 > _d1
const std::array< Real, 23 > _N2

◆ dalpha_ddelta()

Real MethaneFluidProperties::dalpha_ddelta ( Real  delta,
Real  tau 
) const
overrideprotectedvirtual

Derivative of Helmholtz free energy wrt delta.

Parameters
deltascaled density (-)
tauscaled temperature (-)
Returns
derivative of Helmholtz free energy wrt delta

Implements HelmholtzFluidProperties.

Definition at line 242 of file MethaneFluidProperties.C.

243 {
244  // Ideal gas component of the Helmholtz free energy
245  Real dalpha0 = 1.0 / delta;
246 
247  // Residual component of the Helmholtz free energy
248  Real dalphar = 0.0;
249 
250  for (std::size_t i = 0; i < _t1.size(); ++i)
251  dalphar += _N1[i] * _d1[i] * MathUtils::pow(delta, _d1[i]) * std::pow(tau, _t1[i]);
252 
253  for (std::size_t i = 0; i < _t2.size(); ++i)
254  dalphar += _N2[i] * MathUtils::pow(delta, _d2[i]) * std::pow(tau, _t2[i]) *
255  std::exp(-MathUtils::pow(delta, _c2[i])) *
256  (_d2[i] - _c2[i] * MathUtils::pow(delta, _c2[i]));
257 
258  for (std::size_t i = 0; i < _t3.size(); ++i)
259  dalphar += _N3[i] * MathUtils::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
260  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _D3[i]) -
261  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
262  (_d3[i] - delta * (2.0 * _alpha3[i] * (delta - _D3[i])));
263 
264  // The Helmholtz free energy is the sum of these two
265  return dalpha0 + dalphar / delta;
266 }
const std::array< Real, 4 > _t3
const std::array< Real, 4 > _D3
const std::array< unsigned int, 23 > _d2
const std::array< Real, 4 > _beta3
const std::array< Real, 13 > _t1
const std::array< Real, 4 > _N3
const std::array< Real, 13 > _N1
Coefficients for residual component of the Helmholtz free energy.
const std::array< Real, 4 > _gamma3
const std::array< unsigned int, 23 > _c2
const std::array< Real, 23 > _t2
const std::array< int, 4 > _d3
const std::array< Real, 4 > _alpha3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< unsigned int, 13 > _d1
const std::array< Real, 23 > _N2

◆ dalpha_dtau()

Real MethaneFluidProperties::dalpha_dtau ( Real  delta,
Real  tau 
) const
overrideprotectedvirtual

Derivative of Helmholtz free energy wrt tau.

Parameters
deltascaled density (-)
tauscaled temperature (-)
Returns
derivative of Helmholtz free energy wrt tau

Implements HelmholtzFluidProperties.

Definition at line 269 of file MethaneFluidProperties.C.

270 {
271  // Ideal gas component of the Helmholtz free energy
272  Real dalpha0 = -6.33270087 + 3.0016 / tau;
273 
274  for (std::size_t i = 0; i < _a0.size(); ++i)
275  dalpha0 += _a0[i] * _b0[i] * (1.0 / (1.0 - std::exp(-_b0[i] * tau)) - 1.0);
276 
277  // Residual component of the Helmholtz free energy
278  Real dalphar = 0.0;
279 
280  for (std::size_t i = 0; i < _t1.size(); ++i)
281  dalphar += _N1[i] * _t1[i] * MathUtils::pow(delta, _d1[i]) * std::pow(tau, _t1[i]);
282 
283  for (std::size_t i = 0; i < _t2.size(); ++i)
284  dalphar += _N2[i] * _t2[i] * MathUtils::pow(delta, _d2[i]) * std::pow(tau, _t2[i]) *
285  std::exp(-MathUtils::pow(delta, _c2[i]));
286 
287  for (std::size_t i = 0; i < _t3.size(); ++i)
288  dalphar += _N3[i] * MathUtils::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
289  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _D3[i]) -
290  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
291  (_t3[i] + tau * (2.0 * _beta3[i] * (tau - _gamma3[i])));
292 
293  // The Helmholtz free energy is the sum of these two
294  return dalpha0 + dalphar / tau;
295 }
const std::array< Real, 4 > _t3
const std::array< Real, 5 > _a0
Coefficients for ideal gas component of the Helmholtz free energy.
const std::array< Real, 5 > _b0
const std::array< Real, 4 > _D3
const std::array< unsigned int, 23 > _d2
const std::array< Real, 4 > _beta3
const std::array< Real, 13 > _t1
const std::array< Real, 4 > _N3
const std::array< Real, 13 > _N1
Coefficients for residual component of the Helmholtz free energy.
const std::array< Real, 4 > _gamma3
const std::array< unsigned int, 23 > _c2
const std::array< Real, 23 > _t2
const std::array< int, 4 > _d3
const std::array< Real, 4 > _alpha3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< unsigned int, 13 > _d1
const std::array< Real, 23 > _N2

◆ e()

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

Definition at line 292 of file SinglePhaseFluidProperties.C.

Referenced by Water97FluidProperties::b2bc(), IdealGasFluidProperties::c_from_v_e(), StiffenedGasFluidProperties::c_from_v_e(), NaClFluidProperties::cp_from_p_T(), IdealGasFluidProperties::cp_from_v_e(), StiffenedGasFluidProperties::cp_from_v_e(), Water97FluidProperties::densityRegion3(), SinglePhaseFluidProperties::e_dpT(), StiffenedGasFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_rho(), HelmholtzFluidProperties::e_from_p_T(), IdealGasFluidPropertiesPT::e_from_p_T(), Water97FluidProperties::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(), IdealGasFluidProperties::h_from_p_T(), 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(), IdealGasFluidProperties::p_from_v_e(), StiffenedGasFluidProperties::p_from_v_e(), IdealGasFluidPropertiesPT::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_from_p_T(), StiffenedGasFluidProperties::s_from_T_v(), IdealGasFluidProperties::s_from_v_e(), StiffenedGasFluidProperties::s_from_v_e(), Water97FluidProperties::subregion3(), Water97FluidProperties::subregionVolume(), SinglePhaseFluidProperties::T_from_p_h(), IdealGasFluidProperties::T_from_v_e(), StiffenedGasFluidProperties::T_from_v_e(), StiffenedGasFluidProperties::v_e_spndl_from_T(), and Water97FluidProperties::vaporTemperature().

293 {
294  mooseDeprecated(name(), ": e() is deprecated. Use e_from_p_T() instead");
295 
296  return e_from_p_T(p, T);
297 }
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 300 of file SinglePhaseFluidProperties.C.

301 {
302  mooseDeprecated(name(), ": e_dpT() is deprecated. Use e_from_p_T() instead");
303 
304  e_from_p_T(p, T, e, de_dp, de_dT);
305 }
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 HelmholtzFluidProperties::e_from_p_T ( Real  p,
Real  T 
) const
overridevirtualinherited

Internal energy from pressure and temperature.

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 65 of file HelmholtzFluidProperties.C.

Referenced by HelmholtzFluidProperties::e_from_p_T().

66 {
67  // Require density first
69  // Scale the input density and temperature
70  const Real delta = density / criticalDensity();
71  const Real tau = criticalTemperature() / temperature;
72 
73  return _R * temperature * tau * dalpha_dtau(delta, tau) / molarMass();
74 }
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real dalpha_dtau(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt tau.
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ e_from_p_T() [2/2]

void HelmholtzFluidProperties::e_from_p_T ( Real  p,
Real  T,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
overridevirtualinherited

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 77 of file HelmholtzFluidProperties.C.

79 {
80  e = this->e_from_p_T(pressure, temperature);
81 
82  // Require density first
84  // Scale the input density and temperature
85  const Real delta = density / criticalDensity();
86  const Real tau = criticalTemperature() / temperature;
87 
88  const Real da_dd = dalpha_ddelta(delta, tau);
89  const Real d2a_dd2 = d2alpha_ddelta2(delta, tau);
90  const Real d2a_ddt = d2alpha_ddeltatau(delta, tau);
91 
92  de_dp = tau * d2a_ddt / (density * (2.0 * da_dd + delta * d2a_dd2));
93  de_dT = -_R *
94  (delta * tau * d2a_ddt * (da_dd - tau * d2a_ddt) / (2.0 * da_dd + delta * d2a_dd2) +
95  tau * tau * d2alpha_dtau2(delta, tau)) /
96  molarMass();
97 }
virtual Real d2alpha_ddeltatau(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta and tau.
virtual Real d2alpha_dtau2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt tau.
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
virtual Real d2alpha_ddelta2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta.
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real dalpha_ddelta(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt delta.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26
virtual Real e(Real pressure, Real temperature) const
virtual Real e_from_p_T(Real pressure, Real temperature) const override
Internal energy from pressure and temperature.

◆ 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 452 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e().

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

◆ execute()

virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Definition at line 27 of file FluidProperties.h.

27 {}

◆ finalize()

virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Definition at line 29 of file FluidProperties.h.

29 {}

◆ fluidName()

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

Fluid name.

Returns
string representing fluid name

Reimplemented from SinglePhaseFluidProperties.

Definition at line 40 of file MethaneFluidProperties.C.

41 {
42  return "methane";
43 }

◆ 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 (-)

Definition at line 149 of file SinglePhaseFluidProperties.C.

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

◆ 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 437 of file SinglePhaseFluidProperties.C.

438 {
439  mooseDeprecated(name(), ": h_dpT() is deprecated. Use h_from_p_T() instead");
440 
441  h_from_p_T(p, T, h, dh_dp, dh_dT);
442 }
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 HelmholtzFluidProperties::h_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtualinherited

Definition at line 185 of file HelmholtzFluidProperties.C.

Referenced by HelmholtzFluidProperties::h_from_p_T().

186 {
187  // Require density first
188  const Real density = rho_from_p_T(pressure, temperature);
189  // Scale the input density and temperature
190  const Real delta = density / criticalDensity();
191  const Real tau = criticalTemperature() / temperature;
192 
193  return _R * temperature * (tau * dalpha_dtau(delta, tau) + delta * dalpha_ddelta(delta, tau)) /
194  molarMass();
195 }
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real dalpha_ddelta(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt delta.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real dalpha_dtau(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt tau.
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ h_from_p_T() [2/2]

void HelmholtzFluidProperties::h_from_p_T ( Real  p,
Real  T,
Real &  h,
Real &  dh_dp,
Real &  dh_dT 
) const
overridevirtualinherited

Definition at line 198 of file HelmholtzFluidProperties.C.

200 {
201  h = this->h_from_p_T(pressure, temperature);
202 
203  // Require density first
204  const Real density = rho_from_p_T(pressure, temperature);
205  // Scale the input density and temperature
206  const Real delta = density / criticalDensity();
207  const Real tau = criticalTemperature() / temperature;
208 
209  const Real da_dd = dalpha_ddelta(delta, tau);
210  const Real d2a_dd2 = d2alpha_ddelta2(delta, tau);
211  const Real d2a_ddt = d2alpha_ddeltatau(delta, tau);
212 
213  dh_dp = (da_dd + delta * d2a_dd2 + tau * d2a_ddt) / (density * (2.0 * da_dd + delta * d2a_dd2));
214  dh_dT = _R *
215  (delta * da_dd * (1.0 - tau * d2a_ddt / da_dd) * (1.0 - tau * d2a_ddt / da_dd) /
216  (2.0 + delta * d2a_dd2 / da_dd) -
217  tau * tau * d2alpha_dtau2(delta, tau)) /
218  molarMass();
219 }
virtual Real d2alpha_ddeltatau(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta and tau.
virtual Real d2alpha_dtau2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt tau.
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.
const std::string temperature
Definition: NS.h:27
virtual Real d2alpha_ddelta2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta.
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real dalpha_ddelta(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt delta.
virtual Real h_from_p_T(Real pressure, Real temperature) const override
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ henryConstant() [1/2]

Real MethaneFluidProperties::henryConstant ( Real  temperature) const
overridevirtual

Henry's law constant for dissolution in water.

Parameters
temperaturefluid temperature (K)
Returns
Henry's constant

Reimplemented from SinglePhaseFluidProperties.

Definition at line 170 of file MethaneFluidProperties.C.

171 {
172  return henryConstantIAPWS(temperature, -10.44708, 4.66491, 12.12986);
173 }
const std::string temperature
Definition: NS.h:27
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...

◆ henryConstant() [2/2]

void MethaneFluidProperties::henryConstant ( Real  temperature,
Real &  Kh,
Real &  dKh_dT 
) const
overridevirtual

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 from SinglePhaseFluidProperties.

Definition at line 176 of file MethaneFluidProperties.C.

177 {
178  henryConstantIAPWS(temperature, Kh, dKh_dT, -10.44708, 4.66491, 12.12986);
179 }
const std::string temperature
Definition: NS.h:27
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...

◆ henryConstant_dT()

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

Definition at line 256 of file SinglePhaseFluidProperties.C.

257 {
258  mooseDeprecated(name(), ": henryConstant_dT() is deprecated. Use henryConstant() instead");
259 
260  henryConstant(T, Kh, dKh_dT);
261 }
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 161 of file SinglePhaseFluidProperties.C.

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

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

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

222 {
223  mooseDeprecated(name(),
224  ":henryConstantIAPWS_dT() is deprecated. Use henryConstantIAPWS() instead");
225 
226  henryConstantIAPWS(T, Kh, dKh_dT, A, B, C);
227 }
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 28 of file FluidProperties.h.

28 {}

◆ 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 405 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::k_dpT(), IdealGasFluidPropertiesPT::k_from_p_T(), k_from_p_T(), SimpleFluidProperties::k_from_p_T(), NitrogenFluidProperties::k_from_p_T(), NaClFluidProperties::k_from_p_T(), HydrogenFluidProperties::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().

406 {
407  mooseDeprecated(name(), ": k() is deprecated. Use k_from_p_T() instead");
408 
409  return k_from_p_T(p, T);
410 }
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 413 of file SinglePhaseFluidProperties.C.

414 {
415  mooseDeprecated(name(), ": k_dpT() is deprecated. Use k_from_p_T() instead");
416 
417  k_from_p_T(p, T, k, dk_dp, dk_dT);
418 }
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 MethaneFluidProperties::k_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 111 of file MethaneFluidProperties.C.

112 {
113  // Check the temperature is in the range of validity (200 K <= T <= 1000 K)
114  if (temperature <= 200.0 || temperature >= 1000.0)
115  throw MooseException("Temperature " + Moose::stringify(temperature) +
116  "K out of range (200K, 1000K) in " + name() + ": k()");
117 
118  Real kt = 0.0;
119  for (std::size_t i = 0; i < _b.size(); ++i)
120  kt += _b[i] * MathUtils::pow(temperature, i);
121 
122  return kt;
123 }
const std::string temperature
Definition: NS.h:27
const std::array< Real, 7 > _b
Coefficients for thermal conductivity.
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ k_from_p_T() [2/2]

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

Definition at line 126 of file MethaneFluidProperties.C.

128 {
129  // Check the temperature is in the range of validity (200 K <= T <= 1000 K)
130  if (temperature <= 200.0 || temperature >= 1000.0)
131  throw MooseException("Temperature " + Moose::stringify(temperature) +
132  "K out of range (200K, 1000K) in " + name() + ": k()");
133 
134  Real kt = 0.0, dkt_dT = 0.0;
135 
136  for (std::size_t i = 0; i < _b.size(); ++i)
137  kt += _b[i] * MathUtils::pow(temperature, i);
138 
139  for (std::size_t i = 1; i < _b.size(); ++i)
140  dkt_dT += i * _b[i] * MathUtils::pow(temperature, i) / temperature;
141 
142  k = kt;
143  dk_dp = 0.0;
144  dk_dT = dkt_dT;
145 }
const std::string temperature
Definition: NS.h:27
virtual Real k(Real pressure, Real temperature) const
Thermal conductivity.
const std::array< Real, 7 > _b
Coefficients for thermal conductivity.
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ molarMass()

Real MethaneFluidProperties::molarMass ( ) const
overridevirtual

Molar mass [kg/mol].

Returns
molar mass

Reimplemented from SinglePhaseFluidProperties.

Definition at line 46 of file MethaneFluidProperties.C.

47 {
48  return _Mch4;
49 }
const Real _Mch4
Methane molar mass (kg/mol)

◆ mu()

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

Dynamic viscosity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
viscosity (Pa.s)

Definition at line 345 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::mu_dpT(), SinglePhaseFluidProperties::mu_drhoT_from_rho_T(), mu_from_p_T(), CO2FluidProperties::mu_from_p_T(), NitrogenFluidProperties::mu_from_p_T(), HydrogenFluidProperties::mu_from_p_T(), IdealGasFluidPropertiesPT::mu_from_p_T(), IdealGasFluidProperties::mu_from_p_T(), Water97FluidProperties::mu_from_p_T(), StiffenedGasFluidProperties::mu_from_p_T(), SimpleFluidProperties::mu_from_p_T(), TabulatedFluidProperties::mu_from_p_T(), NitrogenFluidProperties::mu_from_rho_T(), HydrogenFluidProperties::mu_from_rho_T(), CO2FluidProperties::mu_from_rho_T(), Water97FluidProperties::mu_from_rho_T(), SinglePhaseFluidProperties::rho_mu(), SinglePhaseFluidProperties::rho_mu_dpT(), NitrogenFluidProperties::rho_mu_from_p_T(), HydrogenFluidProperties::rho_mu_from_p_T(), CO2FluidProperties::rho_mu_from_p_T(), IdealGasFluidPropertiesPT::rho_mu_from_p_T(), Water97FluidProperties::rho_mu_from_p_T(), and SinglePhaseFluidProperties::rho_mu_from_p_T().

346 {
347  mooseDeprecated(name(), ": mu() is deprecated. Use mu_from_p_T() instead");
348 
349  return mu_from_p_T(p, T);
350 }
const std::string name
Definition: Setup.h:22

◆ 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 353 of file SinglePhaseFluidProperties.C.

354 {
355  mooseDeprecated(name(), ": mu_dpT() is deprecated. Use mu_from_p_T() instead");
356 
357  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
358 }
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 236 of file SinglePhaseFluidProperties.C.

238 {
239  mooseDeprecated(name(), ":mu_drhoT_from_rho_T() is deprecated. Use mu_from_rho_T() instead");
240 
241  mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
242 }
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 MethaneFluidProperties::mu_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 82 of file MethaneFluidProperties.C.

Referenced by mu_from_p_T().

83 {
84  // Check the temperature is in the range of validity (200 K <= T <= 1000 K)
85  if (temperature <= 200.0 || temperature >= 1000.0)
86  throw MooseException("Temperature " + Moose::stringify(temperature) +
87  "K out of range (200K, 1000K) in " + name() + ": mu_from_p_T()");
88 
89  Real viscosity = 0.0;
90  for (std::size_t i = 0; i < _a.size(); ++i)
91  viscosity += _a[i] * MathUtils::pow(temperature, i);
92 
93  return viscosity * 1.e-6;
94 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 6 > _a
Coefficients for viscosity.

◆ mu_from_p_T() [2/2]

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

Definition at line 97 of file MethaneFluidProperties.C.

99 {
100 
102  dmu_dp = 0.0;
103 
104  Real dmudt = 0.0;
105  for (std::size_t i = 0; i < _a.size(); ++i)
106  dmudt += i * _a[i] * MathUtils::pow(temperature, i) / temperature;
107  dmu_dT = dmudt * 1.e-6;
108 }
virtual Real mu_from_p_T(Real pressure, Real temperature) const override
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string temperature
Definition: NS.h:27
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::string pressure
Definition: NS.h:26
const std::array< Real, 6 > _a
Coefficients for viscosity.

◆ mu_from_rho_T()

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

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 in Water97FluidProperties, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 230 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::mu_drhoT_from_rho_T().

231 {
232  mooseError(name(), ": mu_from_rho_T is not implemented.");
233 }
const std::string name
Definition: Setup.h:22

◆ p_from_rho_T()

Real HelmholtzFluidProperties::p_from_rho_T ( Real  rho,
Real  T 
) const
virtualinherited

Pressure as a function of density and temperature.

Parameters
rhodensity (kg/m^3)
Ttemperature (K)
Returns
pressure (Pa)

Reimplemented in CO2FluidProperties.

Definition at line 222 of file HelmholtzFluidProperties.C.

Referenced by CO2FluidProperties::p_from_rho_T(), and HelmholtzFluidProperties::rho_from_p_T().

223 {
224  // Scale the input density and temperature
225  const Real delta = density / criticalDensity();
226  const Real tau = criticalTemperature() / temperature;
227 
228  return _R * density * temperature * delta * dalpha_ddelta(delta, tau) / molarMass();
229 }
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real dalpha_ddelta(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt delta.
virtual Real criticalDensity() const
Critical density.

◆ 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 283 of file SinglePhaseFluidProperties.C.

285 {
286  mooseDeprecated(name(), ": rho_dpT() is deprecated. Use rho_from_p_T() instead");
287 
288  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
289 }
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

Reimplemented in IdealGasFluidPropertiesPT.

Definition at line 322 of file SinglePhaseFluidProperties.C.

330 {
331  mooseDeprecated(name(), ": rho_e_dpT() is deprecated. Use rho_e_from_p_T() instead");
332 
333  rho_e_from_p_T(p, T, rho, drho_dp, drho_dT, e, de_dp, de_dT);
334 }
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 308 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::rho_e_dpT().

316 {
317  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
318  e_from_p_T(p, T, e, de_dp, de_dT);
319 }
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 HelmholtzFluidProperties::rho_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtualinherited

Reimplemented in CO2FluidProperties.

Definition at line 29 of file HelmholtzFluidProperties.C.

Referenced by HelmholtzFluidProperties::c_from_p_T(), HelmholtzFluidProperties::cp_from_p_T(), HelmholtzFluidProperties::cv_from_p_T(), HelmholtzFluidProperties::e_from_p_T(), HelmholtzFluidProperties::h_from_p_T(), NitrogenFluidProperties::k_from_p_T(), HydrogenFluidProperties::k_from_p_T(), NitrogenFluidProperties::mu_from_p_T(), CO2FluidProperties::mu_from_p_T(), HydrogenFluidProperties::mu_from_p_T(), HelmholtzFluidProperties::rho_from_p_T(), CO2FluidProperties::rho_from_p_T(), NitrogenFluidProperties::rho_mu_from_p_T(), HydrogenFluidProperties::rho_mu_from_p_T(), and HelmholtzFluidProperties::s_from_p_T().

30 {
31  Real density;
32  // Initial estimate of a bracketing interval for the density
33  Real lower_density = 1.0e-2;
34  Real upper_density = 100.0;
35 
36  // The density is found by finding the zero of the pressure
37  auto pressure_diff = [&pressure, &temperature, this](Real x) {
38  return this->p_from_rho_T(x, temperature) - pressure;
39  };
40 
41  BrentsMethod::bracket(pressure_diff, lower_density, upper_density);
42  density = BrentsMethod::root(pressure_diff, lower_density, upper_density);
43 
44  return density;
45 }
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
Real root(std::function< Real(Real)> const &f, Real x1, Real x2, Real tol=1.0e-12)
Finds the root of a function using Brent&#39;s method.
Definition: BrentsMethod.C:61
virtual Real p_from_rho_T(Real rho, Real T) const
Pressure as a function of density and temperature.
const std::string pressure
Definition: NS.h:26
void bracket(std::function< Real(Real)> const &f, Real &x1, Real &x2)
Function to bracket a root of a given function.
Definition: BrentsMethod.C:17

◆ rho_from_p_T() [2/2]

void HelmholtzFluidProperties::rho_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
overridevirtualinherited

Reimplemented in CO2FluidProperties.

Definition at line 48 of file HelmholtzFluidProperties.C.

50 {
52 
53  // Scale the density and temperature
54  const Real delta = rho / criticalDensity();
55  const Real tau = criticalTemperature() / temperature;
56  const Real da_dd = dalpha_ddelta(delta, tau);
57  const Real d2a_dd2 = d2alpha_ddelta2(delta, tau);
58 
59  drho_dp = molarMass() / (_R * temperature * delta * (2.0 * da_dd + delta * d2a_dd2));
60  drho_dT = rho * (tau * d2alpha_ddeltatau(delta, tau) - da_dd) / temperature /
61  (2.0 * da_dd + delta * d2a_dd2);
62 }
virtual Real d2alpha_ddeltatau(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta and tau.
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string temperature
Definition: NS.h:27
virtual Real d2alpha_ddelta2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta.
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real dalpha_ddelta(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt delta.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ 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 361 of file SinglePhaseFluidProperties.C.

362 {
363  mooseDeprecated(name(), ": rho_mu() is deprecated. Use rho_mu_from_p_T() instead");
364 
365  rho_mu_from_p_T(p, T, rho, mu);
366 }
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 376 of file SinglePhaseFluidProperties.C.

384 {
385  mooseDeprecated(name(), ": rho_mu_dpT() is deprecated. Use rho_mu_from_p_T() instead");
386 
387  rho_mu_from_p_T(p, T, rho, drho_dp, drho_dT, mu, dmu_dp, dmu_dT);
388 }
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 SinglePhaseFluidProperties::rho_mu_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  mu 
) const
virtualinherited

◆ rho_mu_from_p_T() [2/2]

void SinglePhaseFluidProperties::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
virtualinherited

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 in Water97FluidProperties, IdealGasFluidPropertiesPT, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 391 of file SinglePhaseFluidProperties.C.

399 {
400  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
401  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
402 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.

◆ s()

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

◆ s_from_p_T() [1/2]

Real HelmholtzFluidProperties::s_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtualinherited

Definition at line 150 of file HelmholtzFluidProperties.C.

Referenced by HelmholtzFluidProperties::s_from_p_T().

151 {
152  // Require density first
153  const Real density = rho_from_p_T(pressure, temperature);
154  // Scale the input density and temperature
155  const Real delta = density / criticalDensity();
156  const Real tau = criticalTemperature() / temperature;
157 
158  return _R * (tau * dalpha_dtau(delta, tau) - alpha(delta, tau)) / molarMass();
159 }
virtual Real molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real dalpha_dtau(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt tau.
virtual Real alpha(Real delta, Real tau) const =0
Helmholtz free energy.
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ s_from_p_T() [2/2]

void HelmholtzFluidProperties::s_from_p_T ( Real  p,
Real  T,
Real &  s,
Real &  ds_dp,
Real &  ds_dT 
) const
overridevirtualinherited

Definition at line 162 of file HelmholtzFluidProperties.C.

164 {
165  s = this->s_from_p_T(pressure, temperature);
166 
167  // Require density first
168  const Real density = rho_from_p_T(pressure, temperature);
169  // Scale the input density and temperature
170  const Real delta = density / criticalDensity();
171  const Real tau = criticalTemperature() / temperature;
172 
173  const Real da_dd = dalpha_ddelta(delta, tau);
174  const Real da_dt = dalpha_dtau(delta, tau);
175  const Real d2a_dd2 = d2alpha_ddelta2(delta, tau);
176  const Real d2a_dt2 = d2alpha_dtau2(delta, tau);
177  const Real d2a_ddt = d2alpha_ddeltatau(delta, tau);
178 
179  ds_dp = tau * (d2a_ddt - da_dd) / (density * temperature * (2.0 * da_dd + delta * d2a_dd2));
180  ds_dT = -_R * tau * (da_dt - alpha(delta, tau) + tau * (d2a_dt2 - da_dt)) /
181  (molarMass() * temperature);
182 }
virtual Real d2alpha_ddeltatau(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta and tau.
virtual Real d2alpha_dtau2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt tau.
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 molarMass() const
Molar mass [kg/mol].
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
virtual Real d2alpha_ddelta2(Real delta, Real tau) const =0
Second derivative of Helmholtz free energy wrt delta.
const Real _R
Universal gas constant (J/mol/K)
virtual Real criticalTemperature() const
Critical temperature.
virtual Real dalpha_ddelta(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt delta.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real dalpha_dtau(Real delta, Real tau) const =0
Derivative of Helmholtz free energy wrt tau.
virtual Real alpha(Real delta, Real tau) const =0
Helmholtz free energy.
virtual Real criticalDensity() const
Critical density.
virtual Real s_from_p_T(Real pressure, Real temperature) const override
const std::string pressure
Definition: NS.h:26

◆ saturatedLiquidDensity()

Real MethaneFluidProperties::saturatedLiquidDensity ( Real  temperature) const

Saturated liquid density of CH4 Valid for temperatures between the triple point temperature and critical temperature.

Eq. (3.4), from Setzmann and Wagner (reference above)

Parameters
temperaturetemperature (K)
Returns
saturated liquid density (kg/m^3)

Definition at line 182 of file MethaneFluidProperties.C.

183 {
184  if (temperature < _T_triple || temperature > _T_critical)
185  throw MooseException("Temperature is out of range in " + name() + ": saturatedLiquidDensity()");
186 
187  const Real Tr = temperature / _T_critical;
188  const Real theta = 1.0 - Tr;
189 
190  const Real logdensity = 1.9906389 * std::pow(theta, 0.354) - 0.78756197 * std::sqrt(theta) +
191  0.036976723 * std::pow(theta, 2.5);
192 
193  return _rho_critical * std::exp(logdensity);
194 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _rho_critical
Critical density (kg/m^3)
const Real _T_critical
Critical temperature (K)

◆ saturatedVaporDensity()

Real MethaneFluidProperties::saturatedVaporDensity ( Real  temperature) const

Saturated vapor density of CH4 Valid for temperatures between the triple point temperature and critical temperature.

Eq. (3.5), from Setzmann and Wagner (reference above)

Parameters
temperaturetemperature (K)
Returns
saturated vapor density (kg/m^3)

Definition at line 197 of file MethaneFluidProperties.C.

198 {
199  if (temperature < _T_triple || temperature > _T_critical)
200  throw MooseException("Temperature is out of range in " + name() + ": saturatedVaporDensity()");
201 
202  const Real Tr = temperature / _T_critical;
203  const Real theta = 1.0 - Tr;
204 
205  const Real logdensity =
206  -1.880284 * std::pow(theta, 0.354) - 2.8526531 * std::pow(theta, 5.0 / 6.0) -
207  3.000648 * std::pow(theta, 1.5) - 5.251169 * std::pow(theta, 2.5) -
208  13.191859 * std::pow(theta, 25.0 / 6.0) - 37.553961 * std::pow(theta, 47.0 / 6.0);
209 
210  return _rho_critical * std::exp(logdensity);
211 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _rho_critical
Critical density (kg/m^3)
const Real _T_critical
Critical temperature (K)

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Definition at line 32 of file FluidProperties.h.

32 {}

◆ 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 464 of file SinglePhaseFluidProperties.C.

465 {
466  const Real s = s_from_h_p(h, p);
467  const Real rho = rho_from_p_s(p, s);
468  const Real v = 1. / rho;
469  const Real e = e_from_v_h(v, h);
470  return T_from_v_e(v, e);
471 }
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

◆ threadJoin()

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

Definition at line 31 of file FluidProperties.h.

31 {}

◆ triplePointPressure()

Real MethaneFluidProperties::triplePointPressure ( ) const
overridevirtual

Triple point pressure.

Returns
triple point pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 70 of file MethaneFluidProperties.C.

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

◆ triplePointTemperature()

Real MethaneFluidProperties::triplePointTemperature ( ) const
overridevirtual

Triple point temperature.

Returns
triple point temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 76 of file MethaneFluidProperties.C.

77 {
78  return _T_triple;
79 }
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 458 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::v_from_p_T().

459 {
460  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
461 }
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 67 of file SinglePhaseFluidProperties.C.

68 {
69  Real rho, drho_dp, drho_dT;
70  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
71 
72  v = 1.0 / rho;
73  const Real dv_drho = -1.0 / (rho * rho);
74 
75  dv_dp = dv_drho * drho_dp;
76  dv_dT = dv_drho * drho_dT;
77 }

◆ vaporPressure() [1/2]

Real MethaneFluidProperties::vaporPressure ( Real  temperature) const
overridevirtual

Vapor pressure.

Used to delineate liquid and gas phases. Valid for temperatures between the triple point temperature and the critical temperature

Parameters
temperaturewater temperature (K)
Returns
saturation pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 148 of file MethaneFluidProperties.C.

149 {
150  if (temperature < _T_triple || temperature > _T_critical)
151  throw MooseException("Temperature is out of range in " + name() + ": vaporPressure()");
152 
153  const Real Tr = temperature / _T_critical;
154  const Real theta = 1.0 - Tr;
155 
156  const Real logpressure = (-6.036219 * theta + 1.409353 * std::pow(theta, 1.5) -
157  0.4945199 * Utility::pow<2>(theta) - 1.443048 * std::pow(theta, 4.5)) /
158  Tr;
159 
160  return _p_critical * std::exp(logpressure);
161 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _T_critical
Critical temperature (K)
const Real _p_critical
Critical pressure (Pa)

◆ vaporPressure() [2/2]

void MethaneFluidProperties::vaporPressure ( Real  temperature,
Real &  psat,
Real &  dpsat_dT 
) const
overridevirtual

Vapor pressure.

Used to delineate liquid and gas phases. Valid for temperatures between the triple point temperature and the critical temperature

Parameters
temperaturewater temperature (K)
[out]saturationpressure (Pa)
[out]derivativeof saturation pressure wrt temperature (Pa/K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 164 of file MethaneFluidProperties.C.

165 {
166  mooseError(name(), ": vaporPressure() is not implemented");
167 }
const std::string name
Definition: Setup.h:22

◆ vaporPressure_dT()

void SinglePhaseFluidProperties::vaporPressure_dT ( Real  temperature,
Real &  psat,
Real &  dpsat_dT 
) const
virtualinherited

Definition at line 275 of file SinglePhaseFluidProperties.C.

276 {
277  mooseDeprecated(name(), ": vaporPressure_dT() is deprecated. Use vaporPressure() instead");
278 
279  vaporPressure(T, psat, dpsat_dT);
280 }
virtual Real vaporPressure(Real temperature) const
Vapor pressure.
const std::string name
Definition: Setup.h:22

Member Data Documentation

◆ _a

const std::array<Real, 6> MethaneFluidProperties::_a
protected
Initial value:
{
{2.968267e-1, 3.711201e-2, 1.218298e-5, -7.02426e-8, 7.543269e-11, -2.7237166e-14}}

Coefficients for viscosity.

Definition at line 169 of file MethaneFluidProperties.h.

Referenced by mu_from_p_T().

◆ _a0

const std::array<Real, 5> MethaneFluidProperties::_a0 {{0.008449, 4.6942, 3.4865, 1.6572, 1.4115}}
protected

Coefficients for ideal gas component of the Helmholtz free energy.

Definition at line 124 of file MethaneFluidProperties.h.

Referenced by alpha(), d2alpha_dtau2(), and dalpha_dtau().

◆ _alpha3

const std::array<Real, 4> MethaneFluidProperties::_alpha3 {{20.0, 40.0, 40.0, 40.0}}
protected

◆ _b

const std::array<Real, 7> MethaneFluidProperties::_b
protected
Initial value:
{{-1.3401499e-2,
3.663076e-4,
-1.82248608e-6,
5.93987998e-9,
-9.1405505e-12,
6.7896889e-15,
-1.95048736e-18}}

Coefficients for thermal conductivity.

Definition at line 172 of file MethaneFluidProperties.h.

Referenced by k_from_p_T().

◆ _b0

const std::array<Real, 5> MethaneFluidProperties::_b0 {{3.4004324, 10.26951575, 20.43932747, 29.93744884, 79.13351945}}
protected

Definition at line 125 of file MethaneFluidProperties.h.

Referenced by alpha(), d2alpha_dtau2(), and dalpha_dtau().

◆ _beta3

const std::array<Real, 4> MethaneFluidProperties::_beta3 {{200.0, 250.0, 250.0, 250.0}}
protected

◆ _c2

const std::array<unsigned int, 23> MethaneFluidProperties::_c2
protected
Initial value:
{
{1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4}}

Definition at line 154 of file MethaneFluidProperties.h.

Referenced by alpha(), d2alpha_ddelta2(), d2alpha_ddeltatau(), d2alpha_dtau2(), dalpha_ddelta(), and dalpha_dtau().

◆ _d1

const std::array<unsigned int, 13> MethaneFluidProperties::_d1 {{1, 1, 1, 2, 2, 2, 2, 3, 4, 4, 8, 9, 10}}
protected

◆ _d2

const std::array<unsigned int, 23> MethaneFluidProperties::_d2
protected
Initial value:
{
{1, 1, 1, 2, 4, 5, 6, 1, 2, 3, 4, 4, 3, 5, 5, 8, 2, 3, 4, 4, 4, 5, 6}}

Definition at line 156 of file MethaneFluidProperties.h.

Referenced by alpha(), d2alpha_ddelta2(), d2alpha_ddeltatau(), d2alpha_dtau2(), dalpha_ddelta(), and dalpha_dtau().

◆ _d3

const std::array<int, 4> MethaneFluidProperties::_d3 {{2, 0, 0, 0}}
protected

◆ _D3

const std::array<Real, 4> MethaneFluidProperties::_D3 {{1.0, 1.0, 1.0, 1.0}}
protected

◆ _gamma3

const std::array<Real, 4> MethaneFluidProperties::_gamma3 {{1.07, 1.11, 1.11, 1.11}}
protected

◆ _Mch4

const Real MethaneFluidProperties::_Mch4
protected

Methane molar mass (kg/mol)

Definition at line 111 of file MethaneFluidProperties.h.

Referenced by molarMass().

◆ _N1

const std::array<Real, 13> MethaneFluidProperties::_N1
protected
Initial value:
{{0.4367901028e-1,
0.6709236199,
-0.1765577859e1,
0.8582330241,
-0.1206513052e1,
0.512046722,
-0.4000010791e-3,
-0.1247842423e-1,
0.3100269701e-1,
0.1754748522e-2,
-0.3171921605e-5,
-0.224034684e-5,
0.2947056156e-6}}

Coefficients for residual component of the Helmholtz free energy.

Definition at line 128 of file MethaneFluidProperties.h.

Referenced by alpha(), d2alpha_ddelta2(), d2alpha_ddeltatau(), d2alpha_dtau2(), dalpha_ddelta(), and dalpha_dtau().

◆ _N2

const std::array<Real, 23> MethaneFluidProperties::_N2
protected
Initial value:
{
{0.1830487909, 0.1511883679, -0.4289363877, 0.6894002446e-1, -0.1408313996e-1,
-0.306305483e-1, -0.2969906708e-1, -0.1932040831e-1, -0.1105739959, 0.9952548995e-1,
0.8548437825e-2, -0.6150555662e-1, -0.4291792423e-1, -0.181320729e-1, 0.344590476e-1,
-0.238591945e-2, -0.1159094939e-1, 0.6641693602e-1, -0.237154959e-1, -0.3961624905e-1,
-0.1387292044e-1, 0.3389489599e-1, -0.2927378753e-2}}

Definition at line 145 of file MethaneFluidProperties.h.

Referenced by alpha(), d2alpha_ddelta2(), d2alpha_ddeltatau(), d2alpha_dtau2(), dalpha_ddelta(), and dalpha_dtau().

◆ _N3

const std::array<Real, 4> MethaneFluidProperties::_N3
protected
Initial value:
{
{0.9324799946e-4, -0.6287171518e1, 0.1271069467e2, -0.6423953466e1}}

Definition at line 159 of file MethaneFluidProperties.h.

Referenced by alpha(), d2alpha_ddelta2(), d2alpha_ddeltatau(), d2alpha_dtau2(), dalpha_ddelta(), and dalpha_dtau().

◆ _p_critical

const Real MethaneFluidProperties::_p_critical
protected

Critical pressure (Pa)

Definition at line 113 of file MethaneFluidProperties.h.

Referenced by criticalPressure(), and vaporPressure().

◆ _p_triple

const Real MethaneFluidProperties::_p_triple
protected

Triple point pressure (Pa)

Definition at line 119 of file MethaneFluidProperties.h.

Referenced by triplePointPressure().

◆ _R

const Real SinglePhaseFluidProperties::_R
protectedinherited

◆ _rho_critical

const Real MethaneFluidProperties::_rho_critical
protected

Critical density (kg/m^3)

Definition at line 117 of file MethaneFluidProperties.h.

Referenced by criticalDensity(), saturatedLiquidDensity(), and saturatedVaporDensity().

◆ _t1

const std::array<Real, 13> MethaneFluidProperties::_t1
protected
Initial value:
{
{-0.5, 0.5, 1.0, 0.5, 1.0, 1.5, 4.5, 0.0, 1.0, 3.0, 1.0, 3.0, 3.0}}

Definition at line 141 of file MethaneFluidProperties.h.

Referenced by alpha(), d2alpha_ddelta2(), d2alpha_ddeltatau(), d2alpha_dtau2(), dalpha_ddelta(), and dalpha_dtau().

◆ _t2

const std::array<Real, 23> MethaneFluidProperties::_t2
protected
Initial value:
{{0.0, 1.0, 2.0, 0.0, 0.0, 2.0, 2.0, 5.0,
5.0, 5.0, 2.0, 4.0, 12.0, 8.0, 10.0, 10.0,
10.0, 14.0, 12.0, 18.0, 22.0, 18.0, 14.0}}

Definition at line 151 of file MethaneFluidProperties.h.

Referenced by alpha(), d2alpha_ddelta2(), d2alpha_ddeltatau(), d2alpha_dtau2(), dalpha_ddelta(), and dalpha_dtau().

◆ _t3

const std::array<Real, 4> MethaneFluidProperties::_t3 {{2.0, 0.0, 1.0, 2.0}}
protected

◆ _T_c2k

const Real SinglePhaseFluidProperties::_T_c2k
protectedinherited

◆ _T_critical

const Real MethaneFluidProperties::_T_critical
protected

Critical temperature (K)

Definition at line 115 of file MethaneFluidProperties.h.

Referenced by criticalTemperature(), saturatedLiquidDensity(), saturatedVaporDensity(), and vaporPressure().

◆ _T_triple

const Real MethaneFluidProperties::_T_triple
protected

Triple point temperature (K)

Definition at line 121 of file MethaneFluidProperties.h.

Referenced by triplePointTemperature().

◆ p [1/7]

e e e e SinglePhaseFluidProperties::p
inherited

Definition at line 130 of file SinglePhaseFluidProperties.h.

Referenced by SinglePhaseFluidProperties::beta(), SinglePhaseFluidProperties::beta_from_p_T(), SinglePhaseFluidProperties::c(), StiffenedGasFluidProperties::c_from_v_e(), SinglePhaseFluidProperties::e(), SinglePhaseFluidProperties::e_dpT(), StiffenedGasFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_p_T(), SinglePhaseFluidProperties::e_from_p_T(), IdealGasFluidProperties::g_from_v_e(), StiffenedGasFluidProperties::g_from_v_e(), SinglePhaseFluidProperties::gamma_from_p_T(), TabulatedFluidProperties::generateTabulatedData(), SinglePhaseFluidProperties::h(), SinglePhaseFluidProperties::h_dpT(), IdealGasFluidProperties::h_from_p_T(), StiffenedGasFluidProperties::h_from_p_T(), SinglePhaseFluidProperties::henryConstantIAPWS(), SinglePhaseFluidProperties::k(), SinglePhaseFluidProperties::k_dpT(), SinglePhaseFluidProperties::mu(), SinglePhaseFluidProperties::mu_dpT(), IdealGasFluidProperties::p_from_h_s(), StiffenedGasFluidProperties::p_from_h_s(), StiffenedGasFluidProperties::p_from_T_v(), IdealGasFluidProperties::p_from_T_v(), IdealGasFluidProperties::p_from_v_e(), StiffenedGasFluidProperties::p_from_v_e(), SinglePhaseFluidProperties::rho_dpT(), SinglePhaseFluidProperties::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_from_p_T(), StiffenedGasFluidProperties::rho_from_p_s(), IdealGasFluidProperties::rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_T(), IdealGasFluidProperties::rho_from_p_T(), SinglePhaseFluidProperties::rho_mu(), SinglePhaseFluidProperties::rho_mu_dpT(), SinglePhaseFluidProperties::rho_mu_from_p_T(), SinglePhaseFluidProperties::s(), StiffenedGasFluidProperties::s_from_h_p(), IdealGasFluidProperties::s_from_h_p(), IdealGasFluidProperties::s_from_p_T(), StiffenedGasFluidProperties::s_from_p_T(), IdealGasFluidPropertiesPT::s_from_p_T(), SimpleFluidProperties::s_from_p_T(), Water97FluidProperties::s_from_p_T(), TabulatedFluidProperties::s_from_p_T(), IdealGasFluidProperties::s_from_T_v(), StiffenedGasFluidProperties::s_from_v_e(), IdealGasFluidProperties::s_from_v_e(), SinglePhaseFluidProperties::T_from_p_h(), SinglePhaseFluidProperties::v_from_p_T(), Water97FluidProperties::vaporPressure(), and TabulatedFluidProperties::writeTabulatedData().

◆ p [2/7]

e e e e s SinglePhaseFluidProperties::p
inherited

Definition at line 132 of file SinglePhaseFluidProperties.h.

◆ p [3/7]

e e e e s T T SinglePhaseFluidProperties::p
inherited

Definition at line 136 of file SinglePhaseFluidProperties.h.

◆ p [4/7]

e e e e s T T T SinglePhaseFluidProperties::p
inherited

Definition at line 138 of file SinglePhaseFluidProperties.h.

◆ p [5/7]

e e e e s T T T T SinglePhaseFluidProperties::p
inherited

Definition at line 140 of file SinglePhaseFluidProperties.h.

◆ p [6/7]

e e e e s T T T T T SinglePhaseFluidProperties::p
inherited

Definition at line 142 of file SinglePhaseFluidProperties.h.

◆ p [7/7]

e e e e s T T T T T rho v v SinglePhaseFluidProperties::p
inherited

Definition at line 148 of file SinglePhaseFluidProperties.h.

◆ rho

Real SinglePhaseFluidProperties::rho
inherited

Definition at line 134 of file SinglePhaseFluidProperties.h.

Referenced by SinglePhaseFluidProperties::beta_from_p_T(), StiffenedGasFluidProperties::c2_from_p_rho(), StiffenedGasFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_rho(), NaClFluidProperties::e_from_p_T(), SinglePhaseFluidProperties::e_from_p_T(), IdealGasFluidProperties::h_from_p_T(), Water97FluidProperties::k_from_p_T(), SinglePhaseFluidProperties::mu_drhoT_from_rho_T(), CO2FluidProperties::mu_from_p_T(), NitrogenFluidProperties::mu_from_p_T(), HydrogenFluidProperties::mu_from_p_T(), Water97FluidProperties::mu_from_p_T(), SinglePhaseFluidProperties::rho_dpT(), IdealGasFluidPropertiesPT::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_from_p_T(), IdealGasFluidProperties::rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_s(), HelmholtzFluidProperties::rho_from_p_T(), CO2FluidProperties::rho_from_p_T(), StiffenedGasFluidProperties::rho_from_p_T(), IdealGasFluidPropertiesPT::rho_from_p_T(), IdealGasFluidProperties::rho_from_p_T(), Water97FluidProperties::rho_from_p_T(), NaClFluidProperties::rho_from_p_T(), SimpleFluidProperties::rho_from_p_T(), TabulatedFluidProperties::rho_from_p_T(), SinglePhaseFluidProperties::rho_mu(), SinglePhaseFluidProperties::rho_mu_dpT(), NitrogenFluidProperties::rho_mu_from_p_T(), HydrogenFluidProperties::rho_mu_from_p_T(), CO2FluidProperties::rho_mu_from_p_T(), IdealGasFluidPropertiesPT::rho_mu_from_p_T(), Water97FluidProperties::rho_mu_from_p_T(), SinglePhaseFluidProperties::rho_mu_from_p_T(), SinglePhaseFluidProperties::T_from_p_h(), and SinglePhaseFluidProperties::v_from_p_T().

◆ T [1/2]

e e e e s T T T T T rho SinglePhaseFluidProperties::T
inherited

Definition at line 144 of file SinglePhaseFluidProperties.h.

Referenced by SinglePhaseFluidProperties::beta(), SinglePhaseFluidProperties::beta_from_p_T(), SinglePhaseFluidProperties::c(), IdealGasFluidProperties::c_from_v_e(), SinglePhaseFluidProperties::e(), SinglePhaseFluidProperties::e_dpT(), IdealGasFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_p_T(), SinglePhaseFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_T_v(), IdealGasFluidProperties::e_from_T_v(), IdealGasFluidProperties::g_from_v_e(), StiffenedGasFluidProperties::g_from_v_e(), SinglePhaseFluidProperties::gamma_from_p_T(), SinglePhaseFluidProperties::h(), SinglePhaseFluidProperties::h_dpT(), IdealGasFluidProperties::h_from_p_T(), StiffenedGasFluidProperties::h_from_p_T(), StiffenedGasFluidProperties::h_from_T_v(), IdealGasFluidProperties::h_from_T_v(), SinglePhaseFluidProperties::henryConstant_dT(), SinglePhaseFluidProperties::henryConstantIAPWS(), SinglePhaseFluidProperties::henryConstantIAPWS_dT(), SinglePhaseFluidProperties::k(), SinglePhaseFluidProperties::k_dpT(), SinglePhaseFluidProperties::mu(), SinglePhaseFluidProperties::mu_dpT(), SinglePhaseFluidProperties::mu_drhoT_from_rho_T(), StiffenedGasFluidProperties::p_from_T_v(), IdealGasFluidProperties::p_from_T_v(), SinglePhaseFluidProperties::rho_dpT(), SinglePhaseFluidProperties::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_from_p_T(), IdealGasFluidProperties::rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_T(), IdealGasFluidProperties::rho_from_p_T(), SinglePhaseFluidProperties::rho_mu(), SinglePhaseFluidProperties::rho_mu_dpT(), SinglePhaseFluidProperties::rho_mu_from_p_T(), SinglePhaseFluidProperties::s(), IdealGasFluidProperties::s_from_p_T(), StiffenedGasFluidProperties::s_from_p_T(), IdealGasFluidPropertiesPT::s_from_p_T(), SimpleFluidProperties::s_from_p_T(), Water97FluidProperties::s_from_p_T(), TabulatedFluidProperties::s_from_p_T(), StiffenedGasFluidProperties::s_from_T_v(), IdealGasFluidProperties::s_from_T_v(), StiffenedGasFluidProperties::s_from_v_e(), IdealGasFluidProperties::s_from_v_e(), IdealGasFluidProperties::T_from_v_e(), StiffenedGasFluidProperties::T_from_v_e(), SinglePhaseFluidProperties::v_from_p_T(), and SinglePhaseFluidProperties::vaporPressure_dT().

◆ T [2/2]

e e e e s T T T T T rho v SinglePhaseFluidProperties::T
inherited

Definition at line 146 of file SinglePhaseFluidProperties.h.

◆ v [1/5]

SinglePhaseFluidProperties::v
inherited

◆ v [2/5]

e SinglePhaseFluidProperties::v
inherited

Definition at line 124 of file SinglePhaseFluidProperties.h.

◆ v [3/5]

e e SinglePhaseFluidProperties::v
inherited

Definition at line 126 of file SinglePhaseFluidProperties.h.

◆ v [4/5]

e e e SinglePhaseFluidProperties::v
inherited

Definition at line 128 of file SinglePhaseFluidProperties.h.

◆ v [5/5]

e e e e s T T T T T rho v v T SinglePhaseFluidProperties::v
inherited

Definition at line 150 of file SinglePhaseFluidProperties.h.


The documentation for this class was generated from the following files: