3.6-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 *****************************************************************************/
71#ifndef DUMUX_3P3C_MODEL_HH
72#define DUMUX_3P3C_MODEL_HH
73
74#include <dune/common/fvector.hh>
75
83
87
88#include "indices.hh"
89#include "volumevariables.hh"
90#include "iofields.hh"
91#include "localresidual.hh"
92
93namespace Dumux {
94
100template<bool useCS, bool useMol>
102{
104
105 static constexpr int numEq() { return 3; }
106 static constexpr int numFluidPhases() { return 3; }
107 static constexpr int numFluidComponents() { return 3; }
108
109 static constexpr bool enableAdvection() { return true; }
110 static constexpr bool enableMolecularDiffusion() { return true; }
111 static constexpr bool enableEnergyBalance() { return false; }
112
113 static constexpr bool useConstraintSolver() { return useCS; }
114 static constexpr bool useMoles() { return useMol; }
115};
116
117namespace Properties {
118// Create new type tags
119namespace TTag {
121struct ThreePThreeC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
123struct ThreePThreeCNI { using InheritsFrom = std::tuple<ThreePThreeC>; };
124} // end namespace TTag
125
127// Property values
129
131template<class TypeTag>
132struct BaseModelTraits<TypeTag, TTag::ThreePThreeC>
133{
134private:
136 static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p3c model!");
137 static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p3c model!");
138public:
139 using type = ThreePThreeCModelTraits<getPropValue<TypeTag, Properties::UseConstraintSolver>(), getPropValue<TypeTag, Properties::UseMoles>()>;
140};
141template<class TypeTag>
142struct ModelTraits<TypeTag, TTag::ThreePThreeC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
143
145template<class TypeTag>
146struct UseConstraintSolver<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = false; };
147
149template<class TypeTag>
150struct ReplaceCompEqIdx<TypeTag, TTag::ThreePThreeC> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); };
157template<class TypeTag>
158struct FluidState<TypeTag, TTag::ThreePThreeC>{
159 private:
162 public:
164};
165
167template<class TypeTag>
168struct LocalResidual<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCLocalResidual<TypeTag>; };
169
171template<class TypeTag>
172struct PrimaryVariables<TypeTag, TTag::ThreePThreeC>
173{
174private:
175 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
177public:
179};
180
182template<class TypeTag>
183struct VolumeVariables<TypeTag, TTag::ThreePThreeC>
184{
185private:
195
197 template<class BaseTraits, class DT, class EDM>
198 struct NCTraits : public BaseTraits
199 {
200 using DiffusionType = DT;
201 using EffectiveDiffusivityModel = EDM;
202 };
203
204public:
206};
207
209template<class TypeTag>
211
213template<class TypeTag>
214struct IOFields<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCIOFields; };
215
217template<class TypeTag>
218struct UseMoles<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = true; };
219
221// Property values for isothermal model required for the general non-isothermal model
223
225template<class TypeTag>
226struct ModelTraits<TypeTag, TTag::ThreePThreeCNI>
227{
228private:
230public:
232};
233
235template<class TypeTag>
236struct VolumeVariables<TypeTag, TTag::ThreePThreeCNI>
237{
238private:
247
251 template<class BaseTraits, class DT, class EDM, class ETCM>
252 struct NCNITraits : public BaseTraits
253 {
254 using DiffusionType = DT;
255 using EffectiveDiffusivityModel = EDM;
256 using EffectiveThermalConductivityModel = ETCM;
257 };
258public:
260};
261
263template<class TypeTag>
264struct IOFields<TypeTag, TTag::ThreePThreeCNI> { using type = EnergyIOFields<ThreePThreeCIOFields>; };
265
267template<class TypeTag>
269
270} // end namespace Properties
271} // end namespace Dumux
272
273#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...
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
Model traits to be used as a base for nonisothermal, mineralization ... models.
Definition: common/properties.hh:53
A class helping models to define input and output fields.
Definition: common/properties.hh:61
Definition: common/properties.hh:72
Property whether to use moles or kg as amount unit for balance equations.
Definition: common/properties.hh:83
The component balance index that should be replaced by the total mass/mole balance.
Definition: common/properties.hh:85
The secondary variables within a sub-control volume.
Definition: common/properties.hh:105
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
Whether to use a constraint solver for computing the secondary variables.
Definition: common/properties.hh:177
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, multi-component fluid system assum...
Definition: compositional.hh:47
Traits class for the two-phase model.
Definition: porousmediumflow/3p/model.hh:98
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: 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:42
Specifies a number properties of two-phase models.
Definition: porousmediumflow/3p3c/model.hh:102
static constexpr bool useMoles()
Definition: porousmediumflow/3p3c/model.hh:114
static constexpr int numFluidComponents()
Definition: porousmediumflow/3p3c/model.hh:107
static constexpr int numFluidPhases()
Definition: porousmediumflow/3p3c/model.hh:106
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/3p3c/model.hh:110
static constexpr bool useConstraintSolver()
Definition: porousmediumflow/3p3c/model.hh:113
static constexpr bool enableAdvection()
Definition: porousmediumflow/3p3c/model.hh:109
static constexpr int numEq()
Definition: porousmediumflow/3p3c/model.hh:105
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/3p3c/model.hh:111
The type tags for the isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/model.hh:121
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/3p3c/model.hh:121
The type tags for the non-isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/model.hh:123
std::tuple< ThreePThreeC > InheritsFrom
Definition: porousmediumflow/3p3c/model.hh:123
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/3p3c/model.hh:142
Contains the quantities which are are constant within a finite volume in the three-phase three-compon...
Definition: porousmediumflow/3p3c/volumevariables.hh:62
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
Declares all properties used in Dumux.
Defines a type tag and some properties for models using the box scheme.
Adaption of the fully implicit scheme to the three-phase flow model.
The implicit non-isothermal model.
Adds I/O fields specific to non-isothermal models.
Adds I/O fields specific to the tracer model.
Element-wise calculation of the local residual for problems using fully implicit tracer model.
Python wrapper for volume variables (finite volume schemes)
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.