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 (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 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 std::string fluidName () const override
 Fluid name. More...
 
Real molarMass () const override
 Molar mass. More...
 
Real criticalPressure () const
 CO2 critical pressure. More...
 
Real criticalTemperature () const
 CO2 critical temperature. More...
 
Real criticalDensity () const
 CO2 critical density. More...
 
Real triplePointPressure () const
 CO2 triple point pressure. More...
 
Real triplePointTemperature () const
 CO2 triple point temperature. More...
 
Real meltingPressure (Real temperature) const
 Melting pressure. More...
 
Real sublimationPressure (Real temperature) const
 Sublimation pressure. More...
 
Real vaporPressure (Real temperature) const
 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...
 
Real pressure (Real density, Real temperature) const
 Pressure as a function of density and temperature From Span and Wagner (reference above) More...
 
Real pressureSW (Real density, Real temperature) const
 Internal function to calculate pressure as a function of density and temperature using the Span and Wagner EOS. More...
 
Real phiSW (Real delta, Real tau) const
 Helmholtz free energy for CO2 From Span and Wagner (reference above) More...
 
Real dphiSW_dd (Real delta, Real tau) const
 Derivative of Helmholtz free energy wrt delta. More...
 
Real dphiSW_dt (Real delta, Real tau) const
 Derivative of Helmholtz free energy wrt tau. More...
 
Real d2phiSW_dd2 (Real delta, Real tau) const
 Second derivative of Helmholtz free energy wrt delta. More...
 
Real d2phiSW_dt2 (Real delta, Real tau) const
 Second derivative of Helmholtz free energy wrt tau. More...
 
Real d2phiSW_ddt (Real delta, Real tau) const
 Second derivative of Helmholtz free energy wrt delta and tau. 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...
 
Real partialDensity (Real temperature) const
 Partial density of dissolved CO2 From Garcia, Density of aqueous solutions of CO2, LBNL-49023 (2001) 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 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 p, Real T) 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 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 _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...
 
std::vector< Real > _a0 {1.99427042, 0.62105248, 0.41195293, 1.04028922, 0.08327678}
 Coefficients for the ideal gas component of the Helmholtz free energy. More...
 
std::vector< Real > _theta0 {3.15163, 6.11190, 6.77708, 11.32384, 27.08792}
 
std::vector< Real > _n1
 Coefficients for the residual component of the Helmholtz free energy. More...
 
std::vector< Real > _d1 {1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 3.0}
 
std::vector< Real > _t1 {0.0, 0.75, 1.0, 2.0, 0.75, 2.0, 0.75}
 
std::vector< Real > _n2
 
std::vector< Real > _d2
 
std::vector< Real > _t2
 
std::vector< Real > _c2
 
std::vector< Real > _n3
 
std::vector< Real > _d3 {2.0, 2.0, 2.0, 3.0, 3.0}
 
std::vector< Real > _t3 {1.0, 0.0, 1.0, 3.0, 3.0}
 
std::vector< Real > _alpha3 {25.0, 25.0, 25.0, 15.0, 20.0}
 
std::vector< Real > _beta3 {325.0, 300.0, 300.0, 275.0, 275.0}
 
std::vector< Real > _gamma3 {1.16, 1.19, 1.19, 1.25, 1.25}
 
std::vector< Real > _eps3 {1.0, 1.0, 1.0, 1.0, 1.0}
 
std::vector< Real > _n4 {-0.66642276540751, 0.72608632349897, 0.055068668612842}
 
std::vector< Real > _a4 {3.5, 3.5, 3.5}
 
std::vector< Real > _b4 {0.875, 0.925, 0.875}
 
std::vector< Real > _beta4 {0.3, 0.3, 0.3}
 
std::vector< Real > _A4 {0.7, 0.7, 0.7}
 
std::vector< Real > _B4 {0.3, 0.3, 1.0}
 
std::vector< Real > _C4 {10.0, 10.0, 12.5}
 
std::vector< Real > _D4 {275.0, 275.0, 275.0}
 
const Real _R
 Universal gas constant (J/mol/K) More...
 
const Real _T_c2k
 Conversion of temperature from Celcius 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 40 of file CO2FluidProperties.h.

Constructor & Destructor Documentation

CO2FluidProperties::CO2FluidProperties ( const InputParameters &  parameters)

Definition at line 21 of file CO2FluidProperties.C.

22  : SinglePhaseFluidPropertiesPT(parameters)
23 {
24 }
SinglePhaseFluidPropertiesPT(const InputParameters &parameters)
CO2FluidProperties::~CO2FluidProperties ( )
virtual

Definition at line 26 of file CO2FluidProperties.C.

26 {}

Member Function Documentation

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

827 {
828  mooseError(name(), ": beta() not implemented yet");
829 }
Real CO2FluidProperties::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 679 of file CO2FluidProperties.C.

