3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/richards/model.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 *****************************************************************************/
90#ifndef DUMUX_RICHARDS_MODEL_HH
91#define DUMUX_RICHARDS_MODEL_HH
92
93#include <dune/common/fvector.hh>
94
96
104
109
110#include "indices.hh"
111#include "volumevariables.hh"
112#include "iofields.hh"
113#include "localresidual.hh"
114#include "velocityoutput.hh"
115#include "balanceequationopts.hh"
116
117namespace Dumux {
118
125template<bool enableDiff>
127{
129
130 static constexpr int numEq() { return 1; }
131 static constexpr int numFluidPhases() { return 2; }
132 static constexpr int numFluidComponents() { return 1; }
133
134 static constexpr bool enableAdvection() { return true; }
135 static constexpr bool enableMolecularDiffusion() { return enableDiff; }
136 static constexpr bool enableEnergyBalance() { return false; }
137
140 template<class FluidSystem>
141 static constexpr bool fluidSystemIsCompatible()
142 {
143 return !FluidSystem::isGas(FluidSystem::phase0Idx)
144 && FluidSystem::isGas(FluidSystem::phase1Idx);
145 }
146
149 template<class FluidSystem>
150 static constexpr auto checkFluidSystem(const FluidSystem& fs)
151 {
152 struct FluidSystemCheck {
153 static_assert(fluidSystemIsCompatible<FluidSystem>(),
154 "Richards model currently assumes the first phase to be liquid and the second phase to be gaseous.");
155 };
156 return FluidSystemCheck{};
157 }
158};
159
170template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT, class DT, class EDM>
172{
174 using FluidSystem = FSY;
175 using FluidState = FST;
176 using SolidSystem = SSY;
179 using ModelTraits = MT;
180 using DiffusionType = DT;
182};
183
184// \{
186// properties for the isothermal Richards model.
188namespace Properties {
189
191// Type tags
193
195// Create new type tags
196namespace TTag {
197struct Richards { using InheritsFrom = std::tuple<PorousMediumFlow>; };
198struct RichardsNI { using InheritsFrom = std::tuple<Richards>; };
199} // end namespace TTag
200
202// Properties values
204
206template<class TypeTag>
207struct LocalResidual<TypeTag, TTag::Richards> { using type = RichardsLocalResidual<TypeTag>; };
208
210template<class TypeTag>
211struct IOFields<TypeTag, TTag::Richards>
212{
213private:
214 static constexpr bool enableWaterDiffusionInAir
215 = getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>();
216
217public:
219};
220
221template<class TypeTag>
222struct VelocityOutput<TypeTag, TTag::Richards>
223{
227 >;
228};
229
231template<class TypeTag>
233
235template<class TypeTag>
236struct VolumeVariables<TypeTag, TTag::Richards>
237{
238private:
249public:
251};
252
255template<class TypeTag>
256struct EnableWaterDiffusionInAir<TypeTag, TTag::Richards> { static constexpr bool value = false; };
257
259template<class TypeTag>
260struct EffectiveDiffusivityModel<TypeTag, TTag::Richards>
262
264template<class TypeTag>
265struct PrimaryVariables<TypeTag, TTag::Richards>
266{
267private:
268 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
270public:
272};
273
279template<class TypeTag>
280struct FluidSystem<TypeTag, TTag::Richards>
281{
285 FluidSystems::H2OAirDefaultPolicy</*fastButSimplifiedRelations=*/true>>;
286};
287
294template<class TypeTag>
295struct FluidState<TypeTag, TTag::Richards>
296{
297private:
300public:
302};
303
305template<class TypeTag>
306struct BalanceEqOpts<TypeTag, TTag::Richards>
308
310template<class TypeTag>
311struct ThermalConductivityModel<TypeTag, TTag::RichardsNI>
312{
313private:
315public:
317};
318
320// Property values for non-isothermal Richars model
322
324template<class TypeTag>
325struct ModelTraits<TypeTag, TTag::RichardsNI>
326{
327private:
329public:
331};
332
334template<class TypeTag>
335struct IOFields<TypeTag, TTag::RichardsNI>
336{
337 static constexpr bool enableWaterDiffusionInAir
338 = getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>();
341};
342
344template<class TypeTag>
345struct VolumeVariables<TypeTag, TTag::RichardsNI>
346{
347private:
358
360 template<class BaseTraits, class ETCM>
361 struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
362
363public:
365};
366
367// \}
368} // end namespace Properties
369} // end namespace Dumux
370
371#endif
A much simpler (and thus potentially less buggy) version of pure water.
Relation for the saturation-dependent effective thermal conductivity.
Relation for the saturation-dependent effective diffusion coefficient.
Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility...
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
A primary variable vector with a state to allow variable switches.
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
A vector of primary variables.
Definition: common/properties.hh:49
Traits class encapsulating model specifications.
Definition: common/properties.hh:53
A class helping models to define input and output fields.
Definition: common/properties.hh:63
Definition: common/properties.hh:74
A class that collects options for the evaluation of the balance equations.
Definition: common/properties.hh:89
The secondary variables within a sub-control volume.
Definition: common/properties.hh:107
The type of the fluid system to use.
Definition: common/properties.hh:162
The type of the fluid state to use.
Definition: common/properties.hh:164
The employed model for the computation of the effective diffusivity.
Definition: common/properties.hh:170
Model to be used for the calculation of the effective conductivity.
Definition: common/properties.hh:172
specifies the velocity calculation module to be used
Definition: common/properties.hh:174
Property for turning Richards into extended Richards.
Definition: common/properties.hh:197
A simple version of pure water.
Definition: simpleh2o.hh:50
Relation for the saturation-dependent effective thermal conductivity.
Definition: somerton.hh:60
Relation for the saturation-dependent effective diffusion coefficient.
Definition: diffusivitymillingtonquirk.hh:52
Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility...
Definition: immiscible.hh:42
Policy for the H2O-air fluid system.
Definition: h2oair.hh:51
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
Definition: h2oair.hh:74
A primary variable vector with a state to allow variable switches.
Definition: switchableprimaryvariables.hh:40
Adds I/O fields specific to non-isothermal models.
Definition: porousmediumflow/nonisothermal/iofields.hh:39
Specifies a number properties of non-isothermal porous medium flow models based on the specifics of a...
Definition: porousmediumflow/nonisothermal/model.hh:70
Traits class to set options used by the local residual when when evaluating the balance equations.
Definition: porousmediumflow/richards/balanceequationopts.hh:37
Index names for the Richards model.
Definition: porousmediumflow/richards/indices.hh:36
Adds I/O fields specific to the Richards model.
Definition: porousmediumflow/richards/iofields.hh:39
Element-wise calculation of the Jacobian matrix for problems using the Richards fully implicit models...
Definition: porousmediumflow/richards/localresidual.hh:58
Specifies a number properties of the Richards model.
Definition: porousmediumflow/richards/model.hh:127
static constexpr bool enableAdvection()
Definition: porousmediumflow/richards/model.hh:134
static constexpr bool fluidSystemIsCompatible()
Definition: porousmediumflow/richards/model.hh:141
static constexpr int numEq()
Definition: porousmediumflow/richards/model.hh:130
static constexpr int numFluidPhases()
Definition: porousmediumflow/richards/model.hh:131
static constexpr int numFluidComponents()
Definition: porousmediumflow/richards/model.hh:132
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/richards/model.hh:136
static constexpr auto checkFluidSystem(const FluidSystem &fs)
Definition: porousmediumflow/richards/model.hh:150
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/richards/model.hh:135
Traits class for the Richards model.
Definition: porousmediumflow/richards/model.hh:172
SSY SolidSystem
Definition: porousmediumflow/richards/model.hh:176
PV PrimaryVariables
Definition: porousmediumflow/richards/model.hh:173
FST FluidState
Definition: porousmediumflow/richards/model.hh:175
MT ModelTraits
Definition: porousmediumflow/richards/model.hh:179
PT PermeabilityType
Definition: porousmediumflow/richards/model.hh:178
SST SolidState
Definition: porousmediumflow/richards/model.hh:177
DT DiffusionType
Definition: porousmediumflow/richards/model.hh:180
FSY FluidSystem
Definition: porousmediumflow/richards/model.hh:174
EDM EffectiveDiffusivityModel
Definition: porousmediumflow/richards/model.hh:181
Definition: porousmediumflow/richards/model.hh:197
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/richards/model.hh:197
Definition: porousmediumflow/richards/model.hh:198
std::tuple< Richards > InheritsFrom
Definition: porousmediumflow/richards/model.hh:198
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: porousmediumflow/richards/model.hh:282
Velocity output policy for the Richards model.
Definition: porousmediumflow/richards/velocityoutput.hh:38
Volume averaged quantities required by the Richards model.
Definition: porousmediumflow/richards/volumevariables.hh:66
Traits class to set options used by the local residual when when evaluating the balance equations.
Declares all properties used in Dumux.
Defines a type tag and some properties for models using the box scheme.
The implicit non-isothermal model.
TODO: docme!
Adds I/O fields specific to non-isothermal models.
Adds I/O fields specific to the tracer model.
Element-wise calculation of the residual for problems using the n-phase immiscible fully implicit mod...
Element-wise calculation of the local residual for problems using fully implicit tracer model.
Defines the indices used by the non-isothermal two-phase two-component model.
Defines the primary variable and equation indices used by the isothermal tracer model.