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

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

#include <MethaneFluidProperties.h>

Inheritance diagram for MethaneFluidProperties:
[legend]

Public Member Functions

 MethaneFluidProperties (const InputParameters &parameters)
 
virtual ~MethaneFluidProperties ()
 
virtual std::string fluidName () const override
 Fluid name. More...
 
virtual Real molarMass () const override
 Molar mass. More...
 
virtual Real rho (Real pressure, Real temperature) const override
 Density. More...
 
virtual void rho_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
 Density and its derivatives wrt pressure and temperature. More...
 
virtual Real e (Real pressure, Real temperature) const override
 Internal energy. More...
 
virtual void e_dpT (Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const override
 Internal energy and its 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 override
 Density and internal energy and their derivatives wrt pressure and temperature. More...
 
virtual Real c (Real pressure, Real temperature) const override
 Speed of sound. More...
 
virtual Real cp (Real pressure, Real temperature) const override
 Isobaric specific heat capacity. More...
 
virtual Real cv (Real pressure, Real temperature) const override
 Isochoric specific heat. More...
 
virtual Real mu (Real pressure, Real temperature) const override
 
virtual void mu_dpT (Real pressure, Real temperature, Real &mu, Real &dmu_dp, Real &dmu_dT) const override
 
virtual Real mu_from_rho_T (Real density, Real temperature) const override
 
virtual void mu_drhoT_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 Real k (Real pressure, Real temperature) const override
 Thermal conductivity. More...
 
virtual void k_dpT (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 s (Real pressure, Real temperature) const override
 Specific entropy. More...
 
virtual Real h (Real pressure, Real temperature) const override
 Specific enthalpy. More...
 
virtual void h_dpT (Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const override
 Enthalpy and its derivatives wrt pressure and temperature. More...
 
virtual Real beta (Real pressure, Real temperature) const override
 Thermal expansion coefficient. More...
 
virtual Real henryConstant (Real temperature) const override
 Henry's law constant for dissolution in water. More...
 
virtual void henryConstant_dT (Real temperature, Real &Kh, Real &dKh_dT) const override
 Henry's law constant for dissolution in water and derivative wrt temperature. More...
 
virtual Real criticalPressure () const
 Methane critical pressure. More...
 
virtual Real criticalTemperature () const
 Methane critical temperature. More...
 
virtual Real criticalDensity () const
 Methane critical density. More...
 
virtual Real gamma (Real pressure, Real temperature) const
 Adiabatic index - ratio of specific heats. More...
 
virtual void execute () final
 
virtual void initialize () final
 
virtual void finalize () final
 

Protected Member Functions

virtual Real henryConstantIAPWS (Real temperature, Real A, Real B, Real C) const
 IAPWS formulation of Henry's law constant for dissolution in water From Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H20 and D20 at high temperatures, IAPWS (2004) More...
 
virtual void henryConstantIAPWS_dT (Real temperature, Real &Kh, Real &dKh_dT, Real A, Real B, Real C) const
 IAPWS formulation of Henry's law constant for dissolution in water and derivative wrt temperature. More...
 

Protected Attributes

const Real _Mch4
 Methane molar mass (kg/mol) More...
 
const Real _p_critical
 Critical pressure (Pa) More...
 
const Real _T_critical
 Critical temperature (K) More...
 
const Real _rho_critical
 Critical density (kg/m^3) More...
 
const Real _beta
 Coefficient of thermal expansion (1/K) More...
 
const Real _R
 Universal gas constant (J/mol/K) More...
 
const Real _T_c2k
 Conversion of temperature from Celcius to Kelvin. More...
 

Detailed Description

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

Density is computed assuming an ideal gas. Viscosity, enthalpy, entropy, thermal conductivity and specific heat calculated from Irvine Jr, T. F. and Liley, P. E. (1984) Steam and Gas Tables with Computer Equations.

Definition at line 27 of file MethaneFluidProperties.h.

Constructor & Destructor Documentation

MethaneFluidProperties::MethaneFluidProperties ( const InputParameters &  parameters)

Definition at line 20 of file MethaneFluidProperties.C.

21  : SinglePhaseFluidPropertiesPT(parameters),
22  _Mch4(16.0425e-3),
23  _p_critical(4.5992e6),
24  _T_critical(190.564),
25  _rho_critical(162.66),
26  _beta(getParam<Real>("beta"))
27 {
28 }
const Real _beta
Coefficient of thermal expansion (1/K)
virtual Real e(Real pressure, Real temperature) const override
Internal energy.
const Real _rho_critical
Critical density (kg/m^3)
const Real _T_critical
Critical temperature (K)
const Real _Mch4
Methane molar mass (kg/mol)
SinglePhaseFluidPropertiesPT(const InputParameters &parameters)
const Real _p_critical
Critical pressure (Pa)
MethaneFluidProperties::~MethaneFluidProperties ( )
virtual

Definition at line 30 of file MethaneFluidProperties.C.

30 {}

Member Function Documentation

Real MethaneFluidProperties::beta ( Real  pressure,
Real  temperature 
) const
overridevirtual

Thermal expansion coefficient.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
beta (1/K)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 309 of file MethaneFluidProperties.C.

309 { return _beta; }
const Real _beta
Coefficient of thermal expansion (1/K)
Real MethaneFluidProperties::c ( Real  pressure,
Real  temperature 
) const
overridevirtual

Speed of sound.

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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 118 of file MethaneFluidProperties.C.

119 {
120  return std::sqrt(gamma(pressure, temperature) * _R * temperature / _Mch4);
121 }
const std::string temperature
Definition: NS.h:25
virtual Real gamma(Real pressure, Real temperature) const
Adiabatic index - ratio of specific heats.
const Real _Mch4
Methane molar mass (kg/mol)
const std::string pressure
Definition: NS.h:24
const Real _R
Universal gas constant (J/mol/K)
Real MethaneFluidProperties::cp ( Real  pressure,
Real  temperature 
) const
overridevirtual

Isobaric specific heat capacity.

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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 124 of file MethaneFluidProperties.C.

Referenced by cv().

125 {
126  // Check the temperature is in the range of validity (280 K <= T <= 1080 K)
127  if (temperature <= 280.0 || temperature >= 1080.0)
128  mooseError("Temperature ", temperature, "K out of range (280K, 1080K) in ", name(), ": cp()");
129 
130  std::vector<Real> a;
131  if (temperature < 755.0)
132  a = {1.9165258, -1.09269e-3, 8.696605e-6, -5.2291144e-9, 0.0, 0.0, 0.0};
133  else
134  a = {1.04356e1, -4.2025284e-2, 8.849006e-5, -8.4304566e-8, 3.9030203e-11, -7.1345169e-15, 0.0};
135 
136  Real specific_heat = 0.0;
137  for (std::size_t i = 0; i < a.size(); ++i)
138  specific_heat += a[i] * std::pow(temperature, i);
139 
140  // convert to J/kg/K by multiplying by 1000
141  return specific_heat * 1000.0;
142 }
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real MethaneFluidProperties::criticalDensity ( ) const
virtual

Methane critical density.

Returns
critical density (kg/m^3)

Definition at line 57 of file MethaneFluidProperties.C.

58 {
59  return _rho_critical;
60 }
const Real _rho_critical
Critical density (kg/m^3)
Real MethaneFluidProperties::criticalPressure ( ) const
virtual

Methane critical pressure.

Returns
critical pressure (Pa)

Definition at line 45 of file MethaneFluidProperties.C.

46 {
47  return _p_critical;
48 }
const Real _p_critical
Critical pressure (Pa)
Real MethaneFluidProperties::criticalTemperature ( ) const
virtual

Methane critical temperature.

Returns
critical temperature (K)

Definition at line 51 of file MethaneFluidProperties.C.

52 {
53  return _T_critical;
54 }
const Real _T_critical
Critical temperature (K)
Real MethaneFluidProperties::cv ( Real  pressure,
Real  temperature 
) const
overridevirtual

Isochoric specific heat.

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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 145 of file MethaneFluidProperties.C.

146 {
147  return cp(pressure, temperature) - _R / _Mch4;
148 }
const std::string temperature
Definition: NS.h:25
const Real _Mch4
Methane molar mass (kg/mol)
const std::string pressure
Definition: NS.h:24
virtual Real cp(Real pressure, Real temperature) const override
Isobaric specific heat capacity.
const Real _R
Universal gas constant (J/mol/K)
Real MethaneFluidProperties::e ( Real  pressure,
Real  temperature 
) const
overridevirtual

Internal energy.

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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 78 of file MethaneFluidProperties.C.

Referenced by e_dpT().

79 {
80  return h(pressure, temperature) - _R * temperature / _Mch4;
81 }
const std::string temperature
Definition: NS.h:25
virtual Real h(Real pressure, Real temperature) const override
Specific enthalpy.
const Real _Mch4
Methane molar mass (kg/mol)
const std::string pressure
Definition: NS.h:24
const Real _R
Universal gas constant (J/mol/K)
void MethaneFluidProperties::e_dpT ( Real  pressure,
Real  temperature,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
overridevirtual

Internal energy and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]einternal energy (J/kg)
[out]de_dpderivative of internal energy wrt pressure
[out]de_dTderivative of internal energy wrt temperature

Implements SinglePhaseFluidPropertiesPT.

Definition at line 84 of file MethaneFluidProperties.C.

Referenced by rho_e_dpT().

86 {
87  e = this->e(pressure, temperature);
88  Real enthalpy, enthalpy_dp, enthalpy_dT;
89  h_dpT(pressure, temperature, enthalpy, enthalpy_dp, enthalpy_dT);
90  de_dp = enthalpy_dp;
91  de_dT = enthalpy_dT - _R / _Mch4;
92 }
virtual void h_dpT(Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const override
Enthalpy and its derivatives wrt pressure and temperature.
virtual Real e(Real pressure, Real temperature) const override
Internal energy.
const std::string temperature
Definition: NS.h:25
const std::string enthalpy
Definition: NS.h:26
const Real _Mch4
Methane molar mass (kg/mol)
const std::string pressure
Definition: NS.h:24
const Real _R
Universal gas constant (J/mol/K)
virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Definition at line 25 of file FluidProperties.h.

25 {}
virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Definition at line 27 of file FluidProperties.h.

27 {}
std::string MethaneFluidProperties::fluidName ( ) const
overridevirtual

Fluid name.

Returns
string representing fluid name

Implements SinglePhaseFluidPropertiesPT.

Definition at line 33 of file MethaneFluidProperties.C.

34 {
35  return "methane";
36 }
Real SinglePhaseFluidPropertiesPT::gamma ( Real  pressure,
Real  temperature 
) const
virtualinherited

Adiabatic index - ratio of specific heats.

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

Definition at line 27 of file SinglePhaseFluidPropertiesPT.C.

Referenced by c().

28 {
30 }
virtual Real cp(Real pressure, Real temperature) const =0
Isobaric specific heat capacity.
const std::string temperature
Definition: NS.h:25
virtual Real cv(Real pressure, Real temperature) const =0
Isochoric specific heat.
const std::string pressure
Definition: NS.h:24
Real MethaneFluidProperties::h ( Real  p,
Real  T 
) const
overridevirtual

Specific enthalpy.

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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 267 of file MethaneFluidProperties.C.

Referenced by e(), and h_dpT().

268 {
269  // Check the temperature is in the range of validity (280 K <= t <= 1080 K)
270  if (temperature <= 280.0 || temperature >= 1080.0)
271  mooseError("Temperature ", temperature, "K out of range (280K, 1080K) in ", name(), ": cp()");
272 
273  std::vector<Real> a;
274  if (temperature < 755.0)
275  a = {1.9165258, -1.09269e-3, 8.696605e-6, -5.2291144e-9, 0.0, 0.0, 0.0};
276  else
277  a = {1.04356e1, -4.2025284e-2, 8.849006e-5, -8.4304566e-8, 3.9030203e-11, -7.1345169e-15, 0.0};
278 
279  Real enthalpy = 0.0;
280  for (std::size_t i = 0; i < a.size(); ++i)
281  enthalpy += a[i] * std::pow(temperature, i + 1) / (i + 1.0);
282 
283  // convert to J/kg by multiplying by 1000
284  return enthalpy * 1000.0;
285 }
const std::string temperature
Definition: NS.h:25
const std::string enthalpy
Definition: NS.h:26
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
void MethaneFluidProperties::h_dpT ( Real  pressure,
Real  temperature,
Real &  h,
Real &  dh_dp,
Real &  dh_dT 
) const
overridevirtual

Enthalpy and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]h(J/kg)
[out]dh_dpderivative of enthalpy wrt pressure
[out]dh_dTderivative of enthalpy wrt temperature

Implements SinglePhaseFluidPropertiesPT.

Definition at line 288 of file MethaneFluidProperties.C.

Referenced by e_dpT().

290 {
291  h = this->h(pressure, temperature);
292  // Enthalpy doesn't depend on pressure
293  dh_dp = 0.0;
294 
295  std::vector<Real> a;
296  if (temperature < 755.0)
297  a = {1.9165258, -1.09269e-3, 8.696605e-6, -5.2291144e-9, 0.0, 0.0, 0.0};
298  else
299  a = {1.04356e1, -4.2025284e-2, 8.849006e-5, -8.4304566e-8, 3.9030203e-11, -7.1345169e-15, 0.0};
300 
301  Real dhdt = 0.0;
302  for (std::size_t i = 0; i < a.size(); ++i)
303  dhdt += a[i] * std::pow(temperature, i);
304 
305  // convert to J/kg/K by multiplying by 1000
306  dh_dT = dhdt * 1000.0;
307 }
const std::string temperature
Definition: NS.h:25
virtual Real h(Real pressure, Real temperature) const override
Specific enthalpy.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const std::string pressure
Definition: NS.h:24
Real MethaneFluidProperties::henryConstant ( Real  temperature) const
overridevirtual

Henry's law constant for dissolution in water.

Parameters
temperaturefluid temperature (K)
Returns
Henry's constant

Implements SinglePhaseFluidPropertiesPT.

Definition at line 312 of file MethaneFluidProperties.C.

313 {
314  return henryConstantIAPWS(temperature, -10.44708, 4.66491, 12.12986);
315 }
const std::string temperature
Definition: NS.h:25
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...
void MethaneFluidProperties::henryConstant_dT ( 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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 318 of file MethaneFluidProperties.C.

319 {
320  henryConstantIAPWS_dT(temperature, Kh, dKh_dT, -10.44708, 4.66491, 12.12986);
321 }
const std::string temperature
Definition: NS.h:25
virtual void henryConstantIAPWS_dT(Real temperature, Real &Kh, Real &dKh_dT, Real A, Real B, Real C) const
IAPWS formulation of Henry&#39;s law constant for dissolution in water and derivative wrt temperature...
Real SinglePhaseFluidPropertiesPT::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 33 of file SinglePhaseFluidPropertiesPT.C.

Referenced by henryConstant(), and CO2FluidProperties::henryConstant().

34 {
35  Real Tr = temperature / 647.096;
36  Real tau = 1.0 - Tr;
37 
38  Real lnkh = A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
39 
40  // The vapor pressure used in this formulation
41  std::vector<Real> a{-7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
42  std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
43  Real sum = 0.0;
44 
45  for (std::size_t i = 0; i < a.size(); ++i)
46  sum += a[i] * std::pow(tau, b[i]);
47 
48  return 22.064e6 * std::exp(sum / Tr) * std::exp(lnkh);
49 }
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
void SinglePhaseFluidPropertiesPT::henryConstantIAPWS_dT ( Real  temperature,
Real &  Kh,
Real &  dKh_dT,
Real  A,
Real  B,
Real  C 
) const
protectedvirtualinherited

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

Definition at line 52 of file SinglePhaseFluidPropertiesPT.C.

Referenced by henryConstant_dT(), and CO2FluidProperties::henryConstant_dT().

54 {
55  Real pc = 22.064e6;
56  Real Tc = 647.096;
57 
58  Real Tr = temperature / Tc;
59  Real tau = 1.0 - Tr;
60 
61  Real lnkh = A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
62  Real dlnkh_dT =
63  (-A / Tr / Tr - B * std::pow(tau, 0.355) / Tr / Tr - 0.355 * B * std::pow(tau, -0.645) / Tr -
64  0.41 * C * std::pow(Tr, -1.41) * std::exp(tau) - C * std::pow(Tr, -0.41) * std::exp(tau)) /
65  Tc;
66 
67  // The vapor pressure used in this formulation
68  std::vector<Real> a{-7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
69  std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
70  Real sum = 0.0;
71  Real dsum = 0.0;
72 
73  for (std::size_t i = 0; i < a.size(); ++i)
74  {
75  sum += a[i] * std::pow(tau, b[i]);
76  dsum += a[i] * b[i] * std::pow(tau, b[i] - 1.0);
77  }
78 
79  Real p = pc * std::exp(sum / Tr);
80  Real dp_dT = -p / Tc / Tr * (sum / Tr + dsum);
81 
82  // Henry's constant and its derivative wrt temperature
83  Kh = p * std::exp(lnkh);
84  dKh_dT = (p * dlnkh_dT + dp_dT) * std::exp(lnkh);
85 }
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Definition at line 26 of file FluidProperties.h.

26 {}
Real MethaneFluidProperties::k ( Real  pressure,
Real  temperature 
) const
overridevirtual

Thermal conductivity.

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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 210 of file MethaneFluidProperties.C.

211 {
212  Real rho = this->rho(pressure, temperature);
213  return this->k_from_rho_T(rho, temperature);
214 }
virtual Real k_from_rho_T(Real density, Real temperature) const override
Thermal conductivity as a function of density and temperature.
const std::string temperature
Definition: NS.h:25
const std::string pressure
Definition: NS.h:24
virtual Real rho(Real pressure, Real temperature) const override
Density.
void MethaneFluidProperties::k_dpT ( 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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 217 of file MethaneFluidProperties.C.

219 {
220  mooseError(name(), ": k_dpT() is not implemented");
221 }
Real MethaneFluidProperties::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)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 224 of file MethaneFluidProperties.C.

Referenced by k().

225 {
226  // Check the temperature is in the range of validity (200 K <= T <= 1000 K)
227  if (temperature <= 200.0 || temperature >= 1000.0)
228  mooseError("Temperature ", temperature, "K out of range (200K, 1000K) in ", name(), ": k()");
229 
230  const std::vector<Real> a{-1.3401499e-2,
231  3.663076e-4,
232  -1.82248608e-6,
233  5.93987998e-9,
234  -9.1405505e-12,
235  6.7896889e-15,
236  -1.95048736e-18};
237 
238  Real kt = 0.0;
239  for (std::size_t i = 0; i < a.size(); ++i)
240  kt += a[i] * std::pow(temperature, i);
241 
242  return kt;
243 }
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real MethaneFluidProperties::molarMass ( ) const
overridevirtual

Molar mass.

Returns
molar mass (kg/mol)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 39 of file MethaneFluidProperties.C.

40 {
41  return _Mch4;
42 }
const Real _Mch4
Methane molar mass (kg/mol)
Real MethaneFluidProperties::mu ( Real  pressure,
Real  temperature 
) const
overridevirtual

Implements SinglePhaseFluidPropertiesPT.

Definition at line 151 of file MethaneFluidProperties.C.

152 {
153  Real rho = this->rho(pressure, temperature);
154  return this->mu_from_rho_T(rho, temperature);
155 }
const std::string temperature
Definition: NS.h:25
const std::string pressure
Definition: NS.h:24
virtual Real mu_from_rho_T(Real density, Real temperature) const override
virtual Real rho(Real pressure, Real temperature) const override
Density.
void MethaneFluidProperties::mu_dpT ( Real  pressure,
Real  temperature,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
overridevirtual

Implements SinglePhaseFluidPropertiesPT.

Definition at line 158 of file MethaneFluidProperties.C.

160 {
161  Real rho, drho_dp, drho_dT;
162  this->rho_dpT(pressure, temperature, rho, drho_dp, drho_dT);
163  Real dmu_drho;
164  this->mu_drhoT_from_rho_T(rho, temperature, drho_dT, mu, dmu_drho, dmu_dT);
165  dmu_dp = dmu_drho * drho_dp;
166 }
const std::string temperature
Definition: NS.h:25
virtual void mu_drhoT_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.
virtual Real mu(Real pressure, Real temperature) const override
const std::string pressure
Definition: NS.h:24
virtual Real rho(Real pressure, Real temperature) const override
Density.
virtual void rho_dpT(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
Density and its derivatives wrt pressure and temperature.
void MethaneFluidProperties::mu_drhoT_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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 190 of file MethaneFluidProperties.C.

Referenced by mu_dpT().

196 {
197  const std::vector<Real> a{
198  2.968267e-1, 3.711201e-2, 1.218298e-5, -7.02426e-8, 7.543269e-11, -2.7237166e-14};
199 
201  dmu_drho = 0.0;
202 
203  Real dmudt = 0.0;
204  for (std::size_t i = 0; i < a.size(); ++i)
205  dmudt += i * a[i] * std::pow(temperature, i - 1.0);
206  dmu_dT = dmudt * 1.e-6;
207 }
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real mu(Real pressure, Real temperature) const override
virtual Real mu_from_rho_T(Real density, Real temperature) const override
Real MethaneFluidProperties::mu_from_rho_T ( Real  density,
Real  temperature 
) const
overridevirtual

Implements SinglePhaseFluidPropertiesPT.

Definition at line 169 of file MethaneFluidProperties.C.

Referenced by mu(), and mu_drhoT_from_rho_T().

170 {
171  // Check the temperature is in the range of validity (200 K <= T <= 1000 K)
172  if (temperature <= 200.0 || temperature >= 1000.0)
173  mooseError("Temperature ",
174  temperature,
175  "K out of range (200K, 1000K) in ",
176  name(),
177  ": mu_from_rho_T()");
178 
179  const std::vector<Real> a{
180  2.968267e-1, 3.711201e-2, 1.218298e-5, -7.02426e-8, 7.543269e-11, -2.7237166e-14};
181 
182  Real viscosity = 0.0;
183  for (std::size_t i = 0; i < a.size(); ++i)
184  viscosity += a[i] * std::pow(temperature, i);
185 
186  return viscosity * 1.e-6;
187 }
const std::string temperature
Definition: NS.h:25
double FORTRAN_CALL() viscosity(double &rho, double &T)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real MethaneFluidProperties::rho ( Real  pressure,
Real  temperature 
) const
overridevirtual

Density.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
density (kg/m^3)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 63 of file MethaneFluidProperties.C.

Referenced by k(), mu(), mu_dpT(), and rho_dpT().

64 {
65  return pressure * _Mch4 / (_R * temperature);
66 }
const std::string temperature
Definition: NS.h:25
const Real _Mch4
Methane molar mass (kg/mol)
const std::string pressure
Definition: NS.h:24
const Real _R
Universal gas constant (J/mol/K)
void MethaneFluidProperties::rho_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
overridevirtual

Density and its 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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 69 of file MethaneFluidProperties.C.

Referenced by mu_dpT(), and rho_e_dpT().

71 {
72  rho = this->rho(pressure, temperature);
73  drho_dp = _Mch4 / (_R * temperature);
74  drho_dT = -pressure * _Mch4 / (_R * temperature * temperature);
75 }
const std::string temperature
Definition: NS.h:25
const Real _Mch4
Methane molar mass (kg/mol)
const std::string pressure
Definition: NS.h:24
virtual Real rho(Real pressure, Real temperature) const override
Density.
const Real _R
Universal gas constant (J/mol/K)
void MethaneFluidProperties::rho_e_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
overridevirtual

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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 95 of file MethaneFluidProperties.C.

103 {
104  Real density, ddensity_dp, ddensity_dT;
105  rho_dpT(pressure, temperature, density, ddensity_dp, ddensity_dT);
106  rho = density;
107  drho_dp = ddensity_dp;
108  drho_dT = ddensity_dT;
109 
110  Real energy, denergy_dp, denergy_dT;
111  e_dpT(pressure, temperature, energy, denergy_dp, denergy_dT);
112  e = energy;
113  de_dp = denergy_dp;
114  de_dT = denergy_dT;
115 }
const std::string density
Definition: NS.h:15
virtual Real e(Real pressure, Real temperature) const override
Internal energy.
const std::string temperature
Definition: NS.h:25
virtual void e_dpT(Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const override
Internal energy and its derivatives wrt pressure and temperature.
const std::string pressure
Definition: NS.h:24
virtual Real rho(Real pressure, Real temperature) const override
Density.
virtual void rho_dpT(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
Density and its derivatives wrt pressure and temperature.
Real MethaneFluidProperties::s ( Real  pressure,
Real  temperature 
) const
overridevirtual

Specific entropy.

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

Implements SinglePhaseFluidPropertiesPT.

Definition at line 246 of file MethaneFluidProperties.C.

247 {
248  // Check the temperature is in the range of validity (280 K <= t <= 1080 K)
249  if (temperature <= 280.0 || temperature >= 1080.0)
250  mooseError("Temperature ", temperature, "K out of range (280K, 1080K) in ", name(), ": s()");
251 
252  std::vector<Real> a;
253  if (temperature < 755.0)
254  a = {1.9165258, -1.09269e-3, 8.696605e-6, -5.2291144e-9, 0.0, 0.0, 0.0};
255  else
256  a = {1.04356e1, -4.2025284e-2, 8.849006e-5, -8.4304566e-8, 3.9030203e-11, -7.1345169e-15, 0.0};
257 
258  Real entropy = a[0] * std::log(temperature);
259  for (std::size_t i = 1; i < a.size(); ++i)
260  entropy += a[i] * std::pow(temperature, i) / static_cast<Real>(i);
261 
262  // convert to J/kg/K by multiplying by 1000
263  return entropy * 1000.0;
264 }
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

Member Data Documentation

const Real MethaneFluidProperties::_beta
protected

Coefficient of thermal expansion (1/K)

Definition at line 124 of file MethaneFluidProperties.h.

Referenced by beta().

const Real MethaneFluidProperties::_Mch4
protected

Methane molar mass (kg/mol)

Definition at line 116 of file MethaneFluidProperties.h.

Referenced by c(), cv(), e(), e_dpT(), molarMass(), rho(), and rho_dpT().

const Real MethaneFluidProperties::_p_critical
protected

Critical pressure (Pa)

Definition at line 118 of file MethaneFluidProperties.h.

Referenced by criticalPressure().

const Real SinglePhaseFluidPropertiesPT::_R
protectedinherited
const Real MethaneFluidProperties::_rho_critical
protected

Critical density (kg/m^3)

Definition at line 122 of file MethaneFluidProperties.h.

Referenced by criticalDensity().

const Real SinglePhaseFluidPropertiesPT::_T_c2k
protectedinherited
const Real MethaneFluidProperties::_T_critical
protected

Critical temperature (K)

Definition at line 120 of file MethaneFluidProperties.h.

Referenced by criticalTemperature().


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