680 {
681  // Require density first
682  Real density = rho(pressure, temperature);
683  // Scale the input density and temperature
684  Real delta = density / _critical_density;
685  Real tau = _critical_temperature / temperature;
686 
687  Real speed2 =
688  2.0 * delta * dphiSW_dd(delta, tau) + delta * delta * d2phiSW_dd2(delta, tau) -
689  std::pow(delta * dphiSW_dd(delta, tau) - delta * tau * d2phiSW_ddt(delta, tau), 2.0) /
690  (tau * tau * d2phiSW_dt2(delta, tau));
691 
692  return std::sqrt(_Rco2 * temperature * speed2);
693 }
const Real _critical_density
Critical density (kg/m^3)
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
Real d2phiSW_dt2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt tau.
Real d2phiSW_dd2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta.
const Real _Rco2
Specific gas constant (J/mol/K)
Real dphiSW_dd(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt delta.
Real d2phiSW_ddt(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta and tau.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _critical_temperature
Critical temperature (K)
Real CO2FluidProperties::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 696 of file CO2FluidProperties.C.

697 {
698  // Require density first
699  Real density = rho(pressure, temperature);
700  // Scale the input density and temperature
701  Real delta = density / _critical_density;
702  Real tau = _critical_temperature / temperature;
703 
704  Real heat_capacity =
705  -tau * tau * d2phiSW_dt2(delta, tau) +
706  std::pow(delta * dphiSW_dd(delta, tau) - delta * tau * d2phiSW_ddt(delta, tau), 2.0) /
707  (2.0 * delta * dphiSW_dd(delta, tau) + delta * delta * d2phiSW_dd2(delta, tau));
708 
709  return _Rco2 * heat_capacity;
710 }
const Real _critical_density
Critical density (kg/m^3)
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
Real d2phiSW_dt2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt tau.
Real d2phiSW_dd2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta.
const Real _Rco2
Specific gas constant (J/mol/K)
Real dphiSW_dd(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt delta.
Real d2phiSW_ddt(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta and tau.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _critical_temperature
Critical temperature (K)
Real CO2FluidProperties::criticalDensity ( ) const

CO2 critical density.

Returns
critical density (kg/m^3)

Definition at line 53 of file CO2FluidProperties.C.

54 {
55  return _critical_density;
56 }
const Real _critical_density
Critical density (kg/m^3)
Real CO2FluidProperties::criticalPressure ( ) const

CO2 critical pressure.

Returns
critical pressure (Pa)

Definition at line 41 of file CO2FluidProperties.C.

42 {
43  return _critical_pressure;
44 }
const Real _critical_pressure
Critical pressure (Pa)
Real CO2FluidProperties::criticalTemperature ( ) const

CO2 critical temperature.

Returns
critical temperature (K)

Definition at line 47 of file CO2FluidProperties.C.

48 {
49  return _critical_temperature;
50 }
const Real _critical_temperature
Critical temperature (K)
Real CO2FluidProperties::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 713 of file CO2FluidProperties.C.

714 {
715  // Require density first
716  Real density = rho(pressure, temperature);
717  // Scale the input density and temperature
718  Real delta = density / _critical_density;
719  Real tau = _critical_temperature / temperature;
720 
721  return -_Rco2 * tau * tau * d2phiSW_dt2(delta, tau);
722 }
const Real _critical_density
Critical density (kg/m^3)
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
Real d2phiSW_dt2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt tau.
const Real _Rco2
Specific gas constant (J/mol/K)
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _critical_temperature
Critical temperature (K)
Real CO2FluidProperties::d2phiSW_dd2 ( Real  delta,
Real  tau 
) const

Second derivative of Helmholtz free energy wrt delta.

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

Definition at line 270 of file CO2FluidProperties.C.

Referenced by c(), cp(), e_dpT(), h_dpT(), and rho_dpT().

271 {
272  // Second derivative of the ideal gas component wrt gamma
273  Real d2phi0dd2 = -1.0 / delta / delta;
274 
275  // Second derivative of the residual component wrt gamma
276  Real d2phirdd2 = 0.0;
277  Real theta, Delta, Psi, dDelta_dd, dPsi_dd, d2Delta_dd2, d2Psi_dd2;
278 
279  for (std::size_t i = 0; i < _n1.size(); ++i)
280  d2phirdd2 +=
281  _n1[i] * _d1[i] * (_d1[i] - 1.0) * std::pow(delta, _d1[i] - 2.0) * std::pow(tau, _t1[i]);
282 
283  for (std::size_t i = 0; i < _n2.size(); ++i)
284  d2phirdd2 += _n2[i] * std::exp(-std::pow(delta, _c2[i])) * std::pow(delta, _d2[i] - 2.0) *
285  std::pow(tau, _t2[i]) * ((_d2[i] - _c2[i] * std::pow(delta, _c2[i])) *
286  (_d2[i] - 1.0 - _c2[i] * std::pow(delta, _c2[i])) -
287  _c2[i] * _c2[i] * std::pow(delta, _c2[i]));
288 
289  for (std::size_t i = 0; i < _n3.size(); ++i)
290  d2phirdd2 +=
291  _n3[i] * std::pow(tau, _t3[i]) * std::exp(-_alpha3[i] * std::pow(delta - _eps3[i], 2.0) -
292  _beta3[i] * std::pow(tau - _gamma3[i], 2.0)) *
293  (-2.0 * _alpha3[i] * std::pow(delta, _d3[i]) +
294  4.0 * _alpha3[i] * _alpha3[i] * std::pow(delta, _d3[i]) * std::pow(delta - _eps3[i], 2.0) -
295  4.0 * _d3[i] * _alpha3[i] * std::pow(delta, _d3[i] - 1.0) * (delta - _eps3[i]) +
296  _d3[i] * (_d3[i] - 1.0) * std::pow(delta, _d3[i] - 2.0));
297 
298  for (std::size_t i = 0; i < _n4.size(); ++i)
299  {
300  theta = 1.0 - tau + _A4[i] * std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]));
301  Delta = std::pow(theta, 2.0) + _B4[i] * std::pow(std::pow(delta - 1.0, 2.0), _a4[i]);
302  Psi = std::exp(-_C4[i] * std::pow(delta - 1.0, 2.0) - _D4[i] * std::pow(tau - 1.0, 2.0));
303  dPsi_dd = -2.0 * _C4[i] * (delta - 1.0) * Psi;
304  dDelta_dd = (delta - 1.0) *
305  (_A4[i] * theta * 2.0 / _beta4[i] *
306  std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]) - 1.0) +
307  2.0 * _B4[i] * _a4[i] * std::pow(std::pow(delta - 1.0, 2.0), _a4[i] - 1.0));
308  d2Psi_dd2 = 3.0 * _D4[i] * Psi * (2.0 * _C4[i] * std::pow(delta - 1.0, 2.0) - 1.0);
309  d2Delta_dd2 =
310  1.0 / (delta - 1.0) * dDelta_dd +
311  (delta - 1.0) * (delta - 1.0) *
312  (4.0 * _B4[i] * _a4[i] * (_a4[i] - 1.0) *
313  std::pow(std::pow(delta - 1.0, 2.0), _a4[i] - 2.0) +
314  2.0 * _A4[i] * _A4[i] *
315  std::pow(std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]) - 1.0),
316  2.0) /
317  _beta4[i] / _beta4[i] +
318  (4.0 / _beta4[i]) * _A4[i] * theta * (1.0 / (2.0 * _beta4[i]) - 1.0) *
319  std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]) - 2.0));
320  d2phirdd2 +=
321  _n4[i] *
322  (std::pow(Delta, _b4[i]) * (2.0 * dPsi_dd + delta * d2Psi_dd2) +
323  2.0 * _b4[i] * std::pow(Delta, _b4[i] - 1.0) * dDelta_dd * (Psi + delta * dPsi_dd) +
324  _b4[i] * (std::pow(Delta, _b4[i] - 1.0) * d2Delta_dd2 +
325  (_b4[i] - 1.0) * std::pow(Delta, _b4[i] - 2.0) * std::pow(dDelta_dd, 2.0)) *
326  delta * Psi);
327  }
328  // The second derivative of the free energy wrt delta is the sum of these components
329  return d2phi0dd2 + d2phirdd2;
330 }
std::vector< Real > _n4
std::vector< Real > _t1
std::vector< Real > _d3
std::vector< Real > _n2
std::vector< Real > _a4
std::vector< Real > _c2
std::vector< Real > _beta4
std::vector< Real > _D4
std::vector< Real > _gamma3
std::vector< Real > _t3
std::vector< Real > _n3
std::vector< Real > _b4
std::vector< Real > _A4
std::vector< Real > _alpha3
std::vector< Real > _n1
Coefficients for the residual component of the Helmholtz free energy.
std::vector< Real > _C4
std::vector< Real > _d1
std::vector< Real > _t2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::vector< Real > _d2
std::vector< Real > _beta3
std::vector< Real > _B4
std::vector< Real > _eps3
Real CO2FluidProperties::d2phiSW_ddt ( Real  delta,
Real  tau 
) const

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

Definition at line 381 of file CO2FluidProperties.C.

Referenced by c(), cp(), e_dpT(), h_dpT(), and rho_dpT().

