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

Go to the source code of this file.

Functions

 TEST_F (MethaneFluidPropertiesTest, criticalProperties)
 Verify that critical properties are correctly returned.
 
 TEST_F (MethaneFluidPropertiesTest, triplePointProperties)
 Verify that triple point properties are correctly returned.
 
 TEST_F (MethaneFluidPropertiesTest, fluidName)
 Test that the fluid name is correctly returned.
 
 TEST_F (MethaneFluidPropertiesTest, molarMass)
 Test that the molar mass is correctly returned.
 
 TEST_F (MethaneFluidPropertiesTest, 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 (MethaneFluidPropertiesTest, vapor)
 Verify calculation of vapor pressure, vapor density and saturated liquid density.
 
 TEST_F (MethaneFluidPropertiesTest, properties)
 Verify calculation of thermophysical properties of methane using verification data provided in Setzmann and Wagner, A new equation of state and tables of thermodynamic properties for methane covering the range from the melting line to 625 K at pressures up to 100 MPa, Journal of Physical and Chemical Reference Data, 20, 1061–1155 (1991) and Irvine Jr, T.
 
 TEST_F (MethaneFluidPropertiesTest, derivatives)
 Verify calculation of the derivatives of all properties by comparing with finite differences.
 
 TEST_F (MethaneFluidPropertiesTest, derivativesNearCritical)
 Verify the derivatives near the critical point, where the Gaussian bell-shaped terms of the residual Helmholtz free energy contribute significantly.
 
 TEST_F (MethaneFluidPropertiesTest, combined)
 Verify that the methods that return multiple properties in one call return identical values as the individual methods.
 

Function Documentation

◆ TEST_F() [1/10]

TEST_F ( MethaneFluidPropertiesTest  ,
combined   
)

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

Definition at line 158 of file MethaneFluidPropertiesTest.C.

159{
160 const Real p = 1.0e6;
161 const Real T = 300.0;
162 const Real tol = REL_TOL_CONSISTENCY;
163
164 // Single property methods
165 Real rho, drho_dp, drho_dT;
166 _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
167 Real mu, dmu_dp, dmu_dT;
168 _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
169 Real e, de_dp, de_dT;
170 _fp->e_from_p_T(p, T, e, de_dp, de_dT);
171
172 // Combined property methods
173 Real rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT, e2, de2_dp, de2_dT;
174 _fp->rho_mu_from_p_T(p, T, rho2, mu2);
175
176 ABS_TEST(rho, rho2, tol);
177 ABS_TEST(mu, mu2, tol);
178
179 _fp->rho_mu_from_p_T(p, T, rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT);
180 ABS_TEST(rho, rho2, tol);
181 ABS_TEST(drho_dp, drho2_dp, tol);
182 ABS_TEST(drho_dT, drho2_dT, tol);
183 ABS_TEST(mu, mu2, tol);
184 ABS_TEST(dmu_dp, dmu2_dp, tol);
185 ABS_TEST(dmu_dT, dmu2_dT, tol);
186
187 _fp->rho_e_from_p_T(p, T, rho2, drho2_dp, drho2_dT, e2, de2_dp, de2_dT);
188 ABS_TEST(rho, rho2, tol);
189 ABS_TEST(drho_dp, drho2_dp, tol);
190 ABS_TEST(drho_dT, drho2_dT, tol);
191 ABS_TEST(e, e2, tol);
192 ABS_TEST(de_dp, de2_dp, tol);
193 ABS_TEST(de_dT, de2_dT, tol);
194}
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/10]

TEST_F ( MethaneFluidPropertiesTest  ,
criticalProperties   
)

Verify that critical properties are correctly returned.

Definition at line 16 of file MethaneFluidPropertiesTest.C.

17{
18 ABS_TEST(_fp->criticalPressure(), 4.5992e6, REL_TOL_SAVED_VALUE);
19 ABS_TEST(_fp->criticalTemperature(), 190.564, REL_TOL_SAVED_VALUE);
20 ABS_TEST(_fp->criticalDensity(), 162.66, REL_TOL_SAVED_VALUE);
21}

◆ TEST_F() [3/10]

TEST_F ( MethaneFluidPropertiesTest  ,
derivatives   
)

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

Definition at line 117 of file MethaneFluidPropertiesTest.C.

118{
119 const Real tol = REL_TOL_DERIVATIVE;
120
121 const Real p = 10.0e6;
122 Real T = 350.0;
123
124 DERIV_TEST(_fp->rho_from_p_T, p, T, tol);
125 DERIV_TEST(_fp->mu_from_p_T, p, T, tol);
126 DERIV_TEST(_fp->e_from_p_T, p, T, tol);
127 DERIV_TEST(_fp->h_from_p_T, p, T, tol);
128 DERIV_TEST(_fp->s_from_p_T, p, T, tol);
129 DERIV_TEST(_fp->k_from_p_T, p, T, tol);
130}

◆ TEST_F() [4/10]

TEST_F ( MethaneFluidPropertiesTest  ,
derivativesNearCritical   
)

Verify the derivatives near the critical point, where the Gaussian bell-shaped terms of the residual Helmholtz free energy contribute significantly.

Definition at line 136 of file MethaneFluidPropertiesTest.C.

