GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/material/components/trichloroethene.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 2 8 25.0%
Functions: 0 3 0.0%
Branches: 18 30 60.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-FileCopyrightInfo: 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 implementation of Trichloroethene (TCE), a DNAPL.
11 */
12 #ifndef DUMUX_TRICHLOROETHENE_HH
13 #define DUMUX_TRICHLOROETHENE_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 {
22 namespace Components {
23
24 /*!
25 * \ingroup Components
26 * \brief A simple implementation of TCE as exemplary component for a dense NAPL.
27 *
28 * \tparam Scalar The type used for scalar values
29 */
30 template <class Scalar>
31 class Trichloroethene
32 : public Components::Base<Scalar, Trichloroethene<Scalar> >
33 , public Components::Liquid<Scalar, Trichloroethene<Scalar> >
34 , public Components::Gas<Scalar, Trichloroethene<Scalar> >
35 {
36 typedef Dumux::IdealGas<Scalar> IdealGas;
37
38 public:
39 /*!
40 * \brief A human readable name for the dense NAPL TCE.
41 */
42 static std::string name()
43
14/26
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✓ 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 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 1 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 1 times.
✗ Branch 35 not taken.
8 { return "Trichloroethene"; }
44
45 /*!
46 * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of TCE.
47 */
48 static constexpr Scalar molarMass()
49 {
50 return 131.39e-3; // [kg/mol]
51 }
52
53 /*!
54 * \brief Returns the critical temperature \f$\mathrm{[K]}\f$ of TCE.
55 */
56 static Scalar criticalTemperature()
57 {
58 DUNE_THROW(Dune::NotImplemented, "criticalTemperature for TCE");
59 }
60
61 /*!
62 * \brief Returns the critical pressure \f$\mathrm{[Pa]}\f$ of TCE.
63 */
64 static Scalar criticalPressure()
65 {
66 DUNE_THROW(Dune::NotImplemented, "criticalPressure for TCE");
67 }
68
69 /*!
70 * \brief Returns the temperature \f$\mathrm{[K]}\f$ at TCE's triple point.
71 */
72 static Scalar tripleTemperature()
73 {
74 DUNE_THROW(Dune::NotImplemented, "tripleTemperature for TCE");
75 }
76
77 /*!
78 * \brief Returns the pressure \f$\mathrm{[Pa]}\f$ at TCE's triple point.
79 */
80 static Scalar triplePressure()
81 {
82 DUNE_THROW(Dune::NotImplemented, "triplePressure for TCE");
83 }
84
85 /*!
86 * \brief The vapor pressure in \f$\mathrm{[Pa]}\f$ of pure TCE
87 * at a given temperature.
88 *
89 * \param T temperature of component in \f$\mathrm{[K]}\f$
90 */
91 static Scalar vaporPressure(Scalar T)
92 {
93 return 3900; // [Pa] (at 20C)
94 }
95
96 /*!
97 * \brief Returns true if the gas phase is assumed to be compressible
98 */
99 static constexpr bool gasIsCompressible()
100 { return true; }
101
102 /*!
103 * \brief Returns true if the liquid phase is assumed to be compressible
104 */
105 static constexpr bool liquidIsCompressible()
106 { return false; }
107
108 /*!
109 * \brief Returns true if the liquid phase viscostiy is constant
110 */
111 static constexpr bool liquidViscosityIsConstant()
112 { return true; }
113
114 /*!
115 * \brief The density of steam at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$.
116 *
117 * \param temperature temperature of component in \f$\mathrm{[K]}\f$
118 * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
119 */
120 static Scalar gasDensity(Scalar temperature, Scalar pressure)
121 {
122
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 2 times.
226 return IdealGas::density(molarMass(),
123 temperature,
124 pressure);
125 }
126
127 /*!
128 * \brief The molar density of steam in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature.
129 *
130 * \param temperature temperature of component in \f$\mathrm{[K]}\f$
131 * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
132 *
133 */
134 static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
135 { return IdealGas::molarDensity(temperature, pressure); }
136
137 /*!
138 * \brief Returns true if the gas phase is assumed to be ideal
139 */
140 static constexpr bool gasIsIdeal()
141 { return true; }
142
143 /*!
144 * \brief The density of pure TCE at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$.
145 *
146 * \param temperature temperature of component in \f$\mathrm{[K]}\f$
147 * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
148 */
149 static Scalar liquidDensity(Scalar temperature, Scalar pressure)
150 {
151 return 1460.0; // [kg/m^3]
152 }
153
154 /*!
155 * \brief The molar density of pure TCE in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature.
156 *
157 * \param temperature temperature of component in \f$\mathrm{[K]}\f$
158 * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
159 *
160 */
161 static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
162 { return liquidDensity(temperature, pressure)/molarMass(); }
163
164 /*!
165 * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of pure TCE.
166 *
167 * \param temperature temperature of component in \f$\mathrm{[K]}\f$
168 * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
169 */
170 static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
171 {
172 return 5.7e-4;// [Pa*s]
173 }
174 };
175
176 } // end namespace Components
177
178 } // end namespace Dumux
179
180 #endif
181