382 {
383  // Note: second derivative of the ideal gas component wrt delta and tau is 0
384  // Derivative of the residual component wrt gamma
385  Real theta, Delta, Psi, dDelta_dd, dPsi_dd, dDelta_dt, dPsi_dt, d2Delta_ddt, d2Psi_ddt;
386  Real d2phirddt = 0.0;
387  for (std::size_t i = 0; i < _n1.size(); ++i)
388  d2phirddt +=
389  _n1[i] * _d1[i] * _t1[i] * std::pow(delta, _d1[i] - 1.0) * std::pow(tau, _t1[i] - 1.0);
390 
391  for (std::size_t i = 0; i < _n2.size(); ++i)
392  d2phirddt += _n2[i] * std::exp(-std::pow(delta, _c2[i])) *
393  (std::pow(delta, _d2[i] - 1.0) * _t2[i] * std::pow(tau, _t2[i] - 1.0) *
394  (_d2[i] - _c2[i] * std::pow(delta, _c2[i])));
395 
396  for (std::size_t i = 0; i < _n3.size(); ++i)
397  d2phirddt += _n3[i] * std::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
398  std::exp(-_alpha3[i] * std::pow(delta - _eps3[i], 2.0) -
399  _beta3[i] * std::pow(tau - _gamma3[i], 2.0)) *
400  (_d3[i] / delta - 2.0 * _alpha3[i] * (delta - _eps3[i])) *
401  (_t3[i] / tau - 2.0 * _beta3[i] * (tau - _gamma3[i]));
402 
403  for (std::size_t i = 0; i < _n4.size(); ++i)
404  {
405  theta = 1.0 - tau + _A4[i] * std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]));
406  Delta = std::pow(theta, 2.0) + _B4[i] * std::pow(std::pow(delta - 1.0, 2.0), _a4[i]);
407  Psi = std::exp(-_C4[i] * std::pow(delta - 1.0, 2.0) - _D4[i] * std::pow(tau - 1.0, 2.0));
408  dPsi_dd = -2.0 * _C4[i] * (delta - 1.0) * Psi;
409  dPsi_dt = -2.0 * _D4[i] * (tau - 1.0) * Psi;
410  d2Psi_ddt = 4.0 * _C4[i] * _D4[i] * (delta - 1.0) * (tau - 1.0) * Psi;
411  dDelta_dd = (delta - 1.0) *
412  (_A4[i] * theta * 2.0 / _beta4[i] *
413  std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]) - 1.0) +
414  2.0 * _B4[i] * _a4[i] * std::pow(std::pow(delta - 1.0, 2.0), _a4[i] - 1.0));
415  dDelta_dt = -2.0 * theta * _b4[i] * std::pow(Delta, _b4[i] - 1.0);
416  d2Delta_ddt = -2.0 * _A4[i] * _b4[i] / _beta4[i] * std::pow(Delta, _b4[i] - 1.0) *
417  (delta - 1.0) *
418  std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]) - 1.0) -
419  2.0 * theta * _b4[i] * (_b4[i] - 1.0) * std::pow(Delta, _b4[i] - 2.0) * dDelta_dd;
420 
421  d2phirddt += _n4[i] * (std::pow(Delta, _b4[i]) * (dPsi_dt + delta * d2Psi_ddt) +
422  delta * _b4[i] * std::pow(Delta, _b4[i] - 1.0) * dDelta_dd * dPsi_dt +
423  dDelta_dt * (Psi + delta * dPsi_dd) + d2Delta_ddt * delta * Psi);
424  }
425 
426  return d2phirddt;
427 }
std::vector< Real > _n4
std::vector< Real > _t1
std::vector< Real > _d3
std::vector< Real > _n2
std::vector< Real > _a4
std::vector< Real > _c2
std::vector< Real > _beta4
std::vector< Real > _D4
std::vector< Real > _gamma3
std::vector< Real > _t3
std::vector< Real > _n3
std::vector< Real > _b4
std::vector< Real > _A4
std::vector< Real > _alpha3
std::vector< Real > _n1
Coefficients for the residual component of the Helmholtz free energy.
std::vector< Real > _C4
std::vector< Real > _d1
std::vector< Real > _t2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::vector< Real > _d2
std::vector< Real > _beta3
std::vector< Real > _B4
std::vector< Real > _eps3
Real CO2FluidProperties::d2phiSW_dt2 ( Real  delta,
Real  tau 
) const

Second derivative of Helmholtz free energy wrt tau.

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

Definition at line 333 of file CO2FluidProperties.C.

Referenced by c(), cp(), cv(), e_dpT(), and h_dpT().

334 {
335  // Second derivative of the ideal gas component wrt tau
336  Real sum0 = 0.0;
337  for (std::size_t i = 0; i < _a0.size(); ++i)
338  sum0 += _a0[i] * _theta0[i] * _theta0[i] * std::exp(-_theta0[i] * tau) *
339  std::pow(1.0 - std::exp(-_theta0[i] * tau), -2.0);
340 
341  Real d2phi0dt2 = -2.5 / tau / tau - sum0;
342 
343  // Second derivative of the residual component wrt tau
344  Real d2phirdt2 = 0.0;
345  Real theta, Delta, Psi, dPsi_dt, dDelta_dt, d2Delta_dt2, d2Psi_dt2;
346 
347  for (std::size_t i = 0; i < _n1.size(); ++i)
348  d2phirdt2 +=
349  _n1[i] * _t1[i] * (_t1[i] - 1.0) * std::pow(delta, _d1[i]) * std::pow(tau, _t1[i] - 2.0);
350 
351  for (std::size_t i = 0; i < _n2.size(); ++i)
352  d2phirdt2 += _n2[i] * _t2[i] * (_t2[i] - 1.0) * std::pow(delta, _d2[i]) *
353  std::exp(-std::pow(delta, _c2[i])) * std::pow(tau, _t2[i] - 2.0);
354 
355  for (std::size_t i = 0; i < _n3.size(); ++i)
356  d2phirdt2 += _n3[i] * std::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
357  std::exp(-_alpha3[i] * std::pow(delta - _eps3[i], 2.0) -
358  _beta3[i] * std::pow(tau - _gamma3[i], 2.0)) *
359  (std::pow(_t3[i] / tau - 2.0 * _beta3[i] * (tau - _gamma3[i]), 2.0) -
360  _t3[i] / tau / tau - 2.0 * _beta3[i]);
361 
362  for (std::size_t i = 0; i < _n4.size(); ++i)
363  {
364  theta = 1.0 - tau + _A4[i] * std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]));
365  Delta = std::pow(theta, 2.0) + _B4[i] * std::pow(std::pow(delta - 1.0, 2.0), _a4[i]);
366  Psi = std::exp(-_C4[i] * std::pow(delta - 1.0, 2.0) - _D4[i] * std::pow(tau - 1.0, 2.0));
367  dDelta_dt = -2.0 * theta * _b4[i] * std::pow(Delta, _b4[i] - 1.0);
368  d2Delta_dt2 = 2.0 * _b4[i] * std::pow(Delta, _b4[i] - 1.0) +
369  4.0 * theta * theta * _b4[i] * (_b4[i] - 1.0) * std::pow(Delta, _b4[i] - 2.0);
370  dPsi_dt = -2.0 * _D4[i] * (tau - 1.0) * Psi;
371  d2Psi_dt2 = 2.0 * _D4[i] * (2.0 * _D4[i] * (tau - 1.0) * (tau - 1.0) - 1.0) * Psi;
372  d2phirdt2 += _n4[i] * delta * (Psi * d2Delta_dt2 + 2.0 * dDelta_dt * dPsi_dt +
373  std::pow(Delta, _b4[i]) * d2Psi_dt2);
374  }
375 
376  // The second derivative of the free energy wrt tau is the sum of these components
377  return d2phi0dt2 + d2phirdt2;
378 }
std::vector< Real > _n4
std::vector< Real > _t1
std::vector< Real > _d3
std::vector< Real > _n2
std::vector< Real > _a4
std::vector< Real > _c2
std::vector< Real > _beta4
std::vector< Real > _a0
Coefficients for the ideal gas component of the Helmholtz free energy.
std::vector< Real > _D4
std::vector< Real > _gamma3
std::vector< Real > _t3
std::vector< Real > _n3
std::vector< Real > _b4
std::vector< Real > _theta0
std::vector< Real > _A4
std::vector< Real > _alpha3
std::vector< Real > _n1
Coefficients for the residual component of the Helmholtz free energy.
std::vector< Real > _C4
std::vector< Real > _d1
std::vector< Real > _t2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::vector< Real > _d2
std::vector< Real > _beta3
std::vector< Real > _B4
std::vector< Real > _eps3
Real CO2FluidProperties::dphiSW_dd ( Real  delta,
Real  tau 
) const

Derivative of Helmholtz free energy wrt delta.

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

Definition at line 186 of file CO2FluidProperties.C.

Referenced by c(), cp(), e_dpT(), h(), h_dpT(), pressureSW(), and rho_dpT().

