3.2-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 *****************************************************************************/
95
96#ifndef DUMUX_MPNC_MODEL_HH
97#define DUMUX_MPNC_MODEL_HH
98
100
107
115
116#include "indices.hh"
117#include "volumevariables.hh"
118#include "iofields.hh"
119#include "localresidual.hh"
120#include "pressureformulation.hh"
121
122namespace Dumux
123{
124
132template<int nPhases, int nComp, MpNcPressureFormulation formulation, bool useM, int repCompEqIdx = nComp>
134{
135 static constexpr int numEq() { return numTransportEq()+numConstraintEq(); }
136 static constexpr int numFluidPhases() { return nPhases; }
137 static constexpr int numFluidComponents() { return nComp; }
138 static constexpr int numTransportEq() { return nComp;}
139 static constexpr int numConstraintEq() { return nPhases; }
140 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
141
142 static constexpr bool useMoles() { return useM; }
143 static constexpr bool enableAdvection() { return true; }
144 static constexpr bool enableMolecularDiffusion() { return true; }
145 static constexpr bool enableEnergyBalance() { return false; }
146 static constexpr bool enableThermalNonEquilibrium() { return false; }
147 static constexpr bool enableChemicalNonEquilibrium() { return false; }
148
149 static constexpr MpNcPressureFormulation pressureFormulation() { return formulation; }
150
153};
154
164template<class NonEquilTraits>
165struct MPNCNonequilibriumModelTraits : public NonEquilTraits
166{
167private:
170 using MpNcIndices = MPNCIndices< NonEquilTraits::numFluidPhases(),
171 NonEquilTraits::numTransportEq()+NonEquilTraits::numConstraintEq() >;
172public:
173 using Indices = NonEquilbriumIndices< MpNcIndices,
174 NonEquilTraits::numEnergyEqFluid(),
175 NonEquilTraits::numEnergyEqSolid(),
176 NonEquilTraits::numEq() >;
177};
178
190template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT, class DT, class EDM>
192{
194 using FluidSystem = FSY;
195 using FluidState = FST;
196 using SolidSystem = SSY;
197 using SolidState = SST;
199 using ModelTraits = MT;
200 using DiffusionType = DT;
202};
203
204namespace Properties
205{
206
208// Type tags
211// Create new type tags
212namespace TTag {
213struct MPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
214struct MPNCNI { using InheritsFrom = std::tuple<MPNC>; };
215struct MPNCNonequil { using InheritsFrom = std::tuple<NonEquilibrium, MPNC>; };
216} // end namespace TTag
217
219// Properties for the isothermal mpnc model
221
223template<class TypeTag>
224struct LocalResidual<TypeTag, TTag::MPNC> { using type = MPNCLocalResidual<TypeTag>; };
225
227template<class TypeTag>
228struct ModelTraits<TypeTag, TTag::MPNC>
229{
230private:
232public:
233 using type = MPNCModelTraits<FluidSystem::numPhases,
234 FluidSystem::numComponents,
238};
239
241template<class TypeTag>
242struct FluidState<TypeTag, TTag::MPNC>
243{
244private:
247public:
249};
250
252template<class TypeTag>
270
272template<class TypeTag>
275template<class TypeTag>
276struct UseMoles<TypeTag, TTag::MPNC> { static constexpr bool value = true; };
278template<class TypeTag>
281template<class TypeTag>
287
289template<class TypeTag>
290struct IOFields<TypeTag, TTag::MPNC> { using type = MPNCIOFields; };
291
293// Properties for the non-isothermal mpnc model
295
297template<class TypeTag>
298struct ModelTraits<TypeTag, TTag::MPNCNI>
299{
300private:
302 using IsothermalTraits = MPNCModelTraits<FluidSystem::numPhases,
303 FluidSystem::numComponents,
307public:
309};
310
312template<class TypeTag>
333
335template<class TypeTag>
338
340// Properties for the non-equilibrium mpnc model
342
343template<class TypeTag>
344struct EquilibriumLocalResidual<TypeTag, TTag::MPNCNonequil> { using type = MPNCLocalResidual<TypeTag>; };
345
347template<class TypeTag>
348struct EquilibriumIOFields<TypeTag, TTag::MPNCNonequil> { using type = MPNCIOFields; };
349
352template<class TypeTag>
353struct ModelTraits<TypeTag, TTag::MPNCNonequil>
354{
355private:
357 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
358 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
359 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
360 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
363
365public:
367};
368
370template<class TypeTag>
371struct EquilibriumModelTraits<TypeTag, TTag::MPNCNonequil>
372{
373private:
375public:
376 using type = MPNCModelTraits<FluidSystem::numPhases,
377 FluidSystem::numComponents,
381};
382
384template<class TypeTag>
387
389template<class TypeTag>
390struct VolumeVariables<TypeTag, TTag::MPNCNonequil>
391{
392private:
403
405 template<class BaseTraits, class ETCM>
406 struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
407 using EquilibriumVolVars = MPNCVolumeVariables<NITraits<BaseTraits, ETCM>>;
408public:
410};
411
412} //end namespace Properties
413} //end namespace Dumux
414
415#endif
Relation for the saturation-dependent effective thermal conductivity.
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 witho...
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
Enumeration of the formulations accepted by the MpNc model.
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
Definition adapt.hh:29
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:153
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
NonEquilibriumVolumeVariablesImplementation< Traits, EquilibriumVolumeVariables, Traits::ModelTraits::enableChemicalNonEquilibrium(), Traits::ModelTraits::enableThermalNonEquilibrium(), Traits::ModelTraits::numEnergyEqFluid()> NonEquilibriumVolumeVariables
Definition porousmediumflow/nonequilibrium/volumevariables.hh:52
Definition common/properties.hh:48
Type tag for numeric models.
Definition grid.hh:36
Traits class encapsulating model specifications.
Definition common/properties.hh:66
A class helping models to define input and output fields.
Definition common/properties.hh:76
Definition common/properties.hh:89
Property whether to use moles or kg as amount unit for balance equations.
Definition common/properties.hh:100
The component balance index that should be replaced by the total mass/mole balance.
Definition common/properties.hh:102
The secondary variables within a sub-control volume.
Definition common/properties.hh:118
The type of the fluid state to use.
Definition common/properties.hh:169
The employed model for the computation of the effective diffusivity.
Definition common/properties.hh:175
Model to be used for the calculation of the effective conductivity.
Definition common/properties.hh:177
Definition common/properties.hh:256
the formulation of the pressure e.g most wetting first
Definition common/properties.hh:262
Definition common/properties.hh:264
Definition common/properties.hh:268
Relation for the saturation-dependent effective thermal conductivity.
Definition thermalconductivitysimplefluidlumping.hh:38
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 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:134
static constexpr int numConstraintEq()
Definition porousmediumflow/mpnc/model.hh:139
MPNCIndices< numFluidPhases(), numEq() > Indices
Per default, we use the indices without offset.
Definition porousmediumflow/mpnc/model.hh:152
static constexpr bool enableThermalNonEquilibrium()
Definition porousmediumflow/mpnc/model.hh:146
static constexpr bool useMoles()
Definition porousmediumflow/mpnc/model.hh:142
static constexpr bool enableEnergyBalance()
Definition porousmediumflow/mpnc/model.hh:145
static constexpr bool enableMolecularDiffusion()
Definition porousmediumflow/mpnc/model.hh:144
static constexpr int replaceCompEqIdx()
Definition porousmediumflow/mpnc/model.hh:140
static constexpr int numEq()
Definition porousmediumflow/mpnc/model.hh:135
static constexpr int numFluidPhases()
Definition porousmediumflow/mpnc/model.hh:136
static constexpr int numTransportEq()
Definition porousmediumflow/mpnc/model.hh:138
static constexpr bool enableChemicalNonEquilibrium()
Definition porousmediumflow/mpnc/model.hh:147
static constexpr bool enableAdvection()
Definition porousmediumflow/mpnc/model.hh:143
static constexpr MpNcPressureFormulation pressureFormulation()
Definition porousmediumflow/mpnc/model.hh:149
static constexpr int numFluidComponents()
Definition porousmediumflow/mpnc/model.hh:137
Specifies a number properties of the m-phase n-component model in conjunction with non-equilibrium....
Definition porousmediumflow/mpnc/model.hh:166
NonEquilbriumIndices< MpNcIndices, NonEquilTraits::numEnergyEqFluid(), NonEquilTraits::numEnergyEqSolid(), NonEquilTraits::numEq() > Indices
Definition porousmediumflow/mpnc/model.hh:173
Traits class for the mpnc volume variables.
Definition porousmediumflow/mpnc/model.hh:192
DT DiffusionType
Definition porousmediumflow/mpnc/model.hh:200
SSY SolidSystem
Definition porousmediumflow/mpnc/model.hh:196
EDM EffectiveDiffusivityModel
Definition porousmediumflow/mpnc/model.hh:201
SST SolidState
Definition porousmediumflow/mpnc/model.hh:197
FSY FluidSystem
Definition porousmediumflow/mpnc/model.hh:194
MT ModelTraits
Definition porousmediumflow/mpnc/model.hh:199
FST FluidState
Definition porousmediumflow/mpnc/model.hh:195
PT PermeabilityType
Definition porousmediumflow/mpnc/model.hh:198
PV PrimaryVariables
Definition porousmediumflow/mpnc/model.hh:193
Definition porousmediumflow/mpnc/model.hh:213
std::tuple< PorousMediumFlow > InheritsFrom
Definition porousmediumflow/mpnc/model.hh:213
Definition porousmediumflow/mpnc/model.hh:214
std::tuple< MPNC > InheritsFrom
Definition porousmediumflow/mpnc/model.hh:214
Definition porousmediumflow/mpnc/model.hh:215
std::tuple< NonEquilibrium, MPNC > InheritsFrom
Definition porousmediumflow/mpnc/model.hh:215
MPNCLocalResidual< TypeTag > type
Definition porousmediumflow/mpnc/model.hh:224
MPNCModelTraits< FluidSystem::numPhases, FluidSystem::numComponents, getPropValue< TypeTag, Properties::PressureFormulation >(), getPropValue< TypeTag, Properties::UseMoles >(), getPropValue< TypeTag, Properties::ReplaceCompEqIdx >()> type
Definition porousmediumflow/mpnc/model.hh:233
CompositionalFluidState< Scalar, FluidSystem > type
Definition porousmediumflow/mpnc/model.hh:248
MPNCVolumeVariables< Traits > type
Definition porousmediumflow/mpnc/model.hh:268
static constexpr int value
Definition porousmediumflow/mpnc/model.hh:273
static constexpr bool value
Definition porousmediumflow/mpnc/model.hh:276
DiffusivityMillingtonQuirk< GetPropType< TypeTag, Properties::Scalar > > type
Definition porousmediumflow/mpnc/model.hh:279
static const MpNcPressureFormulation value
Definition porousmediumflow/mpnc/model.hh:285
MPNCIOFields type
Definition porousmediumflow/mpnc/model.hh:290
PorousMediumFlowNIModelTraits< IsothermalTraits > type
Definition porousmediumflow/mpnc/model.hh:308
MPNCVolumeVariables< NITraits< BaseTraits, ETCM > > type
Definition porousmediumflow/mpnc/model.hh:331
ThermalConductivitySomerton< GetPropType< TypeTag, Properties::Scalar > > type
Definition porousmediumflow/mpnc/model.hh:337
MPNCLocalResidual< TypeTag > type
Definition porousmediumflow/mpnc/model.hh:344
MPNCIOFields type
Definition porousmediumflow/mpnc/model.hh:348
MPNCNonequilibriumModelTraits< NonEquilTraits > type
Definition porousmediumflow/mpnc/model.hh:366
MPNCModelTraits< FluidSystem::numPhases, FluidSystem::numComponents, getPropValue< TypeTag, Properties::PressureFormulation >(), getPropValue< TypeTag, Properties::UseMoles >(), getPropValue< TypeTag, Properties::ReplaceCompEqIdx >()> type
Definition porousmediumflow/mpnc/model.hh:376
ThermalConductivitySimpleFluidLumping< GetPropType< TypeTag, Properties::Scalar > > type
Definition porousmediumflow/mpnc/model.hh:386
NonEquilibriumVolumeVariables< NITraits< BaseTraits, ETCM >, EquilibriumVolVars > type
Definition porousmediumflow/mpnc/model.hh:409
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
Declares all properties used in Dumux.
Defines a type tag and some properties for models using the box scheme.
This specifies models which are able to capture non-equilibrium mass and / or energy transfer.
The implicit non-isothermal model.
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.
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...
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...