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

Go to the source code of this file.

Functions

 TEST_F (NitrogenFluidPropertiesTest, fluidName)
 Test that the fluid name is correctly returned.
 
 TEST_F (NitrogenFluidPropertiesTest, molarMass)
 Test that the molar mass is correctly returned.
 
 TEST_F (NitrogenFluidPropertiesTest, criticalProperties)
 Test that the critical properties are correctly returned.
 
 TEST_F (NitrogenFluidPropertiesTest, triplePointProperties)
 Test that the triple point properties are correctly returned.
 
 TEST_F (NitrogenFluidPropertiesTest, vapor)
 Verify calculation of vapor pressure, vapor density and saturated liquid density.
 
 TEST_F (NitrogenFluidPropertiesTest, 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).
 
 TEST_F (NitrogenFluidPropertiesTest, thermalConductivity)
 Verify calculation of thermal conductivity using data from Lemmon and Jacobsen, Viscosity and Thermal Conductivity Equations for Nitrogen, Oxygen, Argon, and Air, International Journal of Thermophysics, 25, 21–69 (2004)
 
 TEST_F (NitrogenFluidPropertiesTest, viscosity)
 Verify calculation of viscosity using data from Lemmon and Jacobsen, Viscosity and Thermal Conductivity Equations for Nitrogen, Oxygen, Argon, and Air, International Journal of Thermophysics, 25, 21–69 (2004)
 
 TEST_F (NitrogenFluidPropertiesTest, properties)
 Verify calculation of thermophysical properties of Nitrogen from the Span et al EOS using verification data provided in "A reference equation of state for the thermodynamic properties of nitrogen for temeperatures from 63.151 to 1000 K and pressures to 2200 MPa", Journal of Physical and Chemical Reference Data, 29, 1361–1433 (2000)
 
 TEST_F (NitrogenFluidPropertiesTest, derivatives)
 Verify calculation of the derivatives of all properties by comparing with finite differences.
 
 TEST_F (NitrogenFluidPropertiesTest, combined)
 Verify that the methods that return multiple properties in one call return identical values as the individual methods.
 

Function Documentation

◆ TEST_F() [1/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
combined   
)

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

Definition at line 228 of file NitrogenFluidPropertiesTest.C.

229{
230 const Real p = 1.0e6;
231 const Real T = 300.0;
232 const Real tol = REL_TOL_CONSISTENCY;
233
234 // Single property methods
235 Real rho, drho_dp, drho_dT;
236 _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
237 Real mu, dmu_dp, dmu_dT;
238 _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
239 Real e, de_dp, de_dT;
240 _fp->e_from_p_T(p, T, e, de_dp, de_dT);
241
242 // Combined property methods
243 Real rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT, e2, de2_dp, de2_dT;
244 _fp->rho_mu_from_p_T(p, T, rho2, mu2);
245
246 ABS_TEST(rho, rho2, tol);
247 ABS_TEST(mu, mu2, tol);
248
249 _fp->rho_mu_from_p_T(p, T, rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT);
250 ABS_TEST(rho, rho2, tol);
251 ABS_TEST(drho_dp, drho2_dp, tol);
252 ABS_TEST(drho_dT, drho2_dT, tol);
253 ABS_TEST(mu, mu2, tol);
254 ABS_TEST(dmu_dp, dmu2_dp, tol);
255 ABS_TEST(dmu_dT, dmu2_dT, tol);
256
257 _fp->rho_e_from_p_T(p, T, rho2, drho2_dp, drho2_dT, e2, de2_dp, de2_dT);
258 ABS_TEST(rho, rho2, tol);
259 ABS_TEST(drho_dp, drho2_dp, tol);
260 ABS_TEST(drho_dT, drho2_dT, tol);
261 ABS_TEST(e, e2, tol);
262 ABS_TEST(de_dp, de2_dp, tol);
263 ABS_TEST(de_dT, de2_dT, tol);
264}
const double tol
const double mu
const Real p
const double rho
const double T
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [2/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
criticalProperties   
)

Test that the critical properties are correctly returned.

Definition at line 29 of file NitrogenFluidPropertiesTest.C.

30{
31 ABS_TEST(_fp->criticalPressure(), 3.3958e6, REL_TOL_SAVED_VALUE);
32 ABS_TEST(_fp->criticalTemperature(), 126.192, REL_TOL_SAVED_VALUE);
33 ABS_TEST(_fp->criticalDensity(), 313.3, REL_TOL_SAVED_VALUE);
34}

◆ TEST_F() [3/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
derivatives   
)

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

Definition at line 170 of file NitrogenFluidPropertiesTest.C.

