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

Go to the source code of this file.

Functions

 TEST_F (HeliumFluidPropertiesTest, fluidName)
 Test that the fluid name is correctly returned. More...
 
 TEST_F (HeliumFluidPropertiesTest, molarMass)
 Test that the molar mass is correctly returned. More...
 
 TEST_F (HeliumFluidPropertiesTest, thermalConductivity)
 Test that the thermal conductivity and its derivatives are correctly computed. More...
 
 TEST_F (HeliumFluidPropertiesTest, viscosity)
 Test that the viscosity and its derivatives are correctly computed. More...
 
 TEST_F (HeliumFluidPropertiesTest, isobaricSpecificHeat)
 Test that the isobaric specific heat and its derivatives are correctly computed. More...
 
 TEST_F (HeliumFluidPropertiesTest, isochoricSpecificHeat)
 Test that the isochoric specific heat is correctly computed. More...
 
 TEST_F (HeliumFluidPropertiesTest, density)
 Test that the density and its derivatives are correctly computed. More...
 
 TEST_F (HeliumFluidPropertiesTest, specificInternalEnergy)
 Test that the specific internal energy and its derivatives are correctly computed. More...
 
 TEST_F (HeliumFluidPropertiesTest, pressure)
 Test that the pressure and its derivatives are correctly computed. More...
 
 TEST_F (HeliumFluidPropertiesTest, temperature)
 Test that the temperature and its derivatives are correctly computed. More...
 
 TEST_F (HeliumFluidPropertiesTest, specificEnthalpy)
 Test that the specific enthalpy and its derivatives are correctly computed. More...
 

Function Documentation

◆ TEST_F() [1/11]

TEST_F ( HeliumFluidPropertiesTest  ,
fluidName   
)

Test that the fluid name is correctly returned.

Definition at line 16 of file HeliumFluidPropertiesTest.C.

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

◆ TEST_F() [2/11]

TEST_F ( HeliumFluidPropertiesTest  ,
molarMass   
)

Test that the molar mass is correctly returned.

Definition at line 21 of file HeliumFluidPropertiesTest.C.

22 {
23  ABS_TEST(_fp->molarMass(), 4.002602e-3, REL_TOL_SAVED_VALUE);
24 }

◆ TEST_F() [3/11]

TEST_F ( HeliumFluidPropertiesTest  ,
thermalConductivity   
)

Test that the thermal conductivity and its derivatives are correctly computed.

Definition at line 30 of file HeliumFluidPropertiesTest.C.

31 {
32  const Real T = 120.0 + 273.15;
33  const Real p = 101325.0;
34  const Real e = _fp->e_from_p_T(p, T);
35  const Real v = 1. / _fp->rho_from_p_T(p, T);
36 
37  REL_TEST(_fp->k_from_v_e(v, e), 1.8651584722911332e-01, REL_TOL_SAVED_VALUE);
38  REL_TEST(_fp->k_from_p_T(p, T), 1.8651584722911332e-01, REL_TOL_SAVED_VALUE);
39  DERIV_TEST(_fp->k_from_p_T, p, T, REL_TOL_DERIVATIVE);
40  DERIV_TEST(_fp->k_from_v_e, v, e, REL_TOL_DERIVATIVE);
41 }
const double T
const double v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p

◆ TEST_F() [4/11]

TEST_F ( HeliumFluidPropertiesTest  ,
viscosity   
)

Test that the viscosity and its derivatives are correctly computed.

Definition at line 46 of file HeliumFluidPropertiesTest.C.

47 {
48  const Real T = 120.0 + 273.15;
49  const Real p = 101325.0;
50  const Real e = _fp->e_from_p_T(p, T);
51  const Real v = 1. / _fp->rho_from_p_T(p, T);
52 
53  REL_TEST(_fp->mu_from_v_e(v, e), 2.4061901685126415e-05, REL_TOL_SAVED_VALUE);
54  REL_TEST(_fp->mu_from_p_T(p, T), 2.4061901685126415e-05, REL_TOL_SAVED_VALUE);
55  DERIV_TEST(_fp->mu_from_p_T, p, T, REL_TOL_DERIVATIVE);
56  DERIV_TEST(_fp->mu_from_v_e, v, e, REL_TOL_DERIVATIVE);
57 }
const double T
const double v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p

◆ TEST_F() [5/11]

TEST_F ( HeliumFluidPropertiesTest  ,
isobaricSpecificHeat   
)

Test that the isobaric specific heat and its derivatives are correctly computed.

Definition at line 62 of file HeliumFluidPropertiesTest.C.

63 {
64  const Real T = 120.0 + 273.15;
65  const Real p = 101325.0;
66  const Real e = _fp->e_from_p_T(p, T);
67  const Real v = 1. / _fp->rho_from_p_T(p, T);
68 
69  REL_TEST(_fp->cp_from_p_T(p, T), 5195.0, REL_TOL_SAVED_VALUE);
70  REL_TEST(_fp->cp_from_v_e(v, e), 5195.0, REL_TOL_SAVED_VALUE);
71  DERIV_TEST(_fp->cp_from_p_T, p, T, REL_TOL_DERIVATIVE);
72  DERIV_TEST(_fp->cp_from_v_e, v, e, REL_TOL_DERIVATIVE);
73 }
const double T
const double v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p

◆ TEST_F() [6/11]

TEST_F ( HeliumFluidPropertiesTest  ,
isochoricSpecificHeat   
)

Test that the isochoric specific heat is correctly computed.

Definition at line 78 of file HeliumFluidPropertiesTest.C.

