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

CO2 fluid properties Most thermophysical properties taken from: Span and Wagner, "A New Equation of State for Carbon Dioxide Covering the Fluid Region from the Triple-Point Temperature to 1100K at Pressures up to 800 MPa", J. More...

#include <CO2FluidProperties.h>

Inheritance diagram for CO2FluidProperties:
[legend]

Public Member Functions

 CO2FluidProperties (const InputParameters &parameters)
 
virtual ~CO2FluidProperties ()
 
virtual Real rho_from_p_T (Real pressure, Real temperature) const override
 Density from pressure and temperature. More...
 
virtual void rho_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
 Density and its derivatives from pressure and temperature. 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 mu_from_rho_T (Real density, Real temperature) const override
 Dynamic viscosity as a function of density and temperature. More...
 
virtual void mu_from_rho_T (Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const override
 Dynamic viscosity and its derivatives wrt density and temperature. More...
 
virtual void rho_mu_from_p_T (Real pressure, Real temperature, Real &rho, Real &mu) const override
 
virtual void rho_mu_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &mu, Real &dmu_dp, Real &dmu_dT) const override
 Density and viscosity and their derivatives wrt pressure and temperature. More...
 
virtual std::string fluidName () const override
 Fluid name. More...
 
virtual Real molarMass () const override
 Molar mass [kg/mol]. More...
 
virtual Real criticalPressure () const override
 Critical pressure. More...
 
virtual Real criticalTemperature () const override
 Critical temperature. More...
 
virtual Real criticalDensity () const override
 Critical density. More...
 
virtual Real triplePointPressure () const override
 Triple point pressure. More...
 
virtual Real triplePointTemperature () const override
 Triple point temperature. More...
 
Real meltingPressure (Real temperature) const
 Melting pressure. More...
 
Real sublimationPressure (Real temperature) const
 Sublimation pressure. 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 CO2 Valid for temperatures between the triple point temperature and critical temperature. More...
 
Real saturatedVaporDensity (Real temperature) const
 Saturated vapor density of CO2 Valid for temperatures between the triple point temperature and critical temperature. More...
 
virtual Real p_from_rho_T (Real density, Real temperature) const override
 Pressure as a function of density and temperature. More...
 
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...
 
Real partialDensity (Real temperature) const
 Partial density of dissolved CO2 From Garcia, Density of aqueous solutions of CO2, LBNL-49023 (2001) More...
 
virtual Real k_from_p_T (Real pressure, Real temperature) const override
 Thermal conductivity. More...
 
virtual void k_from_p_T (Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const override
 Thermal conductivity and its derivatives wrt pressure and temperature. More...
 
virtual Real k_from_rho_T (Real density, Real temperature) const override
 Thermal conductivity as a function of density and temperature. More...
 
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
 Speed of sound. More...
 
virtual Real cp_from_p_T (Real pressure, Real temperature) const override
 Isobaric specific heat capacity. More...
 
virtual Real cp_from_p_T (Real pressure, Real temperature) const
 Isobaric specific heat capacity. More...
 
virtual void cp_from_p_T (Real pressure, Real temperature, Real &cp, Real &dcp_dp, Real &dcp_dT) const
 Isobaric specific heat capacity from pressure and temperature. More...
 
virtual void cp_from_p_T (Real pressure, Real temperature, Real &cp, Real &dcp_dp, Real &dcp_dT) const
 Isobaric specific heat capacity from pressure and temperature. More...
 
virtual Real cv_from_p_T (Real pressure, Real temperature) const override
 Isochoric specific heat. More...
 
virtual Real s_from_p_T (Real pressure, Real temperature) const override
 Specific entropy from pressure and temperature. More...
 
virtual void s_from_p_T (Real p, Real T, Real &s, Real &ds_dp, Real &ds_dT) const override
 Specific entropy and its derivatives from pressure and temperature. More...
 
virtual Real h_from_p_T (Real pressure, Real temperature) const override
 Specific enthalpy from pressure and temperature. More...
 
virtual void h_from_p_T (Real p, Real T, Real &h, Real &dh_dp, Real &dh_dT) const override
 Specific enthalpy and its derivatives from pressure and temperature. More...
 
virtual Real p_from_v_e (Real v, Real e) const
 Pressure from specific volume and specific internal energy. More...
 
virtual void p_from_v_e (Real v, Real e, Real &p, Real &dp_dv, Real &dp_de) const
 Pressure and its derivatives from specific volume and specific internal energy. More...
 
virtual Real T_from_v_e (Real v, Real e) const
 Temperature from specific volume and specific internal energy. More...
 
virtual void T_from_v_e (Real v, Real e, Real &T, Real &dT_dv, Real &dT_de) const
 Temperature and its derivatives from specific volume and specific internal energy. More...
 
virtual Real c_from_v_e (Real v, Real e) const
 Sound speed from specific volume and specific internal energy. More...
 
virtual void c_from_v_e (Real v, Real e, Real &c, Real &dc_dv, Real &dc_de) const
 Sound speed and its derivatives from specific volume and specific internal energy. More...
 
virtual Real cp_from_v_e (Real v, Real e) const
 Isobaric (constant-pressure) specific heat from specific volume and specific internal energy. More...
 
virtual void cp_from_v_e (Real v, Real e, Real &cp, Real &dcp_dv, Real &dcp_de) const
 Isobaric (constant pressure) specific heat from specific volume and specific internal energy. More...
 
virtual Real cv_from_v_e (Real v, Real e) const
 Isochoric (constant-volume) specific heat from specific volume and specific internal energy. More...
 
virtual Real mu_from_v_e (Real v, Real e) const
 Dynamic viscosity from specific volume and specific internal energy. More...
 
virtual Real k_from_v_e (Real v, Real e) const
 Thermal conductivity from specific volume and specific internal energy. More...
 
virtual Real s_from_v_e (Real v, Real e) const
 Specific entropy from specific volume and specific internal energy. More...
 
virtual void s_from_v_e (Real v, Real e, Real &s, Real &ds_dv, Real &ds_de) const
 Specific entropy and its derivatives from specific volume and specific internal energy. More...
 
virtual Real s (Real pressure, Real temperature) const
 
virtual Real s_from_h_p (Real h, Real p) const
 Specific entropy from specific enthalpy and pressure. More...
 
virtual void s_from_h_p (Real h, Real p, Real &s, Real &ds_dh, Real &ds_dp) const
 Specific entropy and its derivatives from specific enthalpy and pressure. More...
 
virtual Real rho_from_p_s (Real p, Real s) const
 Density from pressure and specific entropy. More...
 
virtual void rho_from_p_s (Real p, Real s, Real &rho, Real &drho_dp, Real &drho_ds) const
 Density and its derivatives from pressure and specific entropy. More...
 
virtual Real e_from_v_h (Real v, Real h) const
 Specific internal energy as a function of specific volume and specific enthalpy. More...
 
virtual void e_from_v_h (Real v, Real h, Real &e, Real &de_dv, Real &de_dh) const
 Specific internal energy and derivatives as a function of specific volume and specific enthalpy. More...
 
virtual Real rho (Real p, Real T) const
 
virtual void rho_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const
 
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_from_p_rho (Real p, Real rho) const
 Specific internal energy from pressure and density. More...
 
virtual void e_from_p_rho (Real p, Real rho, Real &e, Real &de_dp, Real &de_drho) const
 Specific internal energy and its derivatives from pressure and density. 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 e_from_T_v (Real T, Real v) const
 Specific volume and specific internal energy from temerature at the vapor spinodal. More...
 
virtual void e_from_T_v (Real T, Real v, Real &e, Real &de_dT, Real &de_dv) const
 Specific internal energy and its derivatives from temperature and specific volume. More...
 
virtual Real p_from_T_v (Real T, Real v) const
 Pressure from temperature and specific volume. More...
 
virtual void p_from_T_v (Real T, Real v, Real &p, Real &dp_dT, Real &dp_dv) const
 Pressure and its derivatives from temperature and specific volume. More...
 
virtual Real h_from_T_v (Real T, Real v) const
 Specific enthalpy from temperature and specific volume. More...
 
virtual void h_from_T_v (Real T, Real v, Real &h, Real &dh_dT, Real &dh_dv) const
 Specific enthalpy and its derivatives from temperature and specific volume. More...
 
virtual Real s_from_T_v (Real T, Real v) const
 Specific entropy from temperature and specific volume. More...
 
virtual void s_from_T_v (Real T, Real v, Real &s, Real &ds_dT, Real &ds_dv) const
 Specific entropy and its derivatives from temperature and specific volume. More...
 
virtual Real cv_from_T_v (Real T, Real v) const
 Specific isochoric heat capacity from temperature and specific volume. More...
 
virtual Real h (Real p, Real T) const
 
virtual void h_dpT (Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const
 
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 p_from_h_s (Real h, Real s) const
 Pressure from specific enthalpy and specific entropy. More...
 
virtual void p_from_h_s (Real h, Real s, Real &p, Real &dp_dh, Real &dp_ds) const
 Pressure and its derivatives from specific enthalpy and specific entropy. More...
 
virtual Real g_from_v_e (Real v, Real e) const
 Gibbs free energy from specific volume and specific internal energy. More...
 
virtual Real beta_from_p_T (Real p, Real T) const
 Thermal expansion coefficient from pressure and temperature. More...
 
virtual void beta_from_p_T (Real p, Real T, Real &beta, Real &dbeta_dp, Real &dbeta_dT) const
 Thermal expansion coefficient and its derivatives from pressure and temperature. More...
 
virtual Real beta (Real pressure, Real temperature) const
 
virtual Real pp_sat_from_p_T (Real p, Real T) const
 Partial pressure at saturation in a gas mixture. More...
 
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_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
 
virtual void k_dpT (Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const
 
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 _Mco2 = 44.0098e-3
 Molar mass of CO2 (kg/mol) More...
 
const Real _critical_pressure = 7.3773e6
 Critical pressure (Pa) More...
 
const Real _critical_temperature = 304.1282
 Critical temperature (K) More...
 
const Real _critical_density = 467.6
 Critical density (kg/m^3) More...
 
const Real _triple_point_pressure = 0.51795e6
 Triple point pressure (Pa) More...
 
const Real _triple_point_temperature = 216.592
 Triple point temperature (K) More...
 
const Real _Rco2 = 188.9241
 Specific gas constant (J/mol/K) More...
 
const std::array< Real, 5 > _a0 {{1.99427042, 0.62105248, 0.41195293, 1.04028922, 0.08327678}}
 Coefficients for the ideal gas component of the Helmholtz free energy. More...
 
const std::array< Real, 5 > _theta0 {{3.15163, 6.11190, 6.77708, 11.32384, 27.08792}}
 
const std::array< Real, 7 > _n1
 Coefficients for the residual component of the Helmholtz free energy. More...
 
const std::array< unsigned int, 7 > _d1 {{1, 1, 1, 1, 2, 2, 3}}
 
const std::array< Real, 7 > _t1 {{0.0, 0.75, 1.0, 2.0, 0.75, 2.0, 0.75}}
 
const std::array< Real, 27 > _n2
 
const std::array< unsigned int, 27 > _d2
 
const std::array< Real, 27 > _t2
 
const std::array< unsigned int, 27 > _c2
 
const std::array< Real, 5 > _n3
 
const std::array< unsigned int, 5 > _d3 {{2, 2, 2, 3, 3}}
 
const std::array< unsigned int, 5 > _t3 {{1, 0, 1, 3, 3}}
 
const std::array< Real, 5 > _alpha3 {{25.0, 25.0, 25.0, 15.0, 20.0}}
 
const std::array< Real, 5 > _beta3 {{325.0, 300.0, 300.0, 275.0, 275.0}}
 
const std::array< Real, 5 > _gamma3 {{1.16, 1.19, 1.19, 1.25, 1.25}}
 
const std::array< Real, 5 > _eps3 {{1.0, 1.0, 1.0, 1.0, 1.0}}
 
const std::array< Real, 3 > _n4 {{-0.66642276540751, 0.72608632349897, 0.055068668612842}}
 
const std::array< Real, 3 > _a4 {{3.5, 3.5, 3.5}}
 
const std::array< Real, 3 > _b4 {{0.875, 0.925, 0.875}}
 
const std::array< Real, 3 > _beta4 {{0.3, 0.3, 0.3}}
 
const std::array< Real, 3 > _A4 {{0.7, 0.7, 0.7}}
 
const std::array< Real, 3 > _B4 {{0.3, 0.3, 1.0}}
 
const std::array< Real, 3 > _C4 {{10.0, 10.0, 12.5}}
 
const std::array< Real, 3 > _D4 {{275.0, 275.0, 275.0}}
 
const std::array< Real, 5 > _mu_a {{0.235156, -0.491266, 5.211155e-2, 5.347906e-2, -1.537102e-2}}
 Coefficients for viscosity. More...
 
const std::array< Real, 5 > _mu_d
 
const std::array< Real, 3 > _k_g1 {{0.0, 0.0, 1.5}}
 Coefficients for the thermal conductivity. More...
 
const std::array< Real, 7 > _k_g2 {{0.0, 1.0, 1.5, 1.5, 1.5, 3.5, 5.5}}
 
const std::array< unsigned int, 3 > _k_h1 {{1, 5, 1}}
 
const std::array< unsigned int, 7 > _k_h2 {{1, 2, 0, 5, 9, 0, 0}}
 
const std::array< Real, 3 > _k_n1 {{7.69857587, 0.159885811, 1.56918621}}
 
const std::array< Real, 7 > _k_n2
 
const std::array< Real, 12 > _k_a
 
const Real _R
 Universal gas constant (J/mol/K) More...
 
const Real _T_c2k
 Conversion of temperature from Celsius to Kelvin. More...
 

Detailed Description

CO2 fluid properties Most thermophysical properties taken from: Span and Wagner, "A New Equation of State for Carbon Dioxide Covering the Fluid Region from the Triple-Point Temperature to 1100K at Pressures up to 800 MPa", J.

Phys. Chem. Ref. Data, 25 (1996)

Note: the Span and Wagner EOS uses density and temperature as the primary variables. As a result, density must first be found using iteration, after which the other properties can be calculated directly.

Viscosity from: Fenghour et al., The viscosity of carbon dioxide, J. Phys. Chem. Ref.Data, 27, 31-44 (1998) Note: critical enhancement not included Valid for 217 K < T < 1000K and rho < 1400 kg/m^3

Thermal conductivity from: Scalabrin et al., A Reference Multiparameter Thermal Conductivity Equation for Carbon Dioxide with an Optimized Functional Form, J. Phys. Chem. Ref. Data 35 (2006)

Definition at line 43 of file CO2FluidProperties.h.

Constructor & Destructor Documentation

◆ CO2FluidProperties()

CO2FluidProperties::CO2FluidProperties ( const InputParameters &  parameters)

Definition at line 28 of file CO2FluidProperties.C.

29  : HelmholtzFluidProperties(parameters)
30 {
31 }
HelmholtzFluidProperties(const InputParameters &parameters)

◆ ~CO2FluidProperties()

CO2FluidProperties::~CO2FluidProperties ( )
virtual

Definition at line 33 of file CO2FluidProperties.C.

33 {}

Member Function Documentation

◆ alpha()

Real CO2FluidProperties::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 162 of file CO2FluidProperties.C.

Referenced by k_from_rho_T().

163 {
164  // Ideal gas component of the Helmholtz free energy
165  Real sum0 = 0.0;
166  for (std::size_t i = 0; i < _a0.size(); ++i)
167  sum0 += _a0[i] * std::log(1.0 - std::exp(-_theta0[i] * tau));
168 
169  Real phi0 = std::log(delta) + 8.37304456 - 3.70454304 * tau + 2.5 * std::log(tau) + sum0;
170 
171  // Residual component of the Helmholtz free energy
172  Real theta, Delta, Psi;
173  Real phir = 0.0;
174  for (std::size_t i = 0; i < _n1.size(); ++i)
175  phir += _n1[i] * MathUtils::pow(delta, _d1[i]) * std::pow(tau, _t1[i]);
176 
177  for (std::size_t i = 0; i < _n2.size(); ++i)
178  phir += _n2[i] * MathUtils::pow(delta, _d2[i]) * std::pow(tau, _t2[i]) *
179  std::exp(-MathUtils::pow(delta, _c2[i]));
180 
181  for (std::size_t i = 0; i < _n3.size(); ++i)
182  phir += _n3[i] * MathUtils::pow(delta, _d3[i]) * MathUtils::pow(tau, _t3[i]) *
183  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _eps3[i]) -
184  _beta3[i] * Utility::pow<2>(tau - _gamma3[i]));
185 
186  for (std::size_t i = 0; i < _n4.size(); ++i)
187  {
188  theta = 1.0 - tau + _A4[i] * std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]));
189  Delta = Utility::pow<2>(theta) + _B4[i] * std::pow(Utility::pow<2>(delta - 1.0), _a4[i]);
190  Psi = std::exp(-_C4[i] * Utility::pow<2>(delta - 1.0) - _D4[i] * Utility::pow<2>(tau - 1.0));
191  phir += _n4[i] * std::pow(Delta, _b4[i]) * delta * Psi;
192  }
193 
194  // The Helmholtz free energy is the sum of these components
195  return phi0 + phir;
196 }
const std::array< Real, 3 > _D4
const std::array< Real, 7 > _t1
const std::array< unsigned int, 5 > _d3
const std::array< Real, 27 > _n2
const std::array< Real, 7 > _n1
Coefficients for the residual component of the Helmholtz free energy.
const std::array< Real, 3 > _C4
const std::array< Real, 5 > _theta0
const std::array< Real, 3 > _b4
const std::array< Real, 3 > _a4
const std::array< Real, 5 > _n3
const std::array< unsigned int, 27 > _c2
const std::array< Real, 5 > _eps3
const std::array< Real, 3 > _A4
const std::array< Real, 3 > _B4
const std::array< Real, 5 > _gamma3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 3 > _n4
const std::array< Real, 5 > _alpha3
const std::array< unsigned int, 5 > _t3
const std::array< Real, 3 > _beta4
const std::array< Real, 5 > _a0
Coefficients for the ideal gas component of the Helmholtz free energy.
const std::array< Real, 27 > _t2
const std::array< Real, 5 > _beta3
const std::array< unsigned int, 7 > _d1
const std::array< unsigned int, 27 > _d2