137{
138 const Real tol = REL_TOL_DERIVATIVE;
139
140 // Slightly supercritical state (Tc = 190.564 K, pc = 4.5992 MPa)
141 const Real p = 4.7e6;
142 const Real T = 192.0;
143
144 DERIV_TEST(_fp->rho_from_p_T, p, T, tol);
145 DERIV_TEST(_fp->e_from_p_T, p, T, tol);
146 DERIV_TEST(_fp->h_from_p_T, p, T, tol);
147
148 // The isobaric heat capacity is the temperature derivative of the enthalpy
149 Real h, dh_dp, dh_dT;
150 _fp->h_from_p_T(p, T, h, dh_dp, dh_dT);
151 REL_TEST(_fp->cp_from_p_T(p, T), dh_dT, REL_TOL_CONSISTENCY);
152}

◆ TEST_F() [5/10]

TEST_F ( MethaneFluidPropertiesTest  ,
fluidName   
)

Test that the fluid name is correctly returned.

Definition at line 35 of file MethaneFluidPropertiesTest.C.

35{ EXPECT_EQ(_fp->fluidName(), "methane"); }

◆ TEST_F() [6/10]

TEST_F ( MethaneFluidPropertiesTest  ,
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 50 of file MethaneFluidPropertiesTest.C.

51{
52 const Real tol = REL_TOL_EXTERNAL_VALUE;
53 const std::vector<Real> hc = _fp->henryCoefficients();
54
55 REL_TEST(hc[0], -10.44708, tol);
56 REL_TEST(hc[1], 4.66491, tol);
57 REL_TEST(hc[2], 12.1298, tol);
58}

◆ TEST_F() [7/10]

TEST_F ( MethaneFluidPropertiesTest  ,
molarMass   
)

Test that the molar mass is correctly returned.

Definition at line 40 of file MethaneFluidPropertiesTest.C.

41{
42 ABS_TEST(_fp->molarMass(), 16.0425e-3, REL_TOL_SAVED_VALUE);
43}

◆ TEST_F() [8/10]

TEST_F ( MethaneFluidPropertiesTest  ,
properties   
)

Verify calculation of thermophysical properties of methane using verification data provided in Setzmann and Wagner, A new equation of state and tables of thermodynamic properties for methane covering the range from the melting line to 625 K at pressures up to 100 MPa, Journal of Physical and Chemical Reference Data, 20, 1061–1155 (1991) and Irvine Jr, T.

F. and Liley, P. E. (1984) Steam and Gas Tables with Computer Equations

Definition at line 95 of file MethaneFluidPropertiesTest.C.

96{
97 // Pressure = 10 MPa, temperature = 350 K
98 Real p = 10.0e6;
99 Real T = 350.0;
100 const Real tol = REL_TOL_EXTERNAL_VALUE;
101
102 REL_TEST(_fp->rho_from_p_T(p, T), 59.261, tol);
103 REL_TEST(_fp->h_from_p_T(p, T), 47.785e3, tol);
104 REL_TEST(_fp->e_from_p_T(p, T), -120.96e3, tol);
105 REL_TEST(_fp->s_from_p_T(p, T), -2.1735e3, tol);
106 REL_TEST(_fp->cv_from_p_T(p, T), 1.9048e3, tol);
107 REL_TEST(_fp->cp_from_p_T(p, T), 2.8021e3, tol);
108 REL_TEST(_fp->c_from_p_T(p, T), 487.29, tol);
109 REL_TEST(_fp->mu_from_p_T(p, T), 0.01276e-3, tol);
110 REL_TEST(_fp->k_from_p_T(p, T), 0.04113, tol);
111}

◆ TEST_F() [9/10]

TEST_F ( MethaneFluidPropertiesTest  ,
triplePointProperties   
)

Verify that triple point properties are correctly returned.

Definition at line 26 of file MethaneFluidPropertiesTest.C.

27{
28 ABS_TEST(_fp->triplePointPressure(), 1.169e4, REL_TOL_SAVED_VALUE);
29 ABS_TEST(_fp->triplePointTemperature(), 90.6941, REL_TOL_SAVED_VALUE);
30}

◆ TEST_F() [10/10]

TEST_F ( MethaneFluidPropertiesTest  ,
vapor   
)

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

Definition at line 64 of file MethaneFluidPropertiesTest.C.

65{
66 const Real tol = REL_TOL_EXTERNAL_VALUE;
67
68 // Vapor pressure
69 REL_TEST(_fp->vaporPressure(110.0), 0.08813e6, tol);
70 REL_TEST(_fp->vaporPressure(130.0), 0.36732e6, tol);
71 REL_TEST(_fp->vaporPressure(190.0), 4.5186e6, tol);
72
73 // Saturated vapor density
74 REL_TEST(_fp->saturatedVaporDensity(110.0), 1.5982, tol);
75 REL_TEST(_fp->saturatedVaporDensity(130.0), 5.9804, tol);
76 REL_TEST(_fp->saturatedVaporDensity(190.0), 125.18, tol);
77
78 // Saturated liquid density
79 REL_TEST(_fp->saturatedLiquidDensity(110.0), 424.78, tol);
80 REL_TEST(_fp->saturatedLiquidDensity(130.0), 394.04, tol);
81 REL_TEST(_fp->saturatedLiquidDensity(190.0), 200.78, tol);
82}