https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MethaneFluidPropertiesTest.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
12
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}
22
26TEST_F(MethaneFluidPropertiesTest, triplePointProperties)
27{
28 ABS_TEST(_fp->triplePointPressure(), 1.169e4, REL_TOL_SAVED_VALUE);
29 ABS_TEST(_fp->triplePointTemperature(), 90.6941, REL_TOL_SAVED_VALUE);
30}
31
35TEST_F(MethaneFluidPropertiesTest, fluidName) { EXPECT_EQ(_fp->fluidName(), "methane"); }
36
41{
42 ABS_TEST(_fp->molarMass(), 16.0425e-3, REL_TOL_SAVED_VALUE);
43}
44
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}
59
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}
83
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}
112
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}
131
136TEST_F(MethaneFluidPropertiesTest, derivativesNearCritical)
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}
153
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
TEST_F(MethaneFluidPropertiesTest, criticalProperties)
Verify that critical properties are correctly returned.