3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/2pnc/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 *****************************************************************************/
85#ifndef DUMUX_2PNC_MODEL_HH
86#define DUMUX_2PNC_MODEL_HH
87
88#include <dune/common/fvector.hh>
89
91
95
103
104#include "volumevariables.hh"
105#include "iofields.hh"
106#include "indices.hh"
107
108namespace Dumux {
109
118template<int nComp, bool useMol, bool setMoleFractionForFP, TwoPFormulation formulation, int repCompEqIdx = nComp>
120{
122
123 static constexpr int numEq() { return nComp; }
124 static constexpr int numFluidPhases() { return 2; }
125 static constexpr int numFluidComponents() { return nComp; }
126 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
127
128 static constexpr bool enableAdvection() { return true; }
129 static constexpr bool enableMolecularDiffusion() { return true; }
130 static constexpr bool enableEnergyBalance() { return false; }
131 static constexpr bool enableThermalNonEquilibrium() { return false; }
132 static constexpr bool enableChemicalNonEquilibrium() { return false; }
133
134 static constexpr bool useMoles() { return useMol; }
135 static constexpr bool setMoleFractionsForFirstPhase() { return setMoleFractionForFP; }
136
137 static constexpr TwoPFormulation priVarFormulation() { return formulation; }
138};
139
150template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT>
152{
154 using FluidSystem = FSY;
155 using FluidState = FST;
156 using SolidSystem = SSY;
157 using SolidState = SST;
159 using ModelTraits = MT;
160};
161
162namespace Properties {
164// Type tags
166// Create new type tags
167namespace TTag {
168struct TwoPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
169struct TwoPNCNI { using InheritsFrom = std::tuple<TwoPNC>; };
170} // end namespace TTag
171
173// Properties for the isothermal 2pnc model
176template<class TypeTag>
177struct PrimaryVariables<TypeTag, TTag::TwoPNC>
178{
179private:
180 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
182public:
184};
185
187template<class TypeTag>
188struct VolumeVariables<TypeTag, TTag::TwoPNC>
189{
190private:
198
200public:
202};
203
205template<class TypeTag>
206struct BaseModelTraits<TypeTag, TTag::TwoPNC>
207{
208private:
211 static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!");
212public:
213 using type = TwoPNCModelTraits<FluidSystem::numComponents,
214 getPropValue<TypeTag, Properties::UseMoles>(),
215 getPropValue<TypeTag, Properties::SetMoleFractionsForFirstPhase>(),
216 getPropValue<TypeTag, Properties::Formulation>(), getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
217};
218template<class TypeTag>
219struct ModelTraits<TypeTag, TTag::TwoPNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
220
222template<class TypeTag>
223struct IOFields<TypeTag, TTag::TwoPNC> { using type = TwoPNCIOFields; };
224
225template<class TypeTag>
226struct LocalResidual<TypeTag, TTag::TwoPNC> { using type = CompositionalLocalResidual<TypeTag>; };
227
228template<class TypeTag>
229struct ReplaceCompEqIdx<TypeTag, TTag::TwoPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
230
232template<class TypeTag>
233struct Formulation<TypeTag, TTag::TwoPNC>
234{ static constexpr auto value = TwoPFormulation::p0s1; };
235
236template<class TypeTag>
237struct SetMoleFractionsForFirstPhase<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; };
238template<class TypeTag>
239struct UseMoles<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; };
240
242template<class TypeTag>
244
246template<class TypeTag>
247struct FluidState<TypeTag, TTag::TwoPNC>
248{
249private:
252public:
254};
255
257// Properties for the non-isothermal 2pnc model
259
261template<class TypeTag>
262struct ModelTraits<TypeTag, TTag::TwoPNCNI>
263{
264private:
266public:
268};
269
271template<class TypeTag>
272struct IOFields<TypeTag, TTag::TwoPNCNI> { using type = EnergyIOFields<TwoPNCIOFields>; };
273
275template<class TypeTag>
276struct ThermalConductivityModel<TypeTag, TTag::TwoPNCNI>
277{
278private:
280public:
282};
283
284} // end namespace Properties
285} // end namespace Dumux
286
287#endif
Relation for the saturation-dependent effective thermal conductivity.
Relation for the saturation-dependent effective diffusion coefficient.
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
Defines an enumeration for the formulations accepted by the two-phase model.
A primary variable vector with a state to allow variable switches.
TwoPFormulation
Enumerates the formulations which the two-phase model accepts.
Definition: formulation.hh:35
@ p0s1
first phase pressure and second phase saturation as primary variables
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
The formulation of the model.
Definition: common/properties.hh:237
Set the mole fraction in the wetting or non-wetting phase.
Definition: common/properties.hh:252
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 two-phase n-component model.
Definition: porousmediumflow/2pnc/indices.hh:35
Adds I/O fields specific to the TwoPNC model.
Definition: dumux/porousmediumflow/2pnc/iofields.hh:39
Specifies a number properties of two-phase n-component models.
Definition: porousmediumflow/2pnc/model.hh:120
static constexpr int numFluidPhases()
Definition: porousmediumflow/2pnc/model.hh:124
static constexpr int numEq()
Definition: porousmediumflow/2pnc/model.hh:123
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/2pnc/model.hh:126
static constexpr bool enableAdvection()
Definition: porousmediumflow/2pnc/model.hh:128
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/2pnc/model.hh:129
static constexpr bool enableThermalNonEquilibrium()
Definition: porousmediumflow/2pnc/model.hh:131
static constexpr int numFluidComponents()
Definition: porousmediumflow/2pnc/model.hh:125
static constexpr bool useMoles()
Definition: porousmediumflow/2pnc/model.hh:134
static constexpr bool enableChemicalNonEquilibrium()
Definition: porousmediumflow/2pnc/model.hh:132
static constexpr TwoPFormulation priVarFormulation()
Definition: porousmediumflow/2pnc/model.hh:137
static constexpr bool setMoleFractionsForFirstPhase()
Definition: porousmediumflow/2pnc/model.hh:135
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/2pnc/model.hh:130
Traits class for the volume variables of the single-phase model.
Definition: porousmediumflow/2pnc/model.hh:152
SST SolidState
Definition: porousmediumflow/2pnc/model.hh:157
PT PermeabilityType
Definition: porousmediumflow/2pnc/model.hh:158
PV PrimaryVariables
Definition: porousmediumflow/2pnc/model.hh:153
FSY FluidSystem
Definition: porousmediumflow/2pnc/model.hh:154
SSY SolidSystem
Definition: porousmediumflow/2pnc/model.hh:156
FST FluidState
Definition: porousmediumflow/2pnc/model.hh:155
MT ModelTraits
Definition: porousmediumflow/2pnc/model.hh:159
Definition: porousmediumflow/2pnc/model.hh:168
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/2pnc/model.hh:168
Definition: porousmediumflow/2pnc/model.hh:169
std::tuple< TwoPNC > InheritsFrom
Definition: porousmediumflow/2pnc/model.hh:169
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/2pnc/model.hh:219
Contains the quantities which are are constant within a finite volume in the two-phase,...
Definition: porousmediumflow/2pnc/volumevariables.hh:58
Element-wise calculation of the local residual for problems using compositional fully implicit model.
Definition: porousmediumflow/compositional/localresidual.hh:43
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 compositional fully implicit 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.