3.3.0
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
compositionalsolidstate.hh
Go to the documentation of this file.
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef DUMUX_SOLID_STATE_COMPOSITIONAL_HH
26#define DUMUX_SOLID_STATE_COMPOSITIONAL_HH
27
28namespace Dumux {
29
35template <class Scalar, class SolidSystemType>
37{
38public:
39 using SolidSystem = SolidSystemType;
40
41 enum
42 {
43 numComponents = SolidSystem::numComponents,
44 numInertComponents = SolidSystem::numInertComponents,
45 };
46
47 static constexpr bool isInert() { return SolidSystem::isInert(); }
48
55 Scalar averageMolarMass() const
56 { return SolidSystem::molarMass(); }
57
61 Scalar porosity() const
62 {
63 Scalar sumVolumeFraction = 0.0;
64 for (int compIdx =0; compIdx < numComponents; ++compIdx)
65 sumVolumeFraction += volumeFraction(compIdx);
66 Scalar porosity = 1-sumVolumeFraction;
67 return porosity;
68 }
69
71 Scalar density() const
72 { return density_; }
73
75 Scalar heatCapacity() const
76 { return heatCapacity_; }
77
79 Scalar thermalConductivity() const
80 { return thermalConducivity_; }
81
90 Scalar molarDensity() const
91 { return density_/averageMolarMass(); }
92
94 Scalar temperature() const
95 { return temperature_; }
96
98 Scalar volumeFraction(const int compIdx) const
99 { return volumeFraction_[compIdx]; }
100
101 /*****************************************************
102 * Setter methods. Note that these are not part of the
103 * generic CompositionalSolidState interface but specific for each
104 * implementation...
105 *****************************************************/
106
116 template <class SolidState>
117 void assign(const SolidState &sst)
118 {
119 temperature_ = sst.temperature();
120 density_ = sst.density();
121 thermalConducivity_ = sst.thermalConductivity();
122 heatCapacity_ = sst.heatCapacity();
123 for (int compIdx = 0; compIdx < numComponents; ++compIdx)
124 volumeFraction_[compIdx] = sst.volumeFraction(compIdx);
125 }
126
130 void setTemperature(Scalar value)
131 { temperature_ = value; }
132
136 void setDensity(Scalar value)
137 { density_ = value; }
138
142 void setThermalConductivity(Scalar value)
143 { thermalConducivity_ = value; }
144
148 void setHeatCapacity(Scalar value)
149 { heatCapacity_ = value; }
150
154 void setVolumeFraction(const int compIdx, Scalar value)
155 { volumeFraction_[compIdx] = value; }
156
157protected:
158 Scalar density_;
163};
164
165} // end namespace Dumux
166
167#endif
Definition: adapt.hh:29
Represents all relevant thermodynamic quantities of a compositional solid system.
Definition: compositionalsolidstate.hh:37
Scalar volumeFraction_[numComponents]
Definition: compositionalsolidstate.hh:160
void setThermalConductivity(Scalar value)
Set the heat capacity of the solid phase.
Definition: compositionalsolidstate.hh:142
Scalar density() const
The mass density of the solid phase in .
Definition: compositionalsolidstate.hh:71
void setHeatCapacity(Scalar value)
Set the thermal conductivity of the solid phase.
Definition: compositionalsolidstate.hh:148
Scalar temperature() const
The temperature of the solid phase in .
Definition: compositionalsolidstate.hh:94
Scalar molarDensity() const
The molar density of a solid phase in .
Definition: compositionalsolidstate.hh:90
SolidSystemType SolidSystem
Definition: compositionalsolidstate.hh:39
@ numComponents
Definition: compositionalsolidstate.hh:43
@ numInertComponents
Definition: compositionalsolidstate.hh:44
Scalar temperature_
Definition: compositionalsolidstate.hh:159
Scalar density_
Definition: compositionalsolidstate.hh:158
void setTemperature(Scalar value)
Set the temperature of the solid phase.
Definition: compositionalsolidstate.hh:130
void setDensity(Scalar value)
Set the density of the solid phase.
Definition: compositionalsolidstate.hh:136
Scalar thermalConductivity() const
The heat capacity of the solid phase in .
Definition: compositionalsolidstate.hh:79
void setVolumeFraction(const int compIdx, Scalar value)
Set the volume fraction of a solid component.
Definition: compositionalsolidstate.hh:154
Scalar heatCapacity() const
The heat capacity of the solid phase in .
Definition: compositionalsolidstate.hh:75
void assign(const SolidState &sst)
Retrieve all parameters from an arbitrary solid state.
Definition: compositionalsolidstate.hh:117
Scalar averageMolarMass() const
The average molar mass of phase in .
Definition: compositionalsolidstate.hh:55
Scalar heatCapacity_
Definition: compositionalsolidstate.hh:161
Scalar thermalConducivity_
Definition: compositionalsolidstate.hh:162
Scalar volumeFraction(const int compIdx) const
The volume fraction of a solid component within the solid phase.
Definition: compositionalsolidstate.hh:98
static constexpr bool isInert()
Definition: compositionalsolidstate.hh:47
Scalar porosity() const
The porosity of the porous medium.
Definition: compositionalsolidstate.hh:61