◆ beta()

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

Definition at line 268 of file SinglePhaseFluidProperties.C.

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

269 {
270  return beta_from_p_T(p, T);
271 }
virtual Real beta_from_p_T(Real p, Real T) const
Thermal expansion coefficient from pressure and temperature.

◆ beta_from_p_T() [1/2]

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

Thermal expansion coefficient from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
Returns
beta (1/K)

Reimplemented in SimpleFluidProperties.

Definition at line 177 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::beta().

178 {
179  // The volumetric thermal expansion coefficient is defined as
180  // 1/v dv/dT)_p
181  // It is the fractional change rate of volume with respect to temperature change
182  // at constant pressure. Here it is coded as
183  // - 1/rho drho/dT)_p
184  // using chain rule with v = v(rho)
185 
186  Real rho, drho_dp, drho_dT;
187  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
188  return -drho_dT / rho;
189 }
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.

◆ beta_from_p_T() [2/2]

void SinglePhaseFluidProperties::beta_from_p_T ( Real  p,
Real  T,
Real &  beta,
Real &  dbeta_dp,
Real &  dbeta_dT 
) const
virtualinherited

Thermal expansion coefficient and its derivatives from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
[out]betabeta (1/K)
[out]dbeta_dpderivative of the thermal expansion coefficient w.r.t. pressure
[out]dbeta_dTderivative of the thermal expansion coefficient w.r.t. temperature

Reimplemented in SimpleFluidProperties.

Definition at line 192 of file SinglePhaseFluidProperties.C.

193 {
194  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
195 }
const std::string name
Definition: Setup.h:22

◆ c()

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

Definition at line 465 of file SinglePhaseFluidProperties.C.

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

466 {
467  mooseDeprecated(name(), ": c() is deprecated. Use c_from_p_T() instead");
468 
469  return c_from_p_T(p, T);
470 }
virtual Real c_from_p_T(Real pressure, Real temperature) const
Speed of sound.
const std::string name
Definition: Setup.h:22

◆ c_from_p_T()

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

Speed of sound.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
speed of sound (m/s)

Reimplemented from SinglePhaseFluidProperties.

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
Density from pressure and temperature.
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ c_from_v_e() [1/2]

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

Sound speed from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 50 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), and NSMachAux::computeValue().

51 {
52  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
53 }
const std::string name
Definition: Setup.h:22

◆ c_from_v_e() [2/2]

void SinglePhaseFluidProperties::c_from_v_e ( Real  v,
Real  e,
Real &  c,
Real &  dc_dv,
Real &  dc_de 
) const
virtualinherited

Sound speed and its derivatives from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
[out]dc_dvderivative of sound speed w.r.t. specific volume
[out]dc_dederivative of sound speed w.r.t. specific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 56 of file SinglePhaseFluidProperties.C.

57 {
58  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
59 }
const std::string name
Definition: Setup.h:22

◆ cp_from_p_T() [1/4]

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

Isobaric specific heat capacity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
cp (J/kg/K)

Reimplemented from SinglePhaseFluidProperties.

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
Density from pressure and temperature.
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ cp_from_p_T() [2/4]

Real SinglePhaseFluidProperties::cp_from_p_T
inherited

Isobaric specific heat capacity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
cp (J/kg/K)

Definition at line 472 of file SinglePhaseFluidProperties.C.

473 {
474  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
475 }
const std::string name
Definition: Setup.h:22

◆ cp_from_p_T() [3/4]

void SinglePhaseFluidProperties::cp_from_p_T
inherited

Isobaric specific heat capacity from pressure and temperature.

Parameters
[in]pressurefluid pressure (Pa)
[in]temperaturefluid temperature (K)
[out]cpisobaric specific heat (J/kg/K)
[out]dcp_dpderivative of isobaric specific heat w.r.t. pressure (J/kg/K/Pa)
[out]dcp_dTderivative of isobaric specific heat w.r.t. temperature (J/kg/K/K)

Definition at line 478 of file SinglePhaseFluidProperties.C.

479 {
480  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
481 }
const std::string name
Definition: Setup.h:22

◆ cp_from_p_T() [4/4]

void SinglePhaseFluidProperties::cp_from_p_T ( Real  pressure,
Real  temperature,
Real &  cp,
Real &  dcp_dp,
Real &  dcp_dT 
) const
virtualinherited

Isobaric specific heat capacity from pressure and temperature.

Parameters
[in]pressurefluid pressure (Pa)
[in]temperaturefluid temperature (K)
[out]cpisobaric specific heat (J/kg/K)
[out]dcp_dpderivative of isobaric specific heat w.r.t. pressure (J/kg/K/Pa)
[out]dcp_dTderivative of isobaric specific heat w.r.t. temperature (J/kg/K/K)

Reimplemented in StiffenedGasFluidProperties, IdealGasFluidProperties, and SimpleFluidProperties.

Definition at line 478 of file SinglePhaseFluidProperties.C.

479 {
480  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
481 }
const std::string name
Definition: Setup.h:22

◆ cp_from_v_e() [1/2]

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

Isobaric (constant-pressure) specific heat from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 61 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), and GeneralVaporMixtureFluidProperties::cp_from_p_T().

62 {
63  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
64 }
const std::string name
Definition: Setup.h:22

◆ cp_from_v_e() [2/2]

void SinglePhaseFluidProperties::cp_from_v_e ( Real  v,
Real  e,
Real &  cp,
Real &  dcp_dv,
Real &  dcp_de 
) const
virtualinherited

Isobaric (constant pressure) specific heat from specific volume and specific internal energy.

Parameters
[in]vspecific volume (m$^3$/kg)
[in]especific internal energy (J/kg)
[out]cpisobaric specific heat (J/kg/K)
[out]dcp_dvderivative of isobaric specific heat w.r.t. specific volume (J/K/m$^3$)
[out]dcp_dederivative of isobaric specific heat w.r.t. specific inernal energy (1/K)

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 67 of file SinglePhaseFluidProperties.C.

68 {
69  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
70 }
const std::string name
Definition: Setup.h:22

◆ criticalDensity()

Real CO2FluidProperties::criticalDensity ( ) const
overridevirtual

Critical density.

Returns
critical density (kg/m^3)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 60 of file CO2FluidProperties.C.

61 {
62  return _critical_density;
63 }
const Real _critical_density
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 244 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e().

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

◆ criticalPressure()

Real CO2FluidProperties::criticalPressure ( ) const
overridevirtual

Critical pressure.

Returns
critical pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 48 of file CO2FluidProperties.C.

49 {
50  return _critical_pressure;
51 }
const Real _critical_pressure
Critical pressure (Pa)

◆ criticalTemperature()

Real CO2FluidProperties::criticalTemperature ( ) const
overridevirtual

Critical temperature.

Returns
critical temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 54 of file CO2FluidProperties.C.

55 {
56  return _critical_temperature;
57 }
const Real _critical_temperature
Critical temperature (K)

◆ cv_from_p_T()

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

Isochoric specific heat.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
cv (J/kg/K)

Reimplemented from SinglePhaseFluidProperties.

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
Density from pressure and temperature.
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ cv_from_T_v()

Real SinglePhaseFluidProperties::cv_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Specific isochoric heat capacity from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 695 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::cv_from_p_T(), and IdealRealGasMixtureFluidProperties::cv_from_T_v().

696 {
697  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
698 }
const std::string name
Definition: Setup.h:22

◆ cv_from_v_e()

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

