3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/solidenergy/volumevariables.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 2 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_SOLID_ENERGY_VOLUME_VARIABLES_HH
25#define DUMUX_SOLID_ENERGY_VOLUME_VARIABLES_HH
26
27#include <type_traits>
28
32
33namespace Dumux {
34
39template<class Traits>
41{
43 using Scalar = typename Traits::PrimaryVariables::value_type;
44 static constexpr int temperatureIdx = Traits::ModelTraits::Indices::temperatureIdx;
45
46public:
48 using SolidState = typename Traits::SolidState;
50 using SolidSystem = typename Traits::SolidSystem;
51
61 template<class ElemSol, class Problem, class Element, class Scv>
62 void update(const ElemSol& elemSol,
63 const Problem& problem,
64 const Element& element,
65 const Scv& scv)
66 {
67 ParentType::update(elemSol, problem, element, scv);
68 updateTemperature(elemSol, problem, element, scv, solidState_);
69 updateSolidVolumeFractions(elemSol, problem, element, scv, solidState_, 0);
70 updateSolidEnergyParams(elemSol, problem, element, scv, solidState_);
71 }
72
74 template<class ElemSol, class Problem, class Element, class Scv>
75 void updateTemperature(const ElemSol& elemSol,
76 const Problem& problem,
77 const Element& element,
78 const Scv& scv,
79 SolidState& solidState)
80 {
81 const Scalar T = elemSol[scv.localDofIndex()][temperatureIdx];
82 solidState.setTemperature(T);
83 }
84
86 template<class ElemSol, class Problem, class Element, class Scv>
87 void updateSolidEnergyParams(const ElemSol &elemSol,
88 const Problem& problem,
89 const Element &element,
90 const Scv &scv,
91 SolidState & solidState)
92 {
93 Scalar cs = solidHeatCapacity_(elemSol, problem, element, scv, solidState);
94 solidState.setHeatCapacity(cs);
95
96 Scalar rhos = solidDensity_(elemSol, problem, element, scv, solidState);
97 solidState.setDensity(rhos);
98
99 Scalar lambdas = solidThermalConductivity_(elemSol, problem, element, scv, solidState);
100 solidState.setThermalConductivity(lambdas);
101 }
102
106 Scalar temperatureSolid() const
107 { return solidState_.temperature(); }
108
112 Scalar temperature() const
113 { return solidState_.temperature(); }
114
119 Scalar solidHeatCapacity() const
120 { return solidState_.heatCapacity(); }
121
126 Scalar solidDensity() const
127 { return solidState_.density(); }
128
133 { return solidState_.thermalConductivity(); }
134
140 { return solidThermalConductivity(); }
141
145 Scalar porosity() const
146 { return solidState_.porosity(); }
147
148private:
150 SolidState solidState_;
151
165 // \{
166
176 template<class ElemSol, class Problem, class Element, class Scv,
177 std::enable_if_t<!Detail::hasSolidHeatCapacity<typename Problem::SpatialParams, Element, Scv, ElemSol, SolidState>(), int> = 0>
178 Scalar solidHeatCapacity_(const ElemSol& elemSol,
179 const Problem& problem,
180 const Element& element,
181 const Scv& scv,
182 const SolidState& solidState)
183 {
184 return SolidSystem::heatCapacity(solidState);
185 }
186
196 template<class ElemSol, class Problem, class Element, class Scv,
197 std::enable_if_t<!Detail::hasSolidDensity<typename Problem::SpatialParams, Element, Scv, ElemSol, SolidState>(), int> = 0>
198 Scalar solidDensity_(const ElemSol& elemSol,
199 const Problem& problem,
200 const Element& element,
201 const Scv& scv,
202 const SolidState& solidState)
203 {
204 return SolidSystem::density(solidState);
205 }
206
216 template<class ElemSol, class Problem, class Element, class Scv,
217 std::enable_if_t<!Detail::hasSolidThermalConductivity<typename Problem::SpatialParams, Element, Scv, ElemSol, SolidState>(), int> = 0>
218 Scalar solidThermalConductivity_(const ElemSol& elemSol,
219 const Problem& problem,
220 const Element& element,
221 const Scv& scv,
222 const SolidState& solidState)
223 {
224 return SolidSystem::thermalConductivity(solidState);
225 }
226
227 // \}
228
233 // \{
234
245 template<class ElemSol, class Problem, class Element, class Scv,
246 std::enable_if_t<Detail::hasSolidHeatCapacity<typename Problem::SpatialParams, Element, Scv, ElemSol, SolidState>(), int> = 0>
247 Scalar solidHeatCapacity_(const ElemSol& elemSol,
248 const Problem& problem,
249 const Element& element,
250 const Scv& scv,
251 const SolidState& solidState)
252 {
253 static_assert(Detail::isInertSolidPhase<SolidSystem>::value,
254 "solidHeatCapacity can only be overwritten in the spatial params when the solid system is a simple InertSolidPhase\n"
255 "If you select a proper solid system, the solid heat capacity will be computed as stated in the solid system!");
256 return problem.spatialParams().solidHeatCapacity(element, scv, elemSol, solidState);
257 }
258
269 template<class ElemSol, class Problem, class Element, class Scv,
270 std::enable_if_t<Detail::hasSolidDensity<typename Problem::SpatialParams, Element, Scv, ElemSol, SolidState>(), int> = 0>
271 Scalar solidDensity_(const ElemSol& elemSol,
272 const Problem& problem,
273 const Element& element,
274 const Scv& scv,
275 const SolidState& solidState)
276 {
277 static_assert(Detail::isInertSolidPhase<SolidSystem>::value,
278 "solidDensity can only be overwritten in the spatial params when the solid system is a simple InertSolidPhase\n"
279 "If you select a proper solid system, the solid density will be computed as stated in the solid system!");
280 return problem.spatialParams().solidDensity(element, scv, elemSol, solidState);
281 }
282
293 template<class ElemSol, class Problem, class Element, class Scv,
294 std::enable_if_t<Detail::hasSolidThermalConductivity<typename Problem::SpatialParams, Element, Scv, ElemSol, SolidState>(), int> = 0>
295 Scalar solidThermalConductivity_(const ElemSol& elemSol,
296 const Problem& problem,
297 const Element& element,
298 const Scv& scv,
299 const SolidState& solidState)
300 {
301 static_assert(Detail::isInertSolidPhase<SolidSystem>::value,
302 "solidThermalConductivity can only be overwritten in the spatial params when the solid system is a simple InertSolidPhase\n"
303 "If you select a proper solid system, the solid thermal conductivity will be computed as stated in the solid system!");
304 return problem.spatialParams().solidThermalConductivity(element, scv, elemSol, solidState);
305 }
306
307 // \}
308
309};
310
311} // end namespace Dumux
312
313#endif
Update the solid volume fractions (inert and reacitve) and set them in the solidstate.
void updateSolidVolumeFractions(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, SolidState &solidState, const int solidVolFracOffset)
update the solid volume fractions (inert and reacitve) and set them in the solidstate
Definition: updatesolidvolumefractions.hh:36
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Class for computation of all volume averaged quantities.
Definition: porousmediumflow/solidenergy/volumevariables.hh:41
Scalar temperature() const
Returns the temperature in the sub-control volume.
Definition: porousmediumflow/solidenergy/volumevariables.hh:112
Scalar solidDensity() const
Returns the mass density of the rock matrix in the sub-control volume.
Definition: porousmediumflow/solidenergy/volumevariables.hh:126
Scalar solidHeatCapacity() const
Returns the total heat capacity of the rock matrix in the sub-control volume.
Definition: porousmediumflow/solidenergy/volumevariables.hh:119
void updateSolidEnergyParams(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, SolidState &solidState)
Fill solid matrix parameters in the solid state.
Definition: porousmediumflow/solidenergy/volumevariables.hh:87
Scalar porosity() const
Return the average porosity within the control volume.
Definition: porousmediumflow/solidenergy/volumevariables.hh:145
Scalar effectiveThermalConductivity() const
Returns the effective thermal conductivity of the solid phase in the sub-control volume....
Definition: porousmediumflow/solidenergy/volumevariables.hh:139
typename Traits::SolidSystem SolidSystem
export the type used for the solid system
Definition: porousmediumflow/solidenergy/volumevariables.hh:50
Scalar temperatureSolid() const
Returns the temperature in the sub-control volume.
Definition: porousmediumflow/solidenergy/volumevariables.hh:106
Scalar solidThermalConductivity() const
Returns the thermal conductivity of the solid phase in the sub-control volume.
Definition: porousmediumflow/solidenergy/volumevariables.hh:132
typename Traits::SolidState SolidState
export the type used for the solid state
Definition: porousmediumflow/solidenergy/volumevariables.hh:48
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Update all quantities for a given control volume.
Definition: porousmediumflow/solidenergy/volumevariables.hh:62
void updateTemperature(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, SolidState &solidState)
Fill temperature in the solid state.
Definition: porousmediumflow/solidenergy/volumevariables.hh:75
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:40
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/volumevariables.hh:64
Base class for the model specific class which provides access to all volume averaged quantities.
Base class for the model specific class which provides access to all volume averaged quantities.