171{
172 const Real tol = REL_TOL_DERIVATIVE;
173
174 const Real p = 1.0e6;
175 Real T = 350.0;
176
177 DERIV_TEST(_fp->rho_from_p_T, p, T, tol);
178 DERIV_TEST(_fp->mu_from_p_T, p, T, tol);
179 DERIV_TEST(_fp->e_from_p_T, p, T, tol);
180 DERIV_TEST(_fp->h_from_p_T, p, T, tol);
181 DERIV_TEST(_fp->s_from_p_T, p, T, tol);
182 DERIV_TEST(_fp->k_from_p_T, p, T, tol);
183
184 // Viscosity from density and temperature
185 T = 360.0;
186 const Real drho = 1.0e-4;
187 Real rho, drho_dp, drho_dT;
188 _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
189
190 Real dmu_drho_fd =
191 (_fp->mu_from_rho_T(rho + drho, T) - _fp->mu_from_rho_T(rho - drho, T)) / (2.0 * drho);
192 Real mu = 0.0, dmu_drho = 0.0, dmu_dT = 0.0;
193 _fp->mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
194
195 ABS_TEST(mu, _fp->mu_from_rho_T(rho, T), REL_TOL_CONSISTENCY);
196 REL_TEST(dmu_drho, dmu_drho_fd, tol);
197
198 // To properly test derivative wrt temperature, use p and T and calculate density,
199 // so that the change in density wrt temperature is included
200 const Real dp = 1.0e1;
201 const Real dT = 1.0e-4;
202 _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
203 _fp->mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
204
205 Real dmu_dT_fd = (_fp->mu_from_rho_T(_fp->rho_from_p_T(p, T + dT), T + dT) -
206 _fp->mu_from_rho_T(_fp->rho_from_p_T(p, T - dT), T - dT)) /
207 (2.0 * dT);
208
209 REL_TEST(dmu_dT, dmu_dT_fd, tol);
210
211 Real dmu_dp_fd = (_fp->mu_from_p_T(p + dp, T) - _fp->mu_from_p_T(p - dp, T)) / (2.0 * dp);
212 Real dmu_dp = 0.0;
213 _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
214
215 ABS_TEST(mu, _fp->mu_from_p_T(p, T), REL_TOL_CONSISTENCY);
216 REL_TEST(dmu_dp, dmu_dp_fd, tol);
217
218 _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
219 dmu_dT_fd = (_fp->mu_from_p_T(p, T + dT) - _fp->mu_from_p_T(p, T - dT)) / (2.0 * dT);
220
221 REL_TEST(dmu_dT, dmu_dT_fd, tol);
222}

◆ TEST_F() [4/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
fluidName   
)

Test that the fluid name is correctly returned.

Definition at line 16 of file NitrogenFluidPropertiesTest.C.

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

