https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 
 TEST_F (NaKFluidPropertiesTest, molarMass)
 Test that the molar mass is correctly returned.
 
 TEST_F (NaKFluidPropertiesTest, properties)
 Verify calculation of the NaK fluid properties.
 
 TEST_F (NaKFluidPropertiesTest, derivatives)
 Verify calculation of the derivatives of NaK properties by comparing with finite differences.
 

Function Documentation

◆ TEST_F() [1/4]

TEST_F ( NaKFluidPropertiesTest  ,
derivatives   
)

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

Definition at line 91 of file NaKFluidPropertiesTest.C.

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

◆ TEST_F() [2/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() [3/4]

TEST_F ( NaKFluidPropertiesTest  ,
molarMass   
)

Test that the molar mass is correctly returned.

Definition at line 21 of file NaKFluidPropertiesTest.C.

22{
23 // Mass-fraction average 1 / (0.778 / M_K + 0.222 / M_Na) of the eutectic, in kg/mol
24 REL_TEST(_fp->molarMass(), 1 / (0.778 / 39.102e-3 + 0.222 / 22.9898e-3), REL_TOL_SAVED_VALUE);
25 REL_TEST(_fp->molarMass(), 33.837e-3, 1e-4);
26}

◆ TEST_F() [4/4]

TEST_F ( NaKFluidPropertiesTest  ,
properties   
)

Verify calculation of the NaK fluid properties.

Definition at line 31 of file NaKFluidPropertiesTest.C.

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