GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/material/binarycoefficients/air_mesitylene.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 24 24 100.0%
Functions: 1 1 100.0%
Branches: 5 10 50.0%

Line Branch Exec Source
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 //
4 // SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 /*!
8 * \file
9 * \ingroup Binarycoefficients
10 * \brief Binary coefficients for air and mesitylene.
11 */
12 #ifndef DUMUX_BINARY_COEFF_AIR_MESITYLENE_HH
13 #define DUMUX_BINARY_COEFF_AIR_MESITYLENE_HH
14
15 #include <dumux/material/components/air.hh>
16 #include <dumux/material/components/mesitylene.hh>
17
18 namespace Dumux::BinaryCoeff {
19
20 /*!
21 * \ingroup Binarycoefficients
22 * \brief Binary coefficients for water and mesitylene.
23 */
24 class Air_Mesitylene
25 {
26 public:
27 /*!
28 * \brief Henry coefficient \f$\mathrm{[Pa]}\f$ for mesitylene in air.
29 * \param temperature the temperature \f$\mathrm{[K]}\f$
30 */
31 template <class Scalar>
32 static Scalar henry(Scalar temperature)
33 { DUNE_THROW(Dune::NotImplemented,
34 "Henry coefficient of air in mesitylene");
35 }
36
37 /*!
38 * \brief Binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for air and mesitylene.
39 * I used the method according to Wilke and Lee
40 * see W.J. Lyman, W.F. Reehl, D.H. Rosenblatt (1990) \cite lyman1990 <BR>
41 * \param temperature temperature in \f$\mathrm{[K]}\f$
42 * \param pressure pressure in \f$\mathrm{[Pa]}\f$
43 *
44 */
45 template <class Scalar>
46 1382070 static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
47 {
48 using Air = Dumux::Components::Air<Scalar>;
49 using Mesitylene = Dumux::Components::Mesitylene<Scalar>;
50
51 using std::min;
52 using std::max;
53
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1382070 times.
1382070 temperature = max(temperature, 1e-9); // regularization
54
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1382070 times.
1382070 temperature = min(temperature, 500.0); // regularization
55
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1382070 times.
1382070 pressure = max(pressure, 0.0); // regularization
56
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1382070 times.
1382070 pressure = min(pressure, 1e8); // regularization
57
58 using std::pow;
59 using std::sqrt;
60 using std::exp;
61 using Dune::power;
62 1382070 const Scalar M_m = 1e3*Mesitylene::molarMass(); // [g/mol] molecular weight of mesitylene
63 1382070 const Scalar M_a = 1e3*Air::molarMass(); // [g/mol] molecular weight of air
64 1382070 const Scalar Tb_m = 437.9; // [K] boiling temperature of mesitylene
65 1382070 const Scalar sigma_a = 3.711; // charact. length of air
66 1382070 const Scalar T_scal_a = 78.6; // [K] (molec. energy of attraction/Boltzmann constant)
67 1382070 const Scalar V_B_m = 162.6; // [cm^3/mol] LeBas molal volume of mesitylene
68
69 using std::cbrt;
70 1382070 const Scalar sigma_m = 1.18*cbrt(V_B_m); // charact. length of mesitylene
71 1382070 const Scalar sigma_am = 0.5*(sigma_a + sigma_m);
72 1382070 const Scalar T_scal_m = 1.15*Tb_m;
73 1382070 const Scalar T_scal_am = sqrt(T_scal_a*T_scal_m);
74
75 1382070 Scalar T_star = temperature/T_scal_am;
76
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1382070 times.
1382070 T_star = max(T_star, 1e-5); // regularization
77
78 1382070 const Scalar Omega = 1.06036/pow(T_star, 0.1561) + 0.193/exp(T_star*0.47635)
79 1382070 + 1.03587/exp(T_star*1.52996) + 1.76474/exp(T_star*3.89411);
80 1382070 const Scalar B_ = 0.00217 - 0.0005*sqrt(1.0/M_a + 1.0/M_m);
81 1382070 const Scalar Mr = (M_a + M_m)/(M_a*M_m);
82 1382070 const Scalar D_am = (B_*sqrt(temperature*temperature*temperature*Mr))
83 1382070 /(1e-5*pressure*power(sigma_am, 2) * Omega); // [cm^2/s]
84
85 1382070 return 1e-4*D_am; // [m^2/s]
86 }
87
88 /*!
89 * \brief Diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for air and mesitylene in liquid water.
90 * \param temperature temperature in \f$\mathrm{[K]}\f$
91 * \param pressure pressure in \f$\mathrm{[Pa]}\f$
92 *
93 * \note Returns just an order of magnitude.
94 */
95 template <class Scalar>
96 static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
97 {
98 return 1e-9;
99 }
100 };
101
102 } // end namespace Dumux::BinaryCoeff
103
104 #endif
105