version 3.10-dev
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_INERT_SOLID_STATE_HH
13#define DUMUX_INERT_SOLID_STATE_HH
14
15namespace Dumux {
16
21template <class Scalar, class SolidSystemType>
23{
24public:
25 using SolidSystem = SolidSystemType;
26
27 enum
28 {
29 numComponents = SolidSystem::numComponents,
30 numInertComponents = SolidSystem::numInertComponents,
31 };
32
37 static constexpr bool isInert()
38 {
39 static_assert(SolidSystem::isInert(), "Only inert solid systems are allowed with the InertSolidState");
40 return true;
41 }
42
49 Scalar averageMolarMass() const
50 { return SolidSystem::molarMass(); }
51
55 Scalar porosity() const
56 {
57 Scalar sumVolumeFraction = 0.0;
58 for (int compIdx =0; compIdx < numComponents; ++compIdx)
59 sumVolumeFraction += volumeFraction(compIdx);
60 Scalar porosity = 1-sumVolumeFraction;
61 return porosity;
62 }
63
65 Scalar density() const { return density_; }
66
68 Scalar heatCapacity() const { return heatCapacity_; }
69
71 Scalar thermalConductivity() const { return thermalConducivity_; }
72
74 Scalar temperature() const { return temperature_; }
75
77 Scalar volumeFraction(const int compIdx) const { return volumeFraction_[compIdx]; }
78
79
88 Scalar molarDensity() const
89 { return density_/averageMolarMass(); }
90
91 /*****************************************************
92 * Setter methods. Note that these are not part of the
93 * generic InertSolidState interface but specific for each
94 * implementation...
95 *****************************************************/
96
105 template <class SolidState>
106 void assign(const SolidState &sst)
107 {
108 temperature_ = sst.temperature();
109 density_ = sst.density();
110 thermalConducivity_ = sst.thermalConductivity();
111 heatCapacity_ = sst.heatCapacity();
112 for (int compIdx = 0; compIdx < numComponents; ++compIdx)
113 volumeFraction_[compIdx] = sst.volumeFraction(compIdx);
114 }
115
119 void setTemperature(Scalar value)
120 { temperature_ = value; }
121
125 void setDensity(Scalar value)
126 { density_ = value; }
127
131 void setThermalConductivity(Scalar value)
132 { thermalConducivity_ = value; }
133
137 void setHeatCapacity(Scalar value)
138 { heatCapacity_ = value; }
139
143 void setVolumeFraction(const int compIdx, Scalar value)
144 { volumeFraction_[compIdx] = value; }
145
146protected:
147 Scalar density_;
152};
153
154} // end namespace Dumux
155
156#endif
Represents all relevant thermodynamic quantities of a inert solid system.
Definition: inertsolidstate.hh:23
void setHeatCapacity(Scalar value)
Set the thermal conductivity of the solid phase.
Definition: inertsolidstate.hh:137
Scalar averageMolarMass() const
The average molar mass of phase in .
Definition: inertsolidstate.hh:49
void assign(const SolidState &sst)
Retrieve all parameters from an arbitrary solid state.
Definition: inertsolidstate.hh:106
Scalar heatCapacity() const
The heat capacity of the solid phase in .
Definition: inertsolidstate.hh:68
Scalar density_
Definition: inertsolidstate.hh:147
Scalar porosity() const
The porosity of the porous medium.
Definition: inertsolidstate.hh:55
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:37
Scalar density() const
The mass density of the solid phase in .
Definition: inertsolidstate.hh:65
Scalar temperature_
Definition: inertsolidstate.hh:148
Scalar volumeFraction(const int compIdx) const
The volume fraction of a solid component within the solid phase.
Definition: inertsolidstate.hh:77
Scalar thermalConducivity_
Definition: inertsolidstate.hh:151
Scalar molarDensity() const
The molar density of a solid phase in .
Definition: inertsolidstate.hh:88
@ numComponents
Definition: inertsolidstate.hh:29
@ numInertComponents
Definition: inertsolidstate.hh:30
void setTemperature(Scalar value)
Set the temperature of the solid phase.
Definition: inertsolidstate.hh:119
SolidSystemType SolidSystem
Definition: inertsolidstate.hh:25
void setVolumeFraction(const int compIdx, Scalar value)
Set the volume fraction of a solid component.
Definition: inertsolidstate.hh:143
Scalar heatCapacity_
Definition: inertsolidstate.hh:150
Scalar volumeFraction_[numComponents]
Definition: inertsolidstate.hh:149
void setThermalConductivity(Scalar value)
Set the heat capacity of the solid phase.
Definition: inertsolidstate.hh:131
Scalar temperature() const
The temperature of the solid phase in .
Definition: inertsolidstate.hh:74
Scalar thermalConductivity() const
The thermal conductivity of the solid phase in .
Definition: inertsolidstate.hh:71
void setDensity(Scalar value)
Set the density of the solid phase.
Definition: inertsolidstate.hh:125
Definition: adapt.hh:17