3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
inertsolidstate.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 *****************************************************************************/
24#ifndef DUMUX_INERT_SOLID_STATE_HH
25#define DUMUX_INERT_SOLID_STATE_HH
26
27namespace Dumux {
28
33template <class Scalar, class SolidSystemType>
35{
36public:
37 using SolidSystem = SolidSystemType;
38
39 enum
40 {
41 numComponents = SolidSystem::numComponents,
42 numInertComponents = SolidSystem::numInertComponents,
43 };
44
49 static constexpr bool isInert()
50 {
51 static_assert(SolidSystem::isInert(), "Only inert solid systems are allowed with the InertSolidState");
52 return true;
53 }
54
61 Scalar averageMolarMass() const
62 { return SolidSystem::molarMass(); }
63
67 Scalar porosity() const
68 {
69 Scalar sumVolumeFraction = 0.0;
70 for (int compIdx =0; compIdx < numComponents; ++compIdx)
71 sumVolumeFraction += volumeFraction(compIdx);
72 Scalar porosity = 1-sumVolumeFraction;
73 return porosity;
74 }
75
77 Scalar density() const { return density_; }
78
80 Scalar heatCapacity() const { return heatCapacity_; }
81
83 Scalar thermalConductivity() const { return thermalConducivity_; }
84
86 Scalar temperature() const { return temperature_; }
87
89 Scalar volumeFraction(const int compIdx) const { return volumeFraction_[compIdx]; }
90
91
100 Scalar molarDensity() const
101 { return density_/averageMolarMass(); }
102
103 /*****************************************************
104 * Setter methods. Note that these are not part of the
105 * generic InertSolidState interface but specific for each
106 * implementation...
107 *****************************************************/
108
117 template <class SolidState>
118 void assign(const SolidState &sst)
119 {
120 temperature_ = sst.temperature();
121 density_ = sst.density();
122 thermalConducivity_ = sst.thermalConductivity();
123 heatCapacity_ = sst.heatCapacity();
124 for (int compIdx = 0; compIdx < numComponents; ++compIdx)
125 volumeFraction_[compIdx] = sst.volumeFraction(compIdx);
126 }
127
131 void setTemperature(Scalar value)
132 { temperature_ = value; }
133
137 void setDensity(Scalar value)
138 { density_ = value; }
139
143 void setThermalConductivity(Scalar value)
144 { thermalConducivity_ = value; }
145
149 void setHeatCapacity(Scalar value)
150 { heatCapacity_ = value; }
151
155 void setVolumeFraction(const int compIdx, Scalar value)
156 { volumeFraction_[compIdx] = value; }
157
158protected:
159 Scalar density_;
164};
165
166} // end namespace Dumux
167
168#endif
Definition: adapt.hh:29
Represents all relevant thermodynamic quantities of a inert solid system.
Definition: inertsolidstate.hh:35
void setHeatCapacity(Scalar value)
Set the thermal conductivity of the solid phase.
Definition: inertsolidstate.hh:149
Scalar averageMolarMass() const
The average molar mass of phase in .
Definition: inertsolidstate.hh:61
void assign(const SolidState &sst)
Retrieve all parameters from an arbitrary solid state.
Definition: inertsolidstate.hh:118
Scalar heatCapacity() const
The heat capacity of the solid phase in .
Definition: inertsolidstate.hh:80
Scalar density_
Definition: inertsolidstate.hh:159
Scalar porosity() const
The porosity of the porous medium.
Definition: inertsolidstate.hh:67
static constexpr bool isInert()
Allows compile-time evaluation of if the solid system is inert or takes part in any kind of reactions...
Definition: inertsolidstate.hh:49
Scalar density() const
The mass density of the solid phase in .
Definition: inertsolidstate.hh:77
Scalar temperature_
Definition: inertsolidstate.hh:160
Scalar volumeFraction(const int compIdx) const
The volume fraction of a solid component within the solid phase.
Definition: inertsolidstate.hh:89
@ numComponents
Definition: inertsolidstate.hh:41
@ numInertComponents
Definition: inertsolidstate.hh:42
Scalar thermalConducivity_
Definition: inertsolidstate.hh:163
Scalar molarDensity() const
The molar density of a solid phase in .
Definition: inertsolidstate.hh:100
void setTemperature(Scalar value)
Set the temperature of the solid phase.
Definition: inertsolidstate.hh:131
SolidSystemType SolidSystem
Definition: inertsolidstate.hh:37
void setVolumeFraction(const int compIdx, Scalar value)
Set the volume fraction of a solid component.
Definition: inertsolidstate.hh:155
Scalar heatCapacity_
Definition: inertsolidstate.hh:162
Scalar volumeFraction_[numComponents]
Definition: inertsolidstate.hh:161
void setThermalConductivity(Scalar value)
Set the heat capacity of the solid phase.
Definition: inertsolidstate.hh:143
Scalar temperature() const
The temperature of the solid phase in .
Definition: inertsolidstate.hh:86
Scalar thermalConductivity() const
The thermal conductivity of the solid phase in .
Definition: inertsolidstate.hh:83
void setDensity(Scalar value)
Set the density of the solid phase.
Definition: inertsolidstate.hh:137