Isochoric (constant-volume) specific heat from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 72 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), and GeneralVaporMixtureFluidProperties::cv_from_p_T().

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

◆ d2alpha_ddelta2()

Real CO2FluidProperties::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 283 of file CO2FluidProperties.C.

284 {
285  // Second derivative of the ideal gas component wrt gamma
286  Real d2phi0dd2 = -1.0 / delta / delta;
287 
288  // Second derivative of the residual component wrt gamma
289  Real d2phirdd2 = 0.0;
290  Real theta, Delta, Psi, dDelta_dd, dPsi_dd, d2Delta_dd2, d2Psi_dd2;
291 
292  for (std::size_t i = 0; i < _n1.size(); ++i)
293  d2phirdd2 += _n1[i] * _d1[i] * (_d1[i] - 1.0) * MathUtils::pow(delta, _d1[i] - 2) *
294  std::pow(tau, _t1[i]);
295 
296  for (std::size_t i = 0; i < _n2.size(); ++i)
297  d2phirdd2 += _n2[i] * std::exp(-MathUtils::pow(delta, _c2[i])) *
298  MathUtils::pow(delta, _d2[i] - 2) * std::pow(tau, _t2[i]) *
299  ((_d2[i] - _c2[i] * MathUtils::pow(delta, _c2[i])) *
300  (_d2[i] - 1.0 - _c2[i] * MathUtils::pow(delta, _c2[i])) -
301  _c2[i] * _c2[i] * MathUtils::pow(delta, _c2[i]));
302 
303  for (std::size_t i = 0; i < _n3.size(); ++i)
304  d2phirdd2 +=
305  _n3[i] * MathUtils::pow(tau, _t3[i]) *
306  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _eps3[i]) -
307  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
308  (-2.0 * _alpha3[i] * MathUtils::pow(delta, _d3[i]) +
309  4.0 * _alpha3[i] * _alpha3[i] * MathUtils::pow(delta, _d3[i]) *
310  Utility::pow<2>(delta - _eps3[i]) -
311  4.0 * _d3[i] * _alpha3[i] * MathUtils::pow(delta, _d3[i] - 1.0) * (delta - _eps3[i]) +
312  _d3[i] * (_d3[i] - 1.0) * MathUtils::pow(delta, _d3[i] - 2.0));
313 
314  for (std::size_t i = 0; i < _n4.size(); ++i)
315  {
316  theta = 1.0 - tau + _A4[i] * std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]));
317  Delta = Utility::pow<2>(theta) + _B4[i] * std::pow(Utility::pow<2>(delta - 1.0), _a4[i]);
318  Psi = std::exp(-_C4[i] * Utility::pow<2>(delta - 1.0) - _D4[i] * Utility::pow<2>(tau - 1.0));
319  dPsi_dd = -2.0 * _C4[i] * (delta - 1.0) * Psi;
320  dDelta_dd = (delta - 1.0) *
321  (_A4[i] * theta * 2.0 / _beta4[i] *
322  std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]) - 1.0) +
323  2.0 * _B4[i] * _a4[i] * std::pow(Utility::pow<2>(delta - 1.0), _a4[i] - 1.0));
324  d2Psi_dd2 = 3.0 * _D4[i] * Psi * (2.0 * _C4[i] * Utility::pow<2>(delta - 1.0) - 1.0);
325  d2Delta_dd2 = 1.0 / (delta - 1.0) * dDelta_dd +
326  (delta - 1.0) * (delta - 1.0) *
327  (4.0 * _B4[i] * _a4[i] * (_a4[i] - 1.0) *
328  std::pow(Utility::pow<2>(delta - 1.0), _a4[i] - 2.0) +
329  2.0 * _A4[i] * _A4[i] *
330  Utility::pow<2>(std::pow(Utility::pow<2>(delta - 1.0),
331  1.0 / (2.0 * _beta4[i]) - 1.0)) /
332  _beta4[i] / _beta4[i] +
333  (4.0 / _beta4[i]) * _A4[i] * theta * (1.0 / (2.0 * _beta4[i]) - 1.0) *
334  std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]) - 2.0));
335  d2phirdd2 +=
336  _n4[i] *
337  (std::pow(Delta, _b4[i]) * (2.0 * dPsi_dd + delta * d2Psi_dd2) +
338  2.0 * _b4[i] * std::pow(Delta, _b4[i] - 1.0) * dDelta_dd * (Psi + delta * dPsi_dd) +
339  _b4[i] *
340  (std::pow(Delta, _b4[i] - 1.0) * d2Delta_dd2 +
341  (_b4[i] - 1.0) * std::pow(Delta, _b4[i] - 2.0) * Utility::pow<2>(dDelta_dd)) *
342  delta * Psi);
343  }
344  // The second derivative of the free energy wrt delta is the sum of these components
345  return d2phi0dd2 + d2phirdd2;
346 }
const std::array< Real, 3 > _D4
const std::array< Real, 7 > _t1
const std::array< unsigned int, 5 > _d3
const std::array< Real, 27 > _n2
const std::array< Real, 7 > _n1
Coefficients for the residual component of the Helmholtz free energy.
const std::array< Real, 3 > _C4
const std::array< Real, 3 > _b4
const std::array< Real, 3 > _a4
const std::array< Real, 5 > _n3
const std::array< unsigned int, 27 > _c2
const std::array< Real, 5 > _eps3
const std::array< Real, 3 > _A4
const std::array< Real, 3 > _B4
const std::array< Real, 5 > _gamma3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 3 > _n4
const std::array< Real, 5 > _alpha3
const std::array< unsigned int, 5 > _t3
const std::array< Real, 3 > _beta4
const std::array< Real, 27 > _t2
const std::array< Real, 5 > _beta3
const std::array< unsigned int, 7 > _d1
const std::array< unsigned int, 27 > _d2

◆ d2alpha_ddeltatau()

Real CO2FluidProperties::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 398 of file CO2FluidProperties.C.

399 {
400  // Note: second derivative of the ideal gas component wrt delta and tau is 0
401  // Derivative of the residual component wrt gamma
402  Real theta, Delta, Psi, dDelta_dd, dPsi_dd, dDelta_dt, dPsi_dt, d2Delta_ddt, d2Psi_ddt;
403  Real d2phirddt = 0.0;
404  for (std::size_t i = 0; i < _n1.size(); ++i)
405  d2phirddt += _n1[i] * _d1[i] * _t1[i] * MathUtils::pow(delta, _d1[i] - 1.0) *
406  std::pow(tau, _t1[i] - 1.0);
407 
408  for (std::size_t i = 0; i < _n2.size(); ++i)
409  d2phirddt += _n2[i] * std::exp(-MathUtils::pow(delta, _c2[i])) *
410  (MathUtils::pow(delta, _d2[i] - 1.0) * _t2[i] * std::pow(tau, _t2[i] - 1.0) *
411  (_d2[i] - _c2[i] * MathUtils::pow(delta, _c2[i])));
412 
413  for (std::size_t i = 0; i < _n3.size(); ++i)
414  d2phirddt += _n3[i] * MathUtils::pow(delta, _d3[i]) * MathUtils::pow(tau, _t3[i]) *
415  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _eps3[i]) -
416  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
417  (_d3[i] / delta - 2.0 * _alpha3[i] * (delta - _eps3[i])) *
418  (_t3[i] / tau - 2.0 * _beta3[i] * (tau - _gamma3[i]));
419 
420  for (std::size_t i = 0; i < _n4.size(); ++i)
421  {
422  theta = 1.0 - tau + _A4[i] * std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]));
423  Delta = Utility::pow<2>(theta) + _B4[i] * std::pow(Utility::pow<2>(delta - 1.0), _a4[i]);
424  Psi = std::exp(-_C4[i] * Utility::pow<2>(delta - 1.0) - _D4[i] * Utility::pow<2>(tau - 1.0));
425  dPsi_dd = -2.0 * _C4[i] * (delta - 1.0) * Psi;
426  dPsi_dt = -2.0 * _D4[i] * (tau - 1.0) * Psi;
427  d2Psi_ddt = 4.0 * _C4[i] * _D4[i] * (delta - 1.0) * (tau - 1.0) * Psi;
428  dDelta_dd = (delta - 1.0) *
429  (_A4[i] * theta * 2.0 / _beta4[i] *
430  std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]) - 1.0) +
431  2.0 * _B4[i] * _a4[i] * std::pow(Utility::pow<2>(delta - 1.0), _a4[i] - 1.0));
432  dDelta_dt = -2.0 * theta * _b4[i] * std::pow(Delta, _b4[i] - 1.0);
433  d2Delta_ddt = -2.0 * _A4[i] * _b4[i] / _beta4[i] * std::pow(Delta, _b4[i] - 1.0) *
434  (delta - 1.0) *
435  std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]) - 1.0) -
436  2.0 * theta * _b4[i] * (_b4[i] - 1.0) * std::pow(Delta, _b4[i] - 2.0) * dDelta_dd;
437 
438  d2phirddt += _n4[i] * (std::pow(Delta, _b4[i]) * (dPsi_dt + delta * d2Psi_ddt) +
439  delta * _b4[i] * std::pow(Delta, _b4[i] - 1.0) * dDelta_dd * dPsi_dt +
440  dDelta_dt * (Psi + delta * dPsi_dd) + d2Delta_ddt * delta * Psi);
441  }
442 
443  return d2phirddt;
444 }
const std::array< Real, 3 > _D4
const std::array< Real, 7 > _t1
const std::array< unsigned int, 5 > _d3
const std::array< Real, 27 > _n2
const std::array< Real, 7 > _n1
Coefficients for the residual component of the Helmholtz free energy.
const std::array< Real, 3 > _C4
const std::array< Real, 3 > _b4
const std::array< Real, 3 > _a4
const std::array< Real, 5 > _n3
const std::array< unsigned int, 27 > _c2
const std::array< Real, 5 > _eps3
const std::array< Real, 3 > _A4
const std::array< Real, 3 > _B4
const std::array< Real, 5 > _gamma3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 3 > _n4
const std::array< Real, 5 > _alpha3
const std::array< unsigned int, 5 > _t3
const std::array< Real, 3 > _beta4
const std::array< Real, 27 > _t2
const std::array< Real, 5 > _beta3
const std::array< unsigned int, 7 > _d1
const std::array< unsigned int, 27 > _d2

◆ d2alpha_dtau2()

Real CO2FluidProperties::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 349 of file CO2FluidProperties.C.

350 {
351  // Second derivative of the ideal gas component wrt tau
352  Real sum0 = 0.0;
353  for (std::size_t i = 0; i < _a0.size(); ++i)
354  sum0 += _a0[i] * _theta0[i] * _theta0[i] * std::exp(-_theta0[i] * tau) /
355  Utility::pow<2>(1.0 - std::exp(-_theta0[i] * tau));
356 
357  Real d2phi0dt2 = -2.5 / tau / tau - sum0;
358 
359  // Second derivative of the residual component wrt tau
360  Real d2phirdt2 = 0.0;
361  Real theta, Delta, Psi, dPsi_dt, dDelta_dt, d2Delta_dt2, d2Psi_dt2;
362 
363  for (std::size_t i = 0; i < _n1.size(); ++i)
364  d2phirdt2 += _n1[i] * _t1[i] * (_t1[i] - 1.0) * MathUtils::pow(delta, _d1[i]) *
365  std::pow(tau, _t1[i] - 2.0);
366 
367  for (std::size_t i = 0; i < _n2.size(); ++i)
368  d2phirdt2 += _n2[i] * _t2[i] * (_t2[i] - 1.0) * MathUtils::pow(delta, _d2[i]) *
369  std::exp(-MathUtils::pow(delta, _c2[i])) * std::pow(tau, _t2[i] - 2.0);
370 
371  for (std::size_t i = 0; i < _n3.size(); ++i)
372  d2phirdt2 += _n3[i] * MathUtils::pow(delta, _d3[i]) * MathUtils::pow(tau, _t3[i]) *
373  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _eps3[i]) -
374  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
375  (Utility::pow<2>(_t3[i] / tau - 2.0 * _beta3[i] * (tau - _gamma3[i])) -
376  _t3[i] / tau / tau - 2.0 * _beta3[i]);
377 
378  for (std::size_t i = 0; i < _n4.size(); ++i)
379  {
380  theta = 1.0 - tau + _A4[i] * std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]));
381  Delta = Utility::pow<2>(theta) + _B4[i] * std::pow(Utility::pow<2>(delta - 1.0), _a4[i]);
382  Psi = std::exp(-_C4[i] * Utility::pow<2>(delta - 1.0) - _D4[i] * Utility::pow<2>(tau - 1.0));
383  dDelta_dt = -2.0 * theta * _b4[i] * std::pow(Delta, _b4[i] - 1.0);
384  d2Delta_dt2 = 2.0 * _b4[i] * std::pow(Delta, _b4[i] - 1.0) +
385  4.0 * theta * theta * _b4[i] * (_b4[i] - 1.0) * std::pow(Delta, _b4[i] - 2.0);
386  dPsi_dt = -2.0 * _D4[i] * (tau - 1.0) * Psi;
387  d2Psi_dt2 = 2.0 * _D4[i] * (2.0 * _D4[i] * (tau - 1.0) * (tau - 1.0) - 1.0) * Psi;
388  d2phirdt2 +=
389  _n4[i] * delta *
390  (Psi * d2Delta_dt2 + 2.0 * dDelta_dt * dPsi_dt + std::pow(Delta, _b4[i]) * d2Psi_dt2);
391  }
392 
393  // The second derivative of the free energy wrt tau is the sum of these components
394  return d2phi0dt2 + d2phirdt2;
395 }
const std::array< Real, 3 > _D4
const std::array< Real, 7 > _t1
const std::array< unsigned int, 5 > _d3
const std::array< Real, 27 > _n2
const std::array< Real, 7 > _n1
Coefficients for the residual component of the Helmholtz free energy.
const std::array< Real, 3 > _C4
const std::array< Real, 5 > _theta0
const std::array< Real, 3 > _b4
const std::array< Real, 3 > _a4
const std::array< Real, 5 > _n3
const std::array< unsigned int, 27 > _c2
const std::array< Real, 5 > _eps3
const std::array< Real, 3 > _A4
const std::array< Real, 3 > _B4
const std::array< Real, 5 > _gamma3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 3 > _n4
const std::array< Real, 5 > _alpha3
const std::array< unsigned int, 5 > _t3
const std::array< Real, 3 > _beta4
const std::array< Real, 5 > _a0
Coefficients for the ideal gas component of the Helmholtz free energy.
const std::array< Real, 27 > _t2
const std::array< Real, 5 > _beta3
const std::array< unsigned int, 7 > _d1
const std::array< unsigned int, 27 > _d2

