https://mooseframework.inl.gov
LeadFluidPropertiesTest.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(LeadFluidPropertiesTest, fluidName) { EXPECT_EQ(_fp->fluidName(), "Lead"); }
17 
22 {
23  REL_TEST(_fp->molarMass(), 2.072e-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 = {700, 800, 1000};
34 
35  // Solutions : obtained from running the property object itself
36  // Verified visually against the reference
37  const std::vector<Real> rho_refs = {10545.35, 10417.4, 10161.5};
38  const std::vector<Real> h_refs = {14622.0302715953, 29147.42408111911, 57656.59741445244};
39  const std::vector<Real> e_refs = {14612.54741896357, 29051.43083904335, 57164.54407587054};
40  const std::vector<Real> k_refs = {16.9, 18, 20.2};
41  const std::vector<Real> E_refs = {3.343078e+10, 3.212208e+10, 2.9602e+10};
42  const std::vector<Real> c_refs = {1780.8, 1756.2, 1707};
43  const std::vector<Real> cp_refs = {146.1943959183673, 144.31635, 140.886};
44  const std::vector<Real> cv_refs = {119.4919995682616, 114.7318265760007, 106.1017358488117};
45  const std::vector<Real> mu_refs = {
46  0.002095275392729136, 0.001731160754658103, 0.001325171837844852};
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 }
const double tol
TEST_F(LeadFluidPropertiesTest, fluidName)
Test that the fluid name is correctly returned.
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)