3.6-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 *****************************************************************************/
78#ifndef DUMUX_2PNC_MODEL_HH
79#define DUMUX_2PNC_MODEL_HH
80
81#include <dune/common/fvector.hh>
82
84
87
95
96#include "volumevariables.hh"
97#include "iofields.hh"
98#include "indices.hh"
99
100namespace Dumux {
101
110template<int nComp, bool useMol, bool setMoleFractionForFP, TwoPFormulation formulation, int repCompEqIdx = nComp>
112{
114
115 static constexpr int numEq() { return nComp; }
116 static constexpr int numFluidPhases() { return 2; }
117 static constexpr int numFluidComponents() { return nComp; }
118 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
119
120 static constexpr bool enableAdvection() { return true; }
121 static constexpr bool enableMolecularDiffusion() { return true; }
122 static constexpr bool enableEnergyBalance() { return false; }
123 static constexpr bool enableThermalNonEquilibrium() { return false; }
124 static constexpr bool enableChemicalNonEquilibrium() { return false; }
125 static constexpr bool enableCompositionalDispersion() { return false; }
126 static constexpr bool enableThermalDispersion() { return false; }
127
128 static constexpr bool useMoles() { return useMol; }
129 static constexpr bool setMoleFractionsForFirstPhase() { return setMoleFractionForFP; }
130
131 static constexpr TwoPFormulation priVarFormulation() { return formulation; }
132};
133
134namespace Properties {
136// Type tags
138// Create new type tags
139namespace TTag {
140struct TwoPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
141struct TwoPNCNI { using InheritsFrom = std::tuple<TwoPNC>; };
142} // end namespace TTag
143
145// Properties for the isothermal 2pnc model
148template<class TypeTag>
149struct PrimaryVariables<TypeTag, TTag::TwoPNC>
150{
151private:
152 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
154public:
156};
157
159template<class TypeTag>
160struct VolumeVariables<TypeTag, TTag::TwoPNC>
161{
162private:
171 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
172 // class used for scv-wise reconstruction of nonwetting phase saturations
175
178
179 template<class BaseTraits, class DT, class EDM>
180 struct NCTraits : public BaseTraits
181 {
182 using DiffusionType = DT;
183 using EffectiveDiffusivityModel = EDM;
184 };
185
186public:
188};
189
191template<class TypeTag>
192struct BaseModelTraits<TypeTag, TTag::TwoPNC>
193{
194private:
197 static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!");
198public:
199 using type = TwoPNCModelTraits<FluidSystem::numComponents,
200 getPropValue<TypeTag, Properties::UseMoles>(),
201 getPropValue<TypeTag, Properties::SetMoleFractionsForFirstPhase>(),
202 getPropValue<TypeTag, Properties::Formulation>(), getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
203};
204template<class TypeTag>
205struct ModelTraits<TypeTag, TTag::TwoPNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
206
208template<class TypeTag>
209struct IOFields<TypeTag, TTag::TwoPNC> { using type = TwoPNCIOFields; };
210
211template<class TypeTag>
212struct LocalResidual<TypeTag, TTag::TwoPNC> { using type = CompositionalLocalResidual<TypeTag>; };
213
214template<class TypeTag>
215struct ReplaceCompEqIdx<TypeTag, TTag::TwoPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
216
218template<class TypeTag>
219struct Formulation<TypeTag, TTag::TwoPNC>
220{ static constexpr auto value = TwoPFormulation::p0s1; };
221
222template<class TypeTag>
223struct SetMoleFractionsForFirstPhase<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; };
224template<class TypeTag>
225struct UseMoles<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; };
226
228template<class TypeTag>
230
232template<class TypeTag>
233struct FluidState<TypeTag, TTag::TwoPNC>
234{
235private:
238public:
240};
241
243// Properties for the non-isothermal 2pnc model
245
247template<class TypeTag>
248struct ModelTraits<TypeTag, TTag::TwoPNCNI>
249{
250private:
252public:
254};
255
257template<class TypeTag>
258struct VolumeVariables<TypeTag, TTag::TwoPNCNI>
259{
260private:
269 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
270 // class used for scv-wise reconstruction of nonwetting phase saturations
273
277
278 template<class BaseTraits, class DT, class EDM, class ETCM>
279 struct NCNITraits : public BaseTraits
280 {
281 using DiffusionType = DT;
282 using EffectiveDiffusivityModel = EDM;
283 using EffectiveThermalConductivityModel = ETCM;
284 };
285public:
287};
288
290template<class TypeTag>
291struct IOFields<TypeTag, TTag::TwoPNCNI> { using type = EnergyIOFields<TwoPNCIOFields>; };
292
294template<class TypeTag>
295struct ThermalConductivityModel<TypeTag, TTag::TwoPNCNI>
296{
297private:
299public:
301};
302
303} // end namespace Properties
304} // end namespace Dumux
305
306#endif
Relation for the saturation-dependent effective thermal conductivity.
Relation for the saturation-dependent effective diffusion coefficient.
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
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
The formulation of the model.
Definition: common/properties.hh:174
Set the mole fraction in the wetting or nonwetting phase.
Definition: common/properties.hh:189
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/2p/model.hh:109
Class that computes the nonwetting saturation in an scv from the saturation at the global degree of f...
Definition: saturationreconstruction.hh:43
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: porousmediumflow/2pnc/iofields.hh:39
Specifies a number properties of two-phase n-component models.
Definition: porousmediumflow/2pnc/model.hh:112
static constexpr int numFluidPhases()
Definition: porousmediumflow/2pnc/model.hh:116
static constexpr int numEq()
Definition: porousmediumflow/2pnc/model.hh:115
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/2pnc/model.hh:118
static constexpr bool enableAdvection()
Definition: porousmediumflow/2pnc/model.hh:120
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/2pnc/model.hh:121
static constexpr bool enableThermalNonEquilibrium()
Definition: porousmediumflow/2pnc/model.hh:123
static constexpr int numFluidComponents()
Definition: porousmediumflow/2pnc/model.hh:117
static constexpr bool useMoles()
Definition: porousmediumflow/2pnc/model.hh:128
static constexpr bool enableChemicalNonEquilibrium()
Definition: porousmediumflow/2pnc/model.hh:124
static constexpr TwoPFormulation priVarFormulation()
Definition: porousmediumflow/2pnc/model.hh:131
static constexpr bool enableThermalDispersion()
Definition: porousmediumflow/2pnc/model.hh:126
static constexpr bool enableCompositionalDispersion()
Definition: porousmediumflow/2pnc/model.hh:125
static constexpr bool setMoleFractionsForFirstPhase()
Definition: porousmediumflow/2pnc/model.hh:129
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/2pnc/model.hh:122
Definition: porousmediumflow/2pnc/model.hh:140
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/2pnc/model.hh:140
Definition: porousmediumflow/2pnc/model.hh:141
std::tuple< TwoPNC > InheritsFrom
Definition: porousmediumflow/2pnc/model.hh:141
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/2pnc/model.hh:205
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:45
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.
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 compositional fully implicit 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.