www.mooseframework.org
HeliumFluidProperties.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "HeliumFluidProperties.h"
11 
12 registerMooseObject("FluidPropertiesApp", HeliumFluidProperties);
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<SinglePhaseFluidProperties>();
19  params.addClassDescription("Fluid properties for helium");
20  return params;
21 }
22 
23 HeliumFluidProperties::HeliumFluidProperties(const InputParameters & parameters)
24  : SinglePhaseFluidProperties(parameters), _cv(3117.0), _cp(5195.0)
25 {
26 }
27 
28 std::string
30 {
31  return "helium";
32 }
33 
34 Real
35 HeliumFluidProperties::p_from_v_e(Real v, Real e) const
36 {
37  Real T = T_from_v_e(v, e);
38  return T / (48.14 * v - 0.4446 / std::pow(T, 0.2)) * 1.0e5;
39 }
40 
41 void
42 HeliumFluidProperties::p_from_v_e(Real v, Real e, Real & p, Real & dp_dv, Real & dp_de) const
43 {
44  p = p_from_v_e(v, e);
45 
46  Real T, dT_dv, dT_de;
47  T_from_v_e(v, e, T, dT_dv, dT_de);
48 
49  Real val = 48.14 * v - 0.4446 / std::pow(T, 0.2);
50  Real dp_dT = 1.0e5 / val - 0.4446 * 0.2e5 * std::pow(T, -0.2) / (val * val);
51 
52  dp_dv = -48.14e5 * T / (val * val); // taking advantage of dT_dv = 0.0;
53  dp_de = dp_dT * dT_de;
54 }
55 
56 void
58  const DualReal & v, const DualReal & e, DualReal & p, DualReal & dp_dv, DualReal & dp_de) const
59 {
60  p = SinglePhaseFluidProperties::p_from_v_e(v, e);
61 
62  DualReal T, dT_dv, dT_de;
63  T_from_v_e(v, e, T, dT_dv, dT_de);
64 
65  auto val = 48.14 * v - 0.4446 / std::pow(T, 0.2);
66  auto dp_dT = 1.0e5 / val - 0.4446 * 0.2e5 * std::pow(T, -0.2) / (val * val);
67 
68  dp_dv = -48.14e5 * T / (val * val); // taking advantage of dT_dv = 0.0;
69  dp_de = dp_dT * dT_de;
70 }
71 
72 Real
73 HeliumFluidProperties::T_from_v_e(Real /*v*/, Real e) const
74 {
75  return e / _cv;
76 }
77 
78 void
79 HeliumFluidProperties::T_from_v_e(Real v, Real e, Real & T, Real & dT_dv, Real & dT_de) const
80 {
81  T = T_from_v_e(v, e);
82  dT_dv = 0.0;
83  dT_de = 1.0 / _cv;
84 }
85 
86 void
88  const DualReal & v, const DualReal & e, DualReal & T, DualReal & dT_dv, DualReal & dT_de) const
89 {
90  T = SinglePhaseFluidProperties::T_from_v_e(v, e);
91  dT_dv = 0.0;
92  dT_de = 1.0 / _cv;
93 }
94 
95 Real
96 HeliumFluidProperties::c_from_v_e(Real v, Real e) const
97 {
98  Real p = p_from_v_e(v, e);
99  Real T = T_from_v_e(v, e);
100 
101  Real rho, drho_dp, drho_dT;
102  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
103 
104  Real c2 = -(p / rho / rho - _cv / drho_dT) / (_cv * drho_dp / drho_dT);
105  return std::sqrt(c2);
106 }
107 
108 void
109 HeliumFluidProperties::c_from_v_e(Real v, Real e, Real & c, Real & dc_dv, Real & dc_de) const
110 {
111  DualReal myv = v;
112  Moose::derivInsert(myv.derivatives(), 0, 1);
113  Moose::derivInsert(myv.derivatives(), 1, 0);
114  DualReal mye = e;
115  Moose::derivInsert(mye.derivatives(), 0, 0);
116  Moose::derivInsert(mye.derivatives(), 1, 1);
117 
118  auto p = SinglePhaseFluidProperties::p_from_v_e(myv, mye);
119  auto T = SinglePhaseFluidProperties::T_from_v_e(myv, mye);
120 
121  DualReal rho, drho_dp, drho_dT;
122  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
123 
124  auto cc = std::sqrt(-(p / rho / rho - _cv / drho_dT) / (_cv * drho_dp / drho_dT));
125  c = cc.value();
126  dc_dv = cc.derivatives()[0];
127  dc_de = cc.derivatives()[1];
128 }
129 
130 Real HeliumFluidProperties::cp_from_v_e(Real /*v*/, Real /*e*/) const { return _cp; }
131 
132 void
133 HeliumFluidProperties::cp_from_v_e(Real v, Real e, Real & cp, Real & dcp_dv, Real & dcp_de) const
134 {
135  cp = cp_from_v_e(v, e);
136  dcp_dv = 0.0;
137  dcp_de = 0.0;
138 }
139 
140 Real HeliumFluidProperties::cv_from_v_e(Real /*v*/, Real /*e*/) const { return _cv; }
141 
142 void
143 HeliumFluidProperties::cv_from_v_e(Real v, Real e, Real & cv, Real & dcv_dv, Real & dcv_de) const
144 {
145  cv = cv_from_v_e(v, e);
146  dcv_dv = 0.0;
147  dcv_de = 0.0;
148 }
149 
150 Real
152 {
153  return 3.674e-7 * std::pow(T_from_v_e(v, e), 0.7);
154 }
155 
156 Real
158 {
159  Real p_in_bar = p_from_v_e(v, e) * 1.0e-5;
160  Real T = T_from_v_e(v, e);
161  return 2.682e-3 * (1.0 + 1.123e-3 * p_in_bar) * std::pow(T, 0.71 * (1.0 - 2.0e-4 * p_in_bar));
162 }
163 
164 Real
166 {
167  Real rho;
168  Real drho_dT;
169  Real drho_dp;
170  rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
171 
172  return -drho_dT / rho;
173 }
174 
175 Real
177 {
178  Real p_in_bar = pressure * 1.0e-5;
179  return 48.14 * p_in_bar / (temperature + 0.4446 * p_in_bar / std::pow(temperature, 0.2));
180 }
181 
182 void
184  Real pressure, Real temperature, Real & rho, Real & drho_dp, Real & drho_dT) const
185 {
187  Real val = 1.0 / (temperature + 0.4446e-5 * pressure / std::pow(temperature, 0.2));
188  drho_dp = 48.14e-5 * (val - 0.4446e-5 * pressure * val * val / std::pow(temperature, 0.2));
189  drho_dT =
190  -48.14e-5 * pressure * val * val * (1.0 - 0.08892e-5 * pressure / std::pow(temperature, 1.2));
191 }
192 
193 void
195  const DualReal & temperature,
196  DualReal & rho,
197  DualReal & drho_dp,
198  DualReal & drho_dT) const
199 {
200  rho = SinglePhaseFluidProperties::rho_from_p_T(pressure, temperature);
201  auto val = 1.0 / (temperature + 0.4446e-5 * pressure / std::pow(temperature, 0.2));
202  drho_dp = 48.14e-5 * (val - 0.4446e-5 * pressure * val * val / std::pow(temperature, 0.2));
203  drho_dT =
204  -48.14e-5 * pressure * val * val * (1.0 - 0.08892e-5 * pressure / std::pow(temperature, 1.2));
205 }
206 
207 Real
208 HeliumFluidProperties::e_from_p_T(Real /*pressure*/, Real temperature) const
209 {
210  return _cv * temperature;
211 }
212 
213 void
215  Real pressure, Real temperature, Real & e, Real & de_dp, Real & de_dT) const
216 {
218  de_dp = 0.0;
219  de_dT = _cv;
220 }
221 
222 Real
223 HeliumFluidProperties::h_from_p_T(Real /*pressure*/, Real temperature) const
224 {
225  return _cp * temperature;
226 }
227 
228 void
230  Real pressure, Real temperature, Real & h, Real & dh_dp, Real & dh_dT) const
231 {
233  dh_dp = 0.0;
234  dh_dT = _cp;
235 }
236 
237 Real
239 {
240  return 4.002602e-3;
241 }
242 
243 Real HeliumFluidProperties::cp_from_p_T(Real /*pressure*/, Real /*temperature*/) const
244 {
245  return _cp;
246 }
247 
248 void
250  Real pressure, Real temperature, Real & cp, Real & dcp_dp, Real & dcp_dT) const
251 {
253  dcp_dp = 0.0;
254  dcp_dT = 0.0;
255 }
256 
257 Real HeliumFluidProperties::cv_from_p_T(Real /*pressure*/, Real /*temperature*/) const
258 {
259  return _cv;
260 }
261 
262 void
264  Real pressure, Real temperature, Real & cv, Real & dcv_dp, Real & dcv_dT) const
265 {
267  dcv_dp = 0.0;
268  dcv_dT = 0.0;
269 }
270 
271 Real
272 HeliumFluidProperties::mu_from_p_T(Real /*pressure*/, Real temperature) const
273 {
274  return 3.674e-7 * std::pow(temperature, 0.7);
275 }
276 
277 void
279  Real pressure, Real temperature, Real & mu, Real & dmu_dp, Real & dmu_dT) const
280 {
282  dmu_dp = 0.0;
283  dmu_dT = 3.674e-7 * 0.7 * std::pow(temperature, -0.3);
284 }
285 
286 Real
288 {
289  return 2.682e-3 * (1.0 + 1.123e-8 * pressure) *
290  std::pow(temperature, 0.71 * (1.0 - 2.0e-9 * pressure));
291 }
292 
293 void
295  Real pressure, Real temperature, Real & k, Real & dk_dp, Real & dk_dT) const
296 {
298 
299  Real term = 1.0 + 1.123e-8 * pressure;
300  Real exp = 0.71 * (1.0 - 2.0e-9 * pressure);
301 
302  dk_dp = 2.682e-3 * (term * 0.71 * (-2.0e-9) * std::log(temperature) * std::pow(temperature, exp) +
303  std::pow(temperature, exp) * 1.123e-8);
304 
305  dk_dT = 2.682e-3 * term * exp * std::pow(temperature, exp - 1.0);
306 }
HeliumFluidProperties::molarMass
virtual Real molarMass() const override
Molar mass.
Definition: HeliumFluidProperties.C:238
registerMooseObject
registerMooseObject("FluidPropertiesApp", HeliumFluidProperties)
HeliumFluidProperties::rho_from_p_T
virtual Real rho_from_p_T(Real p, Real T) const override
Density from pressure and temperature.
Definition: HeliumFluidProperties.C:176
HeliumFluidProperties::h_from_p_T
virtual Real h_from_p_T(Real p, Real T) const override
Specific enthalpy from pressure and temperature.
Definition: HeliumFluidProperties.C:223
HeliumFluidProperties::k_from_v_e
virtual Real k_from_v_e(Real v, Real e) const override
Thermal conductivity from specific volume and specific internal energy.
Definition: HeliumFluidProperties.C:157
SinglePhaseFluidProperties
Common class for single phase fluid properties.
Definition: SinglePhaseFluidProperties.h:89
HeliumFluidProperties::k_from_p_T
virtual Real k_from_p_T(Real p, Real T) const override
Thermal conductivity from pressure and temperature.
Definition: HeliumFluidProperties.C:287
pow
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Definition: ExpressionBuilder.h:673
HeliumFluidProperties
Fluid properties for helium .
Definition: HeliumFluidProperties.h:22
SinglePhaseFluidProperties::v
v
Definition: SinglePhaseFluidProperties.h:155
HeliumFluidProperties::cp_from_v_e
virtual Real cp_from_v_e(Real v, Real e) const override
Isobaric specific heat from specific volume and specific internal energy.
Definition: HeliumFluidProperties.C:130
HeliumFluidProperties::mu_from_v_e
virtual Real mu_from_v_e(Real v, Real e) const override
Dynamic viscosity from specific volume and specific internal energy.
Definition: HeliumFluidProperties.C:151
HeliumFluidProperties::HeliumFluidProperties
HeliumFluidProperties(const InputParameters &parameters)
Definition: HeliumFluidProperties.C:23
HeliumFluidProperties::cv_from_p_T
virtual Real cv_from_p_T(Real p, Real T) const override
Isochoric specific heat capacity from pressure and temperature.
Definition: HeliumFluidProperties.C:257
HeliumFluidProperties::mu_from_p_T
virtual Real mu_from_p_T(Real p, Real T) const override
Dynamic viscosity from pressure and temperature.
Definition: HeliumFluidProperties.C:272
validParams< HeliumFluidProperties >
InputParameters validParams< HeliumFluidProperties >()
Definition: HeliumFluidProperties.C:16
HeliumFluidProperties::T_from_v_e
virtual Real T_from_v_e(Real v, Real e) const override
Temperature from specific volume and specific internal energy.
Definition: HeliumFluidProperties.C:73
HeliumFluidProperties::e_from_p_T
virtual void e_from_p_T(Real p, Real T, Real &e, Real &de_dp, Real &de_dT) const override
Specific internal energy and its derivatives from pressure and temperature.
Definition: HeliumFluidProperties.C:214
SinglePhaseFluidProperties::T
e e e e p h T T T T T T
Definition: SinglePhaseFluidProperties.h:177
HeliumFluidProperties::cv_from_v_e
virtual Real cv_from_v_e(Real v, Real e) const override
Isochoric specific heat from specific volume and specific internal energy.
Definition: HeliumFluidProperties.C:140
HeliumFluidProperties::fluidName
virtual std::string fluidName() const override
Fluid name.
Definition: HeliumFluidProperties.C:29
SinglePhaseFluidProperties::rho
e e e e p h T rho
Definition: SinglePhaseFluidProperties.h:169
HeliumFluidProperties::p_from_v_e
virtual Real p_from_v_e(Real v, Real e) const override
Pressure from specific volume and specific internal energy.
Definition: HeliumFluidProperties.C:35
HeliumFluidProperties::c_from_v_e
virtual Real c_from_v_e(Real v, Real e) const override
Speed of sound from specific volume and specific internal energy.
Definition: HeliumFluidProperties.C:96
HeliumFluidProperties::_cp
const Real _cp
specific heat at constant pressure
Definition: HeliumFluidProperties.h:332
HeliumFluidProperties.h
HeliumFluidProperties::_cv
const Real _cv
specific heat at constant volume
Definition: HeliumFluidProperties.h:329
NS::temperature
const std::string temperature
Definition: NS.h:26
HeliumFluidProperties::cp_from_p_T
virtual Real cp_from_p_T(Real p, Real T) const override
Isobaric specific heat capacity from pressure and temperature.
Definition: HeliumFluidProperties.C:243
HeliumFluidProperties::beta_from_p_T
virtual Real beta_from_p_T(Real p, Real T) const override
Thermal expansion coefficient from pressure and temperature.
Definition: HeliumFluidProperties.C:165
SinglePhaseFluidProperties::p
e e e e p h p
Definition: SinglePhaseFluidProperties.h:167
validParams< SinglePhaseFluidProperties >
InputParameters validParams< SinglePhaseFluidProperties >()
Definition: SinglePhaseFluidProperties.C:14
HeliumFluidProperties::e_from_p_T
virtual Real e_from_p_T(Real p, Real T) const override
Specific internal energy from pressure and temperature.
Definition: HeliumFluidProperties.C:208
NS::pressure
const std::string pressure
Definition: NS.h:25
SinglePhaseFluidProperties::h
e e e e h
Definition: SinglePhaseFluidProperties.h:163