3.6-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 <type_traits>
94
95#include <dune/common/fvector.hh>
96
99
107
112
113#include "indices.hh"
114#include "volumevariables.hh"
115#include "iofields.hh"
116#include "localresidual.hh"
117#include "velocityoutput.hh"
118#include "balanceequationopts.hh"
119
120namespace Dumux {
121
128template<bool enableDiff>
130{
132
133 static constexpr int numEq() { return 1; }
134 static constexpr int numFluidPhases() { return 2; }
135 static constexpr int numFluidComponents() { return 1; }
136
137 static constexpr bool enableAdvection() { return true; }
138 static constexpr bool enableMolecularDiffusion() { return Dumux::Deprecated::ExtendedRichardsHelper<enableDiff>::isExtendedRichards(); }
139 static constexpr bool enableEnergyBalance() { return false; }
140
143 template<class FluidSystem>
144 static constexpr bool fluidSystemIsCompatible()
145 {
146 return !FluidSystem::isGas(FluidSystem::phase0Idx)
147 && FluidSystem::isGas(FluidSystem::phase1Idx);
148 }
149
152 template<class FluidSystem>
153 static constexpr auto checkFluidSystem(const FluidSystem& fs)
154 {
155 struct FluidSystemCheck {
156 static_assert(fluidSystemIsCompatible<FluidSystem>(),
157 "Richards model currently assumes the first phase to be liquid and the second phase to be gaseous.");
158 };
159 return FluidSystemCheck{};
160 }
161};
162
173template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT, class DT, class EDM>
175{
177 using FluidSystem = FSY;
178 using FluidState = FST;
179 using SolidSystem = SSY;
182 using ModelTraits = MT;
183 using DiffusionType = DT;
185};
186
187// \{
189// properties for the isothermal Richards model.
191namespace Properties {
192
194// Type tags
196
198// Create new type tags
199namespace TTag {
200struct Richards { using InheritsFrom = std::tuple<PorousMediumFlow>; };
201struct RichardsNI { using InheritsFrom = std::tuple<Richards>; };
202} // end namespace TTag
203
205// Properties values
207
209template<class TypeTag>
210struct LocalResidual<TypeTag, TTag::Richards> { using type = RichardsLocalResidual<TypeTag>; };
211
213template<class TypeTag>
214struct IOFields<TypeTag, TTag::Richards>
215{
216private:
217 static constexpr bool enableWaterDiffusionInAir
218 = getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>();
219
220public:
222};
223
224template<class TypeTag>
225struct VelocityOutput<TypeTag, TTag::Richards>
226{
230 >;
231};
232
234template<class TypeTag>
236
238template<class TypeTag>
239struct VolumeVariables<TypeTag, TTag::Richards>
240{
241private:
252public:
254};
255
258template<class TypeTag>
259struct EnableWaterDiffusionInAir<TypeTag, TTag::Richards> { static constexpr bool value = false; };
260
262template<class TypeTag>
263struct EffectiveDiffusivityModel<TypeTag, TTag::Richards>
265
267template<class TypeTag>
268struct PrimaryVariables<TypeTag, TTag::Richards>
269{
270private:
271 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
273public:
274 // TODO: After release 3.6, use the default (FieldVector) for Richards and remove the whole property specialization
275 using type = std::conditional_t<getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>(),
277 Deprecated::RichardsSwitchablePrimaryVariables<PrimaryVariablesVector, int>>;
278};
279
285template<class TypeTag>
286struct FluidSystem<TypeTag, TTag::Richards>
287{
291 FluidSystems::H2OAirDefaultPolicy</*fastButSimplifiedRelations=*/true>>;
292};
293
300template<class TypeTag>
301struct FluidState<TypeTag, TTag::Richards>
302{
303private:
306public:
308};
309
311template<class TypeTag>
312struct BalanceEqOpts<TypeTag, TTag::Richards>
314
316template<class TypeTag>
317struct ThermalConductivityModel<TypeTag, TTag::RichardsNI>
318{
319private:
321public:
323};
324
326// Property values for non-isothermal Richars model
328
330template<class TypeTag>
331struct ModelTraits<TypeTag, TTag::RichardsNI>
332{
333private:
335public:
337};
338
340template<class TypeTag>
341struct IOFields<TypeTag, TTag::RichardsNI>
342{
343 static constexpr bool enableWaterDiffusionInAir
344 = getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>();
347};
348
350template<class TypeTag>
351struct VolumeVariables<TypeTag, TTag::RichardsNI>
352{
353private:
364
366 template<class BaseTraits, class ETCM>
367 struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
368
369public:
371};
372
373// \}
374} // end namespace Properties
375} // end namespace Dumux
376
377#endif
Helpers for deprecation.
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...
Relation for the saturation-dependent effective thermal conductivity.
Relation for the saturation-dependent effective diffusion coefficient.
A simple implementation of pure water.
A primary variable vector with a state to allow variable switches.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:180
A vector of primary variables.
Definition: common/properties.hh:49
Traits class encapsulating model specifications.
Definition: common/properties.hh:51
A class helping models to define input and output fields.
Definition: common/properties.hh:61
Definition: common/properties.hh:72
A class that collects options for the evaluation of the balance equations.
Definition: common/properties.hh:87
The secondary variables within a sub-control volume.
Definition: common/properties.hh:105
The type of the fluid system to use.
Definition: common/properties.hh:160
The type of the fluid state to use.
Definition: common/properties.hh:162
The employed model for the computation of the effective diffusivity.
Definition: common/properties.hh:168
Model to be used for the calculation of the effective conductivity.
Definition: common/properties.hh:170
specifies the velocity calculation module to be used
Definition: common/properties.hh:172
Property for turning Richards into extended Richards.
Definition: common/properties.hh:195
A simple implementation of pure water.
Definition: simpleh2o.hh:49
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:40
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:130
static constexpr bool enableAdvection()
Definition: porousmediumflow/richards/model.hh:137
static constexpr bool fluidSystemIsCompatible()
Definition: porousmediumflow/richards/model.hh:144
static constexpr int numEq()
Definition: porousmediumflow/richards/model.hh:133
static constexpr int numFluidPhases()
Definition: porousmediumflow/richards/model.hh:134
static constexpr int numFluidComponents()
Definition: porousmediumflow/richards/model.hh:135
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/richards/model.hh:139
static constexpr auto checkFluidSystem(const FluidSystem &fs)
Definition: porousmediumflow/richards/model.hh:153
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/richards/model.hh:138
Traits class for the Richards model.
Definition: porousmediumflow/richards/model.hh:175
SSY SolidSystem
Definition: porousmediumflow/richards/model.hh:179
PV PrimaryVariables
Definition: porousmediumflow/richards/model.hh:176
FST FluidState
Definition: porousmediumflow/richards/model.hh:178
MT ModelTraits
Definition: porousmediumflow/richards/model.hh:182
PT PermeabilityType
Definition: porousmediumflow/richards/model.hh:181
SST SolidState
Definition: porousmediumflow/richards/model.hh:180
DT DiffusionType
Definition: porousmediumflow/richards/model.hh:183
FSY FluidSystem
Definition: porousmediumflow/richards/model.hh:177
EDM EffectiveDiffusivityModel
Definition: porousmediumflow/richards/model.hh:184
Definition: porousmediumflow/richards/model.hh:200
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/richards/model.hh:200
Definition: porousmediumflow/richards/model.hh:201
std::tuple< Richards > InheritsFrom
Definition: porousmediumflow/richards/model.hh:201
std::conditional_t< getPropValue< TypeTag, Properties::EnableWaterDiffusionInAir >(), SwitchablePrimaryVariables< PrimaryVariablesVector, int >, Deprecated::RichardsSwitchablePrimaryVariables< PrimaryVariablesVector, int > > type
Definition: porousmediumflow/richards/model.hh:277
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: porousmediumflow/richards/model.hh:288
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:68
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!
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.
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.
Adds I/O fields specific to non-isothermal models.
Adds I/O fields specific to the tracer model.
Python wrapper for volume variables (finite volume schemes)