SodiumProperties.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
8 #include "SodiumProperties.h"
9 #include "MooseError.h"
10
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<FluidProperties>();
16  params.addClassDescription("Fluid properties for sodium");
17  return params;
18 }
19
20 SodiumProperties::SodiumProperties(const InputParameters & parameters) : FluidProperties(parameters)
21 {
22 }
23
24 Real
25 SodiumProperties::k(Real T) const
26 {
27  const Real T2 = T * T;
28  const Real T3 = T2 * T;
29  return 124.67 - 0.11381 * T + 5.5226e-5 * T2 - 1.1842e-8 * T3;
30 }
31
32 Real
33 SodiumProperties::h(Real T) const
34 {
35  const Real T2 = T * T;
36  const Real T3 = T2 * T;
37
38  // Converted from kJ/kg to J/kg.
39  return -365.77e3 + 1.6582e3 * T - 4.2395e-1 * T2 + 1.4847e-4 * T3 + 2992.6e3 / T;
40 }
41
42 Real
44 {
45  const Real T2 = T * T;
46  // Converted from kJ/kg-K to J/kg-K.
47  return 1.6582e3 - 8.4790e-1 * T + 4.4541e-4 * T2 - 2992.6e3 / T2;
48 }
49
50 Real
52 {
53  // Estimate initial guess from linear part of enthalpy.
54  Real T = (H + 365.77e3) / 1.6582e3;
55
56  // Newton-Raphson for this equation: enthalpy(T) - H = 0 = residual. This is easy because
57  // dResidual/dT is just dH/dT, which is heat capacity.
58  for (unsigned iteration = 0; iteration < 10; ++iteration)
59  {
60  Real residual = h(T) - H;
61  T -= residual / heatCapacity(T);
62  if (std::abs(residual / H) < 1e-6)
63  break;
64  }
65  // If we get here, enthalpy is probably out of bounds. However, due to the nature of the JFNK
66  // calculation, we probably just want to ignore the error and spit out a bogus T so that the
67  // solver keeps rolling.
68  return T;
69 }
70
71 Real
72 SodiumProperties::rho(Real T) const
73 {
74  const Real rhoc = 219.0; // kg/m^3
75  const Real f = 275.32;
76  const Real g = 511.58;
77  const Real Tc = 2503.7; // critical temperature, K
78  mooseAssert(T < Tc, "Temperature is greater than critical temperature 2503.7 K ");
79
80  return rhoc + f * (1 - T / Tc) + g * std::sqrt(1 - T / Tc);
81 }
82
83 Real
85 {
86  const Real f = 275.32;
87  const Real g = 511.58;
88  const Real Tc = 2503.7; // critical temperature, K
89  mooseAssert(T < Tc, "Temperature is greater than critical temperature 2503.7 K ");
90
91  return -(f + g * (0.5) / std::sqrt(1 - T / Tc)) / Tc;
92 }
93
94 Real
96 {
97  Real T = 0.0;
98  T = temperature(h);
99  return drho_dT(T) / heatCapacity(T);
100 }
InputParameters validParams< SodiumProperties >()
Real heatCapacity(Real temperature) const
Heat capacity of liquid Na in J/kg-K as a function of temperature.
Real drho_dT(Real temperature) const
Derivative of density w.r.t temperature.
SodiumProperties(const InputParameters &parameters)
InputParameters validParams< FluidProperties >()
Real k(Real temperature) const
Thermal conductivity as a function of temperature.
Real rho(Real temperature) const
Density as a function of temperature.
Real temperature(Real enthalpy) const
Inverse solve for temperature [K] from enthalpy [J/kg].
Real h(Real temperature) const
Enthalpy of liquid Na (relative to solid Na at STP) in J/kg as a function of temperature.
Real drho_dh(Real enthalpy) const
Derivative of density w.r.t enthalpy.