version 3.9
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//
90#ifndef DUMUX_MPNC_MODEL_HH
91#define DUMUX_MPNC_MODEL_HH
92
94
100
108
109#include "indices.hh"
110#include "volumevariables.hh"
111#include "iofields.hh"
112#include "localresidual.hh"
113#include "pressureformulation.hh"
114
115namespace Dumux
116{
117
125template<int nPhases, int nComp, MpNcPressureFormulation formulation, bool useM, int repCompEqIdx = nComp>
127{
128 static constexpr int numEq() { return numTransportEq()+numConstraintEq(); }
129 static constexpr int numFluidPhases() { return nPhases; }
130 static constexpr int numFluidComponents() { return nComp; }
131 static constexpr int numTransportEq() { return nComp;}
132 static constexpr int numConstraintEq() { return nPhases; }
133 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
134
135 static constexpr bool useMoles() { return useM; }
136 static constexpr bool enableAdvection() { return true; }
137 static constexpr bool enableMolecularDiffusion() { return true; }
138 static constexpr bool enableEnergyBalance() { return false; }
139 static constexpr bool enableThermalNonEquilibrium() { return false; }
140 static constexpr bool enableChemicalNonEquilibrium() { return false; }
141 static constexpr bool enableCompositionalDispersion() { return false; }
142 static constexpr bool enableThermalDispersion() { return false; }
143
144 static constexpr MpNcPressureFormulation pressureFormulation() { return formulation; }
145
148};
149
160template<class NonEquilTraits>
161struct MPNCNonequilibriumModelTraits : public NonEquilTraits
162{
163private:
166 using MpNcIndices = MPNCIndices< NonEquilTraits::numFluidPhases(),
167 NonEquilTraits::numTransportEq()+NonEquilTraits::numConstraintEq() >;
168public:
170 NonEquilTraits::numEnergyEqFluid(),
171 NonEquilTraits::numEnergyEqSolid(),
172 NonEquilTraits::numEq() >;
173};
174
186template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT, class DT, class EDM>
188{
190 using FluidSystem = FSY;
191 using FluidState = FST;
192 using SolidSystem = SSY;
195 using ModelTraits = MT;
196 using DiffusionType = DT;
198};
199
200namespace Properties
201{
202
204// Type tags
207// Create new type tags
208namespace TTag {
209struct MPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
210struct MPNCNI { using InheritsFrom = std::tuple<MPNC>; };
211struct MPNCNonequil { using InheritsFrom = std::tuple<NonEquilibrium, MPNC>; };
212} // end namespace TTag
213
215// Properties for the isothermal mpnc model
217
219template<class TypeTag>
220struct LocalResidual<TypeTag, TTag::MPNC> { using type = MPNCLocalResidual<TypeTag>; };
221
223template<class TypeTag>
224struct ModelTraits<TypeTag, TTag::MPNC>
225{
226private:
228public:
229 using type = MPNCModelTraits<FluidSystem::numPhases,
230 FluidSystem::numComponents,
231 getPropValue<TypeTag, Properties::PressureFormulation>(),
232 getPropValue<TypeTag, Properties::UseMoles>(),
233 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
234};
235
237template<class TypeTag>
238struct FluidState<TypeTag, TTag::MPNC>
239{
240private:
243public:
245};
246
248template<class TypeTag>
249struct VolumeVariables<TypeTag, TTag::MPNC>
250{
251private:
261
263public:
265};
266
268template<class TypeTag>
269struct ReplaceCompEqIdx<TypeTag, TTag::MPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
271template<class TypeTag>
272struct UseMoles<TypeTag, TTag::MPNC> { static constexpr bool value = true; };
274template<class TypeTag>
275struct EffectiveDiffusivityModel<TypeTag, TTag::MPNC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; };
277template<class TypeTag>
278struct PressureFormulation<TypeTag, TTag::MPNC>
279{
280public:
282};
283
285template<class TypeTag>
286struct IOFields<TypeTag, TTag::MPNC> { using type = MPNCIOFields; };
287
289// Properties for the non-isothermal mpnc model
291
293template<class TypeTag>
294struct ModelTraits<TypeTag, TTag::MPNCNI>
295{
296private:
298 using IsothermalTraits = MPNCModelTraits<FluidSystem::numPhases,
299 FluidSystem::numComponents,
300 getPropValue<TypeTag, Properties::PressureFormulation>(),
301 getPropValue<TypeTag, Properties::UseMoles>(),
302 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
303public:
305};
306
308template<class TypeTag>
309struct VolumeVariables<TypeTag, TTag::MPNCNI>
310{
311private:
322
324 template<class BaseTraits, class ETCM>
325 struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
326public:
328};
329
331template<class TypeTag>
332struct ThermalConductivityModel<TypeTag, TTag::MPNCNI>
334
336// Properties for the non-equilibrium mpnc model
338
339template<class TypeTag>
340struct EquilibriumLocalResidual<TypeTag, TTag::MPNCNonequil> { using type = MPNCLocalResidual<TypeTag>; };
341
343template<class TypeTag>
344struct EquilibriumIOFields<TypeTag, TTag::MPNCNonequil> { using type = MPNCIOFields; };
345
348template<class TypeTag>
349struct ModelTraits<TypeTag, TTag::MPNCNonequil>
350{
351private:
353 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
354 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
355 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
356 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
357 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
358 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
359
361public:
363};
364
366template<class TypeTag>
367struct EquilibriumModelTraits<TypeTag, TTag::MPNCNonequil>
368{
369private:
371public:
372 using type = MPNCModelTraits<FluidSystem::numPhases,
373 FluidSystem::numComponents,
374 getPropValue<TypeTag, Properties::PressureFormulation>(),
375 getPropValue<TypeTag, Properties::UseMoles>(),
376 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
377};
378
380template<class TypeTag>
381struct ThermalConductivityModel<TypeTag, TTag::MPNCNonequil>
383
385template<class TypeTag>
386struct VolumeVariables<TypeTag, TTag::MPNCNonequil>
387{
388private:
399
401 template<class BaseTraits, class ETCM>
402 struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
404public:
406};
407
408} //end namespace Properties
409} //end namespace Dumux
410
411#endif
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: compositional.hh:35
Relation for the effective diffusion coefficient after Millington and Quirk.
Definition: diffusivitymillingtonquirk.hh:37
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
Effective thermal conductivity based on weighted arithmetic average.
Definition: thermalconductivityaverage.hh:43
Effective thermal conductivity after Somerton.
Definition: somerton.hh:46
Defines all properties used in Dumux.
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
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:296
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)
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:127
static constexpr int numConstraintEq()
Definition: porousmediumflow/mpnc/model.hh:132
static constexpr bool enableThermalNonEquilibrium()
Definition: porousmediumflow/mpnc/model.hh:139
static constexpr bool enableThermalDispersion()
Definition: porousmediumflow/mpnc/model.hh:142
static constexpr bool useMoles()
Definition: porousmediumflow/mpnc/model.hh:135
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/mpnc/model.hh:138
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/mpnc/model.hh:137
static constexpr bool enableCompositionalDispersion()
Definition: porousmediumflow/mpnc/model.hh:141
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/mpnc/model.hh:133
static constexpr int numEq()
Definition: porousmediumflow/mpnc/model.hh:128
static constexpr int numFluidPhases()
Definition: porousmediumflow/mpnc/model.hh:129
static constexpr int numTransportEq()
Definition: porousmediumflow/mpnc/model.hh:131
static constexpr bool enableChemicalNonEquilibrium()
Definition: porousmediumflow/mpnc/model.hh:140
static constexpr bool enableAdvection()
Definition: porousmediumflow/mpnc/model.hh:136
static constexpr MpNcPressureFormulation pressureFormulation()
Definition: porousmediumflow/mpnc/model.hh:144
static constexpr int numFluidComponents()
Definition: porousmediumflow/mpnc/model.hh:130
Specifies a number properties of the m-phase n-component model in conjunction with non-equilibrium....
Definition: porousmediumflow/mpnc/model.hh:162
Traits class for the mpnc volume variables.
Definition: porousmediumflow/mpnc/model.hh:188
DT DiffusionType
Definition: porousmediumflow/mpnc/model.hh:196
SSY SolidSystem
Definition: porousmediumflow/mpnc/model.hh:192
EDM EffectiveDiffusivityModel
Definition: porousmediumflow/mpnc/model.hh:197
SST SolidState
Definition: porousmediumflow/mpnc/model.hh:193
FSY FluidSystem
Definition: porousmediumflow/mpnc/model.hh:190
MT ModelTraits
Definition: porousmediumflow/mpnc/model.hh:195
FST FluidState
Definition: porousmediumflow/mpnc/model.hh:191
PT PermeabilityType
Definition: porousmediumflow/mpnc/model.hh:194
PV PrimaryVariables
Definition: porousmediumflow/mpnc/model.hh:189
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:76
Definition: porousmediumflow/mpnc/model.hh:209
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:209
Definition: porousmediumflow/mpnc/model.hh:210
std::tuple< MPNC > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:210
Definition: porousmediumflow/mpnc/model.hh:211
std::tuple< NonEquilibrium, MPNC > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:211