GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/material/components/benzene.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 4 4 100.0%
Functions: 0 0 -%
Branches: 10 19 52.6%

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 Components
10 * \brief A simple benzene component (LNAPL).
11 */
12 #ifndef DUMUX_BENZENE_HH
13 #define DUMUX_BENZENE_HH
14
15 #include <dumux/material/idealgas.hh>
16
17 #include <dumux/material/components/base.hh>
18 #include <dumux/material/components/liquid.hh>
19 #include <dumux/material/components/gas.hh>
20
21 namespace Dumux::Components {
22
23 /*!
24 * \ingroup Components
25 * \brief A simple benzene component (LNAPL).
26 *
27 * \tparam Scalar The type used for scalar values
28 */
29 template <class Scalar>
30 class Benzene
31 : public Components::Base<Scalar, Benzene<Scalar> >
32 , public Components::Liquid<Scalar, Benzene<Scalar> >
33 , public Components::Gas<Scalar, Benzene<Scalar> >
34 {
35 using IdealGas = Dumux::IdealGas<Scalar>;
36 public:
37 /*!
38 * \brief A human readable name for the benzene
39 */
40
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
4 static std::string name()
41
7/13
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✗ Branch 3 not taken.
4 { return "benzene"; }
42
43 /*!
44 * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of benzene
45 */
46 static constexpr Scalar molarMass()
47 { return 0.07811; }
48
49 /*!
50 * \brief Returns true if the gas phase is assumed to be compressible
51 */
52 static constexpr bool gasIsCompressible()
53 { return true; }
54
55 /*!
56 * \brief Returns true if the liquid phase is assumed to be compressible
57 */
58 static constexpr bool liquidIsCompressible()
59 { return false; }
60
61 /*!
62 * \brief Returns true if the gas phase viscosity is constant
63 */
64 static constexpr bool gasViscosityIsConstant()
65 { return true; }
66
67 /*!
68 * \brief Returns true if the liquid phase viscosity is constant
69 */
70 static constexpr bool liquidViscosityIsConstant()
71 { return true; }
72
73 /*!
74 * \brief The density of benzene steam at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$.
75 *
76 * \param temperature temperature of component in \f$\mathrm{[K]}\f$
77 * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
78 */
79 110 static Scalar gasDensity(Scalar temperature, Scalar pressure)
80 {
81 110 return IdealGas::density(molarMass(),
82 temperature,
83 pressure);
84 }
85
86 /*!
87 * \brief The molar density of steam in \f$\mathrm{[mol/m^3]}\f$,
88 * depending on pressure and temperature.
89 * \param temperature The temperature of the gas
90 * \param pressure The pressure of the gas
91 */
92 static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
93 { return IdealGas::molarDensity(temperature, pressure); }
94
95 /*!
96 * \brief The density of pure benzene at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$.
97 *
98 * \param temperature temperature of component in \f$\mathrm{[K]}\f$
99 * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
100 */
101 static Scalar liquidDensity(Scalar temperature, Scalar pressure)
102 {
103 return 889.51;
104 }
105
106 /*!
107 * \brief The molar density of pure benzene at a given pressure and temperature \f$\mathrm{[mol/m^3]}\f$.
108 *
109 * \param temperature temperature of component in \f$\mathrm{[K]}\f$
110 * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
111 */
112 static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
113 {
114 return liquidDensity(temperature, pressure)/molarMass();
115 }
116
117 /*!
118 * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of pure benzene.
119 *
120 * \param temperature temperature of component in \f$\mathrm{[K]}\f$
121 * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
122 */
123 static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
124 {
125 return 1.12e-3;//[Pa s]
126 }
127 };
128
129 } // end namespace Dumux::Components
130
131 #endif
132