https://mooseframework.inl.gov
LeadLithiumFluidPropertiesTest.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 
12 
16 TEST_F(LeadLithiumFluidPropertiesTest, fluidName) { EXPECT_EQ(_fp->fluidName(), "LeadLithium"); }
17 
22 {
23  // Expected molar mass: 0.1730 kg/mol
24  REL_TEST(_fp->molarMass(), 0.1730, REL_TOL_SAVED_VALUE);
25 }
26 
45 {
46  const Real tol = REL_TOL_SAVED_VALUE;
47  const std::vector<Real> pressures = {100000.00, 1000000.00, 5000000.00};
48  const std::vector<Real> temperatures = {700.0000, 800.0000, 1000.0000};
49 
50  // Nested loops over pressure and temperature
51  for (size_t ip = 0; ip < pressures.size(); ip++)
52  {
53  const Real p = pressures[ip];
54  for (size_t iT = 0; iT < temperatures.size(); iT++)
55  {
56  const Real T = temperatures[iT];
57 
58  // Compute reference density:
59  const Real rho_ref = 10520.35 - 1.19051 * T;
60  // Compute reference enthalpy (using T_mo = 508 K):
61  const Real h_ref = 195.0 * (T - 508.0) - 0.5 * 9.116e-3 * (T * T - 508.0 * 508.0);
62  // Compute reference internal energy:
63  const Real e_ref = h_ref - p / rho_ref;
64  // Compute thermal conductivity:
65  const Real k_ref = 14.51 + 0.019631 * T;
66  // Compute speed of sound:
67  const Real c_ref = 1876. - 0.306 * T;
68  // Compute bulk modulus:
69  const Real E_ref = c_ref * c_ref * rho_ref;
70  // Compute isobaric specific heat:
71  const Real cp_ref = 195.0 - 9.116e-3 * T;
72  // Compute thermal expansion coefficient:
73  const Real alpha = 1.19051 / (10520.35 - 1.19051 * T);
74  // Compute isochoric specific heat:
75  const Real cv_ref = cp_ref / (1.0 + (alpha * alpha * E_ref * T) / (rho_ref * cp_ref));
76  // Compute dynamic viscosity:
77  const Real mu_ref = 1.87e-4 * std::exp(11640.0 / (FluidProperties::_R * T));
78 
79  // Obtain computed values from the property object
80  const Real rho = _fp->rho_from_p_T(p, T);
81  const Real v = 1.0 / rho;
82  const Real h = _fp->h_from_p_T(p, T);
83  const Real e = _fp->e_from_p_T(p, T);
84 
85  // Test density and specific volume
86  REL_TEST(rho, rho_ref, tol);
87  REL_TEST(_fp->v_from_p_T(p, T), 1.0 / rho_ref, tol);
88 
89  // Test pressure from (v, e): p = (h - e)/v
90  REL_TEST(_fp->p_from_v_e(v, e), p, tol * 1e5);
91 
92  // Test enthalpy (both from p,T and v,e)
93  REL_TEST(h, h_ref, tol);
94  REL_TEST(_fp->h_from_v_e(v, e), h_ref, tol);
95 
96  // Test internal energy (both from p,T and from p,rho)
97  REL_TEST(e, e_ref, tol);
98  REL_TEST(_fp->e_from_p_rho(p, rho), e_ref, tol);
99 
100  // Test temperature (from v,e, from p,, and from p,h)
101  REL_TEST(_fp->T_from_v_e(v, e), T, tol);
102  REL_TEST(_fp->T_from_p_rho(p, rho), T, tol);
103  REL_TEST(_fp->T_from_p_h(p, h), T, tol);
104 
105  // Test thermal conductivity
106  REL_TEST(_fp->k_from_p_T(p, T), k_ref, tol);
107  REL_TEST(_fp->k_from_v_e(v, e), k_ref, tol);
108 
109  // Test bulk modulus
110  REL_TEST(_fp->bulk_modulus_from_p_T(p, T), E_ref, tol);
111 
112  // Test speed of sound
113  REL_TEST(_fp->c_from_p_T(p, T), c_ref, tol);
114  REL_TEST(_fp->c_from_v_e(v, e), c_ref, tol);
115 
116  // Test isobaric specific heat
117  REL_TEST(_fp->cp_from_p_T(p, T), cp_ref, tol);
118  REL_TEST(_fp->cp_from_v_e(v, e), cp_ref, tol);
119 
120  // Test isochoric specific heat
121  REL_TEST(_fp->cv_from_p_T(p, T), cv_ref, tol);
122  REL_TEST(_fp->cv_from_v_e(v, e), cv_ref, tol);
123 
124  // Test dynamic viscosity
125  REL_TEST(_fp->mu_from_p_T(p, T), mu_ref, tol);
126  REL_TEST(_fp->mu_from_v_e(v, e), mu_ref, tol);
127  }
128  }
129 }
130 
139 {
140  const Real tol = REL_TOL_DERIVATIVE;
141 
142  const Real p = 30000000.0000;
143  const Real T = 600.0000; // Temperature above 508 K
144  const Real rho = _fp->rho_from_p_T(p, T);
145  const Real v = 1.0 / rho;
146  const Real h = _fp->h_from_p_T(p, T);
147  const Real e = _fp->e_from_p_T(p, T);
148 
149  DERIV_TEST(_fp->rho_from_p_T, p, T, tol);
150  DERIV_TEST(_fp->e_from_p_T, p, T, tol);
151  DERIV_TEST(_fp->v_from_p_T, p, T, tol);
152  DERIV_TEST(_fp->h_from_p_T, p, T, tol);
153  DERIV_TEST(_fp->k_from_p_T, p, T, tol);
154  DERIV_TEST(_fp->cp_from_p_T, p, T, tol);
155  DERIV_TEST(_fp->cv_from_p_T, p, T, 1.5e-6);
156  DERIV_TEST(_fp->mu_from_p_T, p, T, tol);
157 
158  DERIV_TEST(_fp->p_from_v_e, v, e, tol);
159  DERIV_TEST(_fp->mu_from_v_e, v, e, tol);
160  DERIV_TEST(_fp->k_from_v_e, v, e, tol);
161  DERIV_TEST(_fp->h_from_v_e, v, e, tol);
162  DERIV_TEST(_fp->T_from_v_e, v, e, tol);
163  DERIV_TEST(_fp->cp_from_v_e, v, e, tol);
164  DERIV_TEST(_fp->cv_from_v_e, v, e, tol);
165 
166  DERIV_TEST(_fp->T_from_p_rho, p, rho, tol);
167  DERIV_TEST(_fp->e_from_p_rho, p, rho, tol);
168  DERIV_TEST(_fp->T_from_p_h, p, h, tol);
169 }
const double tol
TEST_F(LeadLithiumFluidPropertiesTest, fluidName)
Test that the fluid name is correctly returned.
static const Real _R
Universal gas constant (J/mol/K)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
Definition: NS.h:84
static const std::string alpha
Definition: NS.h:134