187 {
188  // Derivative of the ideal gas component wrt gamma
189  Real dphi0dd = 1.0 / delta;
190 
191  // Derivative of the residual component wrt gamma
192  Real theta, Delta, Psi, dDelta_dd, dPsi_dd;
193  Real dphirdd = 0.0;
194 
195  for (std::size_t i = 0; i < _n1.size(); ++i)
196  dphirdd += _n1[i] * _d1[i] * std::pow(delta, _d1[i] - 1.0) * std::pow(tau, _t1[i]);
197 
198  for (std::size_t i = 0; i < _n2.size(); ++i)
199  dphirdd += _n2[i] * std::exp(-std::pow(delta, _c2[i])) *
200  (std::pow(delta, _d2[i] - 1.0) * std::pow(tau, _t2[i]) *
201  (_d2[i] - _c2[i] * std::pow(delta, _c2[i])));
202 
203  for (std::size_t i = 0; i < _n3.size(); ++i)
204  dphirdd += _n3[i] * std::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
205  std::exp(-_alpha3[i] * std::pow(delta - _eps3[i], 2.0) -
206  _beta3[i] * std::pow(tau - _gamma3[i], 2.0)) *
207  (_d3[i] / delta - 2.0 * _alpha3[i] * (delta - _eps3[i]));
208 
209  for (std::size_t i = 0; i < _n4.size(); ++i)
210  {
211  theta = 1.0 - tau + _A4[i] * std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]));
212  Delta = std::pow(theta, 2.0) + _B4[i] * std::pow(std::pow(delta - 1.0, 2.0), _a4[i]);
213  Psi = std::exp(-_C4[i] * std::pow(delta - 1.0, 2.0) - _D4[i] * std::pow(tau - 1.0, 2.0));
214  dPsi_dd = -2.0 * _C4[i] * (delta - 1.0) * Psi;
215  dDelta_dd = (delta - 1.0) *
216  (_A4[i] * theta * 2.0 / _beta4[i] *
217  std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]) - 1.0) +
218  2.0 * _B4[i] * _a4[i] * std::pow(std::pow(delta - 1.0, 2.0), _a4[i] - 1.0));
219 
220  dphirdd += _n4[i] * (std::pow(Delta, _b4[i]) * (Psi + delta * dPsi_dd) +
221  _b4[i] * std::pow(Delta, _b4[i] - 1.0) * dDelta_dd * delta * Psi);
222  }
223 
224  // The derivative of the free energy wrt delta is the sum of these components
225  return dphi0dd + dphirdd;
226 }
std::vector< Real > _n4
std::vector< Real > _t1
std::vector< Real > _d3
std::vector< Real > _n2
std::vector< Real > _a4
std::vector< Real > _c2
std::vector< Real > _beta4
std::vector< Real > _D4
std::vector< Real > _gamma3
std::vector< Real > _t3
std::vector< Real > _n3
std::vector< Real > _b4
std::vector< Real > _A4
std::vector< Real > _alpha3
std::vector< Real > _n1
Coefficients for the residual component of the Helmholtz free energy.
std::vector< Real > _C4
std::vector< Real > _d1
std::vector< Real > _t2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::vector< Real > _d2
std::vector< Real > _beta3
std::vector< Real > _B4
std::vector< Real > _eps3
Real CO2FluidProperties::dphiSW_dt ( Real  delta,
Real  tau 
) const

Derivative of Helmholtz free energy wrt tau.

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

Definition at line 229 of file CO2FluidProperties.C.

Referenced by e(), e_dpT(), h(), h_dpT(), and s().

230 {
231  // Derivative of the ideal gas component wrt tau
232  Real sum0 = 0.0;
233  for (std::size_t i = 0; i < _a0.size(); ++i)
234  sum0 += _a0[i] * _theta0[i] * (1.0 / (1.0 - std::exp(-_theta0[i] * tau)) - 1.0);
235 
236  Real dphi0dt = -3.70454304 + 2.5 / tau + sum0;
237 
238  // Derivative of the residual component wrt tau
239  Real theta, Delta, Psi, dDelta_dt, dPsi_dt;
240  Real dphirdt = 0.0;
241  for (std::size_t i = 0; i < _n1.size(); ++i)
242  dphirdt += _n1[i] * _t1[i] * std::pow(delta, _d1[i]) * std::pow(tau, _t1[i] - 1.0);
243 
244  for (std::size_t i = 0; i < _n2.size(); ++i)
245  dphirdt += _n2[i] * _t2[i] * std::pow(delta, _d2[i]) * std::pow(tau, _t2[i] - 1.0) *
246  std::exp(-std::pow(delta, _c2[i]));
247 
248  for (std::size_t i = 0; i < _n3.size(); ++i)
249  dphirdt += _n3[i] * std::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
250  std::exp(-_alpha3[i] * std::pow(delta - _eps3[i], 2.0) -
251  _beta3[i] * std::pow(tau - _gamma3[i], 2.0)) *
252  (_t3[i] / tau - 2.0 * _beta3[i] * (tau - _gamma3[i]));
253 
254  for (std::size_t i = 0; i < _n4.size(); ++i)
255  {
256  theta = 1.0 - tau + _A4[i] * std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]));
257  Delta = std::pow(theta, 2.0) + _B4[i] * std::pow(std::pow(delta - 1.0, 2.0), _a4[i]);
258  Psi = std::exp(-_C4[i] * std::pow(delta - 1.0, 2.0) - _D4[i] * std::pow(tau - 1.0, 2.0));
259  dDelta_dt = -2.0 * theta * _b4[i] * std::pow(Delta, _b4[i] - 1.0);
260  dPsi_dt = -2.0 * _D4[i] * (tau - 1.0) * Psi;
261 
262  dphirdt += _n4[i] * delta * (Psi * dDelta_dt + std::pow(Delta, _b4[i]) * dPsi_dt);
263  }
264 
265  // The derivative of the free energy wrt tau is the sum of these components
266  return dphi0dt + dphirdt;
267 }
std::vector< Real > _n4
std::vector< Real > _t1
std::vector< Real > _d3
std::vector< Real > _n2
std::vector< Real > _a4
std::vector< Real > _c2
std::vector< Real > _beta4
std::vector< Real > _a0
Coefficients for the ideal gas component of the Helmholtz free energy.
std::vector< Real > _D4
std::vector< Real > _gamma3
std::vector< Real > _t3
std::vector< Real > _n3
std::vector< Real > _b4
std::vector< Real > _theta0
std::vector< Real > _A4
std::vector< Real > _alpha3
std::vector< Real > _n1
Coefficients for the residual component of the Helmholtz free energy.
std::vector< Real > _C4
std::vector< Real > _d1
std::vector< Real > _t2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::vector< Real > _d2
std::vector< Real > _beta3
std::vector< Real > _B4
std::vector< Real > _eps3
Real CO2FluidProperties::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 633 of file CO2FluidProperties.C.

Referenced by mu_drhoT_from_rho_T().