79 {
80  const Real T = 120.0 + 273.15;
81  const Real p = 101325.0;
82  const Real e = _fp->e_from_p_T(p, T);
83  const Real v = 1. / _fp->rho_from_p_T(p, T);
84 
85  REL_TEST(_fp->cv_from_v_e(v, e), 3117.0, REL_TOL_SAVED_VALUE);
86  REL_TEST(_fp->cv_from_p_T(p, T), 3117.0, REL_TOL_SAVED_VALUE);
87  DERIV_TEST(_fp->cv_from_p_T, p, T, REL_TOL_DERIVATIVE);
88  DERIV_TEST(_fp->cv_from_v_e, v, e, REL_TOL_DERIVATIVE);
89 }
const double T
const double v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p

◆ TEST_F() [7/11]

TEST_F ( HeliumFluidPropertiesTest  ,
density   
)

Test that the density and its derivatives are correctly computed.

Definition at line 94 of file HeliumFluidPropertiesTest.C.

95 {
96  const Real T = 120.0 + 273.15;
97  const Real p = 101325.0;
98 
99  ABS_TEST(_fp->rho_from_p_T(p, T), 1.2402629878970449e-01, REL_TOL_SAVED_VALUE);
100  DERIV_TEST(_fp->rho_from_p_T, p, T, REL_TOL_DERIVATIVE);
101 }
const double T
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p

◆ TEST_F() [8/11]

TEST_F ( HeliumFluidPropertiesTest  ,
specificInternalEnergy   
)

Test that the specific internal energy and its derivatives are correctly computed.

Definition at line 106 of file HeliumFluidPropertiesTest.C.

107 {
108  const Real T = 120.0 + 273.15;
109  const Real p = 101325.0;
110  const Real rho = _fp->rho_from_p_T(p, T);
111 
112  ABS_TEST(_fp->e_from_p_T(p, T), 1.2254485499999998e6, REL_TOL_SAVED_VALUE);
113  DERIV_TEST(_fp->e_from_p_T, p, T, REL_TOL_DERIVATIVE);
114  ABS_TEST(_fp->e_from_p_rho(p, rho), 1.2254485499999998e6, REL_TOL_SAVED_VALUE);
115 
116  // Equivalent (v,h), (p,T)
117  const Real v = 1. / rho;
118  const Real h = _fp->h_from_p_T(p, T);
119  ABS_TEST(_fp->e_from_v_h(v, h), 1.2254485499999998e6, REL_TOL_SAVED_VALUE);
120  DERIV_TEST(_fp->e_from_v_h, v, h, REL_TOL_DERIVATIVE);
121 }
const double T
const double v
const double rho
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p

◆ TEST_F() [9/11]

TEST_F ( HeliumFluidPropertiesTest  ,
pressure   
)

Test that the pressure and its derivatives are correctly computed.

Definition at line 126 of file HeliumFluidPropertiesTest.C.

127 {
128  const Real T = 120.0 + 273.15;
129  const Real p = 101325.0;
130  const Real e = _fp->e_from_p_T(p, T);
131  const Real v = 1. / _fp->rho_from_p_T(p, T);
132 
133  REL_TEST(_fp->p_from_v_e(v, e), p, REL_TOL_SAVED_VALUE);
134  DERIV_TEST(_fp->p_from_v_e, v, e, REL_TOL_DERIVATIVE);
135 }
const double T
const double v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p

◆ TEST_F() [10/11]

TEST_F ( HeliumFluidPropertiesTest  ,
temperature   
)

Test that the temperature and its derivatives are correctly computed.

Definition at line 140 of file HeliumFluidPropertiesTest.C.

141 {
142  const Real T = 120.0 + 273.15;
143  const Real p = 101325.0;
144  const Real e = _fp->e_from_p_T(p, T);
145  const Real v = 1. / _fp->rho_from_p_T(p, T);
146 
147  REL_TEST(_fp->T_from_v_e(v, e), T, REL_TOL_SAVED_VALUE);
148  DERIV_TEST(_fp->T_from_v_e, v, e, REL_TOL_DERIVATIVE);
149 
150  const Real h = _fp->h_from_p_T(p, T);
151  REL_TEST(_fp->T_from_p_h(p, h), T, REL_TOL_SAVED_VALUE);
152 }
const double T
const double v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p

◆ TEST_F() [11/11]

TEST_F ( HeliumFluidPropertiesTest  ,
specificEnthalpy   
)

Test that the specific enthalpy and its derivatives are correctly computed.

Definition at line 157 of file HeliumFluidPropertiesTest.C.

158 {
159  const Real T = 120.0 + 273.15;
160  const Real p = 101325.0;
161 
162  ABS_TEST(_fp->h_from_p_T(p, T), 2.0424142499999998e+06, REL_TOL_SAVED_VALUE);
163  DERIV_TEST(_fp->h_from_p_T, p, T, REL_TOL_DERIVATIVE);
164 
165  // Derivatives
166  const ADReal T_ad = T;
167  const ADReal p_ad = p;
168  Real h, dhdT, dhdp;
169  ADReal h_ad, dhdT_ad, dhdp_ad;
170  _fp->h_from_p_T(p, T, h, dhdT, dhdp);
171  _fp->h_from_p_T(p_ad, T_ad, h_ad, dhdT_ad, dhdp_ad);
172  DERIV_TEST(_fp->h_from_p_T, p, T, REL_TOL_DERIVATIVE);
173  REL_TEST(h, h_ad.value(), REL_TOL_CONSISTENCY);
174  REL_TEST(dhdT, dhdT_ad.value(), REL_TOL_CONSISTENCY);
175  REL_TEST(dhdp, dhdp_ad.value(), REL_TOL_CONSISTENCY);
176 }
const double T
DualNumber< Real, DNDerivativeType, false > ADReal
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p