SinglePhaseFluidPropertiesPT.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7
9
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<FluidProperties>();
15
16  return params;
17 }
18
20  : FluidProperties(parameters), _R(8.3144598), _T_c2k(273.15)
21 {
22 }
23
25
26 Real
28 {
29  return cp(pressure, temperature) / cv(pressure, temperature);
30 }
31
32 Real
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 }
50
51 void
53  Real temperature, Real & Kh, Real & dKh_dT, Real A, Real B, Real C) const
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 }
virtual Real cp(Real pressure, Real temperature) const =0
Isobaric specific heat capacity.
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real gamma(Real pressure, Real temperature) const
Adiabatic index - ratio of specific heats.
InputParameters validParams< FluidProperties >()
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...
virtual Real cv(Real pressure, Real temperature) const =0
Isochoric specific heat.
const std::string pressure
Definition: NS.h:24
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...
SinglePhaseFluidPropertiesPT(const InputParameters &parameters)
InputParameters validParams< SinglePhaseFluidPropertiesPT >()