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 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 |
16/32✓ 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.
|
16 | static std::string componentName(int compIdx = 0) |
45 |
8/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 1 times.
✗ Branch 30 not taken.
|
8 | { return Component::name(); } |
46 | |||
47 | /*! | ||
48 | * \brief A human readable name for the solid system. | ||
49 | */ | ||
50 |
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 | static std::string name() |
51 |
16/32✓ 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.
|
8 | { 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 | 95489402 | static Scalar density(Scalar temperature, int compIdx = 0) | |
75 | 95489402 | { 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 | 95489402 | static Scalar density(const SolidState& solidState, int compIdx = 0) | |
82 | 95489402 | { 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 | 95260362 | static Scalar thermalConductivity(Scalar temperature, int compIdx = 0) | |
95 | 95260362 | { 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 | 95260362 | static Scalar thermalConductivity(const SolidState &solidState, int compIdx = 0) | |
102 | 95260362 | { return thermalConductivity(solidState.temperature(), compIdx); } | |
103 | |||
104 | /*! | ||
105 | * \brief Specific isobaric heat capacity of the solid \f$\mathrm{[J/(kg K)]}\f$. | ||
106 | */ | ||
107 | 91963705 | static Scalar heatCapacity(Scalar temperature, int compIdx = 0) | |
108 | 91963705 | { 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 | 91963705 | static Scalar heatCapacity(const SolidState &solidState, int compIdx = 0) | |
115 | 91963705 | { 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 |