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

Go to the source code of this file.

Functions

 TEST_F (CO2FluidPropertiesTest, fluidName)
 Test that the fluid name is correctly returned. More...
 
 TEST_F (CO2FluidPropertiesTest, molarMass)
 Test that the molar mass is correctly returned. More...
 
 TEST_F (CO2FluidPropertiesTest, criticalProperties)
 Test that the critical properties are correctly returned. More...
 
 TEST_F (CO2FluidPropertiesTest, triplePointProperties)
 Test that the triple point properties are correctly returned. More...
 
 TEST_F (CO2FluidPropertiesTest, melting)
 Verify calculation of melting pressure using experimental data from Michels et al, The melting line of carbon dioxide up to 2800 atmospheres, Physica 9 (1942). More...
 
 TEST_F (CO2FluidPropertiesTest, sublimation)
 Verify calculation of sublimation pressure using data from Bedford et al., Recommended values of temperature for a selected set of secondary reference points, Metrologia 20 (1984). More...
 
 TEST_F (CO2FluidPropertiesTest, vapor)
 Verify calculation of vapor pressure, vapor density and saturated liquid density using experimental data from Duschek et al., Measurement and correlation of the (pressure, density, temperature) relation of cabon dioxide II. More...
 
 TEST_F (CO2FluidPropertiesTest, partialDensity)
 Verify calculation of partial density at infinite dilution using data from Hnedkovsky et al., Volumes of aqueous solutions of CH4, CO2, H2S, and NH3 at temperatures from 298.15 K to 705 K and pressures to 35 MPa, J. More...
 
 TEST_F (CO2FluidPropertiesTest, 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 (CO2FluidPropertiesTest, thermalConductivity)
 Verify calculation of thermal conductivity using data from Scalabrin et al., A Reference Multiparameter Thermal Conductivity Equation for Carbon Dioxide with an Optimized Functional Form, J. More...
 
 TEST_F (CO2FluidPropertiesTest, viscosity)
 Verify calculation of viscosity using data from Fenghour et al., The viscosity of carbon dioxide, J. More...
 
 TEST_F (CO2FluidPropertiesTest, propertiesSW)
 Verify calculation of thermophysical properties of CO2 from the Span and Wagner EOS using verification data provided in A New Equation of State for Carbon Dioxide Covering the Fluid Region from the Triple-Point Temperature to 1100K at Pressures up to 800 MPa, J. More...
 
 TEST_F (CO2FluidPropertiesTest, derivatives)
 Verify calculation of the derivatives of all properties by comparing with finite differences. More...
 
 TEST_F (CO2FluidPropertiesTest, 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/14]

TEST_F ( CO2FluidPropertiesTest  ,
fluidName   
)

Test that the fluid name is correctly returned.

Definition at line 16 of file CO2FluidPropertiesTest.C.

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

◆ TEST_F() [2/14]

TEST_F ( CO2FluidPropertiesTest  ,
molarMass   
)

Test that the molar mass is correctly returned.

Definition at line 21 of file CO2FluidPropertiesTest.C.

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

◆ TEST_F() [3/14]

TEST_F ( CO2FluidPropertiesTest  ,
criticalProperties   
)

Test that the critical properties are correctly returned.

Definition at line 29 of file CO2FluidPropertiesTest.C.

30 {
31  ABS_TEST(_fp->criticalPressure(), 7.3773e6, REL_TOL_SAVED_VALUE);
32  ABS_TEST(_fp->criticalTemperature(), 304.1282, REL_TOL_SAVED_VALUE);
33  ABS_TEST(_fp->criticalDensity(), 467.6, REL_TOL_SAVED_VALUE);
34 }

◆ TEST_F() [4/14]

TEST_F ( CO2FluidPropertiesTest  ,
triplePointProperties   
)

Test that the triple point properties are correctly returned.

Definition at line 39 of file CO2FluidPropertiesTest.C.

40 {
41  ABS_TEST(_fp->triplePointPressure(), 0.51795e6, REL_TOL_SAVED_VALUE);
42  ABS_TEST(_fp->triplePointTemperature(), 216.592, REL_TOL_SAVED_VALUE);
43 }

◆ TEST_F() [5/14]

TEST_F ( CO2FluidPropertiesTest  ,
melting   
)

Verify calculation of melting pressure using experimental data from Michels et al, The melting line of carbon dioxide up to 2800 atmospheres, Physica 9 (1942).

Note that results in this reference are given in atm, but have been converted to MPa here. As we are comparing with experimental data, calculated values within 1% are considered satisfactory.

Definition at line 54 of file CO2FluidPropertiesTest.C.

55 {
56  const Real tol = 10.0 * REL_TOL_EXTERNAL_VALUE;
57 
58  REL_TEST(_fp->meltingPressure(217.03), 2.57e6, tol);
59  REL_TEST(_fp->meltingPressure(235.29), 95.86e6, tol);
60  REL_TEST(_fp->meltingPressure(266.04), 286.77e6, tol);
61 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [6/14]

TEST_F ( CO2FluidPropertiesTest  ,
sublimation   
)

Verify calculation of sublimation pressure using data from Bedford et al., Recommended values of temperature for a selected set of secondary reference points, Metrologia 20 (1984).

Definition at line 68 of file CO2FluidPropertiesTest.C.

69 {
70  REL_TEST(_fp->sublimationPressure(194.6857), 0.101325e6, REL_TOL_EXTERNAL_VALUE);
71 }

◆ TEST_F() [7/14]

TEST_F ( CO2FluidPropertiesTest  ,
vapor   
)

Verify calculation of vapor pressure, vapor density and saturated liquid density using experimental data from Duschek et al., Measurement and correlation of the (pressure, density, temperature) relation of cabon dioxide II.

Saturated-liquid and saturated-vapor densities and the vapor pressure along the entire coexstance curve, J. Chem. Thermo. 22 (1990). As we are comparing with experimental data, calculated values within 1% are considered satisfactory.

Definition at line 82 of file CO2FluidPropertiesTest.C.

83 {
84  const Real tol = 10.0 * REL_TOL_EXTERNAL_VALUE;
85 
86  // Vapor pressure
87  REL_TEST(_fp->vaporPressure(217.0), 0.52747e6, tol);
88  REL_TEST(_fp->vaporPressure(245.0), 1.51887e6, tol);
89  REL_TEST(_fp->vaporPressure(303.8), 7.32029e6, tol);
90 
91  // Saturated vapor density
92  REL_TEST(_fp->saturatedVaporDensity(217.0), 14.0017, tol);
93  REL_TEST(_fp->saturatedVaporDensity(245.0), 39.5048, tol);
94  REL_TEST(_fp->saturatedVaporDensity(303.8), 382.30, tol);
95 
96  // Saturated liquid density
97  REL_TEST(_fp->saturatedLiquidDensity(217.0), 1177.03, tol);
98  REL_TEST(_fp->saturatedLiquidDensity(245.0), 1067.89, tol);
99  REL_TEST(_fp->saturatedLiquidDensity(303.8), 554.14, tol);
100 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [8/14]

TEST_F ( CO2FluidPropertiesTest  ,
partialDensity   
)

Verify calculation of partial density at infinite dilution using data from Hnedkovsky et al., Volumes of aqueous solutions of CH4, CO2, H2S, and NH3 at temperatures from 298.15 K to 705 K and pressures to 35 MPa, J.

Chem. Thermo. 28, 1996. As we are comparing with experimental data, calculated values within 5% are considered satisfactory.

Definition at line 110 of file CO2FluidPropertiesTest.C.

111 {
112  const Real tol = 50.0 * REL_TOL_EXTERNAL_VALUE;
113 
114  REL_TEST(_fp->partialDensity(373.15), 1182.8, tol);
115  REL_TEST(_fp->partialDensity(473.35), 880.0, tol);
116  REL_TEST(_fp->partialDensity(573.15), 593.8, tol);
117 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [9/14]

TEST_F ( CO2FluidPropertiesTest  ,
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 124 of file CO2FluidPropertiesTest.C.

125 {
126  const Real tol = REL_TOL_EXTERNAL_VALUE;
127  const std::vector<Real> hc = _fp->henryCoefficients();
128 
129  REL_TEST(hc[0], -8.55445, tol);
130  REL_TEST(hc[1], 4.01195, tol);
131  REL_TEST(hc[2], 9.52345, tol);
132 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [10/14]

TEST_F ( CO2FluidPropertiesTest  ,
thermalConductivity   
)

Verify calculation of thermal conductivity using data from Scalabrin et al., A Reference Multiparameter Thermal Conductivity Equation for Carbon Dioxide with an Optimized Functional Form, J.

Phys. Chem. Ref. Data 35 (2006)

Definition at line 140 of file CO2FluidPropertiesTest.C.

141 {
142  const Real tol = REL_TOL_EXTERNAL_VALUE;
143 
144  REL_TEST(_fp->k_from_rho_T(23.435, 250.0), 13.45e-3, tol);
145  REL_TEST(_fp->k_from_rho_T(18.579, 300.0), 17.248e-3, tol);
146  REL_TEST(_fp->k_from_rho_T(11.899, 450.0), 29.377e-3, tol);
147 
148  REL_TEST(_fp->k_from_p_T(1.0e6, 250.0), 1.34504e-2, tol);
149  REL_TEST(_fp->k_from_p_T(1.0e6, 300.0), 1.72483e-2, tol);
150  REL_TEST(_fp->k_from_p_T(1.0e6, 450.0), 2.93767e-2, tol);
151 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [11/14]

TEST_F ( CO2FluidPropertiesTest  ,
viscosity   
)

Verify calculation of viscosity using data from Fenghour et al., The viscosity of carbon dioxide, J.

Phys. Chem. Ref. Data, 27, 31-44 (1998)

Definition at line 158 of file CO2FluidPropertiesTest.C.

159 {
160  const Real tol = REL_TOL_EXTERNAL_VALUE;
161 
162  REL_TEST(_fp->mu_from_rho_T(20.199, 280.0), 14.15e-6, tol);
163  REL_TEST(_fp->mu_from_rho_T(15.105, 360.0), 17.94e-6, tol);
164  REL_TEST(_fp->mu_from_rho_T(10.664, 500.0), 24.06e-6, tol);
165 
166  REL_TEST(_fp->mu_from_p_T(1.0e6, 280.0), 1.41505e-05, tol);
167  REL_TEST(_fp->mu_from_p_T(1.0e6, 360.0), 1.79395e-05, tol);
168  REL_TEST(_fp->mu_from_p_T(1.0e6, 500.0), 2.40643e-05, tol);
169 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [12/14]

TEST_F ( CO2FluidPropertiesTest  ,
propertiesSW   
)

Verify calculation of thermophysical properties of CO2 from the Span and Wagner EOS using verification data provided in A New Equation of State for Carbon Dioxide Covering the Fluid Region from the Triple-Point Temperature to 1100K at Pressures up to 800 MPa, J.

Phys. Chem. Ref. Data, 25 (1996)

Definition at line 178 of file CO2FluidPropertiesTest.C.

179 {
180  // Pressure = 1 MPa, temperature = 280 K
181  Real p = 1.0e6;
182  Real T = 280.0;
183 
184  const Real tol = REL_TOL_EXTERNAL_VALUE;
185 
186  REL_TEST(_fp->rho_from_p_T(p, T), 20.199, tol);
187  REL_TEST(_fp->h_from_p_T(p, T), -26.385e3, tol);
188  REL_TEST(_fp->e_from_p_T(p, T), -75.892e3, tol);
189  REL_TEST(_fp->s_from_p_T(p, T), -0.51326e3, tol);
190  REL_TEST(_fp->cp_from_p_T(p, T), 0.92518e3, tol);
191  REL_TEST(_fp->cv_from_p_T(p, T), 0.67092e3, tol);
192  REL_TEST(_fp->c_from_p_T(p, T), 252.33, tol);
193 
194  // Pressure = 1 MPa, temperature = 500 K
195  T = 500.0;
196  REL_TEST(_fp->rho_from_p_T(p, T), 10.664, tol);
197  REL_TEST(_fp->h_from_p_T(p, T), 185.60e3, tol);
198  REL_TEST(_fp->e_from_p_T(p, T), 91.829e3, tol);
199  REL_TEST(_fp->s_from_p_T(p, T), 0.04225e3, tol);
200  REL_TEST(_fp->cp_from_p_T(p, T), 1.0273e3, tol);
201  REL_TEST(_fp->cv_from_p_T(p, T), 0.82823e3, tol);
202  REL_TEST(_fp->c_from_p_T(p, T), 339.81, tol);
203 
204  // Pressure = 10 MPa, temperature = 500 K
205  p = 10.0e6;
206  REL_TEST(_fp->rho_from_p_T(p, T), 113.07, tol);
207  REL_TEST(_fp->h_from_p_T(p, T), 157.01e3, tol);
208  REL_TEST(_fp->e_from_p_T(p, T), 68.569e3, tol);
209  REL_TEST(_fp->s_from_p_T(p, T), -0.4383e3, tol);
210  REL_TEST(_fp->cp_from_p_T(p, T), 1.1624e3, tol);
211  REL_TEST(_fp->cv_from_p_T(p, T), 0.85516e3, tol);
212  REL_TEST(_fp->c_from_p_T(p, T), 337.45, tol);
213 
214  // Verify properties from p, h
215  {
216  Real h1 = _fp->h_from_p_T(p, T);
217  Real T1 = _fp->T_from_p_h(p, h1);
218  REL_TEST(T1, T, REL_TOL_CONSISTENCY);
219  }
220 }
const double tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [13/14]

TEST_F ( CO2FluidPropertiesTest  ,
derivatives   
)

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

Definition at line 226 of file CO2FluidPropertiesTest.C.

227 {
228  const Real tol = REL_TOL_DERIVATIVE;
229 
230  const Real p = 1.0e6;
231  Real T = 350.0;
232 
233  DERIV_TEST(_fp->rho_from_p_T, p, T, tol);
234  DERIV_TEST(_fp->mu_from_p_T, p, T, tol);
235  DERIV_TEST(_fp->e_from_p_T, p, T, tol);
236  DERIV_TEST(_fp->h_from_p_T, p, T, tol);
237  DERIV_TEST(_fp->k_from_p_T, p, T, tol);
238 
239  // Viscosity from density and temperature
240  T = 360.0;
241  const Real drho = 1.0e-4;
242  Real rho, drho_dp, drho_dT;
243  _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
244 
245  Real dmu_drho_fd =
246  (_fp->mu_from_rho_T(rho + drho, T) - _fp->mu_from_rho_T(rho - drho, T)) / (2.0 * drho);
247  Real mu = 0.0, dmu_drho = 0.0, dmu_dT = 0.0;
248  _fp->mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
249 
250  ABS_TEST(mu, _fp->mu_from_rho_T(rho, T), REL_TOL_CONSISTENCY);
251  REL_TEST(dmu_drho, dmu_drho_fd, tol);
252 
253  // To properly test derivative wrt temperature, use p and T and calculate density,
254  // so that the change in density wrt temperature is included
255  const Real dp = 1.0e1;
256  const Real dT = 1.0e-4;
257  _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
258  _fp->mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
259 
260  Real dmu_dT_fd = (_fp->mu_from_rho_T(_fp->rho_from_p_T(p, T + dT), T + dT) -
261  _fp->mu_from_rho_T(_fp->rho_from_p_T(p, T - dT), T - dT)) /
262  (2.0 * dT);
263 
264  REL_TEST(dmu_dT, dmu_dT_fd, tol);
265 
266  Real dmu_dp_fd = (_fp->mu_from_p_T(p + dp, T) - _fp->mu_from_p_T(p - dp, T)) / (2.0 * dp);
267  Real dmu_dp = 0.0;
268  _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
269 
270  ABS_TEST(mu, _fp->mu_from_p_T(p, T), REL_TOL_CONSISTENCY);
271  REL_TEST(dmu_dp, dmu_dp_fd, tol);
272 
273  _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
274  dmu_dT_fd = (_fp->mu_from_p_T(p, T + dT) - _fp->mu_from_p_T(p, T - dT)) / (2.0 * dT);
275 
276  REL_TEST(dmu_dT, dmu_dT_fd, tol);
277 }
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() [14/14]

TEST_F ( CO2FluidPropertiesTest  ,
combined   
)

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

Definition at line 283 of file CO2FluidPropertiesTest.C.

284 {
285  const Real p = 1.0e6;
286  const Real T = 300.0;
287  const Real tol = REL_TOL_CONSISTENCY;
288 
289  // Single property methods
290  Real rho, drho_dp, drho_dT;
291  _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
292  Real mu, dmu_dp, dmu_dT;
293  _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
294  Real e, de_dp, de_dT;
295  _fp->e_from_p_T(p, T, e, de_dp, de_dT);
296 
297  // Combined property methods
298  Real rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT, e2, de2_dp, de2_dT;
299  _fp->rho_mu_from_p_T(p, T, rho2, mu2);
300 
301  ABS_TEST(rho, rho2, tol);
302  ABS_TEST(mu, mu2, tol);
303 
304  _fp->rho_mu_from_p_T(p, T, rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT);
305  ABS_TEST(rho, rho2, tol);
306  ABS_TEST(drho_dp, drho2_dp, tol);
307  ABS_TEST(drho_dT, drho2_dT, tol);
308  ABS_TEST(mu, mu2, tol);
309  ABS_TEST(dmu_dp, dmu2_dp, tol);
310  ABS_TEST(dmu_dT, dmu2_dT, tol);
311 
312  _fp->rho_e_from_p_T(p, T, rho2, drho2_dp, drho2_dT, e2, de2_dp, de2_dT);
313  ABS_TEST(rho, rho2, tol);
314  ABS_TEST(drho_dp, drho2_dp, tol);
315  ABS_TEST(drho_dT, drho2_dT, tol);
316  ABS_TEST(e, e2, tol);
317  ABS_TEST(de_dp, de2_dp, tol);
318  ABS_TEST(de_dT, de2_dT, tol);
319 }
const double tol
static const std::string mu
Definition: NS.h:123
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real