3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/3p3c/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 *****************************************************************************/
78#ifndef DUMUX_3P3C_MODEL_HH
79#define DUMUX_3P3C_MODEL_HH
80
81#include <dune/common/fvector.hh>
82
88
92
95
96#include "indices.hh"
97#include "volumevariables.hh"
98#include "iofields.hh"
99#include "localresidual.hh"
100
101namespace Dumux {
102
108template<bool useCS, bool useMol>
110{
112
113 static constexpr int numEq() { return 3; }
114 static constexpr int numFluidPhases() { return 3; }
115 static constexpr int numFluidComponents() { return 3; }
116
117 static constexpr bool enableAdvection() { return true; }
118 static constexpr bool enableMolecularDiffusion() { return true; }
119 static constexpr bool enableEnergyBalance() { return false; }
120
121 static constexpr bool useConstraintSolver() { return useCS; }
122 static constexpr bool useMoles() { return useMol; }
123};
124
135template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT>
137{
139 using FluidSystem = FSY;
140 using FluidState = FST;
141 using SolidSystem = SSY;
142 using SolidState = SST;
144 using ModelTraits = MT;
145};
146
147namespace Properties {
148// Create new type tags
149namespace TTag {
151struct ThreePThreeC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
153struct ThreePThreeCNI { using InheritsFrom = std::tuple<ThreePThreeC>; };
154} // end namespace TTag
155
157// Property values
159
161template<class TypeTag>
162struct BaseModelTraits<TypeTag, TTag::ThreePThreeC>
163{
164private:
166 static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p3c model!");
167 static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p3c model!");
168public:
169 using type = ThreePThreeCModelTraits<getPropValue<TypeTag, Properties::UseConstraintSolver>(), getPropValue<TypeTag, Properties::UseMoles>()>;
170};
171template<class TypeTag>
172struct ModelTraits<TypeTag, TTag::ThreePThreeC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
173
175template<class TypeTag>
176struct UseConstraintSolver<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = false; };
177
179template<class TypeTag>
180struct ReplaceCompEqIdx<TypeTag, TTag::ThreePThreeC> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); };
187template<class TypeTag>
188struct FluidState<TypeTag, TTag::ThreePThreeC>{
189 private:
192 public:
194};
195
197template<class TypeTag>
198struct LocalResidual<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCLocalResidual<TypeTag>; };
199
201template<class TypeTag>
202struct PrimaryVariables<TypeTag, TTag::ThreePThreeC>
203{
204private:
205 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
207public:
209};
210
212template<class TypeTag>
213struct VolumeVariables<TypeTag, TTag::ThreePThreeC>
214{
215private:
223
225public:
227};
228
230template<class TypeTag>
232
234template<class TypeTag>
235struct IOFields<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCIOFields; };
236
238template<class TypeTag>
239struct UseMoles<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = true; };
240
242template<class TypeTag>
244
246// Property values for isothermal model required for the general non-isothermal model
248
250template<class TypeTag>
251struct ModelTraits<TypeTag, TTag::ThreePThreeCNI>
252{
253private:
254 using IsothermalModelTraits = GetPropType<TypeTag, Properties::BaseModelTraits>;
255public:
257};
258
260template<class TypeTag>
261struct IOFields<TypeTag, TTag::ThreePThreeCNI> { using type = EnergyIOFields<ThreePThreeCIOFields>; };
262
263} // end namespace Properties
264} // end namespace Dumux
265
266#endif
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, multi-component fluid system assum...
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
A primary variable vector with a state to allow variable switches.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
A vector of primary variables.
Definition: common/properties.hh:59
Traits class encapsulating model specifications.
Definition: common/properties.hh:65
Model traits to be used as a base for nonisothermal, mineralization ... models.
Definition: common/properties.hh:67
A class helping models to define input and output fields.
Definition: common/properties.hh:78
Definition: common/properties.hh:91
Property whether to use moles or kg as amount unit for balance equations.
Definition: common/properties.hh:102
The component balance index that should be replaced by the total mass/mole balance.
Definition: common/properties.hh:104
The secondary variables within a sub-control volume.
Definition: common/properties.hh:174
The type of the fluid state to use.
Definition: common/properties.hh:225
The employed model for the computation of the effective diffusivity.
Definition: common/properties.hh:231
Model to be used for the calculation of the effective conductivity.
Definition: common/properties.hh:233
Whether to use a contraint solver for computing the secondary variables.
Definition: common/properties.hh:240
Relation for the saturation-dependent effective thermal conductivity.
Definition: thermalconductivitysomerton.hh:60
Relation for the saturation-dependent effective diffusion coefficient.
Definition: diffusivitymillingtonquirk.hh:51
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: compositional.hh:47
The indices for the isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/indices.hh:35
Adds I/O fields specific to the three-phase three-component model.
Definition: dumux/porousmediumflow/3p3c/iofields.hh:38
Element-wise calculation of the Jacobian matrix for problems using the three-phase three-component fu...
Definition: porousmediumflow/3p3c/localresidual.hh:41
Specifies a number properties of two-phase models.
Definition: porousmediumflow/3p3c/model.hh:110
static constexpr bool useMoles()
Definition: porousmediumflow/3p3c/model.hh:122
static constexpr int numFluidComponents()
Definition: porousmediumflow/3p3c/model.hh:115
static constexpr int numFluidPhases()
Definition: porousmediumflow/3p3c/model.hh:114
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/3p3c/model.hh:118
static constexpr bool useConstraintSolver()
Definition: porousmediumflow/3p3c/model.hh:121
static constexpr bool enableAdvection()
Definition: porousmediumflow/3p3c/model.hh:117
static constexpr int numEq()
Definition: porousmediumflow/3p3c/model.hh:113
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/3p3c/model.hh:119
Traits class for the 3p3c model.
Definition: porousmediumflow/3p3c/model.hh:137
FSY FluidSystem
Definition: porousmediumflow/3p3c/model.hh:139
MT ModelTraits
Definition: porousmediumflow/3p3c/model.hh:144
PV PrimaryVariables
Definition: porousmediumflow/3p3c/model.hh:138
SST SolidState
Definition: porousmediumflow/3p3c/model.hh:142
FST FluidState
Definition: porousmediumflow/3p3c/model.hh:140
PT PermeabilityType
Definition: porousmediumflow/3p3c/model.hh:143
SSY SolidSystem
Definition: porousmediumflow/3p3c/model.hh:141
The type tags for the isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/model.hh:151
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/3p3c/model.hh:151
The type tags for the non-isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/model.hh:153
std::tuple< ThreePThreeC > InheritsFrom
Definition: porousmediumflow/3p3c/model.hh:153
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/3p3c/model.hh:172
Contains the quantities which are are constant within a finite volume in the three-phase three-compon...
Definition: porousmediumflow/3p3c/volumevariables.hh:49
A primary variable vector with a state to allow variable switches.
Definition: switchableprimaryvariables.hh:38
Adds I/O fields specific to non-isothermal models.
Definition: dumux/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
Declares all properties used in Dumux.
Defines a type tag and some properties for models using the box scheme.
The implicit non-isothermal model.
Adds I/O fields specific to non-isothermal models.
Adds I/O fields specific to the twop model.
Element-wise calculation of the local residual for problems using fully implicit tracer model.
Base class for the model specific class which provides access to all volume averaged quantities.
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.