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, combined)
 Verify that the methods that return multiple properties in one call return identical values as the individual methods.
 

Function Documentation

◆ TEST_F() [1/9]

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 135 of file MethaneFluidPropertiesTest.C.

136{
137 const Real p = 1.0e6;
138 const Real T = 300.0;
139 const Real tol = REL_TOL_CONSISTENCY;
140
141 // Single property methods
142 Real rho, drho_dp, drho_dT;
143 _fp->rho_from_p_T(p, T, rho, drho_dp, drho_dT);
144 Real mu, dmu_dp, dmu_dT;
145 _fp->mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
146 Real e, de_dp, de_dT;
147 _fp->e_from_p_T(p, T, e, de_dp, de_dT);
148
149 // Combined property methods
150 Real rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT, e2, de2_dp, de2_dT;
151 _fp->rho_mu_from_p_T(p, T, rho2, mu2);
152
153 ABS_TEST(rho, rho2, tol);
154 ABS_TEST(mu, mu2, tol);
155
156 _fp->rho_mu_from_p_T(p, T, rho2, drho2_dp, drho2_dT, mu2, dmu2_dp, dmu2_dT);
157 ABS_TEST(rho, rho2, tol);
158 ABS_TEST(drho_dp, drho2_dp, tol);
159 ABS_TEST(drho_dT, drho2_dT, tol);
160 ABS_TEST(mu, mu2, tol);
161 ABS_TEST(dmu_dp, dmu2_dp, tol);
162 ABS_TEST(dmu_dT, dmu2_dT, tol);
163
164 _fp->rho_e_from_p_T(p, T, rho2, drho2_dp, drho2_dT, e2, de2_dp, de2_dT);
165 ABS_TEST(rho, rho2, tol);
166 ABS_TEST(drho_dp, drho2_dp, tol);
167 ABS_TEST(drho_dT, drho2_dT, tol);
168 ABS_TEST(e, e2, tol);
169 ABS_TEST(de_dp, de2_dp, tol);
170 ABS_TEST(de_dT, de2_dT, tol);
171}
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/9]

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/9]

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->k_from_p_T, p, T, tol);
129}

◆ TEST_F() [4/9]

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() [5/9]

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() [6/9]

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() [7/9]

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() [8/9]

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() [9/9]

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}