https://mooseframework.inl.gov
Functions
NaKFluidPropertiesTest.C File Reference

Go to the source code of this file.

Functions

 TEST_F (NaKFluidPropertiesTest, fluidName)
 Test that the fluid name is correctly returned. More...
 
 TEST_F (NaKFluidPropertiesTest, molarMass)
 Test that the molar mass is correctly returned. More...
 
 TEST_F (NaKFluidPropertiesTest, properties)
 Verify calculation of the NaK fluid properties. More...
 
 TEST_F (NaKFluidPropertiesTest, derivatives)
 Verify calculation of the derivatives of NaK properties by comparing with finite differences. More...
 

Function Documentation

◆ TEST_F() [1/4]

TEST_F ( NaKFluidPropertiesTest  ,
fluidName   
)

Test that the fluid name is correctly returned.

Definition at line 16 of file NaKFluidPropertiesTest.C.

16 { EXPECT_EQ(_fp->fluidName(), "NaK"); }

◆ TEST_F() [2/4]

TEST_F ( NaKFluidPropertiesTest  ,
molarMass   
)

Test that the molar mass is correctly returned.

Definition at line 21 of file NaKFluidPropertiesTest.C.

22 {
23  REL_TEST(_fp->molarMass(), 0.0620918, REL_TOL_SAVED_VALUE);
24 }

◆ TEST_F() [3/4]

TEST_F ( NaKFluidPropertiesTest  ,
properties   
)

Verify calculation of the NaK fluid properties.

Definition at line 29 of file NaKFluidPropertiesTest.C.

30 {
31  const Real tol = REL_TOL_SAVED_VALUE;
32  const std::vector<Real> pressures = {1e5, 1e6, 5e6};
33  const std::vector<Real> temperatures = {500, 700, 1000};
34 
35  // Solutions : obtained from running the property object itself
36  // Verified visually against the reference
37  const std::vector<Real> rho_refs = {
38  821.954085329590612, 775.608846516464268, 703.767342628214124};
39  const std::vector<Real> h_refs = {212851.212833445577, 391103.66397524561, 654472.411687945598};
40  const std::vector<Real> e_refs = {212729.55153656195, 389814.354287132388, 647367.791031170636};
41  const std::vector<Real> k_refs = {24.9636547049999997, 26.2273747049999955, 24.8229547050000008};
42  const std::vector<Real> cp_refs = {908.088827709000043, 879.02768370900003, 887.095967709000092};
43  const std::vector<Real> cv_refs = {908.055029910277312, 878.637048045562551, 884.635754614549114};
44  const std::vector<Real> mu_refs = {
45  0.000336716758684162674, 0.000222908484361340899, 0.000145271584941717932};
46 
47  for (auto i : make_range(pressures.size()))
48  {
49  // Obtain variable sets
50  const Real p = pressures[i];
51  const Real T = temperatures[i];
52  const Real rho = _fp->rho_from_p_T(p, T);
53  const Real h = _fp->h_from_p_T(p, T);
54 
55  // Density
56  REL_TEST(_fp->rho_from_p_T(p, T), rho_refs[i], tol);
57 
58  // Specific volume
59  REL_TEST(_fp->v_from_p_T(p, T), 1. / rho_refs[i], tol);
60 
61  // Enthalpy
62  REL_TEST(_fp->h_from_p_T(p, T), h_refs[i], tol);
63 
64  // Specific energy
65  REL_TEST(_fp->e_from_p_T(p, T), e_refs[i], tol);
66  REL_TEST(_fp->e_from_p_rho(p, rho), e_refs[i], tol);
67 
68  // Temperature
69  REL_TEST(_fp->T_from_p_rho(p, rho), T, tol);
70  REL_TEST(_fp->T_from_p_h(p, h), T, tol);
71 
72  // Thermal conductivity (function of T only)
73  REL_TEST(_fp->k_from_p_T(p, T), k_refs[i], tol);
74 
75  // Isobaric specific heat
76  REL_TEST(_fp->cp_from_p_T(p, T), cp_refs[i], tol);
77 
78  // Isochoric specific heat
79  REL_TEST(_fp->cv_from_p_T(p, T), cv_refs[i], tol);
80 
81  // Dynamic viscosity
82  REL_TEST(_fp->mu_from_p_T(p, T), mu_refs[i], tol);
83  }
84 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)

◆ TEST_F() [4/4]

TEST_F ( NaKFluidPropertiesTest  ,
derivatives   
)

Verify calculation of the derivatives of NaK properties by comparing with finite differences.

Definition at line 90 of file NaKFluidPropertiesTest.C.

91 {
92  const Real tol = REL_TOL_DERIVATIVE;
93 
94  const Real p = 30.0e6;
95  const Real T = 400.0; // K
96  const Real T2 = 700.;
97 
98  DERIV_TEST(_fp->rho_from_p_T, p, T, tol);
99  DERIV_TEST(_fp->e_from_p_T, p, T, tol);
100  DERIV_TEST(_fp->v_from_p_T, p, T, tol);
101  DERIV_TEST(_fp->h_from_p_T, p, T, tol);
102  DERIV_TEST(_fp->k_from_p_T, p, T, tol);
103  DERIV_TEST(_fp->cp_from_p_T, p, T, tol);
104  DERIV_TEST(_fp->mu_from_p_T, p, T, tol);
105  DERIV_TEST(_fp->mu_from_p_T, p, T2, tol);
106 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real