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