GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/material/solidsystems/1csolid.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 8 19 42.1%
Functions: 0 78 0.0%
Branches: 96 192 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-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 SolidSystems
10 * \brief The simplest solid phase consisting of a single solid component.
11 */
12 #ifndef DUMUX_SOLIDSYSTEMS_SOLID_PHASE_HH
13 #define DUMUX_SOLIDSYSTEMS_SOLID_PHASE_HH
14
15 #include <string>
16 #include <dune/common/exceptions.hh>
17
18 namespace Dumux {
19 namespace SolidSystems {
20
21 /*!
22 * \ingroup SolidSystems
23 * \brief The simplest solid phase consisting of a single solid component.
24 * \note A solid is considered inert if it can't dissolve in a liquid and
25 * and can't increase its mass by precipitation from a fluid phase.
26 */
27 template <class Scalar, class ComponentT, bool isInertComp = true>
28 class OneCSolid
29 {
30 public:
31 using Component = ComponentT;
32
33 /****************************************
34 * Solid phase related static parameters
35 ****************************************/
36 static constexpr int numComponents = 1;
37 static constexpr int numInertComponents = isInertComp ? 1 : 0;
38
39 /*!
40 * \brief A human readable name for the component.
41 *
42 * \param compIdx The index of the component to consider
43 */
44 static std::string componentName(int compIdx = 0)
45
40/80
✓ 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.
✓ 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 18 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 1 times.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✓ Branch 29 taken 1 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 1 times.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 41 taken 1 times.
✓ Branch 43 taken 1 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 1 times.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✓ Branch 49 taken 1 times.
✗ Branch 50 not taken.
✓ Branch 51 taken 1 times.
✓ Branch 53 taken 1 times.
✗ Branch 54 not taken.
✓ Branch 56 taken 1 times.
✗ Branch 57 not taken.
✓ Branch 59 taken 1 times.
✗ Branch 60 not taken.
✓ Branch 62 taken 1 times.
✗ Branch 63 not taken.
✓ Branch 65 taken 1 times.
✗ Branch 66 not taken.
✓ Branch 68 taken 1 times.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✓ Branch 71 taken 1 times.
✗ Branch 72 not taken.
✓ Branch 73 taken 1 times.
✓ Branch 75 taken 1 times.
✗ Branch 76 not taken.
✓ Branch 78 taken 1 times.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✓ Branch 81 taken 1 times.
✗ Branch 82 not taken.
✓ Branch 83 taken 1 times.
✓ Branch 85 taken 1 times.
✗ Branch 86 not taken.
✓ Branch 88 taken 1 times.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✓ Branch 91 taken 1 times.
✗ Branch 92 not taken.
✓ Branch 93 taken 1 times.
✓ Branch 95 taken 1 times.
✗ Branch 96 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 103 taken 1 times.
24 { return Component::name(); }
46
47 /*!
48 * \brief A human readable name for the solid system.
49 */
50 static std::string name()
51
32/64
✓ 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.
✓ 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.
✓ Branch 37 taken 1 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 1 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 1 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 1 times.
✗ Branch 47 not taken.
✓ Branch 49 taken 1 times.
✗ Branch 50 not taken.
✓ Branch 52 taken 1 times.
✗ Branch 53 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 67 taken 1 times.
✗ Branch 68 not taken.
✓ Branch 70 taken 1 times.
✗ Branch 71 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 79 taken 1 times.
✗ Branch 80 not taken.
✓ Branch 82 taken 1 times.
✗ Branch 83 not taken.
✓ Branch 85 taken 1 times.
✗ Branch 86 not taken.
✓ Branch 88 taken 1 times.
✗ Branch 89 not taken.
✓ Branch 91 taken 1 times.
✗ Branch 92 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
16 { return "s"; }
52
53 /*!
54 * \brief Returns whether the phase is incompressible
55 */
56 static constexpr bool isCompressible(int compIdx = 0)
57 { return false; }
58
59 /*!
60 * \brief Returns whether the component is inert (doesn't react)
61 */
62 static constexpr bool isInert()
63 { return isInertComp; }
64
65 /*!
66 * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of the component.
67 */
68 static Scalar molarMass(int compIdx = 0)
69 { return Component::molarMass(); }
70
71 /*!
72 * \brief The density \f$\mathrm{[kg/m^3]}\f$ of the solid phase at a given pressure and temperature.
73 */
74 static Scalar density(Scalar temperature, int compIdx = 0)
75 8 { return Component::solidDensity(temperature); }
76
77 /*!
78 * \brief The density \f$\mathrm{[kg/m^3]}\f$ of the solid phase at a given pressure and temperature.
79 */
80 template <class SolidState>
81 static Scalar density(const SolidState& solidState, int compIdx = 0)
82
8/16
✓ 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.
✓ 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.
225848 { return density(solidState.temperature(), compIdx); }
83
84 /*!
85 * \brief The molar density of the solid phase at a given pressure and temperature.
86 */
87 template <class SolidState>
88 static Scalar molarDensity(const SolidState& solidState, int compIdx = 0)
89 { return density(solidState.temperature(), compIdx)/molarMass(compIdx); }
90
91 /*!
92 * \brief Thermal conductivity of the solid \f$\mathrm{[W/(m K)]}\f$.
93 */
94 static Scalar thermalConductivity(Scalar temperature, int compIdx = 0)
95 8 { return Component::solidThermalConductivity(temperature); }
96
97 /*!
98 * \brief Thermal conductivity of the solid \f$\mathrm{[W/(m K)]}\f$.
99 */
100 template <class SolidState>
101 static Scalar thermalConductivity(const SolidState &solidState, int compIdx = 0)
102
8/16
✓ 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.
✓ 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.
8 { return thermalConductivity(solidState.temperature(), compIdx); }
103
104 /*!
105 * \brief Specific isobaric heat capacity of the solid \f$\mathrm{[J/(kg K)]}\f$.
106 */
107 static Scalar heatCapacity(Scalar temperature, int compIdx = 0)
108 8 { return Component::solidHeatCapacity(temperature); }
109
110 /*!
111 * \brief Specific isobaric heat capacity of the solid \f$\mathrm{[J/(kg K)]}\f$.
112 */
113 template <class SolidState>
114 static Scalar heatCapacity(const SolidState &solidState, int compIdx = 0)
115
8/16
✓ 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.
✓ 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.
8 { return heatCapacity(solidState.temperature(), compIdx); }
116 };
117
118 /*!
119 * \ingroup SolidSystems
120 * \brief A solid phase consisting of a single inert solid component.
121 * \note a solid is considered inert if it can't dissolve in a liquid and
122 * and can't increase its mass by precipitation from a fluid phase.
123 */
124 template <class Scalar, class ComponentT>
125 using InertSolidPhase = OneCSolid<Scalar, ComponentT, /*isInert=*/true>;
126
127 } // end namespace SolidSystems
128 } // end namespace Dumux
129
130 #endif
131