version 3.7
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
79#ifndef DUMUX_MPNC_MODEL_HH
80#define DUMUX_MPNC_MODEL_HH
81
83
89
97
98#include "indices.hh"
99#include "volumevariables.hh"
100#include "iofields.hh"
101#include "localresidual.hh"
102#include "pressureformulation.hh"
103
104namespace Dumux
105{
106
114template<int nPhases, int nComp, MpNcPressureFormulation formulation, bool useM, int repCompEqIdx = nComp>
116{
117 static constexpr int numEq() { return numTransportEq()+numConstraintEq(); }
118 static constexpr int numFluidPhases() { return nPhases; }
119 static constexpr int numFluidComponents() { return nComp; }
120 static constexpr int numTransportEq() { return nComp;}
121 static constexpr int numConstraintEq() { return nPhases; }
122 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
123
124 static constexpr bool useMoles() { return useM; }
125 static constexpr bool enableAdvection() { return true; }
126 static constexpr bool enableMolecularDiffusion() { return true; }
127 static constexpr bool enableEnergyBalance() { return false; }
128 static constexpr bool enableThermalNonEquilibrium() { return false; }
129 static constexpr bool enableChemicalNonEquilibrium() { return false; }
130 static constexpr bool enableCompositionalDispersion() { return false; }
131 static constexpr bool enableThermalDispersion() { return false; }
132
133 static constexpr MpNcPressureFormulation pressureFormulation() { return formulation; }
134
137};
138
149template<class NonEquilTraits>
150struct MPNCNonequilibriumModelTraits : public NonEquilTraits
151{
152private:
155 using MpNcIndices = MPNCIndices< NonEquilTraits::numFluidPhases(),
156 NonEquilTraits::numTransportEq()+NonEquilTraits::numConstraintEq() >;
157public:
159 NonEquilTraits::numEnergyEqFluid(),
160 NonEquilTraits::numEnergyEqSolid(),
161 NonEquilTraits::numEq() >;
162};
163
175template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT, class DT, class EDM>
177{
179 using FluidSystem = FSY;
180 using FluidState = FST;
181 using SolidSystem = SSY;
184 using ModelTraits = MT;
185 using DiffusionType = DT;
187};
188
189namespace Properties
190{
191
193// Type tags
196// Create new type tags
197namespace TTag {
198struct MPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
199struct MPNCNI { using InheritsFrom = std::tuple<MPNC>; };
200struct MPNCNonequil { using InheritsFrom = std::tuple<NonEquilibrium, MPNC>; };
201} // end namespace TTag
202
204// Properties for the isothermal mpnc model
206
208template<class TypeTag>
209struct LocalResidual<TypeTag, TTag::MPNC> { using type = MPNCLocalResidual<TypeTag>; };
210
212template<class TypeTag>
213struct ModelTraits<TypeTag, TTag::MPNC>
214{
215private:
217public:
218 using type = MPNCModelTraits<FluidSystem::numPhases,
219 FluidSystem::numComponents,
220 getPropValue<TypeTag, Properties::PressureFormulation>(),
221 getPropValue<TypeTag, Properties::UseMoles>(),
222 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
223};
224
226template<class TypeTag>
227struct FluidState<TypeTag, TTag::MPNC>
228{
229private:
232public:
234};
235
237template<class TypeTag>
238struct VolumeVariables<TypeTag, TTag::MPNC>
239{
240private:
250
252public:
254};
255
257template<class TypeTag>
258struct ReplaceCompEqIdx<TypeTag, TTag::MPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
260template<class TypeTag>
261struct UseMoles<TypeTag, TTag::MPNC> { static constexpr bool value = true; };
263template<class TypeTag>
264struct EffectiveDiffusivityModel<TypeTag, TTag::MPNC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; };
266template<class TypeTag>
267struct PressureFormulation<TypeTag, TTag::MPNC>
268{
269public:
271};
272
274template<class TypeTag>
275struct IOFields<TypeTag, TTag::MPNC> { using type = MPNCIOFields; };
276
278// Properties for the non-isothermal mpnc model
280
282template<class TypeTag>
283struct ModelTraits<TypeTag, TTag::MPNCNI>
284{
285private:
287 using IsothermalTraits = MPNCModelTraits<FluidSystem::numPhases,
288 FluidSystem::numComponents,
289 getPropValue<TypeTag, Properties::PressureFormulation>(),
290 getPropValue<TypeTag, Properties::UseMoles>(),
291 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
292public:
294};
295
297template<class TypeTag>
298struct VolumeVariables<TypeTag, TTag::MPNCNI>
299{
300private:
311
313 template<class BaseTraits, class ETCM>
314 struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
315public:
317};
318
320template<class TypeTag>
321struct ThermalConductivityModel<TypeTag, TTag::MPNCNI>
323
325// Properties for the non-equilibrium mpnc model
327
328template<class TypeTag>
329struct EquilibriumLocalResidual<TypeTag, TTag::MPNCNonequil> { using type = MPNCLocalResidual<TypeTag>; };
330
332template<class TypeTag>
333struct EquilibriumIOFields<TypeTag, TTag::MPNCNonequil> { using type = MPNCIOFields; };
334
337template<class TypeTag>
338struct ModelTraits<TypeTag, TTag::MPNCNonequil>
339{
340private:
342 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
343 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
344 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
345 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
346 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
347 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
348
350public:
352};
353
355template<class TypeTag>
356struct EquilibriumModelTraits<TypeTag, TTag::MPNCNonequil>
357{
358private:
360public:
361 using type = MPNCModelTraits<FluidSystem::numPhases,
362 FluidSystem::numComponents,
363 getPropValue<TypeTag, Properties::PressureFormulation>(),
364 getPropValue<TypeTag, Properties::UseMoles>(),
365 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
366};
367
369template<class TypeTag>
370struct ThermalConductivityModel<TypeTag, TTag::MPNCNonequil>
372
374template<class TypeTag>
375struct VolumeVariables<TypeTag, TTag::MPNCNonequil>
376{
377private:
388
390 template<class BaseTraits, class ETCM>
391 struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
393public:
395};
396
397} //end namespace Properties
398} //end namespace Dumux
399
400#endif
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: compositional.hh:35
Relation for the saturation-dependent effective diffusion coefficient.
Definition: diffusivitymillingtonquirk.hh:40
Adds I/O fields specific to the mpnc model.
Definition: porousmediumflow/mpnc/iofields.hh:28
MpNc specific details needed to approximately calculate the local defect in the fully implicit scheme...
Definition: porousmediumflow/mpnc/localresidual.hh:34
Definition: porousmediumflow/mpnc/volumevariables.hh:30
The primary variable and equation indices for the MpNc model.
Definition: porousmediumflow/nonequilibrium/indices.hh:24
This class contains the volume variables required for the modules which require the specific interfac...
Definition: porousmediumflow/nonequilibrium/volumevariables.hh:37
Relation for the saturation-dependent effective thermal conductivity.
Definition: simplefluidlumping.hh:26
Relation for the saturation-dependent effective thermal conductivity.
Definition: somerton.hh:48
Defines all properties used in Dumux.
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Relation for the saturation-dependent effective diffusion coefficient.
MpNcPressureFormulation
Enumerates the formulations which the MpNc model accepts.
Definition: pressureformulation.hh:24
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:267
Definition: adapt.hh:17
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system witho...
Element-wise calculation of the local residual for problems using compositional fully implicit model.
This specifies models which are able to capture non-equilibrium mass and / or energy transfer.
This class contains the volume variables required for the modules which require the specific interfac...
Defines the indices used by the non-isothermal two-phase two-component model.
Adds I/O fields specific to non-isothermal models.
The implicit non-isothermal model.
Defines a type tag and some properties for models using the box scheme.
Defines the primary variable and equation indices used by the isothermal tracer model.
Adds I/O fields specific to the tracer model.
Element-wise calculation of the local residual for problems using fully implicit tracer model.
Enumeration of the formulations accepted by the MpNc model.
Python wrapper for volume variables (finite volume schemes)
Relation for the saturation-dependent effective thermal conductivity.
Relation for the saturation-dependent effective thermal conductivity.
The primary variable and equation indices for the MpNc model.
Definition: porousmediumflow/mpnc/indices.hh:27
Specifies a number properties of the m-phase n-component model.
Definition: porousmediumflow/mpnc/model.hh:116
static constexpr int numConstraintEq()
Definition: porousmediumflow/mpnc/model.hh:121
static constexpr bool enableThermalNonEquilibrium()
Definition: porousmediumflow/mpnc/model.hh:128
static constexpr bool enableThermalDispersion()
Definition: porousmediumflow/mpnc/model.hh:131
static constexpr bool useMoles()
Definition: porousmediumflow/mpnc/model.hh:124
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/mpnc/model.hh:127
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/mpnc/model.hh:126
static constexpr bool enableCompositionalDispersion()
Definition: porousmediumflow/mpnc/model.hh:130
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/mpnc/model.hh:122
static constexpr int numEq()
Definition: porousmediumflow/mpnc/model.hh:117
static constexpr int numFluidPhases()
Definition: porousmediumflow/mpnc/model.hh:118
static constexpr int numTransportEq()
Definition: porousmediumflow/mpnc/model.hh:120
static constexpr bool enableChemicalNonEquilibrium()
Definition: porousmediumflow/mpnc/model.hh:129
static constexpr bool enableAdvection()
Definition: porousmediumflow/mpnc/model.hh:125
static constexpr MpNcPressureFormulation pressureFormulation()
Definition: porousmediumflow/mpnc/model.hh:133
static constexpr int numFluidComponents()
Definition: porousmediumflow/mpnc/model.hh:119
Specifies a number properties of the m-phase n-component model in conjunction with non-equilibrium....
Definition: porousmediumflow/mpnc/model.hh:151
Traits class for the mpnc volume variables.
Definition: porousmediumflow/mpnc/model.hh:177
DT DiffusionType
Definition: porousmediumflow/mpnc/model.hh:185
SSY SolidSystem
Definition: porousmediumflow/mpnc/model.hh:181
EDM EffectiveDiffusivityModel
Definition: porousmediumflow/mpnc/model.hh:186
SST SolidState
Definition: porousmediumflow/mpnc/model.hh:182
FSY FluidSystem
Definition: porousmediumflow/mpnc/model.hh:179
MT ModelTraits
Definition: porousmediumflow/mpnc/model.hh:184
FST FluidState
Definition: porousmediumflow/mpnc/model.hh:180
PT PermeabilityType
Definition: porousmediumflow/mpnc/model.hh:183
PV PrimaryVariables
Definition: porousmediumflow/mpnc/model.hh:178
Specifies a number properties of porous-medium flow non-equilibrium models.
Definition: porousmediumflow/nonequilibrium/model.hh:45
Specifies a number properties of non-isothermal porous medium flow models based on the specifics of a...
Definition: porousmediumflow/nonisothermal/model.hh:58
Definition: porousmediumflow/mpnc/model.hh:198
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:198
Definition: porousmediumflow/mpnc/model.hh:199
std::tuple< MPNC > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:199
Definition: porousmediumflow/mpnc/model.hh:200
std::tuple< NonEquilibrium, MPNC > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:200