634 {
635  // Require density first
636  Real density = rho(pressure, temperature);
637  // Scale the input density and temperature
638  Real delta = density / _critical_density;
639  Real tau = _critical_temperature / temperature;
640 
641  return _Rco2 * temperature * tau * dphiSW_dt(delta, tau);
642 }
const Real _critical_density
Critical density (kg/m^3)
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
const Real _Rco2
Specific gas constant (J/mol/K)
Real dphiSW_dt(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt tau.
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _critical_temperature
Critical temperature (K)
void CO2FluidProperties::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 645 of file CO2FluidProperties.C.

Referenced by rho_e_dpT().

647 {
648  // Require density first
649  Real density = rho(pressure, temperature);
650  // Scale the input density and temperature
651  Real delta = density / _critical_density;
652  Real tau = _critical_temperature / temperature;
653 
654  e = _Rco2 * temperature * tau * dphiSW_dt(delta, tau);
655  Real dpdd = dphiSW_dd(delta, tau);
656  Real d2pdd2 = d2phiSW_dd2(delta, tau);
657  Real d2pddt = d2phiSW_ddt(delta, tau);
658 
659  de_dp = tau * d2pddt / (density * (2.0 * dpdd + delta * d2pdd2));
660  de_dT = -_Rco2 * (delta * tau * d2pddt * (dpdd - tau * d2pddt) / (2.0 * dpdd + delta * d2pdd2) +
661  tau * tau * d2phiSW_dt2(delta, tau));
662 }
const Real _critical_density
Critical density (kg/m^3)
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
Real d2phiSW_dt2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt tau.
Real d2phiSW_dd2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta.
const Real _Rco2
Specific gas constant (J/mol/K)
Real dphiSW_dt(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt tau.
Real dphiSW_dd(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt delta.
Real d2phiSW_ddt(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta and tau.
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
virtual Real e(Real pressure, Real temperature) const override
Internal energy.
const Real _critical_temperature
Critical temperature (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 CO2FluidProperties::fluidName ( ) const
overridevirtual

Fluid name.

Returns
string representing fluid name

Implements SinglePhaseFluidPropertiesPT.

Definition at line 29 of file CO2FluidProperties.C.

30 {
31  return "co2";
32 }
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 MethaneFluidProperties::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 CO2FluidProperties::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 795 of file CO2FluidProperties.C.

796 {
797  // Require density first
798  Real density = rho(pressure, temperature);
799  // Scale the input density and temperature
800  Real delta = density / _critical_density;
801  Real tau = _critical_temperature / temperature;
802 
803  return _Rco2 * temperature * (tau * dphiSW_dt(delta, tau) + delta * dphiSW_dd(delta, tau));
804 }
const Real _critical_density
Critical density (kg/m^3)
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
const Real _Rco2
Specific gas constant (J/mol/K)
Real dphiSW_dt(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt tau.
Real dphiSW_dd(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt delta.
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _critical_temperature
Critical temperature (K)
void CO2FluidProperties::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 807 of file CO2FluidProperties.C.

809 {
810  // Require density first
811  Real density = rho(pressure, temperature);
812  // Scale the input density and temperature
813  Real delta = density / _critical_density;
814  Real tau = _critical_temperature / temperature;
815  Real dpdd = dphiSW_dd(delta, tau);
816  Real d2pdd2 = d2phiSW_dd2(delta, tau);
817  Real d2pddt = d2phiSW_ddt(delta, tau);
818 
819  h = _Rco2 * temperature * (tau * dphiSW_dt(delta, tau) + delta * dpdd);
820  dh_dp = (dpdd + delta * d2pdd2 + tau * d2pddt) / (density * (2.0 * dpdd + delta * d2pdd2));
821  dh_dT = _Rco2 * delta * dpdd * (1.0 - tau * d2pddt / dpdd) * (1.0 - tau * d2pddt / dpdd) /
822  (2.0 + delta * d2pdd2 / dpdd) -
823  _Rco2 * tau * tau * d2phiSW_dt2(delta, tau);
824 }
const Real _critical_density
Critical density (kg/m^3)
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
Real d2phiSW_dt2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt tau.
Real d2phiSW_dd2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta.
virtual Real h(Real p, Real T) const override
Specific enthalpy.
const Real _Rco2
Specific gas constant (J/mol/K)
Real dphiSW_dt(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt tau.
Real dphiSW_dd(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt delta.
Real d2phiSW_ddt(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta and tau.
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _critical_temperature
Critical temperature (K)
Real CO2FluidProperties::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 621 of file CO2FluidProperties.C.

622 {
623  return henryConstantIAPWS(temperature, -8.55445, 4.01195, 9.52345);
624 }
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 CO2FluidProperties::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 627 of file CO2FluidProperties.C.

628 {
629  henryConstantIAPWS_dT(temperature, Kh, dKh_dT, -8.55445, 4.01195, 9.52345);
630 }
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 MethaneFluidProperties::henryConstant(), and 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 MethaneFluidProperties::henryConstant_dT(), and 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 CO2FluidProperties::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 725 of file CO2FluidProperties.C.

726 {
727  Real rho = this->rho(pressure, temperature);
728  return this->k_from_rho_T(rho, temperature);
729 }
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
virtual Real rho(Real pressure, Real temperature) const override
Density.
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
void CO2FluidProperties::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 732 of file CO2FluidProperties.C.

734 {
735  mooseError(name(), ": k_dpT() is not implemented");
736 }
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)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 739 of file CO2FluidProperties.C.

Referenced by k().

740 {
741  // Check the temperature is in the range of validity (216.592 K <= T <= 1000 K)
742  if (temperature <= _triple_point_temperature || temperature >= 1000.0)
743  mooseError("Temperature ", temperature, "K out of range (200K, 1000K) in ", name(), ": k()");
744 
745  const std::vector<Real> g1{0.0, 0.0, 1.5};
746  const std::vector<Real> g2{0.0, 1.0, 1.5, 1.5, 1.5, 3.5, 5.5};
747  const std::vector<Real> h1{1.0, 5.0, 1.0};
748  const std::vector<Real> h2{1.0, 2.0, 0.0, 5.0, 9.0, 0.0, 0.0};
749  const std::vector<Real> n1{7.69857587, 0.159885811, 1.56918621};
750  const std::vector<Real> n2{
751  -6.73400790, 16.3890156, 3.69415242, 22.3205514, 66.1420950, -0.171779133, 0.00433043347};
752  const std::vector<Real> a{
753  3.0, 6.70697, 0.94604, 0.3, 0.3, 0.39751, 0.33791, 0.77963, 0.79857, 0.9, 0.02, 0.2};
754 
755  // Scaled variables
757  Real rhor = density / _critical_density;
758 
759  Real sum1 = 0.0;
760  for (std::size_t i = 0; i < n1.size(); ++i)
761  sum1 += n1[i] * std::pow(Tr, g1[i]) * std::pow(rhor, h1[i]);
762 
763  Real sum2 = 0.0;
764  for (std::size_t i = 0; i < n2.size(); ++i)
765  sum2 += n2[i] * std::pow(Tr, g2[i]) * std::pow(rhor, h2[i]);
766 
767  // Near-critical enhancement
768  Real alpha = 1.0 - a[9] * std::acosh(1.0 + a[10] * std::pow(std::pow(1.0 - Tr, 2.0), a[11]));
769  Real lambdac =
770  rhor * std::exp(-std::pow(rhor, a[0]) / a[0] - std::pow(a[1] * (Tr - 1.0), 2.0) -
771  std::pow(a[2] * (rhor - 1.0), 2.0)) /
772  std::pow(std::pow(std::pow(1.0 - 1.0 / Tr +
773  a[3] * std::pow(std::pow(rhor - 1.0, 2.0), 1.0 / (2.0 * a[4])),
774  2.0),
775  a[5]) +
776  std::pow(std::pow(a[6] * (rhor - alpha), 2.0), a[7]),
777  a[8]);
778 
779  return 4.81384 * (sum1 + std::exp(-5.0 * rhor * rhor) * sum2 + 0.775547504 * lambdac) / 1000.0;
780 }
const Real _critical_density
Critical density (kg/m^3)
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)
const Real _critical_temperature
Critical temperature (K)
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 71 of file CO2FluidProperties.C.

Referenced by rho().

72 {
74  mooseError(
75  "Temperature is below the triple point temperature in ", name(), ": meltingPressure()");
76 
78 
79  return _triple_point_pressure *
80  (1.0 + 1955.539 * (Tstar - 1.0) + 2055.4593 * std::pow(Tstar - 1.0, 2.0));
81 }
const std::string temperature
Definition: NS.h:25
const Real _triple_point_temperature
Triple point temperature (K)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _triple_point_pressure
Triple point pressure (Pa)
Real CO2FluidProperties::molarMass ( ) const
overridevirtual

Molar mass.

Returns
molar mass (kg/mol)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 35 of file CO2FluidProperties.C.

36 {
37  return _Mco2;
38 }
const Real _Mco2
Molar mass of CO2 (kg/mol)
Real CO2FluidProperties::mu ( Real  pressure,
Real  temperature 
) const
overridevirtual

Implements SinglePhaseFluidPropertiesPT.

Definition at line 511 of file CO2FluidProperties.C.

512 {
513  Real rho = this->rho(pressure, temperature);
514  return this->mu_from_rho_T(rho, temperature);
515 }
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
virtual Real mu_from_rho_T(Real density, Real temperature) const override
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
void CO2FluidProperties::mu_dpT ( Real  pressure,
Real  temperature,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
overridevirtual

Implements SinglePhaseFluidPropertiesPT.

Definition at line 518 of file CO2FluidProperties.C.

520 {
521  Real rho, drho_dp, drho_dT;
522  this->rho_dpT(pressure, temperature, rho, drho_dp, drho_dT);
523 
524  Real dmu_drho;
525  mu_drhoT_from_rho_T(rho, temperature, drho_dT, mu, dmu_drho, dmu_dT);
526  dmu_dp = dmu_drho * drho_dp;
527 }
virtual Real mu(Real pressure, Real temperature) const override
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
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 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 pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
void CO2FluidProperties::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 558 of file CO2FluidProperties.C.

Referenced by mu_dpT().

564 {
565  // Check that the input parameters are within the region of validity
566  if (temperature < 216.0 || temperature > 1000.0 || density > 1400.0)
567  mooseError("Parameters out of range in ", name(), ": mu_drhoT()");
568 
569  Real Tstar = temperature / 251.196;
570  Real dTstar_dT = 1.0 / 251.196;
571  const std::vector<Real> a{0.235156, -0.491266, 5.211155e-2, 5.347906e-2, -1.537102e-2};
572  const std::vector<Real> d{
573  0.4071119e-2, 0.7198037e-4, 0.2411697e-16, 0.2971072e-22, -0.1627888e-22};
574 
575  // Viscosity in the zero-density limit. Note this is only a function of T.
576  // Start the sum at i = 1 so the derivative is defined
577  Real sum0 = a[0], dsum0_dTstar = 0.0;
578 
579  for (std::size_t i = 1; i < a.size(); ++i)
580  {
581  sum0 += a[i] * std::pow(std::log(Tstar), i);
582  dsum0_dTstar += i * a[i] * std::pow(std::log(Tstar), i - 1) / Tstar;
583  }
584 
585  Real mu0 = 1.00697 * std::sqrt(temperature) / std::exp(sum0);
586  Real dmu0_dT = (0.5 * 1.00697 / std::sqrt(temperature) -
587  1.00697 * std::sqrt(temperature) * dsum0_dTstar * dTstar_dT) /
588  std::exp(sum0);
589 
590  // Excess viscosity due to finite density
591  Real mue = d[0] * density + d[1] * std::pow(density, 2) +
592  d[2] * std::pow(density, 6) / std::pow(Tstar, 3) + d[3] * std::pow(density, 8) +
593  d[4] * std::pow(density, 8) / Tstar;
594 
595  Real dmue_drho = d[0] + 2.0 * d[1] * density +
596  6.0 * d[2] * std::pow(density, 5) / std::pow(Tstar, 3) +
597  8.0 * d[3] * std::pow(density, 7) + 8.0 * d[4] * std::pow(density, 7) / Tstar;
598 
599  Real dmue_dT = (-3.0 * d[2] * std::pow(density, 6) / std::pow(Tstar, 4) -
600  d[4] * std::pow(density, 8) / Tstar / Tstar) *
601  dTstar_dT;
602 
603  // Viscosity in Pa.s is
604  mu = (mu0 + mue) * 1.0e-6;
605  dmu_drho = dmue_drho * 1.0e-6;
606  dmu_dT = (dmu0_dT + dmue_dT) * 1.0e-6 + dmu_drho * ddensity_dT;
607 }
const std::string density
Definition: NS.h:15
virtual Real mu(Real pressure, Real temperature) const override
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real e(Real pressure, Real temperature) const override
Internal energy.
Real CO2FluidProperties::mu_from_rho_T ( Real  density,
Real  temperature 
) const
overridevirtual

Implements SinglePhaseFluidPropertiesPT.

Definition at line 530 of file CO2FluidProperties.C.

Referenced by mu().

531 {
532  // Check that the input parameters are within the region of validity
533  if (temperature < 216.0 || temperature > 1000.0 || density > 1400.0)
534  mooseError("Parameters out of range in ", name(), ": mu()");
535 
536  Real Tstar = temperature / 251.196;
537  const std::vector<Real> a{0.235156, -0.491266, 5.211155e-2, 5.347906e-2, -1.537102e-2};
538  const std::vector<Real> d{
539  0.4071119e-2, 0.7198037e-4, 0.2411697e-16, 0.2971072e-22, -0.1627888e-22};
540 
541  // Viscosity in the zero-density limit
542  Real sum = 0.0;
543 
544  for (std::size_t i = 0; i < a.size(); ++i)
545  sum += a[i] * std::pow(std::log(Tstar), i);
546 
547  Real mu0 = 1.00697 * std::sqrt(temperature) / std::exp(sum);
548 
549  // Excess viscosity due to finite density
550  Real mue = d[0] * density + d[1] * std::pow(density, 2) +
551  d[2] * std::pow(density, 6) / std::pow(Tstar, 3) + d[3] * std::pow(density, 8) +
552  d[4] * std::pow(density, 8) / Tstar;
553 
554  return (mu0 + mue) * 1.0e-6; // convert to Pa.s
555 }
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)
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 610 of file CO2FluidProperties.C.

611 {
612  // This correlation uses temperature in C
613  Real Tc = temperature - _T_c2k;
614  // The parial volume
615  Real V = 37.51 - 9.585e-2 * Tc + 8.74e-4 * Tc * Tc - 5.044e-7 * Tc * Tc * Tc;
616 
617  return 1.0e6 * _Mco2 / V;
618 }
const std::string temperature
Definition: NS.h:25
const Real _T_c2k
Conversion of temperature from Celcius to Kelvin.
const Real _Mco2
Molar mass of CO2 (kg/mol)
Real CO2FluidProperties::phiSW ( Real  delta,
Real  tau 
) const

Helmholtz free energy for CO2 From Span and Wagner (reference above)

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

Definition at line 149 of file CO2FluidProperties.C.

Referenced by s().

150 {
151  // Ideal gas component of the Helmholtz free energy
152  Real sum0 = 0.0;
153  for (std::size_t i = 0; i < _a0.size(); ++i)
154  sum0 += _a0[i] * std::log(1.0 - std::exp(-_theta0[i] * tau));
155 
156  Real phi0 = std::log(delta) + 8.37304456 - 3.70454304 * tau + 2.5 * std::log(tau) + sum0;
157 
158  // Residual component of the Helmholtz free energy
159  Real theta, Delta, Psi;
160  Real phir = 0.0;
161  for (std::size_t i = 0; i < _n1.size(); ++i)
162  phir += _n1[i] * std::pow(delta, _d1[i]) * std::pow(tau, _t1[i]);
163 
164  for (std::size_t i = 0; i < _n2.size(); ++i)
165  phir += _n2[i] * std::pow(delta, _d2[i]) * std::pow(tau, _t2[i]) *
166  std::exp(-std::pow(delta, _c2[i]));
167 
168  for (std::size_t i = 0; i < _n3.size(); ++i)
169  phir += _n3[i] * std::pow(delta, _d3[i]) * std::pow(tau, _t3[i]) *
170  std::exp(-_alpha3[i] * std::pow(delta - _eps3[i], 2.0) -
171  _beta3[i] * std::pow(tau - _gamma3[i], 2.0));
172 
173  for (std::size_t i = 0; i < _n4.size(); ++i)
174  {
175  theta = 1.0 - tau + _A4[i] * std::pow(std::pow(delta - 1.0, 2.0), 1.0 / (2.0 * _beta4[i]));
176  Delta = std::pow(theta, 2) + _B4[i] * std::pow(std::pow(delta - 1.0, 2.0), _a4[i]);
177  Psi = std::exp(-_C4[i] * std::pow(delta - 1.0, 2.0) - _D4[i] * std::pow(tau - 1.0, 2.0));
178  phir += _n4[i] * std::pow(Delta, _b4[i]) * delta * Psi;
179  }
180 
181  // The Helmholtz free energy is the sum of these components
182  return phi0 + phir;
183 }
std::vector< Real > _n4
std::vector< Real > _t1
std::vector< Real > _d3
std::vector< Real > _n2
std::vector< Real > _a4
std::vector< Real > _c2
std::vector< Real > _beta4
std::vector< Real > _a0
Coefficients for the ideal gas component of the Helmholtz free energy.
std::vector< Real > _D4
std::vector< Real > _gamma3
std::vector< Real > _t3
std::vector< Real > _n3
std::vector< Real > _b4
std::vector< Real > _theta0
std::vector< Real > _A4
std::vector< Real > _alpha3
std::vector< Real > _n1
Coefficients for the residual component of the Helmholtz free energy.
std::vector< Real > _C4
std::vector< Real > _d1
std::vector< Real > _t2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::vector< Real > _d2
std::vector< Real > _beta3
std::vector< Real > _B4
std::vector< Real > _eps3
Real CO2FluidProperties::pressure ( Real  density,
Real  temperature 
) const

Pressure as a function of density and temperature From Span and Wagner (reference above)

Parameters
densityCO2 density (kg/m^3)
temperatureCO2 temperature (K)
Returns
CO2 pressure (Pa)

Definition at line 440 of file CO2FluidProperties.C.

Referenced by rho(), and sublimationPressure().

441 {
442  // Check that the input parameters are within the region of validity
443  if (temperature < 216.0 || temperature > 1100.0 || density <= 0.0)
444  mooseError("Parameters out of range in ", name(), ": pressure()");
445 
446  Real pressure = 0.0;
447 
449  {
450  Real gas_density = saturatedVaporDensity(temperature);
451  Real liquid_density = saturatedLiquidDensity(temperature);
452 
453  if (density < gas_density || density > liquid_density)
454  pressure = pressureSW(density, temperature);
455  else
456  pressure = vaporPressure(temperature);
457  }
458  else
459  pressure = pressureSW(density, temperature);
460 
461  return pressure;
462 }
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
const Real _triple_point_temperature
Triple point temperature (K)
Real saturatedLiquidDensity(Real temperature) const
Saturated liquid density of CO2 Valid for temperatures between the triple point temperature and criti...
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _critical_temperature
Critical temperature (K)
Real pressureSW(Real density, Real temperature) const
Internal function to calculate pressure as a function of density and temperature using the Span and W...
Real vaporPressure(Real temperature) const
Vapor pressure.
Real saturatedVaporDensity(Real temperature) const
Saturated vapor density of CO2 Valid for temperatures between the triple point temperature and critic...
Real CO2FluidProperties::pressureSW ( Real  density,
Real  temperature 
) const

Internal function to calculate pressure as a function of density and temperature using the Span and Wagner EOS.

This function is called by pressure(density, temperature)

Parameters
densityCO2 density (kg/m^3)
temperatureCO2 temperature (K)
Returns
CO2 pressure (Pa)

Definition at line 430 of file CO2FluidProperties.C.

Referenced by pressure().

431 {
432  // Scale the input density and temperature
433  Real delta = density / _critical_density;
434  Real tau = _critical_temperature / temperature;
435 
436  return _Rco2 * temperature * density * delta * dphiSW_dd(delta, tau);
437 }
const Real _critical_density
Critical density (kg/m^3)
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
const Real _Rco2
Specific gas constant (J/mol/K)
Real dphiSW_dd(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt delta.
const Real _critical_temperature
Critical temperature (K)
Real CO2FluidProperties::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 465 of file CO2FluidProperties.C.

Referenced by c(), cp(), cv(), e(), e_dpT(), h(), h_dpT(), k(), mu(), mu_dpT(), rho_dpT(), and s().

466 {
467  // Check that the input parameters are within the region of validity
468  if (temperature < 216.0 || temperature > 1100.0 || pressure <= 0.0)
469  mooseError("Parameters out of range in ", name(), ": rho()");
470 
471  // Also check that the pressure and temperature are not in the solid phase region
474  mooseError(
475  "Input pressure and temperature in ", name(), ": rho() correspond to solid CO2 phase");
476 
477  Real density;
478  // Initial estimate of a bracketing interval for the density
479  Real lower_density = 100.0;
480  Real upper_density = 1000.0;
481 
482  // The density is found by finding the zero of the pressure calculated using the
483  // Span and Wagner EOS minus the input pressure
484  auto pressure_diff = [&pressure, &temperature, this](Real x) {
485  return this->pressure(x, temperature) - pressure;
486  };
487 
488  BrentsMethod::bracket(pressure_diff, lower_density, upper_density);
489  density = BrentsMethod::root(pressure_diff, lower_density, upper_density);
490 
491  return density;
492 }
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
Real sublimationPressure(Real temperature) const
Sublimation pressure.
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:58
const Real _triple_point_temperature
Triple point temperature (K)
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
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:14
void CO2FluidProperties::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 495 of file CO2FluidProperties.C.

Referenced by mu_dpT(), and rho_e_dpT().

497 {
498  rho = this->rho(pressure, temperature);
499  // Scale the density and temperature
500  Real delta = rho / _critical_density;
501  Real tau = _critical_temperature / temperature;
502  Real dpdd = dphiSW_dd(delta, tau);
503  Real d2pdd2 = d2phiSW_dd2(delta, tau);
504 
505  drho_dp = 1.0 / (_Rco2 * temperature * delta * (2.0 * dpdd + delta * d2pdd2));
506  drho_dT =
507  rho * (tau * d2phiSW_ddt(delta, tau) - dpdd) / temperature / (2.0 * dpdd + delta * d2pdd2);
508 }
const Real _critical_density
Critical density (kg/m^3)
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
Real d2phiSW_dd2(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta.
const Real _Rco2
Specific gas constant (J/mol/K)
Real dphiSW_dd(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt delta.
Real d2phiSW_ddt(Real delta, Real tau) const
Second derivative of Helmholtz free energy wrt delta and tau.
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _critical_temperature
Critical temperature (K)
void CO2FluidProperties::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 665 of file CO2FluidProperties.C.

673 {
674  rho_dpT(pressure, temperature, rho, drho_dp, drho_dT);
675  e_dpT(pressure, temperature, e, de_dp, de_dT);
676 }
const std::string temperature
Definition: NS.h:25
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 pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
virtual Real e(Real pressure, Real temperature) const override
Internal energy.
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.
Real CO2FluidProperties::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 783 of file CO2FluidProperties.C.

784 {
785  // Require density first
786  Real density = rho(pressure, temperature);
787  // Scale the input density and temperature
788  Real delta = density / _critical_density;
789  Real tau = _critical_temperature / temperature;
790 
791  return _Rco2 * (tau * dphiSW_dt(delta, tau) - phiSW(delta, tau));
792 }
const Real _critical_density
Critical density (kg/m^3)
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
virtual Real rho(Real pressure, Real temperature) const override
Density.
Real phiSW(Real delta, Real tau) const
Helmholtz free energy for CO2 From Span and Wagner (reference above)
const Real _Rco2
Specific gas constant (J/mol/K)
Real dphiSW_dt(Real delta, Real tau) const
Derivative of Helmholtz free energy wrt tau.
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _critical_temperature
Critical temperature (K)
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 117 of file CO2FluidProperties.C.

Referenced by pressure().

118 {
119  if (temperature < _triple_point_temperature || temperature > _critical_temperature)
120  mooseError("Temperature is out of range in ", name(), ": saturatedLiquiDensity()");
121 
122  Real Tstar = temperature / _critical_temperature;
123 
124  Real logdensity = 1.9245108 * std::pow(1.0 - Tstar, 0.34) -
125  0.62385555 * std::pow(1.0 - Tstar, 0.5) -
126  0.32731127 * std::pow(1.0 - Tstar, 10.0 / 6.0) +
127  0.39245142 * std::pow(1.0 - Tstar, 11.0 / 6.0);
128 
129  return _critical_density * std::exp(logdensity);
130 }
const Real _critical_density
Critical density (kg/m^3)
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _critical_temperature
Critical temperature (K)
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 133 of file CO2FluidProperties.C.

Referenced by pressure().

134 {
135  if (temperature < _triple_point_temperature || temperature > _critical_temperature)
136  mooseError("Temperature is out of range in ", name(), ": saturatedVaporDensity()");
137 
138  Real Tstar = temperature / _critical_temperature;
139 
140  Real logdensity =
141  (-1.7074879 * std::pow(1.0 - Tstar, 0.34) - 0.82274670 * std::pow(1.0 - Tstar, 0.5) -
142  4.6008549 * (1.0 - Tstar) - 10.111178 * std::pow(1.0 - Tstar, 7.0 / 3.0) -
143  29.742252 * std::pow(1.0 - Tstar, 14.0 / 3.0));
144 
145  return _critical_density * std::exp(logdensity);
146 }
const Real _critical_density
Critical density (kg/m^3)
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _critical_temperature
Critical temperature (K)
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 84 of file CO2FluidProperties.C.

Referenced by rho().

85 {
87  mooseError(
88  "Temperature is above the triple point temperature in ", name(), ": sublimationPressure()");
89 
91 
93  std::exp((-14.740846 * (1.0 - Tstar) + 2.4327015 * std::pow(1.0 - Tstar, 1.9) -
94  5.3061778 * std::pow(1.0 - Tstar, 2.9)) /
95  Tstar);
96 
97  return pressure;
98 }
const std::string temperature
Definition: NS.h:25
const Real _triple_point_temperature
Triple point temperature (K)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real pressure(Real density, Real temperature) const
Pressure as a function of density and temperature From Span and Wagner (reference above) ...
const Real _triple_point_pressure
Triple point pressure (Pa)
Real CO2FluidProperties::triplePointPressure ( ) const

CO2 triple point pressure.

Returns
triple point pressure (Pa)

Definition at line 59 of file CO2FluidProperties.C.

60 {
62 }
const Real _triple_point_pressure
Triple point pressure (Pa)
Real CO2FluidProperties::triplePointTemperature ( ) const

CO2 triple point temperature.

Returns
triple point temperature (K)

Definition at line 65 of file CO2FluidProperties.C.

66 {
68 }
const Real _triple_point_temperature
Triple point temperature (K)
Real CO2FluidProperties::vaporPressure ( Real  temperature) const

Vapor pressure.

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

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

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

Definition at line 101 of file CO2FluidProperties.C.

Referenced by pressure().

102 {
103  if (temperature < _triple_point_temperature || temperature > _critical_temperature)
104  mooseError("Temperature is out of range in ", name(), ": vaporPressure()");
105 
106  Real Tstar = temperature / _critical_temperature;
107 
108  Real logpressure =
109  (-7.0602087 * (1.0 - Tstar) + 1.9391218 * std::pow(1.0 - Tstar, 1.5) -
110  1.6463597 * std::pow(1.0 - Tstar, 2.0) - 3.2995634 * std::pow(1.0 - Tstar, 4.0)) /
111  Tstar;
112 
113  return _critical_pressure * std::exp(logpressure);
114 }
const Real _critical_pressure
Critical pressure (Pa)
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _critical_temperature
Critical temperature (K)

Member Data Documentation

std::vector<Real> 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 299 of file CO2FluidProperties.h.

Referenced by d2phiSW_dt2(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_a4 {3.5, 3.5, 3.5}
protected

Definition at line 335 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_A4 {0.7, 0.7, 0.7}
protected

Definition at line 338 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_alpha3 {25.0, 25.0, 25.0, 15.0, 20.0}
protected

Definition at line 330 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_b4 {0.875, 0.925, 0.875}
protected

Definition at line 336 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_B4 {0.3, 0.3, 1.0}
protected

Definition at line 339 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_beta3 {325.0, 300.0, 300.0, 275.0, 275.0}
protected

Definition at line 331 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_beta4 {0.3, 0.3, 0.3}
protected

Definition at line 337 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_c2
protected
Initial value:
{1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0,
2.0, 2.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 6.0}

Definition at line 324 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_C4 {10.0, 10.0, 12.5}
protected

Definition at line 340 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

const Real CO2FluidProperties::_critical_density = 467.6
protected
const Real CO2FluidProperties::_critical_pressure = 7.3773e6
protected

Critical pressure (Pa)

Definition at line 286 of file CO2FluidProperties.h.

Referenced by criticalPressure(), and vaporPressure().

const Real CO2FluidProperties::_critical_temperature = 304.1282
protected
std::vector<Real> CO2FluidProperties::_d1 {1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 3.0}
protected

Definition at line 310 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_d2
protected
Initial value:
{1.0, 2.0, 4.0, 5.0, 5.0, 5.0, 6.0, 6.0, 6.0, 1.0, 1.0, 4.0, 4.0, 4.0,
7.0, 8.0, 2.0, 3.0, 3.0, 5.0, 5.0, 6.0, 7.0, 8.0, 10.0, 4.0, 8.0}

Definition at line 320 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_d3 {2.0, 2.0, 2.0, 3.0, 3.0}
protected

Definition at line 328 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_D4 {275.0, 275.0, 275.0}
protected

Definition at line 341 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_eps3 {1.0, 1.0, 1.0, 1.0, 1.0}
protected

Definition at line 333 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_gamma3 {1.16, 1.19, 1.19, 1.25, 1.25}
protected

Definition at line 332 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

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

Molar mass of CO2 (kg/mol)

Definition at line 284 of file CO2FluidProperties.h.

Referenced by molarMass(), and partialDensity().

std::vector<Real> 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 303 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> 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 312 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

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

Definition at line 326 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_n4 {-0.66642276540751, 0.72608632349897, 0.055068668612842}
protected

Definition at line 334 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

const Real SinglePhaseFluidPropertiesPT::_R
protectedinherited
const Real CO2FluidProperties::_Rco2 = 188.9241
protected

Specific gas constant (J/mol/K)

Definition at line 296 of file CO2FluidProperties.h.

Referenced by c(), cp(), cv(), e(), e_dpT(), h(), h_dpT(), pressureSW(), rho_dpT(), and s().

std::vector<Real> CO2FluidProperties::_t1 {0.0, 0.75, 1.0, 2.0, 0.75, 2.0, 0.75}
protected

Definition at line 311 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> 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 322 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

std::vector<Real> CO2FluidProperties::_t3 {1.0, 0.0, 1.0, 3.0, 3.0}
protected

Definition at line 329 of file CO2FluidProperties.h.

Referenced by d2phiSW_dd2(), d2phiSW_ddt(), d2phiSW_dt2(), dphiSW_dd(), dphiSW_dt(), and phiSW().

const Real SinglePhaseFluidPropertiesPT::_T_c2k
protectedinherited
std::vector<Real> CO2FluidProperties::_theta0 {3.15163, 6.11190, 6.77708, 11.32384, 27.08792}
protected

Definition at line 300 of file CO2FluidProperties.h.

Referenced by d2phiSW_dt2(), dphiSW_dt(), and phiSW().

const Real CO2FluidProperties::_triple_point_pressure = 0.51795e6
protected

Triple point pressure (Pa)

Definition at line 292 of file CO2FluidProperties.h.

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

const Real CO2FluidProperties::_triple_point_temperature = 216.592
protected

Triple point temperature (K)

Definition at line 294 of file CO2FluidProperties.h.

Referenced by meltingPressure(), pressure(), rho(), sublimationPressure(), and triplePointTemperature().


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