◆ dalpha_ddelta()

Real CO2FluidProperties::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 199 of file CO2FluidProperties.C.

200 {
201  // Derivative of the ideal gas component wrt gamma
202  Real dphi0dd = 1.0 / delta;
203 
204  // Derivative of the residual component wrt gamma
205  Real theta, Delta, Psi, dDelta_dd, dPsi_dd;
206  Real dphirdd = 0.0;
207 
208  for (std::size_t i = 0; i < _n1.size(); ++i)
209  dphirdd += _n1[i] * _d1[i] * MathUtils::pow(delta, _d1[i] - 1.0) * std::pow(tau, _t1[i]);
210 
211  for (std::size_t i = 0; i < _n2.size(); ++i)
212  dphirdd += _n2[i] * std::exp(-MathUtils::pow(delta, _c2[i])) *
213  (MathUtils::pow(delta, _d2[i] - 1.0) * std::pow(tau, _t2[i]) *
214  (_d2[i] - _c2[i] * MathUtils::pow(delta, _c2[i])));
215 
216  for (std::size_t i = 0; i < _n3.size(); ++i)
217  dphirdd += _n3[i] * MathUtils::pow(delta, _d3[i]) * MathUtils::pow(tau, _t3[i]) *
218  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _eps3[i]) -
219  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
220  (_d3[i] / delta - 2.0 * _alpha3[i] * (delta - _eps3[i]));
221 
222  for (std::size_t i = 0; i < _n4.size(); ++i)
223  {
224  theta = 1.0 - tau + _A4[i] * std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]));
225  Delta = Utility::pow<2>(theta) + _B4[i] * std::pow(Utility::pow<2>(delta - 1.0), _a4[i]);
226  Psi = std::exp(-_C4[i] * Utility::pow<2>(delta - 1.0) - _D4[i] * Utility::pow<2>(tau - 1.0));
227  dPsi_dd = -2.0 * _C4[i] * (delta - 1.0) * Psi;
228  dDelta_dd = (delta - 1.0) *
229  (_A4[i] * theta * 2.0 / _beta4[i] *
230  std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]) - 1.0) +
231  2.0 * _B4[i] * _a4[i] * std::pow(Utility::pow<2>(delta - 1.0), _a4[i] - 1.0));
232 
233  dphirdd += _n4[i] * (std::pow(Delta, _b4[i]) * (Psi + delta * dPsi_dd) +
234  _b4[i] * std::pow(Delta, _b4[i] - 1.0) * dDelta_dd * delta * Psi);
235  }
236 
237  // The derivative of the free energy wrt delta is the sum of these components
238  return dphi0dd + dphirdd;
239 }
const std::array< Real, 3 > _D4
const std::array< Real, 7 > _t1
const std::array< unsigned int, 5 > _d3
const std::array< Real, 27 > _n2
const std::array< Real, 7 > _n1
Coefficients for the residual component of the Helmholtz free energy.
const std::array< Real, 3 > _C4
const std::array< Real, 3 > _b4
const std::array< Real, 3 > _a4
const std::array< Real, 5 > _n3
const std::array< unsigned int, 27 > _c2
const std::array< Real, 5 > _eps3
const std::array< Real, 3 > _A4
const std::array< Real, 3 > _B4
const std::array< Real, 5 > _gamma3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 3 > _n4
const std::array< Real, 5 > _alpha3
const std::array< unsigned int, 5 > _t3
const std::array< Real, 3 > _beta4
const std::array< Real, 27 > _t2
const std::array< Real, 5 > _beta3
const std::array< unsigned int, 7 > _d1
const std::array< unsigned int, 27 > _d2

◆ dalpha_dtau()

Real CO2FluidProperties::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 242 of file CO2FluidProperties.C.

243 {
244  // Derivative of the ideal gas component wrt tau
245  Real sum0 = 0.0;
246  for (std::size_t i = 0; i < _a0.size(); ++i)
247  sum0 += _a0[i] * _theta0[i] * (1.0 / (1.0 - std::exp(-_theta0[i] * tau)) - 1.0);
248 
249  Real dphi0dt = -3.70454304 + 2.5 / tau + sum0;
250 
251  // Derivative of the residual component wrt tau
252  Real theta, Delta, Psi, dDelta_dt, dPsi_dt;
253  Real dphirdt = 0.0;
254  for (std::size_t i = 0; i < _n1.size(); ++i)
255  dphirdt += _n1[i] * _t1[i] * MathUtils::pow(delta, _d1[i]) * std::pow(tau, _t1[i] - 1.0);
256 
257  for (std::size_t i = 0; i < _n2.size(); ++i)
258  dphirdt += _n2[i] * _t2[i] * MathUtils::pow(delta, _d2[i]) * std::pow(tau, _t2[i] - 1.0) *
259  std::exp(-MathUtils::pow(delta, _c2[i]));
260 
261  for (std::size_t i = 0; i < _n3.size(); ++i)
262  dphirdt += _n3[i] * MathUtils::pow(delta, _d3[i]) * MathUtils::pow(tau, _t3[i]) *
263  std::exp(-_alpha3[i] * Utility::pow<2>(delta - _eps3[i]) -
264  _beta3[i] * Utility::pow<2>(tau - _gamma3[i])) *
265  (_t3[i] / tau - 2.0 * _beta3[i] * (tau - _gamma3[i]));
266 
267  for (std::size_t i = 0; i < _n4.size(); ++i)
268  {
269  theta = 1.0 - tau + _A4[i] * std::pow(Utility::pow<2>(delta - 1.0), 1.0 / (2.0 * _beta4[i]));
270  Delta = Utility::pow<2>(theta) + _B4[i] * std::pow(Utility::pow<2>(delta - 1.0), _a4[i]);
271  Psi = std::exp(-_C4[i] * Utility::pow<2>(delta - 1.0) - _D4[i] * Utility::pow<2>(tau - 1.0));
272  dDelta_dt = -2.0 * theta * _b4[i] * std::pow(Delta, _b4[i] - 1.0);
273  dPsi_dt = -2.0 * _D4[i] * (tau - 1.0) * Psi;
274 
275  dphirdt += _n4[i] * delta * (Psi * dDelta_dt + std::pow(Delta, _b4[i]) * dPsi_dt);
276  }
277 
278  // The derivative of the free energy wrt tau is the sum of these components
279  return dphi0dt + dphirdt;
280 }
const std::array< Real, 3 > _D4
const std::array< Real, 7 > _t1
const std::array< unsigned int, 5 > _d3
const std::array< Real, 27 > _n2
const std::array< Real, 7 > _n1
Coefficients for the residual component of the Helmholtz free energy.
const std::array< Real, 3 > _C4
const std::array< Real, 5 > _theta0
const std::array< Real, 3 > _b4
const std::array< Real, 3 > _a4
const std::array< Real, 5 > _n3
const std::array< unsigned int, 27 > _c2
const std::array< Real, 5 > _eps3
const std::array< Real, 3 > _A4
const std::array< Real, 3 > _B4
const std::array< Real, 5 > _gamma3
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::array< Real, 3 > _n4
const std::array< Real, 5 > _alpha3
const std::array< unsigned int, 5 > _t3
const std::array< Real, 3 > _beta4
const std::array< Real, 5 > _a0
Coefficients for the ideal gas component of the Helmholtz free energy.
const std::array< Real, 27 > _t2
const std::array< Real, 5 > _beta3
const std::array< unsigned int, 7 > _d1
const std::array< unsigned int, 27 > _d2

◆ e()

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

Definition at line 415 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(), 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().

416 {
417  mooseDeprecated(name(), ": e() is deprecated. Use e_from_p_T() instead");
418 
419  return e_from_p_T(p, T);
420 }
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 423 of file SinglePhaseFluidProperties.C.

424 {
425  mooseDeprecated(name(), ": e_dpT() is deprecated. Use e_from_p_T() instead");
426 
427  e_from_p_T(p, T, e, de_dp, de_dT);
428 }
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 SinglePhaseFluidProperties::e_from_p_rho ( Real  p,
Real  rho 
) const
virtualinherited

Specific internal energy from pressure and density.

Parameters
[in]ppressure
[in]rhodensity

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 629 of file SinglePhaseFluidProperties.C.

Referenced by StagnationTemperatureAux::computeValue(), InternalEnergyAux::computeValue(), and SinglePhaseFluidProperties::e_from_p_T().

630 {
631  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
632 }
const std::string name
Definition: Setup.h:22

◆ e_from_p_rho() [2/2]

void SinglePhaseFluidProperties::e_from_p_rho ( Real  p,
Real  rho,
Real &  e,
Real &  de_dp,
Real &  de_drho 
) const
virtualinherited

Specific internal energy and its derivatives from pressure and density.

Parameters
[in]ppressure
[in]rhodensity
[out]especific internal energy
[out]de_dpderivative of specific internal energy w.r.t. pressure
[out]de_drhoderivative of specific internal energy w.r.t. density

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 635 of file SinglePhaseFluidProperties.C.

636 {
637  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
638 }
const std::string name
Definition: Setup.h:22

◆ 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
Density from pressure and temperature.
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
Density from pressure and temperature.
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_from_T_v() [1/2]

Real SinglePhaseFluidProperties::e_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Specific volume and specific internal energy from temerature at the vapor spinodal.

Parameters
[in]Ttemerature

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 640 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::e_from_T_v(), IdealRealGasMixtureFluidProperties::k_from_p_T(), IdealRealGasMixtureFluidProperties::k_from_T_v(), IdealRealGasMixtureFluidProperties::mu_from_p_T(), and IdealRealGasMixtureFluidProperties::mu_from_T_v().

641 {
642  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
643 }
const std::string name
Definition: Setup.h:22

◆ e_from_T_v() [2/2]

void SinglePhaseFluidProperties::e_from_T_v ( Real  T,
Real  v,
Real &  e,
Real &  de_dT,
Real &  de_dv 
) const
virtualinherited

Specific internal energy and its derivatives from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume
[out]especific internal energy (J/kg)
[out]de_dTderivative of specific internal energy w.r.t. temperature
[out]de_dvderivative of specific internal energy w.r.t. specific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 657 of file SinglePhaseFluidProperties.C.

658 {
659  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
660 }
const std::string name
Definition: Setup.h:22

◆ e_from_v_h() [1/2]

Real SinglePhaseFluidProperties::e_from_v_h ( Real  v,
Real  h 
) const
virtualinherited

Specific internal energy as a function of specific volume and specific enthalpy.

Parameters
[in]vspecific volume
[in]hspecific enthalpy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 120 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::T_from_p_h().

121 {
122  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
123 }
const std::string name
Definition: Setup.h:22

◆ e_from_v_h() [2/2]

void SinglePhaseFluidProperties::e_from_v_h ( Real  v,
Real  h,
Real &  e,
Real &  de_dv,
Real &  de_dh 
) const
virtualinherited

Specific internal energy and derivatives as a function of specific volume and specific enthalpy.

