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

Go to the source code of this file.

Functions

 TEST_F (HydrogenFluidPropertiesTest, fluidName)
 Test that the fluid name is correctly returned. More...
 
 TEST_F (HydrogenFluidPropertiesTest, molarMass)
 Test that the molar mass is correctly returned. More...
 
 TEST_F (HydrogenFluidPropertiesTest, criticalProperties)
 Test that the critical properties are correctly returned. More...
 
 TEST_F (HydrogenFluidPropertiesTest, triplePointProperties)
 Test that the triple point properties are correctly returned. More...
 
 TEST_F (HydrogenFluidPropertiesTest, vapor)
 Verify calculation of vapor pressure, vapor density and saturated liquid density. More...
 
 TEST_F (HydrogenFluidPropertiesTest, henry)
 Verify that the coefficients for Henry's constant are correct using Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H20 and D20 at high temperatures, IAPWS (2004). More...
 
 TEST_F (HydrogenFluidPropertiesTest, thermalConductivity)
 Verify calculation of thermal conductivity using data from Assael, Assael, Huber, Perkins and Takata, Correlation of te thermal conductivity of normal and parahydrogen from the triple point to 1000 K and up to 100 Mpa, Journal of Physical and Chemical Reference Data, 40 (2011) More...
 
 TEST_F (HydrogenFluidPropertiesTest, viscosity)
 Verify calculation of viscosity using data from Muzny, Huber and Kazakov, Correlation for the viscosity of normal hydrogen obtained from symbolic regression, Journal of Chemical and Engineering Data, 58, 969-979 (2013) More...
 
 TEST_F (HydrogenFluidPropertiesTest, properties)
 Verify calculation of thermophysical properties of Hydrogen using reference data from NIST. More...
 
 TEST_F (HydrogenFluidPropertiesTest, derivatives)
 Verify calculation of the derivatives of all properties by comparing with finite differences. More...
 
 TEST_F (HydrogenFluidPropertiesTest, combined)
 Verify that the methods that return multiple properties in one call return identical values as the individual methods. More...
 

Function Documentation

◆ TEST_F() [1/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
fluidName   
)

Test that the fluid name is correctly returned.

Definition at line 16 of file HydrogenFluidPropertiesTest.C.

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

◆ TEST_F() [2/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
molarMass   
)

Test that the molar mass is correctly returned.

Definition at line 21 of file HydrogenFluidPropertiesTest.C.

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

◆ TEST_F() [3/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
criticalProperties   
)

Test that the critical properties are correctly returned.

Definition at line 29 of file HydrogenFluidPropertiesTest.C.

30 {
31  ABS_TEST(_fp->criticalPressure(), 1.315e6, REL_TOL_SAVED_VALUE);
32  ABS_TEST(_fp->criticalTemperature(), 33.19, REL_TOL_SAVED_VALUE);
33  ABS_TEST(_fp->criticalDensity(), 31.26226704, REL_TOL_SAVED_VALUE);
34 }

◆ TEST_F() [4/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
triplePointProperties   
)

Test that the triple point properties are correctly returned.

Definition at line 39 of file HydrogenFluidPropertiesTest.C.

40 {
41  ABS_TEST(_fp->triplePointPressure(), 7.7e3, REL_TOL_SAVED_VALUE);
42  ABS_TEST(_fp->triplePointTemperature(), 13.952, REL_TOL_SAVED_VALUE);
43 }

◆ TEST_F() [5/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
vapor   
)

Verify calculation of vapor pressure, vapor density and saturated liquid density.

Definition at line 49 of file HydrogenFluidPropertiesTest.C.

