GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/material/binarycoefficients/h2o_constant.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 4 4 100.0%
Branches: 13 18 72.2%

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 water and a "constant" component.
11 */
12 #ifndef DUMUX_BINARY_COEFF_H2O_CONSTANT_HH
13 #define DUMUX_BINARY_COEFF_H2O_CONSTANT_HH
14
15 #include <dune/common/exceptions.hh>
16
17 #include <dumux/common/parameters.hh>
18 #include <dumux/material/components/h2o.hh>
19 #include <dumux/material/components/constant.hh>
20
21 namespace Dumux::BinaryCoeff {
22
23 /*!
24 * \ingroup Binarycoefficients
25 * \brief Binary coefficients for water and another component.
26 * \todo All other binary coefficient could be generalized like this
27 */
28 template<class Scalar, class Component>
29 class H2O_Component
30 {
31 H2O_Component()
32 {
33 DUNE_THROW(Dune::NotImplemented, "The binary coefficients for H2O and your "
34 << "component are not implemented! Please implement the needed specialization.");
35 }
36 };
37
38 /*!
39 * \ingroup Binarycoefficients
40 * \brief Binary coefficients for water and a constant component
41 */
42 template<class Scalar, int id>
43 class H2O_Component<Scalar, Components::Constant<id, Scalar>>
44 {
45 public:
46 /*!
47 * \brief Henry coefficient \f$N/m^2\f$ for the constant component in liquid water.
48 *
49 * \param temperature the temperature \f$\mathrm{[K]}\f$
50 */
51 358440 static Scalar henryCompInWater(Scalar temperature)
52 {
53
5/6
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 358431 times.
✓ Branch 3 taken 4 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
358440 static const Scalar h = getParamFromGroup<Scalar>(std::to_string(id), "Component.HenryComponentInWater", 1.0);
54 358440 return h;
55 }
56
57 /*!
58 * \brief Henry coefficient \f$N/m^2\f$ for water in the constant component.
59 *
60 * \param temperature the temperature \f$\mathrm{[K]}\f$
61 */
62 static Scalar henryWaterInComp(Scalar temperature)
63 {
64 static const Scalar h = getParamFromGroup<Scalar>(std::to_string(id), "Component.HenryWaterInComponent", 1.0);
65 return h;
66 }
67
68
69 /*!
70 * \brief Binary diffusion coefficient \f$m^2/s\f$ for molecular water and the constant component.
71 * \param temperature the temperature \f$\mathrm{[K]}\f$
72 * \param pressure the phase pressure \f$\mathrm{[Pa]}\f$
73 */
74 1 static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
75 {
76
3/6
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
1 static const Scalar D = getParamFromGroup<Scalar>(std::to_string(id), "Component.GasDiffusionCoefficient", 1.0);
77 1 return D;
78 }
79
80 /*!
81 * \brief Diffusion coefficient \f$m^2/s\f$ for the constant component in liquid water.
82 * \param temperature the temperature \f$\mathrm{[K]}\f$
83 * \param pressure the phase pressure \f$\mathrm{[Pa]}\f$
84 */
85 5471013 static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
86 {
87
5/6
✓ Branch 0 taken 7 times.
✓ Branch 1 taken 5471006 times.
✓ Branch 3 taken 5 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
5471013 static const Scalar D = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidDiffusionCoefficient", 1.0);
88 5471013 return D;
89 }
90 };
91
92 } // end namespace Dumux::BinaryCoeff
93
94 #endif
95