GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/material/binarycoefficients/h2o_constant.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 4 4 100.0%
Branches: 19 36 52.8%

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