https://mooseframework.inl.gov
LeadBismuthFluidPropertiesTest.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(LeadBismuthFluidPropertiesTest, fluidName) { EXPECT_EQ(_fp->fluidName(), "LeadBismuth"); }
17 
22 {
23  REL_TEST(_fp->molarMass(), 2.3399e-1, REL_TOL_SAVED_VALUE);
24 }
25 
30 {
31  const Real tol = REL_TOL_SAVED_VALUE;
32  const std::vector<Real> pressures = {1e5, 1e6, 5e6};
33  const std::vector<Real> temperatures = {400, 500, 700};
34 
35  // Solutions : obtained from running the property object itself
36  // Verified visually against the reference
37  const std::vector<Real> rho_refs = {10547.8, 10418.5, 10159.9};
38  const std::vector<Real> h_refs = {296.410190117253, 15029.57685678392, 43909.33876154583};
39  const std::vector<Real> e_refs = {286.9295401238894, 14933.59374981075, 43417.2079334865};
40  const std::vector<Real> k_refs = {9.3832, 10.79275, 13.47355};
41  const std::vector<Real> c_refs = {1770.2, 1749, 1706.6};
42  const std::vector<Real> E_refs = {3.30472e+10, 3.187e+10, 2.95948e+10};
43  const std::vector<Real> cp_refs = {148.19, 146.401, 142.4143877551021};
44  const std::vector<Real> cv_refs = {131.481010510397, 126.1085687634637, 115.6060997100004};
45  const std::vector<Real> mu_refs = {
46  0.003254472610814353, 0.002232183463848443, 0.001450728657307528};
47 
48  for (auto i : make_range(pressures.size()))
49  {
50  // Obtain variable sets
51  const Real p = pressures[i];
52  const Real T = temperatures[i];
53  const Real rho = _fp->rho_from_p_T(p, T);
54  const Real v = 1. / rho;
55  const Real e = _fp->e_from_p_T(p, T);
56  const Real h = _fp->h_from_p_T(p, T);
57 
58  // Density
59  REL_TEST(_fp->rho_from_p_T(p, T), rho_refs[i], tol);
60 
61  // Specific volume
62  REL_TEST(_fp->v_from_p_T(p, T), 1. / rho_refs[i], tol);
63 
64  // Pressure
65  REL_TEST(_fp->p_from_v_e(v, e), p, 1e5 * tol);
66 
67  // Enthalpy
68  REL_TEST(_fp->h_from_p_T(p, T), h_refs[i], tol);
69  REL_TEST(_fp->h_from_v_e(v, e), h_refs[i], tol);
70 
71  // Specific energy
72  REL_TEST(_fp->e_from_p_T(p, T), e_refs[i], tol);
73  REL_TEST(_fp->e_from_p_rho(p, rho), e_refs[i], tol);
74 
75  // Temperature
76  REL_TEST(_fp->T_from_v_e(v, e), T, tol);
77  REL_TEST(_fp->T_from_p_rho(p, rho), T, tol);
78  REL_TEST(_fp->T_from_p_h(p, h), T, tol);
79 
80  // Thermal conductivity (function of T only)
81  REL_TEST(_fp->k_from_p_T(p, T), k_refs[i], tol);
82  REL_TEST(_fp->k_from_v_e(v, e), k_refs[i], tol);
83 
84  // Bulk modulus
85  REL_TEST(_fp->bulk_modulus_from_p_T(p, T), E_refs[i], tol);
86 
87  // Speed of sound
88  REL_TEST(_fp->c_from_v_e(v, e), c_refs[i], tol);
89 
90  // Isobaric specific heat
91  REL_TEST(_fp->cp_from_p_T(p, T), cp_refs[i], tol);
92  REL_TEST(_fp->cp_from_v_e(v, e), cp_refs[i], tol);
93 
94  // Isochoric specific heat
95  REL_TEST(_fp->cv_from_p_T(p, T), cv_refs[i], tol);
96  REL_TEST(_fp->cv_from_v_e(v, e), cv_refs[i], tol);
97 
98  // Dynamic viscosity
99  REL_TEST(_fp->mu_from_p_T(p, T), mu_refs[i], tol);
100  REL_TEST(_fp->mu_from_v_e(v, e), mu_refs[i], tol);
101  }
102 }
103 
109 {
110  const Real tol = REL_TOL_DERIVATIVE;
111 
112  const Real p = 30.0e6;
113  const Real T = 300.0;
114  const Real rho = _fp->rho_from_p_T(p, T);
115  const Real v = 1. / rho;
116  const Real e = _fp->e_from_p_T(p, T);
117  const Real h = _fp->h_from_p_T(p, T);
118 
119  DERIV_TEST(_fp->rho_from_p_T, p, T, tol);
120  DERIV_TEST(_fp->e_from_p_T, p, T, tol);
121  DERIV_TEST(_fp->v_from_p_T, p, T, tol);
122  DERIV_TEST(_fp->h_from_p_T, p, T, tol);
123  DERIV_TEST(_fp->k_from_p_T, p, T, tol);
124  DERIV_TEST(_fp->cp_from_p_T, p, T, tol);
125  DERIV_TEST(_fp->cv_from_p_T, p, T, tol);
126  DERIV_TEST(_fp->mu_from_p_T, p, T, tol);
127 
128  DERIV_TEST(_fp->p_from_v_e, v, e, tol);
129  DERIV_TEST(_fp->mu_from_v_e, v, e, tol);
130  DERIV_TEST(_fp->k_from_v_e, v, e, tol);
131  DERIV_TEST(_fp->h_from_v_e, v, e, tol);
132  DERIV_TEST(_fp->T_from_v_e, v, e, tol);
133  DERIV_TEST(_fp->cp_from_v_e, v, e, tol);
134  DERIV_TEST(_fp->cv_from_v_e, v, e, tol);
135 
136  DERIV_TEST(_fp->T_from_p_rho, p, rho, tol);
137  DERIV_TEST(_fp->e_from_p_rho, p, rho, tol);
138  DERIV_TEST(_fp->T_from_p_h, p, h, tol);
139 }
TEST_F(LeadBismuthFluidPropertiesTest, fluidName)
Test that the fluid name is correctly returned.
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
Definition: NS.h:84
IntRange< T > make_range(T beg, T end)