Parameters
[in]vspecific volume
[in]hspecific enthalpy
[out]de_dvderivative of specific internal energy w.r.t. specific volume
[out]de_dhderivative of specific internal energy w.r.t. specific enthalpy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 126 of file SinglePhaseFluidProperties.C.

127 {
128  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
129 }
const std::string name
Definition: Setup.h:22

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

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e().

646 {
647  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
648 }
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 CO2FluidProperties::fluidName ( ) const
overridevirtual

Fluid name.

Returns
string representing fluid name

Reimplemented from SinglePhaseFluidProperties.

Definition at line 36 of file CO2FluidProperties.C.

37 {
38  return "co2";
39 }

◆ g_from_v_e()

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

Gibbs free energy from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 722 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties().

723 {
724  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
725 }
const std::string name
Definition: Setup.h:22

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

263 {
264  return cp_from_p_T(p, T) / cv_from_p_T(p, T);
265 }
virtual Real cv_from_p_T(Real pressure, Real temperature) const
Isochoric specific heat.
virtual Real cp_from_p_T(Real pressure, Real temperature) const
Isobaric specific heat capacity.

◆ 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

Definition at line 603 of file SinglePhaseFluidProperties.C.

604 {
605  mooseDeprecated(name(), ": h_dpT() is deprecated. Use h_from_p_T() instead");
606 
607  h_from_p_T(p, T, h, dh_dp, dh_dT);
608 }
virtual Real h(Real p, Real T) const
const std::string name
Definition: Setup.h:22
virtual Real h_from_p_T(Real p, Real T) const
Specific enthalpy from pressure and temperature.

◆ h_from_p_T() [1/2]

Real HelmholtzFluidProperties::h_from_p_T ( Real  p,
Real  T 
) const
overridevirtualinherited

Specific enthalpy from pressure and temperature.

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

Reimplemented from SinglePhaseFluidProperties.

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
Density from pressure and temperature.
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

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

Reimplemented from SinglePhaseFluidProperties.

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
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
Specific enthalpy from pressure and temperature.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
Density from pressure and temperature.
virtual Real criticalDensity() const
Critical density.
const std::string pressure
Definition: NS.h:26

◆ h_from_T_v() [1/2]

Real SinglePhaseFluidProperties::h_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Specific enthalpy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 673 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::cp_from_p_T(), and IdealRealGasMixtureFluidProperties::cp_from_T_v().

674 {
675  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
676 }
const std::string name
Definition: Setup.h:22

◆ h_from_T_v() [2/2]

void SinglePhaseFluidProperties::h_from_T_v ( Real  T,
Real  v,
Real &  h,
Real &  dh_dT,
Real &  dh_dv 
) const
virtualinherited

Specific enthalpy and its derivatives from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume
[out]hspecific enthalpy (J/kg)
[out]dh_dTderivative of specific enthalpy w.r.t. temperature
[out]dh_dvderivative of specific enthalpy w.r.t. specific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 679 of file SinglePhaseFluidProperties.C.

680 {
681  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
682 }
const std::string name
Definition: Setup.h:22

◆ henryConstant() [1/2]

Real CO2FluidProperties::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 637 of file CO2FluidProperties.C.

638 {
639  return henryConstantIAPWS(temperature, -8.55445, 4.01195, 9.52345);
640 }
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 CO2FluidProperties::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 643 of file CO2FluidProperties.C.

644 {
645  henryConstantIAPWS(temperature, Kh, dKh_dT, -8.55445, 4.01195, 9.52345);
646 }
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 379 of file SinglePhaseFluidProperties.C.

380 {
381  mooseDeprecated(name(), ": henryConstant_dT() is deprecated. Use henryConstant() instead");
382 
383  henryConstant(T, Kh, dKh_dT);
384 }
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 274 of file SinglePhaseFluidProperties.C.

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

