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->k_from_p_T, p, T, tol);
129}
130
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
TEST_F(MethaneFluidPropertiesTest, criticalProperties)
Verify that critical properties are correctly returned.