50 {
51  const Real tol = 10.0 * REL_TOL_EXTERNAL_VALUE;
52 
53  // Vapor pressure
54  REL_TEST(_fp->vaporPressure(14.0), 7.541e3, tol);
55  REL_TEST(_fp->vaporPressure(30.0), 0.80432e6, tol);
56 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [6/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
henry   
)

Verify that the coefficients for Henry's constant are correct using Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H20 and D20 at high temperatures, IAPWS (2004).

Definition at line 63 of file HydrogenFluidPropertiesTest.C.

64 {
65  const Real tol = REL_TOL_EXTERNAL_VALUE;
66  const std::vector<Real> hc = _fp->henryCoefficients();
67 
68  REL_TEST(hc[0], -4.73284, tol);
69  REL_TEST(hc[1], 6.08954, tol);
70  REL_TEST(hc[2], 6.06066, tol);
71 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [7/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
thermalConductivity   
)

Verify calculation of thermal conductivity using data from Assael, Assael, Huber, Perkins and Takata, Correlation of te thermal conductivity of normal and parahydrogen from the triple point to 1000 K and up to 100 Mpa, Journal of Physical and Chemical Reference Data, 40 (2011)

Definition at line 79 of file HydrogenFluidPropertiesTest.C.

80 {
81  const Real tol = REL_TOL_EXTERNAL_VALUE;
82 
83  REL_TEST(_fp->k_from_rho_T(0.80844, 298.15), 186.97e-3, tol);
84  REL_TEST(_fp->k_from_rho_T(30.0, 35.0), 71.854e-3, tol);
85  REL_TEST(_fp->k_from_rho_T(15.879, 400.0), 248.6e-3, tol);
86 
87  REL_TEST(_fp->k_from_p_T(30.0e6, 400.0), 248.6e-3, tol);
88 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [8/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
viscosity   
)

Verify calculation of viscosity using data from Muzny, Huber and Kazakov, Correlation for the viscosity of normal hydrogen obtained from symbolic regression, Journal of Chemical and Engineering Data, 58, 969-979 (2013)

Definition at line 96 of file HydrogenFluidPropertiesTest.C.

97 {
98  const Real tol = 10.0 * REL_TOL_EXTERNAL_VALUE;
99 
100  REL_TEST(_fp->mu_from_rho_T(0.0, 298.15), 8.8997e-6, tol);
101  REL_TEST(_fp->mu_from_rho_T(0.68911, 350.0), 9.9645e-6, tol);
102  REL_TEST(_fp->mu_from_rho_T(6.5764, 350.0), 1.0147e-5, tol);
103 
104  REL_TEST(_fp->mu_from_p_T(1.0e6, 350.0), 9.9645e-6, tol);
105  REL_TEST(_fp->mu_from_p_T(10.0e6, 350.0), 1.0147e-5, tol);
106 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [9/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
properties   
)

Verify calculation of thermophysical properties of Hydrogen using reference data from NIST.

Definition at line 112 of file HydrogenFluidPropertiesTest.C.

113 {
114  // Pressure = 1 MPa, temperature = 280 K
115  Real p = 1.0e6;
116  Real T = 280.0;
117 
118  const Real tol = REL_TOL_EXTERNAL_VALUE;
119 
120  REL_TEST(_fp->rho_from_p_T(p, T), 0.86069, tol);
121  REL_TEST(_fp->h_from_p_T(p, T), 3676.1e3, tol);
122  REL_TEST(_fp->e_from_p_T(p, T), 2514.2e3, tol);
123  REL_TEST(_fp->s_from_p_T(p, T), 43.025e3, tol);
124  REL_TEST(_fp->cp_from_p_T(p, T), 14.26e3, tol);
125  REL_TEST(_fp->cv_from_p_T(p, T), 10.112e3, tol);
126  REL_TEST(_fp->c_from_p_T(p, T), 1283.9, tol);
127 
128  // Pressure = 1 MPa, temperature = 500 K
129  T = 500.0;
130  REL_TEST(_fp->rho_from_p_T(p, T), 0.48302, tol);
131  REL_TEST(_fp->h_from_p_T(p, T), 6856.5e3, tol);
132  REL_TEST(_fp->e_from_p_T(p, T), 4786.2e3, tol);
133  REL_TEST(_fp->s_from_p_T(p, T), 51.401e3, tol);
134  REL_TEST(_fp->cp_from_p_T(p, T), 14.52e3, tol);
135  REL_TEST(_fp->cv_from_p_T(p, T), 10.392e3, tol);
136  REL_TEST(_fp->c_from_p_T(p, T), 1704.1, tol);
137 
138  // Pressure = 10 MPa, temperature = 500 K
139  p = 10.0e6;
140  REL_TEST(_fp->rho_from_p_T(p, T), 4.6658, tol);
141  REL_TEST(_fp->h_from_p_T(p, T), 6923.4e3, tol);
142  REL_TEST(_fp->e_from_p_T(p, T), 4780.1e3, tol);
143  REL_TEST(_fp->s_from_p_T(p, T), 41.892e3, tol);
144  REL_TEST(_fp->cp_from_p_T(p, T), 14.584e3, tol);
145  REL_TEST(_fp->cv_from_p_T(p, T), 10.436e3, tol);
146  REL_TEST(_fp->c_from_p_T(p, T), 1764.3, tol);
147 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [10/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
derivatives   
)

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

Definition at line 153 of file HydrogenFluidPropertiesTest.C.

154 {
155  const Real tol = REL_TOL_DERIVATIVE;
156 
157  const Real p = 1.0e6;
158  Real T = 350.0;
159 
160  DERIV_TEST(_fp->rho_from_p_T, p, T, tol);
161  DERIV_TEST(_fp->mu_from_p_T, p, T, tol);
162  DERIV_TEST(_fp->e_from_p_T, p, T, tol);
163  DERIV_TEST(_fp->h_from_p_T, p, T, tol);
164  DERIV_TEST(_fp->k_from_p_T, p, T, tol);
165 
166  // Viscosity from density and temperature
167  T = 360.0;
168  const Real drho = 1.0e-4;
169  Real rho, drho_dp, drho_dT;
170  _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
171 
172  Real dmu_drho_fd =
173  (_fp->mu_from_rho_T(rho + drho, T) - _fp->mu_from_rho_T(rho - drho, T)) / (2.0 * drho);
174  Real mu = 0.0, dmu_drho = 0.0, dmu_dT = 0.0;
175  _fp->mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
176 
177  ABS_TEST(mu, _fp->mu_from_rho_T(rho, T), REL_TOL_CONSISTENCY);
178  REL_TEST(dmu_drho, dmu_drho_fd, tol);
179 
180  // To properly test derivative wrt temperature, use p and T and calculate density,
181  // so that the change in density wrt temperature is included
182  const Real dp = 1.0e1;
183  const Real dT = 1.0e-4;
184  _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
185  _fp->mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
186 
187  Real dmu_dT_fd = (_fp->mu_from_rho_T(_fp->rho_from_p_T(p, T + dT), T + dT) -
188  _fp->mu_from_rho_T(_fp->rho_from_p_T(p, T - dT), T - dT)) /
189  (2.0 * dT);
190 
191  REL_TEST(dmu_dT, dmu_dT_fd, tol);
192 
193  Real dmu_dp_fd = (_fp->mu_from_p_T(p + dp, T) - _fp->mu_from_p_T(p - dp, T)) / (2.0 * dp);
194  Real dmu_dp = 0.0;
195  _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
196 
197  ABS_TEST(mu, _fp->mu_from_p_T(p, T), REL_TOL_CONSISTENCY);
198  REL_TEST(dmu_dp, dmu_dp_fd, tol);
199 
200  _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
201  dmu_dT_fd = (_fp->mu_from_p_T(p, T + dT) - _fp->mu_from_p_T(p, T - dT)) / (2.0 * dT);
202 
203  REL_TEST(dmu_dT, dmu_dT_fd, tol);
204 }
const double tol
static const std::string mu
Definition: NS.h:123
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [11/11]

TEST_F ( HydrogenFluidPropertiesTest  ,
combined   
)

Verify that the methods that return multiple properties in one call return identical values as the individual methods.

Definition at line 210 of file HydrogenFluidPropertiesTest.C.

211 {
212  const Real p = 1.0e6;
213  const Real T = 300.0;
214  const Real tol = REL_TOL_CONSISTENCY;
215 
216  // Single property methods
217  Real rho, drho_dp, drho_dT;
218  _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
219  Real mu, dmu_dp, dmu_dT;
220  _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
221  Real e, de_dp, de_dT;
222  _fp->e_from_p_T(p, T, e, de_dp, de_dT);
223 
224  // Combined property methods
225  Real rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT, e2, de2_dp, de2_dT;
226  _fp->rho_mu_from_p_T(p, T, rho2, mu2);
227 
228  ABS_TEST(rho, rho2, tol);
229  ABS_TEST(mu, mu2, tol);
230 
231  _fp->rho_mu_from_p_T(p, T, rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT);
232  ABS_TEST(rho, rho2, tol);
233  ABS_TEST(drho_dp, drho2_dp, tol);
234  ABS_TEST(drho_dT, drho2_dT, tol);
235  ABS_TEST(mu, mu2, tol);
236  ABS_TEST(dmu_dp, dmu2_dp, tol);
237  ABS_TEST(dmu_dT, dmu2_dT, tol);
238 
239  _fp->rho_e_from_p_T(p, T, rho2, drho2_dp, drho2_dT, e2, de2_dp, de2_dT);
240  ABS_TEST(rho, rho2, tol);
241  ABS_TEST(drho_dp, drho2_dp, tol);
242  ABS_TEST(drho_dT, drho2_dT, tol);
243  ABS_TEST(e, e2, tol);
244  ABS_TEST(de_dp, de2_dp, tol);
245  ABS_TEST(de_dT, de2_dT, tol);
246 }
const double tol
static const std::string mu
Definition: NS.h:123
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real