275 {
276  const Real Tr = T / 647.096;
277  const Real tau = 1.0 - Tr;
278 
279  const Real lnkh =
280  A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
281 
282  // The vapor pressure used in this formulation
283  const std::vector<Real> a{
284  -7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
285  const std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
286  Real sum = 0.0;
287 
288  for (std::size_t i = 0; i < a.size(); ++i)
289  sum += a[i] * std::pow(tau, b[i]);
290 
291  return 22.064e6 * std::exp(sum / Tr) * std::exp(lnkh);
292 }
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 295 of file SinglePhaseFluidProperties.C.

297 {
298  const Real pc = 22.064e6;
299  const Real Tc = 647.096;
300 
301  const Real Tr = T / Tc;
302  const Real tau = 1.0 - Tr;
303 
304  const Real lnkh =
305  A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
306  const Real dlnkh_dT =
307  (-A / Tr / Tr - B * std::pow(tau, 0.355) / Tr / Tr - 0.355 * B * std::pow(tau, -0.645) / Tr -
308  0.41 * C * std::pow(Tr, -1.41) * std::exp(tau) - C * std::pow(Tr, -0.41) * std::exp(tau)) /
309  Tc;
310 
311  // The vapor pressure used in this formulation
312  const std::vector<Real> a{
313  -7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
314  const std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
315  Real sum = 0.0;
316  Real dsum = 0.0;
317 
318  for (std::size_t i = 0; i < a.size(); ++i)
319  {
320  sum += a[i] * std::pow(tau, b[i]);
321  dsum += a[i] * b[i] * std::pow(tau, b[i] - 1.0);
322  }
323 
324  const Real p = pc * std::exp(sum / Tr);
325  const Real dp_dT = -p / Tc / Tr * (sum / Tr + dsum);
326 
327  // Henry's constant and its derivative wrt temperature
328  Kh = p * std::exp(lnkh);
329  dKh_dT = (p * dlnkh_dT + dp_dT) * std::exp(lnkh);
330 }
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 333 of file SinglePhaseFluidProperties.C.

335 {
336  mooseDeprecated(name(),
337  ":henryConstantIAPWS_dT() is deprecated. Use henryConstantIAPWS() instead");
338 
339  henryConstantIAPWS(T, Kh, dKh_dT, A, B, C);
340 }
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

◆ k_dpT()

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

Definition at line 579 of file SinglePhaseFluidProperties.C.

580 {
581  mooseDeprecated(name(), ": k_dpT() is deprecated. Use k_from_p_T() instead");
582 
583  k_from_p_T(p, T, k, dk_dp, dk_dT);
584 }
virtual Real k(Real pressure, Real temperature) const
const std::string name
Definition: Setup.h:22
virtual Real k_from_p_T(Real pressure, Real temperature) const
Thermal conductivity.

◆ k_from_p_T() [1/2]

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

Thermal conductivity.

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 649 of file CO2FluidProperties.C.

Referenced by k_from_p_T().

650 {
651  // Require density first
654 }
virtual Real k_from_rho_T(Real density, Real temperature) const override
Thermal conductivity as a function of density and temperature.
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
Density from pressure and temperature.
const std::string pressure
Definition: NS.h:26

◆ k_from_p_T() [2/2]

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

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 657 of file CO2FluidProperties.C.

659 {
660  k = this->k_from_p_T(pressure, temperature);
661  // Calculate derivatives using finite differences. Note: this will be slow as
662  // multiple calculations of density are required
663  const Real eps = 1.0e-6;
664  const Real peps = pressure * eps;
665  const Real Teps = temperature * eps;
666 
667  dk_dp = (this->k_from_p_T(pressure + peps, temperature) - k) / peps;
668  dk_dT = (this->k_from_p_T(pressure, temperature + Teps) - k) / Teps;
669 }
const std::string temperature
Definition: NS.h:27
virtual Real k(Real pressure, Real temperature) const
virtual Real k_from_p_T(Real pressure, Real temperature) const override
Thermal conductivity.
const std::string pressure
Definition: NS.h:26

◆ k_from_rho_T()

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

Thermal conductivity as a function of density and temperature.

Parameters
densityfluid density (kg/m^3)
temperaturefluid temperature (K)
Returns
thermal conductivity (W/m/K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 672 of file CO2FluidProperties.C.

Referenced by k_from_p_T().

673 {
674  // Check the temperature is in the range of validity (216.592 K <= T <= 1000 K)
675  if (temperature <= _triple_point_temperature || temperature >= 1000.0)
676  throw MooseException("Temperature " + Moose::stringify(temperature) +
677  "K out of range (200K, 1000K) in " + name() + ": k()");
678 
679  // Scaled variables
681  Real rhor = density / _critical_density;
682 
683  Real sum1 = 0.0;
684  for (std::size_t i = 0; i < _k_n1.size(); ++i)
685  sum1 += _k_n1[i] * std::pow(Tr, _k_g1[i]) * MathUtils::pow(rhor, _k_h1[i]);
686 
687  Real sum2 = 0.0;
688  for (std::size_t i = 0; i < _k_n2.size(); ++i)
689  sum2 += _k_n2[i] * std::pow(Tr, _k_g2[i]) * MathUtils::pow(rhor, _k_h2[i]);
690 
691  // Near-critical enhancement
692  Real alpha =
693  1.0 - _k_a[9] * std::acosh(1.0 + _k_a[10] * std::pow(Utility::pow<2>(1.0 - Tr), _k_a[11]));
694  Real lambdac =
695  rhor *
696  std::exp(-std::pow(rhor, _k_a[0]) / _k_a[0] - Utility::pow<2>(_k_a[1] * (Tr - 1.0)) -
697  Utility::pow<2>(_k_a[2] * (rhor - 1.0))) /
698  std::pow(std::pow(Utility::pow<2>(
699  1.0 - 1.0 / Tr +
700  _k_a[3] * std::pow(Utility::pow<2>(rhor - 1.0), 1.0 / (2.0 * _k_a[4]))),
701  _k_a[5]) +
702  std::pow(Utility::pow<2>(_k_a[6] * (rhor - alpha)), _k_a[7]),
703  _k_a[8]);
704 
705  return 4.81384 * (sum1 + std::exp(-5.0 * rhor * rhor) * sum2 + 0.775547504 * lambdac) / 1000.0;
706 }
const std::array< Real, 7 > _k_n2
const Real _critical_density
Critical density (kg/m^3)
const std::array< Real, 3 > _k_g1
Coefficients for the thermal conductivity.
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const std::array< unsigned int, 7 > _k_h2
const std::array< unsigned int, 3 > _k_h1
const std::string name
Definition: Setup.h:22
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _critical_temperature
Critical temperature (K)
const std::array< Real, 12 > _k_a
const std::array< Real, 3 > _k_n1
const std::array< Real, 7 > _k_g2
virtual Real alpha(Real delta, Real tau) const override
Helmholtz free energy.

◆ k_from_v_e()

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

Thermal conductivity from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 82 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), GeneralVaporMixtureFluidProperties::k_from_p_T(), IdealRealGasMixtureFluidProperties::k_from_p_T(), and IdealRealGasMixtureFluidProperties::k_from_T_v().

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

◆ meltingPressure()

Real CO2FluidProperties::meltingPressure ( Real  temperature) const

Melting pressure.

Used to delineate solid and liquid phases Valid for temperatures greater than the triple point temperature

Eq. 3.10, from Span and Wagner (reference above)

Parameters
temperatureCO2 temperature (K)
Returns
melting pressure (Pa)

Definition at line 78 of file CO2FluidProperties.C.

Referenced by rho_from_p_T().

79 {
81  throw MooseException("Temperature is below the triple point temperature in " + name() +
82  ": meltingPressure()");
83 
85 
86  return _triple_point_pressure *
87  (1.0 + 1955.539 * (Tstar - 1.0) + 2055.4593 * Utility::pow<2>(Tstar - 1.0));
88 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const Real _triple_point_temperature
Triple point temperature (K)
const Real _triple_point_pressure
Triple point pressure (Pa)

◆ molarMass()

Real CO2FluidProperties::molarMass ( ) const
overridevirtual

Molar mass [kg/mol].

Returns
molar mass

Reimplemented from SinglePhaseFluidProperties.

Definition at line 42 of file CO2FluidProperties.C.

43 {
44  return _Mco2;
45 }
const Real _Mco2
Molar mass of CO2 (kg/mol)

◆ mu()

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

◆ mu_dpT()

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

Dynamic viscosity and its derivatives wrt pressure and temperature.

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

Definition at line 502 of file SinglePhaseFluidProperties.C.

503 {
504  mooseDeprecated(name(), ": mu_dpT() is deprecated. Use mu_from_p_T() instead");
505 
506  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
507 }
virtual Real mu_from_p_T(Real pressure, Real temperature) const
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 354 of file SinglePhaseFluidProperties.C.

356 {
357  mooseDeprecated(name(), ":mu_drhoT_from_rho_T() is deprecated. Use mu_from_rho_T() instead");
358 
359  mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
360 }
virtual Real mu_from_rho_T(Real density, Real temperature) const
Dynamic viscosity as a function of density and temperature.
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
virtual Real rho(Real p, Real T) const
const std::string name
Definition: Setup.h:22

◆ mu_from_p_T() [1/2]

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 509 of file CO2FluidProperties.C.

510 {
512  return mu_from_rho_T(rho, temperature);
513 }
const std::string temperature
Definition: NS.h:27
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
Density from pressure and temperature.
const std::string pressure
Definition: NS.h:26
virtual Real mu_from_rho_T(Real density, Real temperature) const override
Dynamic viscosity as a function of density and temperature.

◆ mu_from_p_T() [2/2]

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 516 of file CO2FluidProperties.C.

518 {
519  Real rho, drho_dp, drho_dT;
521 
522  Real dmu_drho;
523  mu_from_rho_T(rho, temperature, drho_dT, mu, dmu_drho, dmu_dT);
524  dmu_dp = dmu_drho * drho_dp;
525 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string temperature
Definition: NS.h:27
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
Density from pressure and temperature.
const std::string pressure
Definition: NS.h:26
virtual Real mu_from_rho_T(Real density, Real temperature) const override
Dynamic viscosity as a function of density and temperature.

◆ mu_from_rho_T() [1/2]

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

Dynamic viscosity as a function of density and temperature.

Parameters
densityfluid density (kg/m^3)
temperaturefluid temperature (K)
Returns
viscosity (Pa.s)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 528 of file CO2FluidProperties.C.

Referenced by mu_from_p_T(), and rho_mu_from_p_T().

529 {
530  // Check that the input parameters are within the region of validity
531  if (temperature < 216.0 || temperature > 1000.0 || density > 1400.0)
532  throw MooseException("Parameters out of range in " + name() + ": mu_from_rho_T()");
533 
534  Real Tstar = temperature / 251.196;
535 
536  // Viscosity in the zero-density limit
537  Real sum = 0.0;
538 
539  for (std::size_t i = 0; i < _mu_a.size(); ++i)
540  sum += _mu_a[i] * MathUtils::pow(std::log(Tstar), i);
541 
542  Real mu0 = 1.00697 * std::sqrt(temperature) / std::exp(sum);
543 
544  // Excess viscosity due to finite density
545  Real mue = _mu_d[0] * density + _mu_d[1] * Utility::pow<2>(density) +
546  _mu_d[2] * Utility::pow<6>(density) / Utility::pow<3>(Tstar) +
547  _mu_d[3] * Utility::pow<8>(density) + _mu_d[4] * Utility::pow<8>(density) / Tstar;
548 
549  return (mu0 + mue) * 1.0e-6; // convert to Pa.s
550 }
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::array< Real, 5 > _mu_a
Coefficients for viscosity.
const std::array< Real, 5 > _mu_d
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ mu_from_rho_T() [2/2]

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

Dynamic viscosity and its derivatives wrt density and temperature.

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 553 of file CO2FluidProperties.C.

559 {
560  // Check that the input parameters are within the region of validity
561  if (temperature < 216.0 || temperature > 1000.0 || density > 1400.0)
562  throw MooseException("Parameters out of range in " + name() + ": mu_drhoT()");
563 
564  Real Tstar = temperature / 251.196;
565  Real dTstar_dT = 1.0 / 251.196;
566 
567  // Viscosity in the zero-density limit. Note this is only a function of T.
568  // Start the sum at i = 1 so the derivative is defined
569  Real sum0 = _mu_a[0], dsum0_dTstar = 0.0;
570 
571  for (std::size_t i = 1; i < _mu_a.size(); ++i)
572  {
573  sum0 += _mu_a[i] * MathUtils::pow(std::log(Tstar), i);
574  dsum0_dTstar += i * _mu_a[i] * MathUtils::pow(std::log(Tstar), i - 1) / Tstar;
575  }
576 
577  Real mu0 = 1.00697 * std::sqrt(temperature) / std::exp(sum0);
578  Real dmu0_dT = (0.5 * 1.00697 / std::sqrt(temperature) -
579  1.00697 * std::sqrt(temperature) * dsum0_dTstar * dTstar_dT) /
580  std::exp(sum0);
581 
582  // Excess viscosity due to finite density
583  Real mue = _mu_d[0] * density + _mu_d[1] * Utility::pow<2>(density) +
584  _mu_d[2] * Utility::pow<6>(density) / Utility::pow<3>(Tstar) +
585  _mu_d[3] * Utility::pow<8>(density) + _mu_d[4] * Utility::pow<8>(density) / Tstar;
586 
587  Real dmue_drho = _mu_d[0] + 2.0 * _mu_d[1] * density +
588  6.0 * _mu_d[2] * Utility::pow<5>(density) / Utility::pow<3>(Tstar) +
589  8.0 * _mu_d[3] * Utility::pow<7>(density) +
590  8.0 * _mu_d[4] * Utility::pow<7>(density) / Tstar;
591 
592  Real dmue_dT = (-3.0 * _mu_d[2] * Utility::pow<6>(density) / Utility::pow<4>(Tstar) -
593  _mu_d[4] * Utility::pow<8>(density) / Tstar / Tstar) *
594  dTstar_dT;
595 
596  // Viscosity in Pa.s is
597  mu = (mu0 + mue) * 1.0e-6;
598  dmu_drho = dmue_drho * 1.0e-6;
599  dmu_dT = (dmu0_dT + dmue_dT) * 1.0e-6 + dmu_drho * ddensity_dT;
600 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::array< Real, 5 > _mu_a
Coefficients for viscosity.
const std::array< Real, 5 > _mu_d
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real e(Real pressure, Real temperature) const

◆ mu_from_v_e()

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

Dynamic viscosity from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 77 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), GeneralVaporMixtureFluidProperties::mu_from_p_T(), IdealRealGasMixtureFluidProperties::mu_from_p_T(), and IdealRealGasMixtureFluidProperties::mu_from_T_v().

78 {
79  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
80 }
const std::string name
Definition: Setup.h:22

◆ p_from_h_s() [1/2]

Real SinglePhaseFluidProperties::p_from_h_s ( Real  h,
Real  s 
) const
virtualinherited

Pressure from specific enthalpy and specific entropy.

Parameters
[in]hspecific enthalpy
[in]sspecific entropy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 711 of file SinglePhaseFluidProperties.C.

Referenced by StagnationPressureAux::computeValue(), and StagnationTemperatureAux::computeValue().

712 {
713  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
714 }
const std::string name
Definition: Setup.h:22

◆ p_from_h_s() [2/2]

void SinglePhaseFluidProperties::p_from_h_s ( Real  h,
Real  s,
Real &  p,
Real &  dp_dh,
Real &  dp_ds 
) const
virtualinherited

Pressure and its derivatives from specific enthalpy and specific entropy.

Parameters
[in]hspecific enthalpy
[in]sspecific entropy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 717 of file SinglePhaseFluidProperties.C.

718 {
719  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
720 }
const std::string name
Definition: Setup.h:22

◆ p_from_rho_T()

Real CO2FluidProperties::p_from_rho_T ( Real  rho,
Real  T 
) const
overridevirtual

Pressure as a function of density and temperature.

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

Reimplemented from HelmholtzFluidProperties.

Definition at line 447 of file CO2FluidProperties.C.

Referenced by rho_from_p_T().

448 {
449  // Check that the input parameters are within the region of validity
450  if (temperature < 216.0 || temperature > 1100.0 || density <= 0.0)
451  throw MooseException("Parameters out of range in " + name() + ": pressure()");
452 
453  Real pressure = 0.0;
454 
456  {
457  Real gas_density = saturatedVaporDensity(temperature);
458  Real liquid_density = saturatedLiquidDensity(temperature);
459 
460  if (density < gas_density || density > liquid_density)
462  else
464  }
465  else
467 
468  return pressure;
469 }
Real saturatedLiquidDensity(Real temperature) const
Saturated liquid density of CO2 Valid for temperatures between the triple point temperature and criti...
virtual Real vaporPressure(Real temperature) const override
Vapor pressure.
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
Real saturatedVaporDensity(Real temperature) const
Saturated vapor density of CO2 Valid for temperatures between the triple point temperature and critic...
const std::string name
Definition: Setup.h:22
const Real _triple_point_temperature
Triple point temperature (K)
virtual Real p_from_rho_T(Real rho, Real T) const
Pressure as a function of density and temperature.
const Real _critical_temperature
Critical temperature (K)
const std::string pressure
Definition: NS.h:26

◆ p_from_T_v() [1/2]

Real SinglePhaseFluidProperties::p_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Pressure from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 662 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::p_from_T_v().

663 {
664  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
665 }
const std::string name
Definition: Setup.h:22

◆ p_from_T_v() [2/2]

void SinglePhaseFluidProperties::p_from_T_v ( Real  T,
Real  v,
Real &  p,
Real &  dp_dT,
Real &  dp_dv 
) const
virtualinherited

Pressure and its derivatives from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume
[out]ppressure (Pa)
[out]dp_dTderivative of pressure w.r.t. temperature
[out]dp_dvderivative of pressure w.r.t. specific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 668 of file SinglePhaseFluidProperties.C.

669 {
670  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
671 }
const std::string name
Definition: Setup.h:22

◆ p_from_v_e() [1/2]

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

Pressure from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, StiffenedGasFluidProperties, and NaNInterfaceTestFluidProperties.

Definition at line 28 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), PressureAux::computeValue(), StagnationPressureAux::computeValue(), and StagnationTemperatureAux::computeValue().

29 {
30  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
31 }
const std::string name
Definition: Setup.h:22

◆ p_from_v_e() [2/2]

void SinglePhaseFluidProperties::p_from_v_e ( Real  v,
Real  e,
Real &  p,
Real &  dp_dv,
Real &  dp_de 
) const
virtualinherited

Pressure and its derivatives from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
[out]ppressure
[out]dp_dvderivative of pressure w.r.t. specific volume
[out]dp_dederivative of pressure w.r.t. specific internal energy

Reimplemented in IdealGasFluidProperties, StiffenedGasFluidProperties, and NaNInterfaceTestFluidProperties.

Definition at line 34 of file SinglePhaseFluidProperties.C.

35 {
36  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
37 }
const std::string name
Definition: Setup.h:22

◆ partialDensity()

Real CO2FluidProperties::partialDensity ( Real  temperature) const

Partial density of dissolved CO2 From Garcia, Density of aqueous solutions of CO2, LBNL-49023 (2001)

Parameters
temperaturefluid temperature (K)
Returns
partial molar density (kg/m^3)

Definition at line 626 of file CO2FluidProperties.C.

627 {
628  // This correlation uses temperature in C
629  Real Tc = temperature - _T_c2k;
630  // The parial volume
631  Real V = 37.51 - 9.585e-2 * Tc + 8.74e-4 * Tc * Tc - 5.044e-7 * Tc * Tc * Tc;
632 
633  return 1.0e6 * _Mco2 / V;
634 }
const Real _T_c2k
Conversion of temperature from Celsius to Kelvin.
const std::string temperature
Definition: NS.h:27
const Real _Mco2
Molar mass of CO2 (kg/mol)

◆ pp_sat_from_p_T()

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

Partial pressure at saturation in a gas mixture.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
Returns
pp_sat (Pa)

Reimplemented in StiffenedGasFluidProperties.

Definition at line 208 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::xs_prim_from_p_T().

209 {
210  mooseError(name(), ": pp_sat_from_p_T is not implemented");
211 }
const std::string name
Definition: Setup.h:22

◆ rho()

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

Definition at line 616 of file SinglePhaseFluidProperties.C.

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(), 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(), 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(), 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().

617 {
618  mooseDeprecated(name(), ": rho() is deprecated. Use rho_from_p_T() instead");
619 
620  return rho_from_p_T(p, T);
621 }
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
const std::string name
Definition: Setup.h:22

◆ rho_dpT()

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

Definition at line 406 of file SinglePhaseFluidProperties.C.

408 {
409  mooseDeprecated(name(), ": rho_dpT() is deprecated. Use rho_from_p_T() instead");
410 
411  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
412 }
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
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 445 of file SinglePhaseFluidProperties.C.

453 {
454  mooseDeprecated(name(), ": rho_e_dpT() is deprecated. Use rho_e_from_p_T() instead");
455 
456  rho_e_from_p_T(p, T, rho, drho_dp, drho_dT, e, de_dp, de_dT);
457 }
virtual Real rho(Real p, Real T) const
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 431 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::rho_e_dpT().

439 {
440  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
441  e_from_p_T(p, T, e, de_dp, de_dT);
442 }
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
virtual Real e(Real pressure, Real temperature) const

◆ rho_from_p_s() [1/2]

Real SinglePhaseFluidProperties::rho_from_p_s ( Real  p,
Real  s 
) const
virtualinherited

Density from pressure and specific entropy.

Parameters
[in]ppressure
[in]sspecific entropy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 109 of file SinglePhaseFluidProperties.C.

Referenced by StagnationTemperatureAux::computeValue(), and SinglePhaseFluidProperties::T_from_p_h().

110 {
111  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
112 }
const std::string name
Definition: Setup.h:22

◆ rho_from_p_s() [2/2]

void SinglePhaseFluidProperties::rho_from_p_s ( Real  p,
Real  s,
Real &  rho,
Real &  drho_dp,
Real &  drho_ds 
) const
virtualinherited

Density and its derivatives from pressure and specific entropy.

Parameters
[in]ppressure
[in]sspecific entropy
[out]rhodensity
[out]drho_dpderivative of density w.r.t. pressure
[out]drho_dsderivative of density w.r.t. specific entropy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 115 of file SinglePhaseFluidProperties.C.

116 {
117  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
118 }
const std::string name
Definition: Setup.h:22

◆ rho_from_p_T() [1/2]

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

Density from pressure and temperature.

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

Reimplemented from HelmholtzFluidProperties.

Definition at line 472 of file CO2FluidProperties.C.

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

473 {
474  // Check that the input parameters are within the region of validity
475  if (temperature < 216.0 || temperature > 1100.0 || pressure <= 0.0)
476  throw MooseException("Parameters out of range in " + name() + ": rho_from_p_T()");
477 
478  // Also check that the pressure and temperature are not in the solid phase region
481  throw MooseException("Input pressure and temperature in " + name() +
482  ": rho_from_p_T() correspond to solid CO2 phase");
483 
484  Real density;
485  // Initial estimate of a bracketing interval for the density
486  Real lower_density = 100.0;
487  Real upper_density = 1000.0;
488 
489  // The density is found by finding the zero of the pressure calculated using the
490  // Span and Wagner EOS minus the input pressure
491  auto pressure_diff = [&pressure, &temperature, this](Real x) {
492  return p_from_rho_T(x, temperature) - pressure;
493  };
494 
495  BrentsMethod::bracket(pressure_diff, lower_density, upper_density);
496  density = BrentsMethod::root(pressure_diff, lower_density, upper_density);
497 
498  return density;
499 }
Real sublimationPressure(Real temperature) const
Sublimation pressure.
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
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
const Real _triple_point_temperature
Triple point temperature (K)
virtual Real p_from_rho_T(Real density, Real temperature) const override
Pressure as a function of density and temperature.
const std::string pressure
Definition: NS.h:26
Real meltingPressure(Real temperature) const
Melting pressure.
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 CO2FluidProperties::rho_from_p_T ( Real  p,
Real  T,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
overridevirtual

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

Reimplemented from HelmholtzFluidProperties.

Definition at line 502 of file CO2FluidProperties.C.

504 {
506 }
const std::string temperature
Definition: NS.h:27
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
Density from pressure and temperature.
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 516 of file SinglePhaseFluidProperties.C.

517 {
518  mooseDeprecated(name(), ": rho_mu() is deprecated. Use rho_mu_from_p_T() instead");
519 
520  rho_mu_from_p_T(p, T, rho, mu);
521 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
virtual Real rho(Real p, Real T) const
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 531 of file SinglePhaseFluidProperties.C.

539 {
540  mooseDeprecated(name(), ": rho_mu_dpT() is deprecated. Use rho_mu_from_p_T() instead");
541 
542  rho_mu_from_p_T(p, T, rho, drho_dp, drho_dT, mu, dmu_dp, dmu_dT);
543 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
virtual Real rho(Real p, Real T) const
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 CO2FluidProperties::rho_mu_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  mu 
) const
overridevirtual

Reimplemented from SinglePhaseFluidProperties.

Definition at line 603 of file CO2FluidProperties.C.

604 {
607 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string temperature
Definition: NS.h:27
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
Density from pressure and temperature.
const std::string pressure
Definition: NS.h:26
virtual Real mu_from_rho_T(Real density, Real temperature) const override
Dynamic viscosity as a function of density and temperature.

◆ rho_mu_from_p_T() [2/2]

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

Density and viscosity and their derivatives wrt pressure and temperature.

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 610 of file CO2FluidProperties.C.

618 {
619  rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
620  Real dmu_drho;
621  mu_from_rho_T(rho, temperature, drho_dT, mu, dmu_drho, dmu_dT);
622  dmu_dp = dmu_drho * drho_dp;
623 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string temperature
Definition: NS.h:27
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
Density from pressure and temperature.
const std::string pressure
Definition: NS.h:26
virtual Real mu_from_rho_T(Real density, Real temperature) const override
Dynamic viscosity as a function of density and temperature.

◆ s()

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

◆ s_from_h_p() [1/2]

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

Specific entropy from specific enthalpy and pressure.

Parameters
[in]hspecific enthalpy
[in]ppressure

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 98 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::T_from_p_h().

99 {
100  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
101 }
const std::string name
Definition: Setup.h:22

◆ s_from_h_p() [2/2]

void SinglePhaseFluidProperties::s_from_h_p ( Real  h,
Real  p,
Real &  s,
Real &  ds_dh,
Real &  ds_dp 
) const
virtualinherited

Specific entropy and its derivatives from specific enthalpy and pressure.

Parameters
[in]hspecific enthalpy
[in]ppressure
[out]sspecific entropy
[out]ds_dhderivative of specific entropy w.r.t. specific enthalpy
[out]ds_dpderivative of specific entropy w.r.t. pressure

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 104 of file SinglePhaseFluidProperties.C.

105 {
106  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
107 }
const std::string name
Definition: Setup.h:22

◆ s_from_p_T() [1/2]

Real HelmholtzFluidProperties::s_from_p_T ( Real  p,
Real  T 
) const
overridevirtualinherited

Specific entropy from pressure and temperature.

Parameters
[in]ppressure
[in]Ttemperature

Reimplemented from SinglePhaseFluidProperties.

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
Density from pressure and temperature.
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

Specific entropy and its derivatives from pressure and temperature.

Parameters
[in]ppressure
[in]Ttemperature
[out]sspecific entropy
[out]ds_dpderivative of specific entropy w.r.t. pressure
[out]ds_dTderivative of specific entropy w.r.t. temperature

Reimplemented from SinglePhaseFluidProperties.

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.
virtual 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
Density from pressure and temperature.
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
Specific entropy from pressure and temperature.
const std::string pressure
Definition: NS.h:26

◆ s_from_T_v() [1/2]

Real SinglePhaseFluidProperties::s_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Specific entropy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 684 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::s_from_T_v().

685 {
686  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
687 }
const std::string name
Definition: Setup.h:22

◆ s_from_T_v() [2/2]

void SinglePhaseFluidProperties::s_from_T_v ( Real  T,
Real  v,
Real &  s,
Real &  ds_dT,
Real &  ds_dv 
) const
virtualinherited

Specific entropy and its derivatives from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume
[out]sspecific entropy (J/kg)
[out]ds_dTderivative of specific entropy w.r.t. temperature
[out]ds_dvderivative of specific entropy w.r.t. specific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 690 of file SinglePhaseFluidProperties.C.

691 {
692  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
693 }
const std::string name
Definition: Setup.h:22

◆ s_from_v_e() [1/2]

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

Specific entropy from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 87 of file SinglePhaseFluidProperties.C.

Referenced by StagnationPressureAux::computeValue(), and StagnationTemperatureAux::computeValue().

88 {
89  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
90 }
const std::string name
Definition: Setup.h:22

◆ s_from_v_e() [2/2]

void SinglePhaseFluidProperties::s_from_v_e ( Real  v,
Real  e,
Real &  s,
Real &  ds_dv,
Real &  ds_de 
) const
virtualinherited

Specific entropy and its derivatives from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
[out]sspecific entropy
[out]ds_dvderivative of specific entropy w.r.t. specific volume
[out]ds_dederivative of specific entropy w.r.t. specific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 93 of file SinglePhaseFluidProperties.C.

94 {
95  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
96 }
const std::string name
Definition: Setup.h:22

◆ saturatedLiquidDensity()

Real CO2FluidProperties::saturatedLiquidDensity ( Real  temperature) const

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

Eq. 3.14, from Span and Wagner (reference above)

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

Definition at line 130 of file CO2FluidProperties.C.

Referenced by p_from_rho_T().

131 {
132  if (temperature < _triple_point_temperature || temperature > _critical_temperature)
133  throw MooseException("Temperature is out of range in " + name() + ": saturatedLiquiDensity()");
134 
135  Real Tstar = temperature / _critical_temperature;
136 
137  Real logdensity = 1.9245108 * std::pow(1.0 - Tstar, 0.34) -
138  0.62385555 * std::pow(1.0 - Tstar, 0.5) -
139  0.32731127 * std::pow(1.0 - Tstar, 10.0 / 6.0) +
140  0.39245142 * std::pow(1.0 - Tstar, 11.0 / 6.0);
141 
142  return _critical_density * std::exp(logdensity);
143 }
const Real _critical_density
Critical density (kg/m^3)
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 _critical_temperature
Critical temperature (K)

◆ saturatedVaporDensity()

Real CO2FluidProperties::saturatedVaporDensity ( Real  temperature) const

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

Eq. 3.15, from Span and Wagner (reference above)

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

Definition at line 146 of file CO2FluidProperties.C.

Referenced by p_from_rho_T().

147 {
148  if (temperature < _triple_point_temperature || temperature > _critical_temperature)
149  throw MooseException("Temperature is out of range in " + name() + ": saturatedVaporDensity()");
150 
151  Real Tstar = temperature / _critical_temperature;
152 
153  Real logdensity =
154  (-1.7074879 * std::pow(1.0 - Tstar, 0.34) - 0.82274670 * std::pow(1.0 - Tstar, 0.5) -
155  4.6008549 * (1.0 - Tstar) - 10.111178 * std::pow(1.0 - Tstar, 7.0 / 3.0) -
156  29.742252 * std::pow(1.0 - Tstar, 14.0 / 3.0));
157 
158  return _critical_density * std::exp(logdensity);
159 }
const Real _critical_density
Critical density (kg/m^3)
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 _critical_temperature
Critical temperature (K)

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Definition at line 32 of file FluidProperties.h.

32 {}

◆ sublimationPressure()

Real CO2FluidProperties::sublimationPressure ( Real  temperature) const

Sublimation pressure.

Used to delineate solid and gas phases Valid for temperatures less than the triple point temperature

Eq. 3.12, from Span and Wagner (reference above)

Parameters
temperatureCO2 temperature (K)
Returns
sublimation pressure (Pa)

Definition at line 91 of file CO2FluidProperties.C.

Referenced by rho_from_p_T().

92 {
94  throw MooseException("Temperature is above the triple point temperature in " + name() +
95  ": sublimationPressure()");
96 
98 
100  std::exp((-14.740846 * (1.0 - Tstar) + 2.4327015 * std::pow(1.0 - Tstar, 1.9) -
101  5.3061778 * std::pow(1.0 - Tstar, 2.9)) /
102  Tstar);
103 
104  return pressure;
105 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const Real _triple_point_temperature
Triple point temperature (K)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::string pressure
Definition: NS.h:26
const Real _triple_point_pressure
Triple point pressure (Pa)

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

729 {
730  const Real s = s_from_h_p(h, p);
731  const Real rho = rho_from_p_s(p, s);
732  const Real v = 1. / rho;
733  const Real e = e_from_v_h(v, h);
734  return T_from_v_e(v, e);
735 }
virtual Real T_from_v_e(Real v, Real e) const
Temperature from specific volume and specific internal energy.
virtual Real s(Real pressure, Real temperature) const
virtual Real h(Real p, Real T) const
virtual Real s_from_h_p(Real h, Real p) const
Specific entropy from specific enthalpy and pressure.
virtual Real rho(Real p, Real T) const
virtual Real e_from_v_h(Real v, Real h) const
Specific internal energy as a function of specific volume and specific enthalpy.
virtual Real rho_from_p_s(Real p, Real s) const
Density from pressure and specific entropy.
virtual Real e(Real pressure, Real temperature) const

◆ T_from_v_e() [1/2]

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

Temperature from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
Returns
sound speed

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 39 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), StagnationTemperatureAux::computeValue(), TemperatureAux::computeValue(), IdealRealGasMixtureFluidProperties::p_T_from_v_e(), and SinglePhaseFluidProperties::T_from_p_h().

40 {
41  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
42 }
const std::string name
Definition: Setup.h:22

◆ T_from_v_e() [2/2]

void SinglePhaseFluidProperties::T_from_v_e ( Real  v,
Real  e,
Real &  T,
Real &  dT_dv,
Real &  dT_de 
) const
virtualinherited

Temperature and its derivatives from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
[out]Ttemperature
[out]dT_dvderivative of temperature w.r.t. specific volume
[out]dT_dederivative of temperature w.r.t. specific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 45 of file SinglePhaseFluidProperties.C.

46 {
47  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
48 }
const std::string name
Definition: Setup.h:22

◆ threadJoin()

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

Definition at line 31 of file FluidProperties.h.

31 {}

◆ triplePointPressure()

Real CO2FluidProperties::triplePointPressure ( ) const
overridevirtual

Triple point pressure.

Returns
triple point pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 66 of file CO2FluidProperties.C.

67 {
69 }
const Real _triple_point_pressure
Triple point pressure (Pa)

◆ triplePointTemperature()

Real CO2FluidProperties::triplePointTemperature ( ) const
overridevirtual

Triple point temperature.

Returns
triple point temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 72 of file CO2FluidProperties.C.

73 {
75 }
const Real _triple_point_temperature
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 651 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::v_from_p_T().

652 {
653  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
654 }
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

Specific volume from pressure and temperature.

Parameters
[in]ppressure
[in]Ttemperature

Definition at line 157 of file SinglePhaseFluidProperties.C.

Referenced by GeneralVaporMixtureFluidProperties::c_from_p_T(), GeneralVaporMixtureFluidProperties::cp_from_p_T(), GeneralVaporMixtureFluidProperties::cv_from_p_T(), GeneralVaporMixtureFluidProperties::k_from_p_T(), GeneralVaporMixtureFluidProperties::mu_from_p_T(), GeneralVaporMixtureFluidProperties::v_from_p_T(), and IdealRealGasMixtureFluidProperties::xs_prim_from_p_T().

158 {
159  const Real rho = rho_from_p_T(p, T);
160  return 1.0 / rho;
161 }
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.

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

165 {
166  Real rho, drho_dp, drho_dT;
167  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
168 
169  v = 1.0 / rho;
170  const Real dv_drho = -1.0 / (rho * rho);
171 
172  dv_dp = dv_drho * drho_dp;
173  dv_dT = dv_drho * drho_dT;
174 }
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.

◆ vaporPressure() [1/2]

Real CO2FluidProperties::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 108 of file CO2FluidProperties.C.

Referenced by p_from_rho_T().

109 {
110  if (temperature < _triple_point_temperature || temperature > _critical_temperature)
111  throw MooseException("Temperature is out of range in " + name() + ": vaporPressure()");
112 
113  Real Tstar = temperature / _critical_temperature;
114 
115  Real logpressure =
116  (-7.0602087 * (1.0 - Tstar) + 1.9391218 * std::pow(1.0 - Tstar, 1.5) -
117  1.6463597 * Utility::pow<2>(1.0 - Tstar) - 3.2995634 * Utility::pow<4>(1.0 - Tstar)) /
118  Tstar;
119 
120  return _critical_pressure * std::exp(logpressure);
121 }
const Real _critical_pressure
Critical pressure (Pa)
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 _critical_temperature
Critical temperature (K)

◆ vaporPressure() [2/2]

void CO2FluidProperties::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 124 of file CO2FluidProperties.C.

125 {
126  mooseError(name(), ": vaporPressure() is not implemented");
127 }
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 398 of file SinglePhaseFluidProperties.C.

399 {
400  mooseDeprecated(name(), ": vaporPressure_dT() is deprecated. Use vaporPressure() instead");
401 
402  vaporPressure(T, psat, dpsat_dT);
403 }
virtual Real vaporPressure(Real temperature) const
Vapor pressure.
const std::string name
Definition: Setup.h:22

Member Data Documentation

◆ _a0

const std::array<Real, 5> CO2FluidProperties::_a0 {{1.99427042, 0.62105248, 0.41195293, 1.04028922, 0.08327678}}
protected

Coefficients for the ideal gas component of the Helmholtz free energy.

Definition at line 195 of file CO2FluidProperties.h.

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

◆ _a4

const std::array<Real, 3> CO2FluidProperties::_a4 {{3.5, 3.5, 3.5}}
protected

◆ _A4

const std::array<Real, 3> CO2FluidProperties::_A4 {{0.7, 0.7, 0.7}}
protected

◆ _alpha3

const std::array<Real, 5> CO2FluidProperties::_alpha3 {{25.0, 25.0, 25.0, 15.0, 20.0}}
protected

◆ _b4

const std::array<Real, 3> CO2FluidProperties::_b4 {{0.875, 0.925, 0.875}}
protected

◆ _B4

const std::array<Real, 3> CO2FluidProperties::_B4 {{0.3, 0.3, 1.0}}
protected

◆ _beta3

const std::array<Real, 5> CO2FluidProperties::_beta3 {{325.0, 300.0, 300.0, 275.0, 275.0}}
protected

◆ _beta4

const std::array<Real, 3> CO2FluidProperties::_beta4 {{0.3, 0.3, 0.3}}
protected

◆ _c2

const std::array<unsigned int, 27> CO2FluidProperties::_c2
protected
Initial value:
{
{1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 6}}

Definition at line 221 of file CO2FluidProperties.h.

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

◆ _C4

const std::array<Real, 3> CO2FluidProperties::_C4 {{10.0, 10.0, 12.5}}
protected

◆ _critical_density

const Real CO2FluidProperties::_critical_density = 467.6
protected

Critical density (kg/m^3)

Definition at line 186 of file CO2FluidProperties.h.

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

◆ _critical_pressure

const Real CO2FluidProperties::_critical_pressure = 7.3773e6
protected

Critical pressure (Pa)

Definition at line 182 of file CO2FluidProperties.h.

Referenced by criticalPressure(), and vaporPressure().

◆ _critical_temperature

const Real CO2FluidProperties::_critical_temperature = 304.1282
protected

◆ _d1

const std::array<unsigned int, 7> CO2FluidProperties::_d1 {{1, 1, 1, 1, 2, 2, 3}}
protected

◆ _d2

const std::array<unsigned int, 27> CO2FluidProperties::_d2
protected
Initial value:
{
{1, 2, 4, 5, 5, 5, 6, 6, 6, 1, 1, 4, 4, 4, 7, 8, 2, 3, 3, 5, 5, 6, 7, 8, 10, 4, 8}}

Definition at line 216 of file CO2FluidProperties.h.

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

◆ _d3

const std::array<unsigned int, 5> CO2FluidProperties::_d3 {{2, 2, 2, 3, 3}}
protected

◆ _D4

const std::array<Real, 3> CO2FluidProperties::_D4 {{275.0, 275.0, 275.0}}
protected

◆ _eps3

const std::array<Real, 5> CO2FluidProperties::_eps3 {{1.0, 1.0, 1.0, 1.0, 1.0}}
protected

◆ _gamma3

const std::array<Real, 5> CO2FluidProperties::_gamma3 {{1.16, 1.19, 1.19, 1.25, 1.25}}
protected

◆ _k_a

const std::array<Real, 12> CO2FluidProperties::_k_a
protected
Initial value:
{
{3.0, 6.70697, 0.94604, 0.3, 0.3, 0.39751, 0.33791, 0.77963, 0.79857, 0.9, 0.02, 0.2}}

Definition at line 253 of file CO2FluidProperties.h.

Referenced by k_from_rho_T().

◆ _k_g1

const std::array<Real, 3> CO2FluidProperties::_k_g1 {{0.0, 0.0, 1.5}}
protected

Coefficients for the thermal conductivity.

Definition at line 246 of file CO2FluidProperties.h.

Referenced by k_from_rho_T().

◆ _k_g2

const std::array<Real, 7> CO2FluidProperties::_k_g2 {{0.0, 1.0, 1.5, 1.5, 1.5, 3.5, 5.5}}
protected

Definition at line 247 of file CO2FluidProperties.h.

Referenced by k_from_rho_T().

◆ _k_h1

const std::array<unsigned int, 3> CO2FluidProperties::_k_h1 {{1, 5, 1}}
protected

Definition at line 248 of file CO2FluidProperties.h.

Referenced by k_from_rho_T().

◆ _k_h2

const std::array<unsigned int, 7> CO2FluidProperties::_k_h2 {{1, 2, 0, 5, 9, 0, 0}}
protected

Definition at line 249 of file CO2FluidProperties.h.

Referenced by k_from_rho_T().

◆ _k_n1

const std::array<Real, 3> CO2FluidProperties::_k_n1 {{7.69857587, 0.159885811, 1.56918621}}
protected

Definition at line 250 of file CO2FluidProperties.h.

Referenced by k_from_rho_T().

◆ _k_n2

const std::array<Real, 7> CO2FluidProperties::_k_n2
protected
Initial value:
{
{-6.73400790, 16.3890156, 3.69415242, 22.3205514, 66.1420950, -0.171779133, 0.00433043347}}

Definition at line 251 of file CO2FluidProperties.h.

Referenced by k_from_rho_T().

◆ _Mco2

const Real CO2FluidProperties::_Mco2 = 44.0098e-3
protected

Molar mass of CO2 (kg/mol)

Definition at line 180 of file CO2FluidProperties.h.

Referenced by molarMass(), and partialDensity().

◆ _mu_a

const std::array<Real, 5> CO2FluidProperties::_mu_a {{0.235156, -0.491266, 5.211155e-2, 5.347906e-2, -1.537102e-2}}
protected

Coefficients for viscosity.

Definition at line 241 of file CO2FluidProperties.h.

Referenced by mu_from_rho_T().

◆ _mu_d

const std::array<Real, 5> CO2FluidProperties::_mu_d
protected
Initial value:
{
{0.4071119e-2, 0.7198037e-4, 0.2411697e-16, 0.2971072e-22, -0.1627888e-22}}

Definition at line 242 of file CO2FluidProperties.h.

Referenced by mu_from_rho_T().

◆ _n1

const std::array<Real, 7> CO2FluidProperties::_n1
protected
Initial value:
{{0.38856823203161,
2.9385475942740,
-5.5867188534934,
-0.76753199592477,
0.31729005580416,
0.54803315897767,
0.12279411220335}}

Coefficients for the residual component of the Helmholtz free energy.

Definition at line 199 of file CO2FluidProperties.h.

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

◆ _n2

const std::array<Real, 27> CO2FluidProperties::_n2
protected
Initial value:
{
{2.1658961543220, 1.5841735109724, -0.23132705405503, 0.058116916431436,
-0.55369137205382, 0.48946615909422, -0.024275739843501, 0.062494790501678,
-0.12175860225246, -0.37055685270086, -0.016775879700426, -0.11960736637987,
-0.045619362508778, 0.035612789270346, -0.0074427727132052, -0.0017395704902432,
-0.021810121289527, 0.024332166559236, -0.037440133423463, 0.14338715756878,
-0.13491969083286, -0.023151225053480, 0.012363125492901, 0.0021058321972940,
-0.00033958519026368, 0.0055993651771592, -0.00030335118055646}}

Definition at line 208 of file CO2FluidProperties.h.

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

◆ _n3

const std::array<Real, 5> CO2FluidProperties::_n3
protected
Initial value:
{
{-213.65488688320, 26641.569149272, -24027.212204557, -283.41603423999, 212.47284400179}}

Definition at line 223 of file CO2FluidProperties.h.

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

◆ _n4

const std::array<Real, 3> CO2FluidProperties::_n4 {{-0.66642276540751, 0.72608632349897, 0.055068668612842}}
protected

◆ _R

const Real SinglePhaseFluidProperties::_R
protectedinherited

◆ _Rco2

const Real CO2FluidProperties::_Rco2 = 188.9241
protected

Specific gas constant (J/mol/K)

Definition at line 192 of file CO2FluidProperties.h.

◆ _t1

const std::array<Real, 7> CO2FluidProperties::_t1 {{0.0, 0.75, 1.0, 2.0, 0.75, 2.0, 0.75}}
protected

◆ _t2

const std::array<Real, 27> CO2FluidProperties::_t2
protected
Initial value:
{{1.5, 1.5, 2.5, 0.0, 1.5, 2.0, 0.0, 1.0, 2.0,
3.0, 6.0, 3.0, 6.0, 8.0, 6.0, 0.0, 7.0, 12.0,
16.0, 22.0, 24.0, 16.0, 24.0, 8.0, 2.0, 28.0, 14.0}}

Definition at line 218 of file CO2FluidProperties.h.

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

◆ _t3

const std::array<unsigned int, 5> CO2FluidProperties::_t3 {{1, 0, 1, 3, 3}}
protected

◆ _T_c2k

const Real SinglePhaseFluidProperties::_T_c2k
protectedinherited

◆ _theta0

const std::array<Real, 5> CO2FluidProperties::_theta0 {{3.15163, 6.11190, 6.77708, 11.32384, 27.08792}}
protected

Definition at line 196 of file CO2FluidProperties.h.

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

◆ _triple_point_pressure

const Real CO2FluidProperties::_triple_point_pressure = 0.51795e6
protected

Triple point pressure (Pa)

Definition at line 188 of file CO2FluidProperties.h.

Referenced by meltingPressure(), sublimationPressure(), and triplePointPressure().

◆ _triple_point_temperature

const Real CO2FluidProperties::_triple_point_temperature = 216.592
protected

Triple point temperature (K)

Definition at line 190 of file CO2FluidProperties.h.

Referenced by meltingPressure(), p_from_rho_T(), rho_from_p_T(), sublimationPressure(), and triplePointTemperature().


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