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

Ideal gas fluid properties. More...

#include <IdealGasFluidProperties.h>

Inheritance diagram for IdealGasFluidProperties:
[legend]

Public Member Functions

 IdealGasFluidProperties (const InputParameters &parameters)
 
virtual ~IdealGasFluidProperties ()
 
virtual Real p_from_v_e (Real v, Real e) const override
 
virtual void p_from_v_e (Real v, Real e, Real &p, Real &dp_dv, Real &dp_de) const override
 
virtual Real T_from_v_e (Real v, Real e) const override
 
virtual void T_from_v_e (Real v, Real e, Real &T, Real &dT_dv, Real &dT_de) const override
 
virtual Real c_from_v_e (Real v, Real e) const override
 
virtual void c_from_v_e (Real v, Real e, Real &c, Real &dc_dv, Real &dc_de) const override
 
virtual Real cp_from_v_e (Real v, Real e) const override
 
virtual void cp_from_v_e (Real v, Real e, Real &cp, Real &dcp_dv, Real &dcp_de) const override
 
virtual Real cv_from_v_e (Real v, Real e) const override
 
virtual Real mu_from_v_e (Real v, Real e) const override
 
virtual Real k_from_v_e (Real v, Real e) const override
 
virtual Real s_from_v_e (Real v, Real e) const override
 
virtual void s_from_v_e (Real v, Real e, Real &s, Real &ds_dv, Real &ds_de) const override
 
virtual Real s_from_p_T (Real p, Real T) const override
 
virtual void s_from_p_T (Real p, Real T, Real &s, Real &ds_dp, Real &ds_dT) const override
 
virtual Real s_from_h_p (Real h, Real p) const override
 
virtual void s_from_h_p (Real h, Real p, Real &s, Real &ds_dh, Real &ds_dp) const override
 
virtual Real rho_from_p_s (Real p, Real s) const override
 
virtual void rho_from_p_s (Real p, Real s, Real &rho, Real &drho_dp, Real &drho_ds) const override
 
virtual Real e_from_v_h (Real v, Real h) const override
 
virtual void e_from_v_h (Real v, Real h, Real &e, Real &de_dv, Real &de_dh) const override
 
virtual Real rho_from_p_T (Real p, Real T) const override
 
virtual void rho_from_p_T (Real p, Real T, Real &rho, Real &drho_dp, Real &drho_dT) const override
 
virtual Real e_from_p_rho (Real p, Real rho) const override
 
virtual void e_from_p_rho (Real p, Real rho, Real &e, Real &de_dp, Real &de_drho) const override
 
virtual Real e_from_T_v (Real T, Real v) const override
 
virtual void e_from_T_v (Real T, Real v, Real &e, Real &de_dT, Real &de_dv) const override
 
virtual Real p_from_T_v (Real T, Real v) const override
 
virtual void p_from_T_v (Real T, Real v, Real &p, Real &dp_dT, Real &dp_dv) const override
 
virtual Real h_from_T_v (Real T, Real v) const override
 
virtual void h_from_T_v (Real T, Real v, Real &h, Real &dh_dT, Real &dh_dv) const override
 
virtual Real s_from_T_v (Real T, Real v) const override
 
virtual void s_from_T_v (Real T, Real v, Real &s, Real &ds_dT, Real &ds_dv) const override
 
virtual Real cv_from_T_v (Real T, Real v) const override
 
virtual Real h_from_p_T (Real p, Real T) const override
 
virtual void h_from_p_T (Real p, Real T, Real &h, Real &dh_dp, Real &dh_dT) const override
 
virtual Real e_from_p_T (Real p, Real T) 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 p_from_h_s (Real h, Real s) const override
 
virtual void p_from_h_s (Real h, Real s, Real &p, Real &dp_dh, Real &dp_ds) const override
 
virtual Real g_from_v_e (Real v, Real e) const override
 
virtual Real T_from_p_h (Real p, Real h) const override
 Temperature from pressure and specific enthalpy. More...
 
virtual Real molarMass () const override
 Molar mass [kg/mol]. More...
 
virtual Real cv_from_p_T (Real p, Real T) const override
 
virtual Real cp_from_p_T (Real p, Real T) const override
 
virtual void cp_from_p_T (Real p, Real T, Real &cp, Real &dcp_dp, Real &dcp_dT) const override
 
virtual Real mu_from_p_T (Real p, Real T) const override
 
