3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/mpnc/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 *****************************************************************************/
91#ifndef DUMUX_MPNC_MODEL_HH
92#define DUMUX_MPNC_MODEL_HH
93
95
101
109
110#include "indices.hh"
111#include "volumevariables.hh"
112#include "iofields.hh"
113#include "localresidual.hh"
114#include "pressureformulation.hh"
115
116namespace Dumux
117{
118
126template<int nPhases, int nComp, MpNcPressureFormulation formulation, bool useM, int repCompEqIdx = nComp>
128{
129 static constexpr int numEq() { return numTransportEq()+numConstraintEq(); }
130 static constexpr int numFluidPhases() { return nPhases; }
131 static constexpr int numFluidComponents() { return nComp; }
132 static constexpr int numTransportEq() { return nComp;}
133 static constexpr int numConstraintEq() { return nPhases; }
134 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
135
136 static constexpr bool useMoles() { return useM; }
137 static constexpr bool enableAdvection() { return true; }
138 static constexpr bool enableMolecularDiffusion() { return true; }
139 static constexpr bool enableEnergyBalance() { return false; }
140 static constexpr bool enableThermalNonEquilibrium() { return false; }
141 static constexpr bool enableChemicalNonEquilibrium() { return false; }
142 static constexpr bool enableCompositionalDispersion() { return false; }
143 static constexpr bool enableThermalDispersion() { return false; }
144
145 static constexpr MpNcPressureFormulation pressureFormulation() { return formulation; }
146
149};
150
161template<class NonEquilTraits>
162struct MPNCNonequilibriumModelTraits : public NonEquilTraits
163{
164private:
167 using MpNcIndices = MPNCIndices< NonEquilTraits::numFluidPhases(),
168 NonEquilTraits::numTransportEq()+NonEquilTraits::numConstraintEq() >;
169public:
171 NonEquilTraits::numEnergyEqFluid(),
172 NonEquilTraits::numEnergyEqSolid(),
173 NonEquilTraits::numEq() >;
174};
175
187template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT, class DT, class EDM>
189{
191 using FluidSystem = FSY;
192 using FluidState = FST;
193 using SolidSystem = SSY;
196 using ModelTraits = MT;
197 using DiffusionType = DT;
199};
200
201namespace Properties
202{
203
205// Type tags
208// Create new type tags
209namespace TTag {
210struct MPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
211struct MPNCNI { using InheritsFrom = std::tuple<MPNC>; };
212struct MPNCNonequil { using InheritsFrom = std::tuple<NonEquilibrium, MPNC>; };
213} // end namespace TTag
214
216// Properties for the isothermal mpnc model
218
220template<class TypeTag>
221struct LocalResidual<TypeTag, TTag::MPNC> { using type = MPNCLocalResidual<TypeTag>; };
222
224template<class TypeTag>
225struct ModelTraits<TypeTag, TTag::MPNC>
226{
227private:
229public:
230 using type = MPNCModelTraits<FluidSystem::numPhases,
231 FluidSystem::numComponents,
232 getPropValue<TypeTag, Properties::PressureFormulation>(),
233 getPropValue<TypeTag, Properties::UseMoles>(),
234 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
235};
236
238template<class TypeTag>
239struct FluidState<TypeTag, TTag::MPNC>
240{
241private:
244public:
246};
247
249template<class TypeTag>
250struct VolumeVariables<TypeTag, TTag::MPNC>
251{
252private:
262
264public:
266};
267
269template<class TypeTag>
270struct ReplaceCompEqIdx<TypeTag, TTag::MPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
272template<class TypeTag>
273struct UseMoles<TypeTag, TTag::MPNC> { static constexpr bool value = true; };
275template<class TypeTag>
278template<class TypeTag>
279struct PressureFormulation<TypeTag, TTag::MPNC>
280{
281public:
283};
284
286template<class TypeTag>
287struct IOFields<TypeTag, TTag::MPNC> { using type = MPNCIOFields; };
288
290// Properties for the non-isothermal mpnc model
292
294template<class TypeTag>
295struct ModelTraits<TypeTag, TTag::MPNCNI>
296{
297private:
299 using IsothermalTraits = MPNCModelTraits<FluidSystem::numPhases,
300 FluidSystem::numComponents,
301 getPropValue<TypeTag, Properties::PressureFormulation>(),
302 getPropValue<TypeTag, Properties::UseMoles>(),
303 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
304public:
306};
307
309template<class TypeTag>
310struct VolumeVariables<TypeTag, TTag::MPNCNI>
311{
312private:
323
325 template<class BaseTraits, class ETCM>
326 struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
327public:
329};
330
332template<class TypeTag>
333struct ThermalConductivityModel<TypeTag, TTag::MPNCNI>
335
337// Properties for the non-equilibrium mpnc model
339
340template<class TypeTag>
341struct EquilibriumLocalResidual<TypeTag, TTag::MPNCNonequil> { using type = MPNCLocalResidual<TypeTag>; };
342
344template<class TypeTag>
345struct EquilibriumIOFields<TypeTag, TTag::MPNCNonequil> { using type = MPNCIOFields; };
346
349template<class TypeTag>
350struct ModelTraits<TypeTag, TTag::MPNCNonequil>
351{
352private:
354 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
355 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
356 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
357 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
358 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
359 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
360
362public:
364};
365
367template<class TypeTag>
368struct EquilibriumModelTraits<TypeTag, TTag::MPNCNonequil>
369{
370private:
372public:
373 using type = MPNCModelTraits<FluidSystem::numPhases,
374 FluidSystem::numComponents,
375 getPropValue<TypeTag, Properties::PressureFormulation>(),
376 getPropValue<TypeTag, Properties::UseMoles>(),
377 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
378};
379
381template<class TypeTag>
382struct ThermalConductivityModel<TypeTag, TTag::MPNCNonequil>
384
386template<class TypeTag>
387struct VolumeVariables<TypeTag, TTag::MPNCNonequil>
388{
389private:
400
402 template<class BaseTraits, class ETCM>
403 struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
405public:
407};
408
409} //end namespace Properties
410} //end namespace Dumux
411
412#endif
Enumeration of the formulations accepted by the MpNc model.
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system witho...
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Relation for the saturation-dependent effective diffusion coefficient.
Relation for the saturation-dependent effective thermal conductivity.
Relation for the saturation-dependent effective thermal conductivity.
MpNcPressureFormulation
Enumerates the formulations which the MpNc model accepts.
Definition: pressureformulation.hh:36
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
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
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
Definition: common/properties.hh:249
the formulation of the pressure e.g most wetting first
Definition: common/properties.hh:255
Definition: common/properties.hh:257
Definition: common/properties.hh:261
Relation for the saturation-dependent effective thermal conductivity.
Definition: simplefluidlumping.hh:38
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
The primary variable and equation indices for the MpNc model.
Definition: porousmediumflow/mpnc/indices.hh:39
Adds I/O fields specific to the mpnc model.
Definition: porousmediumflow/mpnc/iofields.hh:40
MpNc specific details needed to approximately calculate the local defect in the fully implicit scheme...
Definition: porousmediumflow/mpnc/localresidual.hh:46
Specifies a number properties of the m-phase n-component model.
Definition: porousmediumflow/mpnc/model.hh:128
static constexpr int numConstraintEq()
Definition: porousmediumflow/mpnc/model.hh:133
static constexpr bool enableThermalNonEquilibrium()
Definition: porousmediumflow/mpnc/model.hh:140
static constexpr bool enableThermalDispersion()
Definition: porousmediumflow/mpnc/model.hh:143
static constexpr bool useMoles()
Definition: porousmediumflow/mpnc/model.hh:136
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/mpnc/model.hh:139
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/mpnc/model.hh:138
static constexpr bool enableCompositionalDispersion()
Definition: porousmediumflow/mpnc/model.hh:142
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/mpnc/model.hh:134
static constexpr int numEq()
Definition: porousmediumflow/mpnc/model.hh:129
static constexpr int numFluidPhases()
Definition: porousmediumflow/mpnc/model.hh:130
static constexpr int numTransportEq()
Definition: porousmediumflow/mpnc/model.hh:132
static constexpr bool enableChemicalNonEquilibrium()
Definition: porousmediumflow/mpnc/model.hh:141
static constexpr bool enableAdvection()
Definition: porousmediumflow/mpnc/model.hh:137
static constexpr MpNcPressureFormulation pressureFormulation()
Definition: porousmediumflow/mpnc/model.hh:145
static constexpr int numFluidComponents()
Definition: porousmediumflow/mpnc/model.hh:131
Specifies a number properties of the m-phase n-component model in conjunction with non-equilibrium....
Definition: porousmediumflow/mpnc/model.hh:163
Traits class for the mpnc volume variables.
Definition: porousmediumflow/mpnc/model.hh:189
DT DiffusionType
Definition: porousmediumflow/mpnc/model.hh:197
SSY SolidSystem
Definition: porousmediumflow/mpnc/model.hh:193
EDM EffectiveDiffusivityModel
Definition: porousmediumflow/mpnc/model.hh:198
SST SolidState
Definition: porousmediumflow/mpnc/model.hh:194
FSY FluidSystem
Definition: porousmediumflow/mpnc/model.hh:191
MT ModelTraits
Definition: porousmediumflow/mpnc/model.hh:196
FST FluidState
Definition: porousmediumflow/mpnc/model.hh:192
PT PermeabilityType
Definition: porousmediumflow/mpnc/model.hh:195
PV PrimaryVariables
Definition: porousmediumflow/mpnc/model.hh:190
Definition: porousmediumflow/mpnc/model.hh:210
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:210
Definition: porousmediumflow/mpnc/model.hh:211
std::tuple< MPNC > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:211
Definition: porousmediumflow/mpnc/model.hh:212
std::tuple< NonEquilibrium, MPNC > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:212
Definition: porousmediumflow/mpnc/volumevariables.hh:42
The primary variable and equation indices for the MpNc model.
Definition: porousmediumflow/nonequilibrium/indices.hh:36
Specifies a number properties of porous-medium flow non-equilibrium models.
Definition: porousmediumflow/nonequilibrium/model.hh:57
This class contains the volume variables required for the modules which require the specific interfac...
Definition: porousmediumflow/nonequilibrium/volumevariables.hh:49
Specifies a number properties of non-isothermal porous medium flow models based on the specifics of a...
Definition: porousmediumflow/nonisothermal/model.hh:70
This specifies models which are able to capture non-equilibrium mass and / or energy transfer.
The implicit non-isothermal model.
Element-wise calculation of the local residual for problems using compositional fully implicit model.
Element-wise calculation of the local residual for problems using fully implicit tracer model.
Declares all properties used in Dumux.
Defines a type tag and some properties for models using the box scheme.
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.
Adds I/O fields specific to non-isothermal models.
Adds I/O fields specific to the tracer model.
This class contains the volume variables required for the modules which require the specific interfac...
Python wrapper for volume variables (finite volume schemes)