https://mooseframework.inl.gov
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
15 const 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
25 const std::vector<Real>
27  sodium_T + sizeof(sodium_T) / sizeof(sodium_T[0]));
28 
29 const 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
42 const std::vector<Real>
44 
47 {
49  params.addParam<Real>("p_0", 1.e5, "Reference pressure");
50  params.addClassDescription(
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 {
58  _H0 = cp_from_p_T(_p_0, _T0) * _T0;
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 
67 Real
68 PBSodiumFluidProperties::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 
76 void
78  Real pressure, Real temperature, Real & rho, Real & drho_dp, Real & drho_dT) const
79 {
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 
87 Real
88 PBSodiumFluidProperties::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 
106 Real
108 {
109  Real A42 = 2.5156e-6;
110  Real A43 = 0.79919;
111  Real A44 = -6.9716e2;
112  Real A45 = 3.3140e5;
113  Real A46 = -7.0502e7;
114  Real A47 = 5.4920e9;
115  Real dt = 2503.3 - temperature;
116  return (A42 + A43 / dt + A44 / dt / dt + A45 / (dt * dt * dt) + A46 / (dt * dt * dt * dt) +
117  A47 / (dt * dt * dt * dt * dt));
118 }
119 
120 Real
122 {
123  // Consistent with SAM model cv is assumed to be equal to cp
124  // cv is currentl not being used in subchannel algorithm.
126 }
127 
128 Real
129 PBSodiumFluidProperties::cp_from_p_T(Real /*pressure*/, Real temperature) const
130 {
131  if (temperature < _Tmin_cp_k)
132  {
134  flagInvalidSolution(
135  "Temperature below the valid range [388.15, 1148.15] K for the sodium heat capacity "
136  "computation");
137  }
138  if (temperature > _Tmax_cp_k)
139  {
141  flagInvalidSolution(
142  "Temperature above the valid range [388.15, 1148.15] K for the sodium heat capacity "
143  "computation");
144  }
146  Real A28 = 7.3898e5;
147  Real A29 = 3.154e5;
148  Real A30 = 1.1340e3;
149  Real A31 = -2.2153e-1;
150  Real A32 = 1.1156e-4;
151  Real dt = 2503.3 - temperature;
152  return (A28 / dt / dt + A29 / dt + A30 + A31 * dt + A32 * dt * dt);
153 }
154 
155 void
157  Real pressure, Real temperature, Real & cp, Real & dcp_dp, Real & dcp_dT) const
158 {
160  dcp_dp = 0;
161  Real A28 = 7.3898e5;
162  Real A29 = 3.154e5;
163  Real A31 = -2.2153e-1;
164  Real A32 = 1.1156e-4;
165  Real dt = 2503.3 - temperature;
166  if (temperature < _Tmax && temperature > _Tmin)
167  dcp_dT = (2 * A28 / dt / dt / dt + A29 / dt / dt - A31 - 2 * A32 * dt);
168  else
169  dcp_dT = 0.;
170 }
171 
172 Real
173 PBSodiumFluidProperties::mu_from_p_T(Real /*pressure*/, Real temperature) const
174 {
175  Real A52 = 3.6522e-5;
176  Real A53 = 0.16626;
177  Real A54 = -4.56877e1;
178  Real A55 = 2.8733e4;
179  return (A52 + A53 / temperature + A54 / temperature / temperature +
180  A55 / (temperature * temperature * temperature));
181 }
182 
183 Real
185 {
186  Real A52 = 3.6522e-5;
187  Real A53 = 0.16626;
188  Real A54 = -4.56877e1;
189  Real A55 = 2.8733e4;
190  return (A52 + A53 / temperature + A54 / temperature / temperature +
191  A55 / (temperature * temperature * temperature));
192 }
193 
194 Real
195 PBSodiumFluidProperties::k_from_p_T(Real /*pressure*/, Real temperature) const
196 {
197  if (temperature < _Tmin_cp_k)
198  {
200  flagInvalidSolution(
201  "Temperature below the valid range [388.15, 1148.15] K for the sodium thermal "
202  "conductivity computation");
203  }
204  if (temperature > _Tmax_cp_k)
205  {
207  flagInvalidSolution(
208  "Temperature above the valid range [388.15, 1148.15] K for the sodium thermal "
209  "conductivity computation");
210  }
211  Real A48 = 1.1045e2;
212  Real A49 = -6.5112e-2;
213  Real A50 = 1.5430e-5;
214  Real A51 = -2.4617e-9;
215  return (A48 + A49 * temperature + A50 * temperature * temperature +
217 }
218 
219 Real
221 {
222  Real A28 = 7.3898e5;
223  Real A29 = 3.154e5;
224  Real A30 = 1.1340e3;
225  Real A31 = -2.2153e-1;
226  Real A32 = 1.1156e-4;
227  Real dt = 2503.3 - temperature;
228 
229  return -(-A28 / dt + A29 * std::log(dt) + A30 * dt + 0.5 * A31 * dt * dt +
230  1.0 / 3 * A32 * dt * dt * dt);
231 }
232 
233 Real
235 {
236  if (temperature > _Tmax)
237  return _Tmax;
238  else if (temperature < _Tmin)
239  return _Tmin;
240  else
241  return temperature;
242 }
243 
244 Real
245 PBSodiumFluidProperties::T_from_p_h(Real /*pressure*/, Real enthalpy) const
246 {
247  // the algorithm were made fully compliant with the enthalpy correlations above.
248  // Consistent with the approach in SAM, it ignores that sodium boiling.
249  // This part will be revisited in future.
250  Real temperature = 0;
251  if (enthalpy > _H_Tmax)
252  {
253  flagInvalidSolution(
254  "Enthalpy above the valid range for the sodium temperature computation; extrapolating");
255  temperature = (enthalpy - _H_Tmax) / _Cp_Tmax + _Tmax;
256  }
257  else if (enthalpy < _H_Tmin)
258  {
259  flagInvalidSolution(
260  "Enthalpy below the valid range for the sodium temperature computation; extrapolating");
261  temperature = (enthalpy - _H_Tmin) / _Cp_Tmin + _Tmin;
262  }
263  else
264  {
265  for (unsigned int i = 0; i < _e_vec.size() - 1; i++)
266  {
267  if (enthalpy > _e_vec[i] && enthalpy <= _e_vec[i + 1])
268  {
269  temperature = _temperature_vec[i] + (enthalpy - _e_vec[i]) / (_e_vec[i + 1] - _e_vec[i]) *
270  (_temperature_vec[i + 1] - _temperature_vec[i]);
271  break;
272  }
273  }
274  }
275  return temperature;
276 }
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
static constexpr Real _Tmin_cp_k
valid temperature range [K] of the heat capacity and thermal conductivity correlations ...
const Real sodium_e[]
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
static constexpr Real _Tmax_cp_k
Class that implements the equations of state for single phase liquid sodium.
static const std::vector< Real > _temperature_vec
virtual Real beta_from_p_T(Real pressure, Real temperature) const override
static const std::string temperature
Definition: NS.h:60
virtual Real cv_from_p_T(Real pressure, Real temperature) const override
static constexpr Real _Tmax
max temperature
static constexpr Real _Tmin
min temperature
virtual Real cp_from_p_T(Real pressure, Real temperature) const override
static const std::string cp
Definition: NS.h:125
const double rho
static constexpr Real _T0
reference temperature
Common class for single phase fluid properties.
registerMooseObject("SubChannelApp", PBSodiumFluidProperties)
Real temperature_correction(Real &temperature) const
const Real & _p_0
reference pressure
PBSodiumFluidProperties(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real sodium_T[]
Real F_enthalpy(Real temperature) const
static const std::string pressure
Definition: NS.h:57
void addClassDescription(const std::string &doc_string)
virtual Real h_from_p_T(Real pressure, Real temperature) const override
virtual Real k_from_p_T(Real pressure, Real temperature) const override
virtual Real T_from_p_h(Real pressure, Real enthalpy) const override
Real _H0
reference enthalpy
static InputParameters validParams()
static const std::vector< Real > _e_vec
virtual Real mu_from_rho_T(Real rho, Real temperature) const override
virtual Real mu_from_p_T(Real pressure, Real temperature) const override