◆ TEST_F() [5/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
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 74 of file NitrogenFluidPropertiesTest.C.

75{
76 const Real tol = REL_TOL_EXTERNAL_VALUE;
77 const std::vector<Real> hc = _fp->henryCoefficients();
78
79 REL_TEST(hc[0], -9.67578, tol);
80 REL_TEST(hc[1], 4.72162, tol);
81 REL_TEST(hc[2], 11.70585, tol);
82}

◆ TEST_F() [6/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
molarMass   
)

Test that the molar mass is correctly returned.

Definition at line 21 of file NitrogenFluidPropertiesTest.C.

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

◆ TEST_F() [7/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
properties   
)

Verify calculation of thermophysical properties of Nitrogen from the Span et al EOS using verification data provided in "A reference equation of state for the thermodynamic properties of nitrogen for temeperatures from 63.151 to 1000 K and pressures to 2200 MPa", Journal of Physical and Chemical Reference Data, 29, 1361–1433 (2000)

Definition at line 129 of file NitrogenFluidPropertiesTest.C.

130{
131 // Pressure = 1 MPa, temperature = 280 K
132 Real p = 1.0e6;
133 Real T = 280.0;
134
135 const Real tol = REL_TOL_EXTERNAL_VALUE;
136
137 REL_TEST(_fp->rho_from_p_T(p, T), 0.43104 * 1000.0 * _fp->molarMass(), tol);
138 REL_TEST(_fp->h_from_p_T(p, T), 8070.2 / _fp->molarMass(), tol);
139 REL_TEST(_fp->e_from_p_T(p, T), 5750.3 / _fp->molarMass(), tol);
140 REL_TEST(_fp->s_from_p_T(p, T), 170.41 / _fp->molarMass(), tol);
141 REL_TEST(_fp->cp_from_p_T(p, T), 29.66 / _fp->molarMass(), tol);
142 REL_TEST(_fp->cv_from_p_T(p, T), 20.89 / _fp->molarMass(), tol);
143 REL_TEST(_fp->c_from_p_T(p, T), 342.4, tol);
144
145 // Pressure = 1 MPa, temperature = 500 K
146 T = 500.0;
147 REL_TEST(_fp->rho_from_p_T(p, T), 0.23958 * 1000.0 * _fp->molarMass(), tol);
148 REL_TEST(_fp->e_from_p_T(p, T), 10395.0 / _fp->molarMass(), tol);
149 REL_TEST(_fp->h_from_p_T(p, T), 14569.0 / _fp->molarMass(), tol);
150 REL_TEST(_fp->s_from_p_T(p, T), 187.54 / _fp->molarMass(), tol);
151 REL_TEST(_fp->cp_from_p_T(p, T), 29.72 / _fp->molarMass(), tol);
152 REL_TEST(_fp->cv_from_p_T(p, T), 21.29 / _fp->molarMass(), tol);
153 REL_TEST(_fp->c_from_p_T(p, T), 457.0, tol);
154
155 // Pressure = 10 MPa, temperature = 500 K
156 p = 10.0e6;
157 REL_TEST(_fp->rho_from_p_T(p, T), 2.3024 * 1000.0 * _fp->molarMass(), tol);
158 REL_TEST(_fp->e_from_p_T(p, T), 10154.0 / _fp->molarMass(), tol);
159 REL_TEST(_fp->h_from_p_T(p, T), 14497.0 / _fp->molarMass(), tol);
160 REL_TEST(_fp->s_from_p_T(p, T), 167.93 / _fp->molarMass(), tol);
161 REL_TEST(_fp->cp_from_p_T(p, T), 30.82 / _fp->molarMass(), tol);
162 REL_TEST(_fp->cv_from_p_T(p, T), 21.49 / _fp->molarMass(), tol);
163 REL_TEST(_fp->c_from_p_T(p, T), 483.1, tol);
164}

◆ TEST_F() [8/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
thermalConductivity   
)

Verify calculation of thermal conductivity using data from Lemmon and Jacobsen, Viscosity and Thermal Conductivity Equations for Nitrogen, Oxygen, Argon, and Air, International Journal of Thermophysics, 25, 21–69 (2004)

Definition at line 89 of file NitrogenFluidPropertiesTest.C.

90{
91 const Real tol = REL_TOL_EXTERNAL_VALUE;
92
93 REL_TEST(_fp->k_from_rho_T(0.0, 300.0), 25.9361e-3, tol);
94 REL_TEST(_fp->k_from_rho_T(5.0 * 1000.0 * _fp->molarMass(), 300.0), 32.7694e-3, tol);
95
96 const Real p = _fp->p_from_rho_T(5.0 * 1000.0 * _fp->molarMass(), 300.0);
97 REL_TEST(_fp->k_from_p_T(p, 300.0), 32.7694e-3, tol);
98
99 // Liquid state, where the highest-order residual term (delta^10) dominates. The
100 // reference value includes the critical enhancement, which is not implemented and
101 // contributes well under 1% at this state
102 REL_TEST(_fp->k_from_rho_T(25.0 * 1000.0 * _fp->molarMass(), 100.0), 103.834e-3, 1.0e-2);
103}

◆ TEST_F() [9/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
triplePointProperties   
)

Test that the triple point properties are correctly returned.

Definition at line 39 of file NitrogenFluidPropertiesTest.C.

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

◆ TEST_F() [10/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
vapor   
)

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

Definition at line 49 of file NitrogenFluidPropertiesTest.C.

50{
51 const Real tol = REL_TOL_EXTERNAL_VALUE;
52
53 // Vapor pressure
54 REL_TEST(_fp->vaporPressure(80.0), 0.13687e6, tol);
55 REL_TEST(_fp->vaporPressure(100.0), 0.77827e6, tol);
56 REL_TEST(_fp->vaporPressure(120.0), 2.51058e6, tol);
57 //
58 // Saturated vapor density
59 REL_TEST(_fp->saturatedVaporDensity(80.0), 0.21737 * 1000.0 * _fp->molarMass(), tol);
60 REL_TEST(_fp->saturatedVaporDensity(100.0), 1.1409 * 1000.0 * _fp->molarMass(), tol);
61 REL_TEST(_fp->saturatedVaporDensity(120.0), 4.4653 * 1000.0 * _fp->molarMass(), tol);
62
63 // Saturated liquid density
64 REL_TEST(_fp->saturatedLiquidDensity(80.0), 28.341 * 1000.0 * _fp->molarMass(), tol);
65 REL_TEST(_fp->saturatedLiquidDensity(100.0), 24.608 * 1000.0 * _fp->molarMass(), tol);
66 REL_TEST(_fp->saturatedLiquidDensity(120.0), 18.682 * 1000.0 * _fp->molarMass(), tol);
67}

◆ TEST_F() [11/11]

TEST_F ( NitrogenFluidPropertiesTest  ,
viscosity   
)

Verify calculation of viscosity using data from Lemmon and Jacobsen, Viscosity and Thermal Conductivity Equations for Nitrogen, Oxygen, Argon, and Air, International Journal of Thermophysics, 25, 21–69 (2004)

Definition at line 110 of file NitrogenFluidPropertiesTest.C.

111{
112 const Real tol = REL_TOL_EXTERNAL_VALUE;
113
114 REL_TEST(_fp->mu_from_rho_T(0.0, 100.0), 6.90349e-6, tol);
115 REL_TEST(_fp->mu_from_rho_T(25.0 * 1000.0 * _fp->molarMass(), 100.0), 79.7418e-6, tol);
116 REL_TEST(_fp->mu_from_rho_T(10.0 * 1000.0 * _fp->molarMass(), 200.0), 21.081e-6, tol);
117
118 const Real p = _fp->p_from_rho_T(5.0 * 1000.0 * _fp->molarMass(), 300.0);
119 REL_TEST(_fp->mu_from_p_T(p, 300.0), 20.7430e-6, tol);
120}