version 3.10-dev
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_SOLID_STATE_COMPOSITIONAL_HH
14#define DUMUX_SOLID_STATE_COMPOSITIONAL_HH
15
16namespace Dumux {
17
23template <class Scalar, class SolidSystemType>
25{
26public:
27 using SolidSystem = SolidSystemType;
28
29 enum
30 {
31 numComponents = SolidSystem::numComponents,
32 numInertComponents = SolidSystem::numInertComponents,
33 };
34
35 static constexpr bool isInert() { return SolidSystem::isInert(); }
36
43 Scalar averageMolarMass() const
44 { return SolidSystem::molarMass(); }
45
49 Scalar porosity() const
50 {
51 Scalar sumVolumeFraction = 0.0;
52 for (int compIdx =0; compIdx < numComponents; ++compIdx)
53 sumVolumeFraction += volumeFraction(compIdx);
54 Scalar porosity = 1-sumVolumeFraction;
55 return porosity;
56 }
57
59 Scalar density() const
60 { return density_; }
61
63 Scalar heatCapacity() const
64 { return heatCapacity_; }
65
67 Scalar thermalConductivity() const
68 { return thermalConducivity_; }
69
78 Scalar molarDensity() const
79 { return density_/averageMolarMass(); }
80
82 Scalar temperature() const
83 { return temperature_; }
84
86 Scalar volumeFraction(const int compIdx) const
87 { return volumeFraction_[compIdx]; }
88
89 /*****************************************************
90 * Setter methods. Note that these are not part of the
91 * generic CompositionalSolidState interface but specific for each
92 * implementation...
93 *****************************************************/
94
104 template <class SolidState>
105 void assign(const SolidState &sst)
106 {
107 temperature_ = sst.temperature();
108 density_ = sst.density();
109 thermalConducivity_ = sst.thermalConductivity();
110 heatCapacity_ = sst.heatCapacity();
111 for (int compIdx = 0; compIdx < numComponents; ++compIdx)
112 volumeFraction_[compIdx] = sst.volumeFraction(compIdx);
113 }
114
118 void setTemperature(Scalar value)
119 { temperature_ = value; }
120
124 void setDensity(Scalar value)
125 { density_ = value; }
126
130 void setThermalConductivity(Scalar value)
131 { thermalConducivity_ = value; }
132
136 void setHeatCapacity(Scalar value)
137 { heatCapacity_ = value; }
138
142 void setVolumeFraction(const int compIdx, Scalar value)
143 { volumeFraction_[compIdx] = value; }
144
145protected:
146 Scalar density_;
151};
152
153} // end namespace Dumux
154
155#endif
Represents all relevant thermodynamic quantities of a compositional solid system.
Definition: compositionalsolidstate.hh:25
Scalar volumeFraction_[numComponents]
Definition: compositionalsolidstate.hh:148
void setThermalConductivity(Scalar value)
Set the heat capacity of the solid phase.
Definition: compositionalsolidstate.hh:130
Scalar density() const
The mass density of the solid phase in .
Definition: compositionalsolidstate.hh:59
void setHeatCapacity(Scalar value)
Set the thermal conductivity of the solid phase.
Definition: compositionalsolidstate.hh:136
Scalar temperature() const
The temperature of the solid phase in .
Definition: compositionalsolidstate.hh:82
Scalar molarDensity() const
The molar density of a solid phase in .
Definition: compositionalsolidstate.hh:78
@ numComponents
Definition: compositionalsolidstate.hh:31
@ numInertComponents
Definition: compositionalsolidstate.hh:32
SolidSystemType SolidSystem
Definition: compositionalsolidstate.hh:27
Scalar temperature_
Definition: compositionalsolidstate.hh:147
Scalar density_
Definition: compositionalsolidstate.hh:146
void setTemperature(Scalar value)
Set the temperature of the solid phase.
Definition: compositionalsolidstate.hh:118
void setDensity(Scalar value)
Set the density of the solid phase.
Definition: compositionalsolidstate.hh:124
Scalar thermalConductivity() const
The heat capacity of the solid phase in .
Definition: compositionalsolidstate.hh:67
void setVolumeFraction(const int compIdx, Scalar value)
Set the volume fraction of a solid component.
Definition: compositionalsolidstate.hh:142
Scalar heatCapacity() const
The heat capacity of the solid phase in .
Definition: compositionalsolidstate.hh:63
void assign(const SolidState &sst)
Retrieve all parameters from an arbitrary solid state.
Definition: compositionalsolidstate.hh:105
Scalar averageMolarMass() const
The average molar mass of phase in .
Definition: compositionalsolidstate.hh:43
Scalar heatCapacity_
Definition: compositionalsolidstate.hh:149
Scalar thermalConducivity_
Definition: compositionalsolidstate.hh:150
Scalar volumeFraction(const int compIdx) const
The volume fraction of a solid component within the solid phase.
Definition: compositionalsolidstate.hh:86
static constexpr bool isInert()
Definition: compositionalsolidstate.hh:35
Scalar porosity() const
The porosity of the porous medium.
Definition: compositionalsolidstate.hh:49
Definition: adapt.hh:17