virtual void mu_from_p_T (Real p, Real T, 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 gamma () const
 
virtual Real cv () const
 
virtual Real cp () const
 
virtual Real rho (Real p, Real T) const
 Density from pressure and temperature. More...
 
virtual std::string fluidName () const
 Fluid name. 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 criticalPressure () const
 Critical pressure. More...
 
virtual Real criticalTemperature () const
 Critical temperature. More...
 
virtual Real criticalDensity () const
 Critical density. More...
 
virtual Real criticalInternalEnergy () const
 Critical specific internal energy. More...
 
virtual Real triplePointPressure () const
 Triple point pressure. More...
 
virtual Real triplePointTemperature () const
 Triple point temperature. 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 Real henryConstant (Real temperature) const
 Henry's law constant for dissolution in water. More...
 
virtual void henryConstant (Real temperature, Real &Kh, Real &dKh_dT) const
 Henry's law constant for dissolution in water and derivative wrt temperature. More...
 
virtual void henryConstant_dT (Real temperature, Real &Kh, Real &dKh_dT) const
 
virtual Real vaporPressure (Real temperature) const
 Vapor pressure. More...
 
virtual void vaporPressure (Real temperature, Real &psat, Real &dpsat_dT) const
 Vapor pressure. More...
 
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 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

Real _gamma
 
Real _R
 
Real _cv
 
Real _cp
 
Real _mu
 
Real _k
 
const Real _T_c2k
 Conversion of temperature from Celsius to Kelvin. More...
 

Static Protected Attributes

static constexpr Real R_universal = 8.3144598
 Universal gas constant [J/K.mol]. 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

Ideal gas fluid properties.

Definition at line 26 of file IdealGasFluidProperties.h.

Constructor & Destructor Documentation

◆ IdealGasFluidProperties()

IdealGasFluidProperties::IdealGasFluidProperties ( const InputParameters &  parameters)

Definition at line 28 of file IdealGasFluidProperties.C.

29  : SinglePhaseFluidProperties(parameters),
30  _gamma(getParam<Real>("gamma")),
31  _R(getParam<Real>("R")),
32  _mu(getParam<Real>("mu")),
33  _k(getParam<Real>("k"))
34 {
35  _cp = _gamma * _R / (_gamma - 1.0);
36  _cv = _cp / _gamma;
37 }
SinglePhaseFluidProperties(const InputParameters &parameters)

◆ ~IdealGasFluidProperties()

IdealGasFluidProperties::~IdealGasFluidProperties ( )
virtual

Definition at line 39 of file IdealGasFluidProperties.C.

39 {}

Member Function Documentation

◆ 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 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_v_e() [1/2]

Real IdealGasFluidProperties::c_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 74 of file IdealGasFluidProperties.C.

Referenced by NSInitialCondition::value().

75 {
76  Real T = T_from_v_e(v, e);
77 
78  const Real c2 = _gamma * _R * T;
79  if (c2 < 0)
80  mooseException(name() + ": Sound speed squared (gamma * R * T) is negative: c2 = " +
81  Moose::stringify(c2) + ".");
82 
83  return std::sqrt(c2);
84 }
virtual Real T_from_v_e(Real v, Real e) const override
const std::string name
Definition: Setup.h:22
virtual Real e(Real pressure, Real temperature) const

◆ c_from_v_e() [2/2]

void IdealGasFluidProperties::c_from_v_e ( Real  v,
Real  e,
Real &  c,
Real &  dc_dv,
Real &  dc_de 
) const
overridevirtual

Definition at line 87 of file IdealGasFluidProperties.C.

88 {
89  Real T, dT_dv, dT_de;
90  T_from_v_e(v, e, T, dT_dv, dT_de);
91 
92  c = std::sqrt(_gamma * _R * T);
93 
94  const Real dc_dT = 0.5 / c * _gamma * _R;
95  dc_dv = dc_dT * dT_dv;
96  dc_de = dc_dT * dT_de;
97 }
virtual Real T_from_v_e(Real v, Real e) const override
virtual Real c(Real pressure, Real temperature) const
virtual Real e(Real pressure, Real temperature) const

◆ cp()

Real IdealGasFluidProperties::cp ( ) const
virtual

◆ cp_from_p_T() [1/2]

Real IdealGasFluidProperties::cp_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Definition at line 442 of file IdealGasFluidProperties.C.

Referenced by cp_from_p_T().

443 {
444  return _cp;
445 }

◆ cp_from_p_T() [2/2]

void IdealGasFluidProperties::cp_from_p_T ( Real  p,
Real  T,
Real &  cp,
Real &  dcp_dp,
Real &  dcp_dT 
) const
overridevirtual

Definition at line 448 of file IdealGasFluidProperties.C.

450 {
452  dcp_dp = 0.0;
453  dcp_dT = 0.0;
454 }
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
virtual Real cp_from_p_T(Real p, Real T) const override

◆ cp_from_v_e() [1/2]

Real IdealGasFluidProperties::cp_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 99 of file IdealGasFluidProperties.C.

Referenced by cp_from_v_e().

◆ cp_from_v_e() [2/2]

void IdealGasFluidProperties::cp_from_v_e ( Real  v,
Real  e,
Real &  cp,
Real &  dcp_dv,
Real &  dcp_de 
) const
overridevirtual

Definition at line 102 of file IdealGasFluidProperties.C.

103 {
104  cp = cp_from_v_e(v, e);
105  dcp_dv = 0.0;
106  dcp_de = 0.0;
107 }
virtual Real cp_from_v_e(Real v, Real e) const override
virtual Real e(Real pressure, Real temperature) const

◆ criticalDensity()

Real SinglePhaseFluidProperties::criticalDensity ( ) const
virtualinherited

◆ 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 SinglePhaseFluidProperties::criticalPressure ( ) const
virtualinherited

Critical pressure.

Returns
critical pressure (Pa)

Reimplemented in HydrogenFluidProperties, CO2FluidProperties, NitrogenFluidProperties, MethaneFluidProperties, NaClFluidProperties, and Water97FluidProperties.

Definition at line 113 of file SinglePhaseFluidProperties.C.

114 {
115  mooseError(name(), ": criticalPressure() is not implemented");
116 }
const std::string name
Definition: Setup.h:22

◆ criticalTemperature()

Real SinglePhaseFluidProperties::criticalTemperature ( ) const
virtualinherited

◆ cv()

Real IdealGasFluidProperties::cv ( ) const
virtual

◆ cv_from_p_T()

Real IdealGasFluidProperties::cv_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Definition at line 437 of file IdealGasFluidProperties.C.

438 {
439  return _cv;
440 }

◆ cv_from_T_v()

Real IdealGasFluidProperties::cv_from_T_v ( Real  T,
Real  v 
) const
overridevirtual

Definition at line 358 of file IdealGasFluidProperties.C.

◆ cv_from_v_e()

Real IdealGasFluidProperties::cv_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 115 of file IdealGasFluidProperties.C.

◆ e()

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

Definition at line 292 of file SinglePhaseFluidProperties.C.

Referenced by Water97FluidProperties::b2bc(), c_from_v_e(), StiffenedGasFluidProperties::c_from_v_e(), NaClFluidProperties::cp_from_p_T(), cp_from_v_e(), StiffenedGasFluidProperties::cp_from_v_e(), Water97FluidProperties::densityRegion3(), SinglePhaseFluidProperties::e_dpT(), StiffenedGasFluidProperties::e_from_p_rho(), e_from_p_rho(), HelmholtzFluidProperties::e_from_p_T(), IdealGasFluidPropertiesPT::e_from_p_T(), Water97FluidProperties::e_from_p_T(), NaClFluidProperties::e_from_p_T(), 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(), e_from_T_v(), e_from_v_h(), StiffenedGasFluidProperties::e_from_v_h(), g_from_v_e(), StiffenedGasFluidProperties::g_from_v_e(), 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(), 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(), s_from_v_e(), StiffenedGasFluidProperties::s_from_v_e(), Water97FluidProperties::subregion3(), Water97FluidProperties::subregionVolume(), SinglePhaseFluidProperties::T_from_p_h(), 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_rho() [1/2]

Real IdealGasFluidProperties::e_from_p_rho ( Real  p,
Real  rho 
) const
overridevirtual

Definition at line 284 of file IdealGasFluidProperties.C.

Referenced by e_from_p_rho().

◆ e_from_p_rho() [2/2]

void IdealGasFluidProperties::e_from_p_rho ( Real  p,
Real  rho,
Real &  e,
Real &  de_dp,
Real &  de_drho 
) const
overridevirtual

Definition at line 290 of file IdealGasFluidProperties.C.

292 {
293  e = e_from_p_rho(p, rho);
294  de_dp = 1.0 / (_gamma - 1.0) / rho;
295  de_drho = -p / (_gamma - 1.0) / rho / rho;
296 }
virtual Real e_from_p_rho(Real p, Real rho) const override
virtual Real e(Real pressure, Real temperature) const

◆ e_from_p_T() [1/2]

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

Internal energy from pressure and temperature.

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 378 of file IdealGasFluidProperties.C.

Referenced by e_from_p_T().

379 {
380  return _cv * T;
381 }

◆ e_from_p_T() [2/2]

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

Internal energy and its derivatives from pressure and temperature.

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 384 of file IdealGasFluidProperties.C.

385 {
386  e = e_from_p_T(p, T);
387  de_dp = 0.;
388  de_dT = _cv;
389 }
virtual Real e_from_p_T(Real p, Real T) const override
Internal energy from pressure and temperature.
virtual Real e(Real pressure, Real temperature) const

◆ e_from_T_v() [1/2]

Real IdealGasFluidProperties::e_from_T_v ( Real  T,
Real  v 
) const
overridevirtual

Definition at line 299 of file IdealGasFluidProperties.C.

300 {
301  return _cv * T;
302 }

◆ e_from_T_v() [2/2]

void IdealGasFluidProperties::e_from_T_v ( Real  T,
Real  v,
Real &  e,
Real &  de_dT,
Real &  de_dv 
) const
overridevirtual

Definition at line 305 of file IdealGasFluidProperties.C.

306 {
307  e = _cv * T;
308  de_dT = _cv;
309  de_dv = 0.0;
310 }
virtual Real e(Real pressure, Real temperature) const

◆ e_from_v_h() [1/2]

Real IdealGasFluidProperties::e_from_v_h ( Real  v,
Real  h 
) const
overridevirtual

Definition at line 250 of file IdealGasFluidProperties.C.

Referenced by e_from_v_h().

251 {
252  return h / _gamma;
253 }
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.

◆ e_from_v_h() [2/2]

void IdealGasFluidProperties::e_from_v_h ( Real  v,
Real  h,
Real &  e,
Real &  de_dv,
Real &  de_dh 
) const
overridevirtual

Definition at line 256 of file IdealGasFluidProperties.C.

257 {
258  e = e_from_v_h(v, h);
259  de_dv = 0.0;
260  de_dh = 1.0 / _gamma;
261 }
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.
virtual Real e_from_v_h(Real v, Real h) const override
virtual Real e(Real pressure, Real temperature) const

◆ e_spndl_from_v()

Real SinglePhaseFluidProperties::e_spndl_from_v ( Real  v) const
virtualinherited

Specific internal energy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in StiffenedGasFluidProperties.

Definition at line 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 SinglePhaseFluidProperties::fluidName ( ) const
virtualinherited

◆ g_from_v_e()

Real IdealGasFluidProperties::g_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 410 of file IdealGasFluidProperties.C.

411 {
412  // g(p,T) for SGEOS is given by Equation (37) in the following reference:
413  //
414  // Ray A. Berry, Richard Saurel, Olivier LeMetayer
415  // The discrete equation method (DEM) for fully compressible, two-phase flows in
416  // ducts of spatially varying cross-section
417  // Nuclear Engineering and Design 240 (2010) p. 3797-3818
418  //
419  const Real p = p_from_v_e(v, e);
420  const Real T = T_from_v_e(v, e);
421 
422  return _gamma * _cv * T - _cv * T * std::log(std::pow(T, _gamma) / std::pow(p, _gamma - 1.0));
423 }
virtual Real p_from_v_e(Real v, Real e) const override
virtual Real T_from_v_e(Real v, Real e) const override
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real e(Real pressure, Real temperature) const

◆ gamma()

Real IdealGasFluidProperties::gamma ( ) const
virtual

◆ 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 IdealGasFluidProperties::h_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Definition at line 361 of file IdealGasFluidProperties.C.

Referenced by h_from_p_T().

362 {
363  Real rho = rho_from_p_T(p, T);
364  Real e = T * _cv;
365  return e + p / rho;
366 }
virtual Real rho_from_p_T(Real p, Real T) const override
virtual Real e(Real pressure, Real temperature) const

◆ h_from_p_T() [2/2]

void IdealGasFluidProperties::h_from_p_T ( Real  p,
Real  T,
Real &  h,
Real &  dh_dp,
Real &  dh_dT 
) const
overridevirtual

Definition at line 369 of file IdealGasFluidProperties.C.

370 {
371  h = h_from_p_T(p, T);
372  Real rho = rho_from_p_T(p, T);
373  dh_dp = 0.0;
374  dh_dT = _cv + p / rho / T;
375 }
virtual Real rho_from_p_T(Real p, Real T) const override
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.
virtual Real h_from_p_T(Real p, Real T) const override

◆ h_from_T_v() [1/2]

Real IdealGasFluidProperties::h_from_T_v ( Real  T,
Real  v 
) const
overridevirtual

Definition at line 327 of file IdealGasFluidProperties.C.

◆ h_from_T_v() [2/2]

void IdealGasFluidProperties::h_from_T_v ( Real  T,
Real  v,
Real &  h,
Real &  dh_dT,
Real &  dh_dv 
) const
overridevirtual

Definition at line 333 of file IdealGasFluidProperties.C.

334 {
335  h = _gamma * _cv * T;
336  dh_dT = _gamma * _cv;
337  dh_dv = 0.0;
338 }
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.

◆ henryConstant() [1/2]

Real SinglePhaseFluidProperties::henryConstant ( Real  temperature) const
virtualinherited

Henry's law constant for dissolution in water.

Parameters
temperaturefluid temperature (K)
Returns
Henry's constant

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

Definition at line 244 of file SinglePhaseFluidProperties.C.

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

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

◆ henryConstant() [2/2]

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

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

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

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

Definition at line 250 of file SinglePhaseFluidProperties.C.

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

◆ henryConstant_dT()

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

Definition at line 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 MethaneFluidProperties::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(), MethaneFluidProperties::k_from_p_T(), SimpleFluidProperties::k_from_p_T(), NitrogenFluidProperties::k_from_p_T(), NaClFluidProperties::k_from_p_T(), HydrogenFluidProperties::k_from_p_T(), 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 IdealGasFluidProperties::k_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Definition at line 470 of file IdealGasFluidProperties.C.

Referenced by k_from_p_T().

471 {
472  return _k;
473 }

◆ k_from_p_T() [2/2]

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

Definition at line 476 of file IdealGasFluidProperties.C.

478 {
479  k = this->k_from_p_T(pressure, temperature);
480  dk_dp = 0.0;
481  dk_dT = 0.0;
482 }
virtual Real k_from_p_T(Real pressure, Real temperature) const override
const std::string temperature
Definition: NS.h:27
virtual Real k(Real pressure, Real temperature) const
Thermal conductivity.
const std::string pressure
Definition: NS.h:26

◆ k_from_v_e()

Real IdealGasFluidProperties::k_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 131 of file IdealGasFluidProperties.C.

131 { return _k; }

◆ molarMass()

Real IdealGasFluidProperties::molarMass ( ) const
overridevirtual

Molar mass [kg/mol].

Returns
molar mass

Reimplemented from SinglePhaseFluidProperties.

Definition at line 426 of file IdealGasFluidProperties.C.

427 {
428  return _R / R_universal;
429 }
static constexpr Real R_universal
Universal gas constant [J/K.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(), MethaneFluidProperties::mu_from_p_T(), CO2FluidProperties::mu_from_p_T(), NitrogenFluidProperties::mu_from_p_T(), HydrogenFluidProperties::mu_from_p_T(), IdealGasFluidPropertiesPT::mu_from_p_T(), 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 IdealGasFluidProperties::mu_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Definition at line 456 of file IdealGasFluidProperties.C.

Referenced by mu_from_p_T().

457 {
458  return _mu;
459 }

◆ mu_from_p_T() [2/2]

void IdealGasFluidProperties::mu_from_p_T ( Real  p,
Real  T,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
overridevirtual

Definition at line 462 of file IdealGasFluidProperties.C.

464 {
466  dmu_dp = 0.0;
467  dmu_dT = 0.0;
468 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string temperature
Definition: NS.h:27
virtual Real mu_from_p_T(Real p, Real T) const override
const std::string pressure
Definition: NS.h:26

◆ 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

◆ mu_from_v_e()

Real IdealGasFluidProperties::mu_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 129 of file IdealGasFluidProperties.C.

◆ p_from_h_s() [1/2]

Real IdealGasFluidProperties::p_from_h_s ( Real  h,
Real  s 
) const
overridevirtual

Definition at line 392 of file IdealGasFluidProperties.C.

Referenced by p_from_h_s().

393 {
394  return std::pow(h / (_gamma * _cv), _gamma / (_gamma - 1.0)) *
395  std::exp(-s / ((_gamma - 1.0) * _cv));
396 }
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.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ p_from_h_s() [2/2]

void IdealGasFluidProperties::p_from_h_s ( Real  h,
Real  s,
Real &  p,
Real &  dp_dh,
Real &  dp_ds 
) const
overridevirtual

Definition at line 399 of file IdealGasFluidProperties.C.

400 {
401  p = p_from_h_s(h, s);
402  dp_dh = _gamma / (_gamma - 1.0) / (_gamma * _cv) *
403  std::pow(h / (_gamma * _cv), 1.0 / (_gamma - 1.0)) *
404  std::exp(-s / ((_gamma - 1.0) * _cv));
405  dp_ds = std::pow(h / (_gamma * _cv), _gamma / (_gamma - 1)) *
406  std::exp(-s / ((_gamma - 1) * _cv)) / ((1 - _gamma) * _cv);
407 }
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.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real p_from_h_s(Real h, Real s) const override

◆ p_from_T_v() [1/2]

Real IdealGasFluidProperties::p_from_T_v ( Real  T,
Real  v 
) const
overridevirtual

◆ p_from_T_v() [2/2]

void IdealGasFluidProperties::p_from_T_v ( Real  T,
Real  v,
Real &  p,
Real &  dp_dT,
Real &  dp_dv 
) const
overridevirtual

Definition at line 319 of file IdealGasFluidProperties.C.

320 {
321  p = (_gamma - 1.0) * _cv * T / v;
322  dp_dT = (_gamma - 1.0) * _cv / v;
323  dp_dv = -(_gamma - 1.0) * _cv * T / (v * v);
324 }

◆ p_from_v_e() [1/2]

Real IdealGasFluidProperties::p_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 42 of file IdealGasFluidProperties.C.

Referenced by NSPressureAux::computeValue(), g_from_v_e(), p_from_v_e(), and s_from_v_e().

43 {
44  if (v == 0.0)
45  throw MooseException(
46  name() + ": Invalid value of specific volume detected (v = " + Moose::stringify(v) + ").");
47 
48  return (_gamma - 1.0) * e / v;
49 }
const std::string name
Definition: Setup.h:22
virtual Real e(Real pressure, Real temperature) const

◆ p_from_v_e() [2/2]

void IdealGasFluidProperties::p_from_v_e ( Real  v,
Real  e,
Real &  p,
Real &  dp_dv,
Real &  dp_de 
) const
overridevirtual

Definition at line 52 of file IdealGasFluidProperties.C.

53 {
54  p = p_from_v_e(v, e);
55  dp_dv = -(_gamma - 1.0) * e / v / v;
56  dp_de = (_gamma - 1.0) / v;
57 }
virtual Real p_from_v_e(Real v, Real e) const override
virtual Real e(Real pressure, Real temperature) const

◆ 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_s() [1/2]

Real IdealGasFluidProperties::rho_from_p_s ( Real  p,
Real  s 
) const
overridevirtual

Definition at line 217 of file IdealGasFluidProperties.C.

218 {
219  const Real aux = (s + _cv * std::log(std::pow(p, _gamma - 1.0))) / _cv;
220  const Real T = std::pow(std::exp(aux), 1.0 / _gamma);
221  return rho_from_p_T(p, T);
222 }
virtual Real rho_from_p_T(Real p, Real T) const override
e e e e s T T T T T rho v v T virtual e Real s(Real pressure, Real temperature) const
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ rho_from_p_s() [2/2]

void IdealGasFluidProperties::rho_from_p_s ( Real  p,
Real  s,
Real &  rho,
Real &  drho_dp,
Real &  drho_ds 
) const
overridevirtual

Definition at line 225 of file IdealGasFluidProperties.C.

227 {
228  // T(p,s)
229  const Real aux = (s + _cv * std::log(std::pow(p, _gamma - 1.0))) / _cv;
230  const Real T = std::pow(std::exp(aux), 1 / _gamma);
231 
232  // dT/dp
233  const Real dT_dp = 1.0 / _gamma * std::pow(std::exp(aux), 1.0 / _gamma - 1.0) * std::exp(aux) /
234  std::pow(p, _gamma - 1.0) * (_gamma - 1.0) * std::pow(p, _gamma - 2.0);
235 
236  // dT/ds
237  const Real dT_ds =
238  1.0 / _gamma * std::pow(std::exp(aux), 1.0 / _gamma - 1.0) * std::exp(aux) / _cv;
239 
240  // Drho/Dp = d/dp[rho(p, T(p,s))] = drho/dp + drho/dT * dT/dp
241  Real drho_dp_partial, drho_dT;
242  rho_from_p_T(p, T, rho, drho_dp_partial, drho_dT);
243  drho_dp = drho_dp_partial + drho_dT * dT_dp;
244 
245  // Drho/Ds = d/ds[rho(p, T(p,s))] = drho/dT * dT/ds
246  drho_ds = drho_dT * dT_ds;
247 }
virtual Real rho_from_p_T(Real p, Real T) const override
e e e e s T T T T T rho v v T virtual e Real s(Real pressure, Real temperature) const
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ rho_from_p_T() [1/2]

Real IdealGasFluidProperties::rho_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Definition at line 264 of file IdealGasFluidProperties.C.

Referenced by h_from_p_T(), rho_from_p_s(), rho_from_p_T(), NSWeakStagnationBaseBC::staticValues(), and NSInitialCondition::value().

265 {
266  if ((_gamma - 1.0) * p == 0.0)
267  throw MooseException(name() +
268  ": Invalid gamma or pressure detected in rho_from_p_T(pressure = " +
269  Moose::stringify(p) + ", gamma = " + Moose::stringify(_gamma) + ")");
270 
271  return p / (_gamma - 1.0) / _cv / T;
272 }
const std::string name
Definition: Setup.h:22

◆ rho_from_p_T() [2/2]

void IdealGasFluidProperties::rho_from_p_T ( Real  p,
Real  T,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
overridevirtual

Definition at line 275 of file IdealGasFluidProperties.C.

277 {
278  rho = rho_from_p_T(p, T);
279  drho_dp = 1.0 / (_gamma - 1.0) / _cv / T;
280  drho_dT = -p / (_gamma - 1.0) / _cv / (T * T);
281 }
virtual Real rho_from_p_T(Real p, Real T) const override

◆ 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_h_p() [1/2]

Real IdealGasFluidProperties::s_from_h_p ( Real  h,
Real  p 
) const
overridevirtual

Definition at line 195 of file IdealGasFluidProperties.C.

Referenced by s_from_h_p().

196 {
197  const Real aux = p * std::pow(h / (_gamma * _cv), -_gamma / (_gamma - 1));
198  if (aux <= 0.0)
199  throw MooseException(name() + ": Non-positive argument in the ln() function.");
200  return -(_gamma - 1) * _cv * std::log(aux);
201 }
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ s_from_h_p() [2/2]

void IdealGasFluidProperties::s_from_h_p ( Real  h,
Real  p,
Real &  s,
Real &  ds_dh,
Real &  ds_dp 
) const
overridevirtual

Definition at line 204 of file IdealGasFluidProperties.C.

205 {
206  s = s_from_h_p(h, p);
207 
208  const Real aux = p * std::pow(h / (_gamma * _cv), -_gamma / (_gamma - 1));
209  const Real daux_dh = p * std::pow(h / (_gamma * _cv), -_gamma / (_gamma - 1) - 1) *
210  (-_gamma / (_gamma - 1)) / (_gamma * _cv);
211  const Real daux_dp = std::pow(h / (_gamma * _cv), -_gamma / (_gamma - 1));
212  ds_dh = -(_gamma - 1) * _cv / aux * daux_dh;
213  ds_dp = -(_gamma - 1) * _cv / aux * daux_dp;
214 }
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 s_from_h_p(Real h, Real p) const override
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ s_from_p_T() [1/2]

Real IdealGasFluidProperties::s_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Definition at line 170 of file IdealGasFluidProperties.C.

Referenced by s_from_T_v().

171 {
172  const Real n = std::pow(T, _gamma) / std::pow(p, _gamma - 1.0);
173  if (n <= 0.0)
174  throw MooseException(name() + ": Negative argument in the ln() function.");
175  return _cv * std::log(n);
176 }
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ s_from_p_T() [2/2]

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

Definition at line 179 of file IdealGasFluidProperties.C.

180 {
181  const Real n = std::pow(T, _gamma) / std::pow(p, _gamma - 1.0);
182  if (n <= 0.0)
183  throw MooseException(name() + ": Negative argument in the ln() function.");
184 
185  s = _cv * std::log(n);
186 
187  const Real dn_dT = _gamma * std::pow(T, _gamma - 1.0) / std::pow(p, _gamma - 1.0);
188  const Real dn_dp = std::pow(T, _gamma) * (1.0 - _gamma) * std::pow(p, -_gamma);
189 
190  ds_dp = _cv / n * dn_dp;
191  ds_dT = _cv / n * dn_dT;
192 }
e e e e s T T T T T rho v v T virtual e Real s(Real pressure, Real temperature) const
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ s_from_T_v() [1/2]

Real IdealGasFluidProperties::s_from_T_v ( Real  T,
Real  v 
) const
overridevirtual

Definition at line 341 of file IdealGasFluidProperties.C.

342 {
343  Real p = p_from_T_v(T, v);
344  return s_from_p_T(p, T);
345 }
virtual Real p_from_T_v(Real T, Real v) const override
virtual Real s_from_p_T(Real p, Real T) const override

◆ s_from_T_v() [2/2]

void IdealGasFluidProperties::s_from_T_v ( Real  T,
Real  v,
Real &  s,
Real &  ds_dT,
Real &  ds_dv 
) const
overridevirtual

Definition at line 348 of file IdealGasFluidProperties.C.

349 {
350  Real p, dp_dT_v, dp_dv_T;
351  Real ds_dp_T, ds_dT_p;
352  p_from_T_v(T, v, p, dp_dT_v, dp_dv_T);
353  s_from_p_T(p, T, s, ds_dp_T, ds_dT_p);
354  ds_dT = ds_dT_p + ds_dp_T * dp_dT_v;
355  ds_dv = ds_dp_T * dp_dv_T;
356 }
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 p_from_T_v(Real T, Real v) const override
virtual Real s_from_p_T(Real p, Real T) const override

◆ s_from_v_e() [1/2]

Real IdealGasFluidProperties::s_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 134 of file IdealGasFluidProperties.C.

135 {
136  const Real T = T_from_v_e(v, e);
137  const Real p = p_from_v_e(v, e);
138  const Real n = std::pow(T, _gamma) / std::pow(p, _gamma - 1.0);
139  if (n <= 0.0)
140  throw MooseException(name() + ": Negative argument in the ln() function.");
141  return _cv * std::log(n);
142 }
virtual Real p_from_v_e(Real v, Real e) const override
virtual Real T_from_v_e(Real v, Real e) const override
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real e(Real pressure, Real temperature) const

◆ s_from_v_e() [2/2]

void IdealGasFluidProperties::s_from_v_e ( Real  v,
Real  e,
Real &  s,
Real &  ds_dv,
Real &  ds_de 
) const
overridevirtual

Definition at line 145 of file IdealGasFluidProperties.C.

146 {
147  Real T, dT_dv, dT_de;
148  T_from_v_e(v, e, T, dT_dv, dT_de);
149 
150  Real p, dp_dv, dp_de;
151  p_from_v_e(v, e, p, dp_dv, dp_de);
152 
153  const Real n = std::pow(T, _gamma) / std::pow(p, _gamma - 1.0);
154  if (n <= 0.0)
155  throw MooseException(name() + ": Negative argument in the ln() function.");
156 
157  s = _cv * std::log(n);
158 
159  const Real dn_dT = _gamma * std::pow(T, _gamma - 1.0) / std::pow(p, _gamma - 1.0);
160  const Real dn_dp = std::pow(T, _gamma) * (1.0 - _gamma) * std::pow(p, -_gamma);
161 
162  const Real dn_dv = dn_dT * dT_dv + dn_dp * dp_dv;
163  const Real dn_de = dn_dT * dT_de + dn_dp * dp_de;
164 
165  ds_dv = _cv / n * dn_dv;
166  ds_de = _cv / n * dn_de;
167 }
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 p_from_v_e(Real v, Real e) const override
virtual Real T_from_v_e(Real v, Real e) const override
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real e(Real pressure, Real temperature) const

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Definition at line 32 of file FluidProperties.h.

32 {}

◆ T_from_p_h()

Real IdealGasFluidProperties::T_from_p_h ( Real  pressure,
Real  enthalpy 
) const
overridevirtual

Temperature from pressure and specific enthalpy.

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 432 of file IdealGasFluidProperties.C.

433 {
434  return h / _gamma / _cv;
435 }
virtual Real h(Real p, Real T) const
Specific enthalpy from pressure and temperature.

◆ T_from_v_e() [1/2]

Real IdealGasFluidProperties::T_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 60 of file IdealGasFluidProperties.C.

Referenced by c_from_v_e(), NSTemperatureAux::computeValue(), g_from_v_e(), s_from_v_e(), and T_from_v_e().

61 {
62  return e / _cv;
63 }
virtual Real e(Real pressure, Real temperature) const

◆ T_from_v_e() [2/2]

void IdealGasFluidProperties::T_from_v_e ( Real  v,
Real  e,
Real &  T,
Real &  dT_dv,
Real &  dT_de 
) const
overridevirtual

Definition at line 66 of file IdealGasFluidProperties.C.

67 {
68  T = T_from_v_e(v, e);
69  dT_dv = 0.0;
70  dT_de = 1.0 / _cv;
71 }
virtual Real T_from_v_e(Real v, Real e) const override
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 SinglePhaseFluidProperties::triplePointPressure ( ) const
virtualinherited

Triple point pressure.

Returns
triple point pressure (Pa)

Reimplemented in HydrogenFluidProperties, CO2FluidProperties, NitrogenFluidProperties, MethaneFluidProperties, NaClFluidProperties, and Water97FluidProperties.

Definition at line 137 of file SinglePhaseFluidProperties.C.

138 {
139  mooseError(name(), ": triplePointPressure() is not implemented");
140 }
const std::string name
Definition: Setup.h:22

◆ triplePointTemperature()

Real SinglePhaseFluidProperties::triplePointTemperature ( ) const
virtualinherited

Triple point temperature.

Returns
triple point temperature (K)

Reimplemented in HydrogenFluidProperties, CO2FluidProperties, NitrogenFluidProperties, MethaneFluidProperties, NaClFluidProperties, and Water97FluidProperties.

Definition at line 143 of file SinglePhaseFluidProperties.C.

144 {
145  mooseError(name(), ": triplePointTemperature() is not implemented");
146 }
const std::string name
Definition: Setup.h:22

◆ 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 SinglePhaseFluidProperties::vaporPressure ( Real  temperature) const
virtualinherited

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

Definition at line 263 of file SinglePhaseFluidProperties.C.

Referenced by PorousFlowWaterNCG::equilibriumMassFractions(), PorousFlowWaterNCG::gasProperties(), BrineFluidProperties::vaporPressure(), TabulatedFluidProperties::vaporPressure(), and SinglePhaseFluidProperties::vaporPressure_dT().

264 {
265  mooseError(name(), ": vaporPressure() is not implemented");
266 }
const std::string name
Definition: Setup.h:22

◆ vaporPressure() [2/2]

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

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

Definition at line 269 of file SinglePhaseFluidProperties.C.

270 {
271  mooseError(name(), ": vaporPressure() is not implemented");
272 }
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

◆ _cp

Real IdealGasFluidProperties::_cp
protected

Definition at line 95 of file IdealGasFluidProperties.h.

Referenced by cp(), cp_from_p_T(), cp_from_v_e(), and IdealGasFluidProperties().

◆ _cv

Real IdealGasFluidProperties::_cv
protected

◆ _gamma

Real IdealGasFluidProperties::_gamma
protected

◆ _k

Real IdealGasFluidProperties::_k
protected

Definition at line 98 of file IdealGasFluidProperties.h.

Referenced by k_from_p_T(), and k_from_v_e().

◆ _mu

Real IdealGasFluidProperties::_mu
protected

Definition at line 97 of file IdealGasFluidProperties.h.

Referenced by mu_from_p_T(), and mu_from_v_e().

◆ _R

Real IdealGasFluidProperties::_R
protected

Definition at line 93 of file IdealGasFluidProperties.h.

Referenced by c_from_v_e(), IdealGasFluidProperties(), and molarMass().

◆ _T_c2k

const Real SinglePhaseFluidProperties::_T_c2k
protectedinherited

◆ 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(), e_from_p_rho(), e_from_p_T(), StiffenedGasFluidProperties::e_from_p_T(), SinglePhaseFluidProperties::e_from_p_T(), g_from_v_e(), StiffenedGasFluidProperties::g_from_v_e(), SinglePhaseFluidProperties::gamma_from_p_T(), TabulatedFluidProperties::generateTabulatedData(), SinglePhaseFluidProperties::h(), SinglePhaseFluidProperties::h_dpT(), h_from_p_T(), StiffenedGasFluidProperties::h_from_p_T(), SinglePhaseFluidProperties::henryConstantIAPWS(), SinglePhaseFluidProperties::k(), SinglePhaseFluidProperties::k_dpT(), SinglePhaseFluidProperties::mu(), SinglePhaseFluidProperties::mu_dpT(), p_from_h_s(), StiffenedGasFluidProperties::p_from_h_s(), StiffenedGasFluidProperties::p_from_T_v(), p_from_T_v(), 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(), rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_T(), rho_from_p_T(), SinglePhaseFluidProperties::rho_mu(), SinglePhaseFluidProperties::rho_mu_dpT(), SinglePhaseFluidProperties::rho_mu_from_p_T(), SinglePhaseFluidProperties::s(), StiffenedGasFluidProperties::s_from_h_p(), s_from_h_p(), 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(), s_from_T_v(), StiffenedGasFluidProperties::s_from_v_e(), 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.

◆ R_universal

constexpr Real IdealGasFluidProperties::R_universal = 8.3144598
staticprotected

Universal gas constant [J/K.mol].

Definition at line 101 of file IdealGasFluidProperties.h.

Referenced by molarMass().

◆ 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(), e_from_p_rho(), NaClFluidProperties::e_from_p_T(), SinglePhaseFluidProperties::e_from_p_T(), 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(), 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(), 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(), c_from_v_e(), SinglePhaseFluidProperties::e(), SinglePhaseFluidProperties::e_dpT(), e_from_p_T(), StiffenedGasFluidProperties::e_from_p_T(), SinglePhaseFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_T_v(), e_from_T_v(), g_from_v_e(), StiffenedGasFluidProperties::g_from_v_e(), SinglePhaseFluidProperties::gamma_from_p_T(), SinglePhaseFluidProperties::h(), SinglePhaseFluidProperties::h_dpT(), h_from_p_T(), StiffenedGasFluidProperties::h_from_p_T(), StiffenedGasFluidProperties::h_from_T_v(), 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(), p_from_T_v(), SinglePhaseFluidProperties::rho_dpT(), SinglePhaseFluidProperties::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_from_p_T(), rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_T(), rho_from_p_T(), SinglePhaseFluidProperties::rho_mu(), SinglePhaseFluidProperties::rho_mu_dpT(), SinglePhaseFluidProperties::rho_mu_from_p_T(), SinglePhaseFluidProperties::s(), 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(), s_from_T_v(), StiffenedGasFluidProperties::s_from_v_e(), s_from_v_e(), 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: