https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Functions
LeadLithiumFluidPropertiesTest.C File Reference

Go to the source code of this file.

Functions

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

Function Documentation

◆ TEST_F() [1/4]

TEST_F ( LeadLithiumFluidPropertiesTest  ,
derivatives   
)

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

Note: The test temperature is chosen above the melting point (e.g., 600 K) to ensure that the correlations are evaluated in the valid liquid range.

Definition at line 138 of file LeadLithiumFluidPropertiesTest.C.

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
const Real p
const double rho
const double T
const double v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [2/4]

TEST_F ( LeadLithiumFluidPropertiesTest  ,
fluidName   
)

Test that the fluid name is correctly returned.

Definition at line 16 of file LeadLithiumFluidPropertiesTest.C.

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

◆ TEST_F() [3/4]

TEST_F ( LeadLithiumFluidPropertiesTest  ,
molarMass   
)

Test that the molar mass is correctly returned.

Definition at line 21 of file LeadLithiumFluidPropertiesTest.C.

22{
23 // Expected molar mass: 0.1730 kg/mol
24 REL_TEST(_fp->molarMass(), 0.1730, REL_TOL_SAVED_VALUE);
25}

◆ TEST_F() [4/4]

TEST_F ( LeadLithiumFluidPropertiesTest  ,
properties   
)

Verify calculation of the LeadLithium fluid properties.

The expected reference values are computed from:

rho(T) = 10520.35 - 1.19051*T h(T) = 195*(T - 508) - 0.5*9.116e-3*(T^2 - 508^2) (T_mo = 508 K) e = h - p/rho k(T) = 14.51 + 0.019631 * (T - 273.15); E(T) = (44.73077 - 0.02634615*T + 5.76923e-6*T^2)*1e9 c(T) = 1876. - 0.306 * (T - 273.15); cp(T) = 195 - 9.116e-3*T cv(T) = cp/(1 + alpha^2*E*T/(rho*cp)), alpha = 1.19051/(10520.35 - 1.19051*T) mu(T) = 1.87e-4 * exp(11640/(R*T))

The test uses three pressure/temperature pairs.

Definition at line 44 of file LeadLithiumFluidPropertiesTest.C.

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 - 273.15);
66 // Compute speed of sound:
67 const Real c_ref = 1876. - 0.306 * (T - 273.15);
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}
static const Real _R
Universal gas constant (J/mol/K)