https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PBSodiumFluidProperties.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
11
13
14// Use the array to initialize the const static vector
15const Real sodium_T[] = {
16 388.15, 398.15, 408.15, 418.15, 428.15, 438.15, 448.15, 458.15, 468.15, 478.15,
17 488.15, 498.15, 508.15, 518.15, 528.15, 538.15, 548.15, 558.15, 568.15, 578.15,
18 588.15, 598.15, 608.15, 618.15, 628.15, 638.15, 648.15, 658.15, 668.15, 678.15,
19 688.15, 698.15, 708.15, 718.15, 728.15, 738.15, 748.15, 758.15, 768.15, 778.15,
20 788.15, 798.15, 808.15, 818.15, 828.15, 838.15, 848.15, 858.15, 868.15, 878.15,
21 888.15, 898.15, 908.15, 918.15, 928.15, 938.15, 948.15, 958.15, 968.15, 978.15,
22 988.15, 998.15, 1008.15, 1018.15, 1028.15, 1038.15, 1048.15, 1058.15, 1068.15, 1078.15,
23 1088.15, 1098.15, 1108.15, 1118.15, 1128.15, 1138.15, 1148.15};
24// sodium temperature vector corresponding to _e_vec enthalpy vector
25const std::vector<Real>
27 sodium_T + sizeof(sodium_T) / sizeof(sodium_T[0]));
28
29const Real sodium_e[] = {
30 492755, 505884, 518995, 532089, 545166, 558227, 571270,
31 584298, 597309, 610305, 623286, 636252, 649203, 662139,
32 675061, 687970, 700865, 713747, 726616, 739472, 752316,
33 765148, 777969, 790778, 803576, 816363, 829140, 841907,
34 854665, 867413, 880151, 892882, 905603, 918317, 931023,
35 943721, 956412, 969097, 981775, 994447, 1.00711e+06, 1.01977e+06,
36 1.03243e+06, 1.04508e+06, 1.05773e+06, 1.07037e+06, 1.08301e+06, 1.09565e+06, 1.10828e+06,
37 1.12091e+06, 1.13354e+06, 1.14617e+06, 1.15879e+06, 1.17142e+06, 1.18404e+06, 1.19667e+06,
38 1.20929e+06, 1.22191e+06, 1.23454e+06, 1.24717e+06, 1.25979e+06, 1.27243e+06, 1.28506e+06,
39 1.29769e+06, 1.31033e+06, 1.32298e+06, 1.33562e+06, 1.34828e+06, 1.36093e+06, 1.3736e+06,
40 1.38626e+06, 1.39894e+06, 1.41162e+06, 1.42431e+06, 1.43701e+06, 1.44971e+06, 1.46243e+06};
41// sodium enthalpy vector corresponding to _temperature_vec temperature vector
42const std::vector<Real>
44
47{
49 params.addParam<Real>("p_0", 1.e5, "Reference pressure");
51 "Class that provides the methods that realize the equations of state for Liquid Sodium");
52 return params;
53}
54
56 : SinglePhaseFluidProperties(parameters), _p_0(getParam<Real>("p_0"))
57{
59 // Evaluate cp at the heat-capacity correlation bounds (cp_from_p_T clamps to this range), so the
60 // precomputed boundary values do not raise spurious invalid-solution flags during construction.
65}
66
67Real
68PBSodiumFluidProperties::rho_from_p_T(Real /*pressure*/, Real temperature) const
69{
70 Real A12 = 1.00423e3;
71 Real A13 = -0.21390;
72 Real A14 = -1.1046e-5;
73 return (A12 + A13 * temperature + A14 * temperature * temperature);
74}
75
76void
78 Real pressure, Real temperature, Real & rho, Real & drho_dp, Real & drho_dT) const
79{
80 rho = rho_from_p_T(pressure, temperature);
81 drho_dp = 0;
82 Real A13 = -0.21390;
83 Real A14 = -1.1046e-5;
84 drho_dT = (A13 + 2.0 * A14 * temperature);
85}
86
87Real
88PBSodiumFluidProperties::h_from_p_T(Real /*pressure*/, Real temperature) const
89{
90 if (temperature > _Tmax + 1.e-3)
91 {
92 flagInvalidSolution(
93 "Temperature above the valid range for the sodium enthalpy computation; extrapolating");
94 return _H_Tmax + _Cp_Tmax * (temperature - _Tmax);
95 }
96 else if (temperature < _Tmin - 1.e-3)
97 {
98 flagInvalidSolution(
99 "Temperature below the valid range for the sodium enthalpy computation; extrapolating");
100 return _H_Tmin + _Cp_Tmin * (temperature - _Tmin);
101 }
102 else
103 return _H0 + F_enthalpy(temperature) - F_enthalpy(_T0);
104}
105
106void
108 Real pressure, Real temperature, Real & h, Real & dh_dp, Real & dh_dT) const
109{
110 h = h_from_p_T(pressure, temperature);
111 // This model defines enthalpy as pressure-independent and its temperature derivative as cp.
112 dh_dp = 0.0;
113 dh_dT = cp_from_p_T(pressure, temperature);
114}
115
116Real
117PBSodiumFluidProperties::beta_from_p_T(Real /*pressure*/, Real temperature) const
118{
119 Real A42 = 2.5156e-6;
120 Real A43 = 0.79919;
121 Real A44 = -6.9716e2;
122 Real A45 = 3.3140e5;
123 Real A46 = -7.0502e7;
124 Real A47 = 5.4920e9;
125 Real dt = 2503.3 - temperature;
126 return (A42 + A43 / dt + A44 / dt / dt + A45 / (dt * dt * dt) + A46 / (dt * dt * dt * dt) +
127 A47 / (dt * dt * dt * dt * dt));
128}
129
130Real
131PBSodiumFluidProperties::cv_from_p_T(Real pressure, Real temperature) const
132{
133 // Consistent with SAM model cv is assumed to be equal to cp
134 // cv is currentl not being used in subchannel algorithm.
135 return cp_from_p_T(pressure, temperature);
136}
137
138Real
139PBSodiumFluidProperties::cp_from_p_T(Real /*pressure*/, Real temperature) const
140{
141 if (temperature < _Tmin_cp_k)
142 {
143 temperature = _Tmin_cp_k;
144 flagInvalidSolution(
145 "Temperature below the valid range [388.15, 1148.15] K for the sodium heat capacity "
146 "computation");
147 }
148 if (temperature > _Tmax_cp_k)
149 {
150 temperature = _Tmax_cp_k;
151 flagInvalidSolution(
152 "Temperature above the valid range [388.15, 1148.15] K for the sodium heat capacity "
153 "computation");
154 }
155 temperature = temperature_correction(temperature);
156 Real A28 = 7.3898e5;
157 Real A29 = 3.154e5;
158 Real A30 = 1.1340e3;
159 Real A31 = -2.2153e-1;
160 Real A32 = 1.1156e-4;
161 Real dt = 2503.3 - temperature;
162 return (A28 / dt / dt + A29 / dt + A30 + A31 * dt + A32 * dt * dt);
163}
164
165void
167 Real pressure, Real temperature, Real & cp, Real & dcp_dp, Real & dcp_dT) const
168{
169 cp = cp_from_p_T(pressure, temperature);
170 dcp_dp = 0;
171 Real A28 = 7.3898e5;
172 Real A29 = 3.154e5;
173 Real A31 = -2.2153e-1;
174 Real A32 = 1.1156e-4;
175 Real dt = 2503.3 - temperature;
176 if (temperature < _Tmax && temperature > _Tmin)
177 dcp_dT = (2 * A28 / dt / dt / dt + A29 / dt / dt - A31 - 2 * A32 * dt);
178 else
179 dcp_dT = 0.;
180}
181
182Real
183PBSodiumFluidProperties::mu_from_p_T(Real /*pressure*/, Real temperature) const
184{
185 Real A52 = 3.6522e-5;
186 Real A53 = 0.16626;
187 Real A54 = -4.56877e1;
188 Real A55 = 2.8733e4;
189 return (A52 + A53 / temperature + A54 / temperature / temperature +
190 A55 / (temperature * temperature * temperature));
191}
192
193Real
194PBSodiumFluidProperties::mu_from_rho_T(Real /*rho*/, Real temperature) const
195{
196 Real A52 = 3.6522e-5;
197 Real A53 = 0.16626;
198 Real A54 = -4.56877e1;
199 Real A55 = 2.8733e4;
200 return (A52 + A53 / temperature + A54 / temperature / temperature +
201 A55 / (temperature * temperature * temperature));
202}
203
204Real
205PBSodiumFluidProperties::k_from_p_T(Real /*pressure*/, Real temperature) const
206{
207 if (temperature < _Tmin_cp_k)
208 {
209 temperature = _Tmin_cp_k;
210 flagInvalidSolution(
211 "Temperature below the valid range [388.15, 1148.15] K for the sodium thermal "
212 "conductivity computation");
213 }
214 if (temperature > _Tmax_cp_k)
215 {
216 temperature = _Tmax_cp_k;
217 flagInvalidSolution(
218 "Temperature above the valid range [388.15, 1148.15] K for the sodium thermal "
219 "conductivity computation");
220 }
221 Real A48 = 1.1045e2;
222 Real A49 = -6.5112e-2;
223 Real A50 = 1.5430e-5;
224 Real A51 = -2.4617e-9;
225 return (A48 + A49 * temperature + A50 * temperature * temperature +
226 A51 * temperature * temperature * temperature);
227}
228
229Real
231{
232 Real A28 = 7.3898e5;
233 Real A29 = 3.154e5;
234 Real A30 = 1.1340e3;
235 Real A31 = -2.2153e-1;
236 Real A32 = 1.1156e-4;
237 Real dt = 2503.3 - temperature;
238
239 return -(-A28 / dt + A29 * std::log(dt) + A30 * dt + 0.5 * A31 * dt * dt +
240 1.0 / 3 * A32 * dt * dt * dt);
241}
242
243Real
245{
246 if (temperature > _Tmax)
247 return _Tmax;
248 else if (temperature < _Tmin)
249 return _Tmin;
250 else
251 return temperature;
252}
253
254Real
255PBSodiumFluidProperties::T_from_p_h(Real /*pressure*/, Real enthalpy) const
256{
257 // the algorithm were made fully compliant with the enthalpy correlations above.
258 // Consistent with the approach in SAM, it ignores that sodium boiling.
259 // This part will be revisited in future.
260 Real temperature = 0;
261 if (enthalpy > _H_Tmax)
262 {
263 flagInvalidSolution(
264 "Enthalpy above the valid range for the sodium temperature computation; extrapolating");
265 temperature = (enthalpy - _H_Tmax) / _Cp_Tmax + _Tmax;
266 }
267 else if (enthalpy < _H_Tmin)
268 {
269 flagInvalidSolution(
270 "Enthalpy below the valid range for the sodium temperature computation; extrapolating");
271 temperature = (enthalpy - _H_Tmin) / _Cp_Tmin + _Tmin;
272 }
273 else
274 {
275 for (unsigned int i = 0; i < _e_vec.size() - 1; i++)
276 {
277 if (enthalpy > _e_vec[i] && enthalpy <= _e_vec[i + 1])
278 {
279 temperature = _temperature_vec[i] + (enthalpy - _e_vec[i]) / (_e_vec[i + 1] - _e_vec[i]) *
281 break;
282 }
283 }
284 }
285 return temperature;
286}
const double rho
registerMooseObject("SubChannelApp", PBSodiumFluidProperties)
const Real sodium_e[]
const Real sodium_T[]
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Class that implements the equations of state for single phase liquid sodium.
Real temperature_correction(Real &temperature) const
virtual Real h_from_p_T(Real pressure, Real temperature) const override
virtual Real beta_from_p_T(Real pressure, Real temperature) const override
static constexpr Real _Tmin
min temperature
virtual Real mu_from_p_T(Real pressure, Real temperature) const override
static InputParameters validParams()
virtual Real k_from_p_T(Real pressure, Real temperature) const override
virtual Real cv_from_p_T(Real pressure, Real temperature) const override
virtual Real T_from_p_h(Real pressure, Real enthalpy) const override
static constexpr Real _T0
reference temperature
static const std::vector< Real > _temperature_vec
static constexpr Real _Tmin_cp_k
valid temperature range [K] of the heat capacity and thermal conductivity correlations
PBSodiumFluidProperties(const InputParameters &parameters)
Real F_enthalpy(Real temperature) const
const Real & _p_0
reference pressure
static constexpr Real _Tmax
max temperature
static constexpr Real _Tmax_cp_k
virtual Real cp_from_p_T(Real pressure, Real temperature) const override
static const std::vector< Real > _e_vec
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual Real mu_from_rho_T(Real rho, Real temperature) const override
Common class for single phase fluid properties.
static InputParameters validParams()
e e e e s T T T T T rho v v T e h