3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Loading...
Searching...
No Matches
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 *****************************************************************************/
90
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:
170 using Indices = NonEquilbriumIndices< MpNcIndices,
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,
235};
236
238template<class TypeTag>
239struct FluidState<TypeTag, TTag::MPNC>
240{
241private:
244public:
246};
247
249template<class TypeTag>
267
269template<class TypeTag>
272template<class TypeTag>
273struct UseMoles<TypeTag, TTag::MPNC> { static constexpr bool value = true; };
275template<class TypeTag>
278template<class TypeTag>
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,
304public:
306};
307
309template<class TypeTag>
330
332template<class TypeTag>
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>();
360
362public:
364};
365
367template<class TypeTag>
368struct EquilibriumModelTraits<TypeTag, TTag::MPNCNonequil>
369{
370private:
372public:
373 using type = MPNCModelTraits<FluidSystem::numPhases,
374 FluidSystem::numComponents,
378};
379
381template<class TypeTag>
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; };
404 using EquilibriumVolVars = MPNCVolumeVariables<NITraits<BaseTraits, 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
MPNCVolumeVariablesImplementation< Traits, Traits::ModelTraits::enableChemicalNonEquilibrium()> MPNCVolumeVariables
Contains the quantities which are constant within a finite volume in the MpNc model.
Definition porousmediumflow/mpnc/volumevariables.hh:50
@ mostWettingFirst
Definition pressureformulation.hh:37
@ SST
Definition turbulencemodel.hh:75
Definition adapt.hh:29
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:154
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:150
NonEquilibriumVolumeVariablesImplementation< Traits, EquilibriumVolumeVariables, Traits::ModelTraits::enableChemicalNonEquilibrium(), Traits::ModelTraits::enableThermalNonEquilibrium(), Traits::ModelTraits::numEnergyEqFluid()> NonEquilibriumVolumeVariables
Definition porousmediumflow/nonequilibrium/volumevariables.hh:52
Definition common/properties.hh:37
Type tag for numeric models.
Definition grid.hh:36
Traits class encapsulating model specifications.
Definition common/properties.hh:53
A class helping models to define input and output fields.
Definition common/properties.hh:63
Definition common/properties.hh:74
Property whether to use moles or kg as amount unit for balance equations.
Definition common/properties.hh:85
The component balance index that should be replaced by the total mass/mole balance.
Definition common/properties.hh:87
The secondary variables within a sub-control volume.
Definition common/properties.hh:107
The type of the fluid state to use.
Definition common/properties.hh:164
The employed model for the computation of the effective diffusivity.
Definition common/properties.hh:170
Model to be used for the calculation of the effective conductivity.
Definition common/properties.hh:172
Definition common/properties.hh:251
the formulation of the pressure e.g most wetting first
Definition common/properties.hh:257
Definition common/properties.hh:259
Definition common/properties.hh:263
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
MPNCIndices< numFluidPhases(), numEq() > Indices
Per default, we use the indices without offset.
Definition porousmediumflow/mpnc/model.hh:148
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
NonEquilbriumIndices< MpNcIndices, NonEquilTraits::numEnergyEqFluid(), NonEquilTraits::numEnergyEqSolid(), NonEquilTraits::numEq() > Indices
Definition porousmediumflow/mpnc/model.hh:170
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
MPNCLocalResidual< TypeTag > type
Definition porousmediumflow/mpnc/model.hh:221
MPNCModelTraits< FluidSystem::numPhases, FluidSystem::numComponents, getPropValue< TypeTag, Properties::PressureFormulation >(), getPropValue< TypeTag, Properties::UseMoles >(), getPropValue< TypeTag, Properties::ReplaceCompEqIdx >()> type
Definition porousmediumflow/mpnc/model.hh:230
CompositionalFluidState< Scalar, FluidSystem > type
Definition porousmediumflow/mpnc/model.hh:245
MPNCVolumeVariables< Traits > type
Definition porousmediumflow/mpnc/model.hh:265
static constexpr int value
Definition porousmediumflow/mpnc/model.hh:270
static constexpr bool value
Definition porousmediumflow/mpnc/model.hh:273
DiffusivityMillingtonQuirk< GetPropType< TypeTag, Properties::Scalar > > type
Definition porousmediumflow/mpnc/model.hh:276
static const MpNcPressureFormulation value
Definition porousmediumflow/mpnc/model.hh:282
MPNCIOFields type
Definition porousmediumflow/mpnc/model.hh:287
PorousMediumFlowNIModelTraits< IsothermalTraits > type
Definition porousmediumflow/mpnc/model.hh:305
MPNCVolumeVariables< NITraits< BaseTraits, ETCM > > type
Definition porousmediumflow/mpnc/model.hh:328
ThermalConductivitySomerton< GetPropType< TypeTag, Properties::Scalar > > type
Definition porousmediumflow/mpnc/model.hh:334
MPNCLocalResidual< TypeTag > type
Definition porousmediumflow/mpnc/model.hh:341
MPNCIOFields type
Definition porousmediumflow/mpnc/model.hh:345
MPNCNonequilibriumModelTraits< NonEquilTraits > type
Definition porousmediumflow/mpnc/model.hh:363
MPNCModelTraits< FluidSystem::numPhases, FluidSystem::numComponents, getPropValue< TypeTag, Properties::PressureFormulation >(), getPropValue< TypeTag, Properties::UseMoles >(), getPropValue< TypeTag, Properties::ReplaceCompEqIdx >()> type
Definition porousmediumflow/mpnc/model.hh:373
ThermalConductivitySimpleFluidLumping< GetPropType< TypeTag, Properties::Scalar > > type
Definition porousmediumflow/mpnc/model.hh:383
NonEquilibriumVolumeVariables< NITraits< BaseTraits, ETCM >, EquilibriumVolVars > type
Definition porousmediumflow/mpnc/model.hh:406
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
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.
MpNc specific details needed to approximately calculate the local defect in the fully implicit scheme...
Declares all properties used in Dumux.
Defines a type tag and some properties for models using the box scheme.
The primary variable and equation indices for the MpNc model.
Defines the indices used by the non-isothermal two-phase two-component model.
Adds I/O fields specific to the mpnc model.
Adds I/O fields specific to non-isothermal models.
Contains the secondary variables (Quantities which are constant within a finite volume) of the MpNc m...
This class contains the volume variables required for the modules which require the specific interfac...