Loading [MathJax]/extensions/tex2jax.js
3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 *****************************************************************************/
96#ifndef DUMUX_MPNC_MODEL_HH
97#define DUMUX_MPNC_MODEL_HH
98
100
106
114
115#include "indices.hh"
116#include "volumevariables.hh"
117#include "iofields.hh"
118#include "localresidual.hh"
119#include "pressureformulation.hh"
120
125namespace Dumux
126{
127
135template<int nPhases, int nComp, MpNcPressureFormulation formulation, bool useM, int repCompEqIdx = nComp>
137{
138 static constexpr int numEq() { return numTransportEq()+numConstraintEq(); }
139 static constexpr int numFluidPhases() { return nPhases; }
140 static constexpr int numFluidComponents() { return nComp; }
141 static constexpr int numTransportEq() { return nComp;}
142 static constexpr int numConstraintEq() { return nPhases; }
143 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
144
145 static constexpr bool useMoles() { return useM; }
146 static constexpr bool enableAdvection() { return true; }
147 static constexpr bool enableMolecularDiffusion() { return true; }
148 static constexpr bool enableEnergyBalance() { return false; }
149 static constexpr bool enableThermalNonEquilibrium() { return false; }
150 static constexpr bool enableChemicalNonEquilibrium() { return false; }
151
152 static constexpr MpNcPressureFormulation pressureFormulation() { return formulation; }
153
156};
157
167template<class NonEquilTraits>
168struct MPNCNonequilibriumModelTraits : public NonEquilTraits
169{
170private:
173 using MpNcIndices = MPNCIndices< NonEquilTraits::numFluidPhases(),
174 NonEquilTraits::numTransportEq()+NonEquilTraits::numConstraintEq() >;
175public:
177 NonEquilTraits::numEnergyEqFluid(),
178 NonEquilTraits::numEnergyEqSolid(),
179 NonEquilTraits::numEq() >;
180};
181
192template<class PV,
193 class FSY,
194 class FST,
195 class SSY,
196 class SST,
197 class PT,
198 class MT>
200{
202 using FluidSystem = FSY;
203 using FluidState = FST;
204 using SolidSystem = SSY;
205 using SolidState = SST;
207 using ModelTraits = MT;
208};
209
210namespace Properties
211{
212
214// Type tags
217// Create new type tags
218namespace TTag {
219struct MPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
220struct MPNCNI { using InheritsFrom = std::tuple<MPNC>; };
221struct MPNCNonequil { using InheritsFrom = std::tuple<NonEquilibrium, MPNC>; };
222} // end namespace TTag
223
225// Properties for the isothermal mpnc model
227
229template<class TypeTag>
230struct LocalResidual<TypeTag, TTag::MPNC> { using type = MPNCLocalResidual<TypeTag>; };
231
233template<class TypeTag>
234struct ModelTraits<TypeTag, TTag::MPNC>
235{
236private:
238public:
239 using type = MPNCModelTraits<FluidSystem::numPhases,
240 FluidSystem::numComponents,
241 getPropValue<TypeTag, Properties::PressureFormulation>(),
242 getPropValue<TypeTag, Properties::UseMoles>(),
243 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
244};
245
247template<class TypeTag>
248struct FluidState<TypeTag, TTag::MPNC>
249{
250private:
253public:
255};
256
258template<class TypeTag>
259struct VolumeVariables<TypeTag, TTag::MPNC>
260{
261private:
269
271public:
273};
274
276template<class TypeTag>
277struct ReplaceCompEqIdx<TypeTag, TTag::MPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
279template<class TypeTag>
280struct UseMoles<TypeTag, TTag::MPNC> { static constexpr bool value = true; };
282template<class TypeTag>
285template<class TypeTag>
286struct PressureFormulation<TypeTag, TTag::MPNC>
287{
288public:
290};
291
293template<class TypeTag>
294struct IOFields<TypeTag, TTag::MPNC> { using type = MPNCIOFields; };
295
297// Properties for the non-isothermal mpnc model
299
301template<class TypeTag>
302struct ModelTraits<TypeTag, TTag::MPNCNI>
303{
304private:
306 using IsothermalTraits = MPNCModelTraits<FluidSystem::numPhases,
307 FluidSystem::numComponents,
308 getPropValue<TypeTag, Properties::PressureFormulation>(),
309 getPropValue<TypeTag, Properties::UseMoles>(),
310 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
311public:
313};
314
316// Properties for the non-equilibrium mpnc model
318
319template<class TypeTag>
320struct EquilibriumLocalResidual<TypeTag, TTag::MPNCNonequil> { using type = MPNCLocalResidual<TypeTag>; };
321
323template<class TypeTag>
324struct EquilibriumIOFields<TypeTag, TTag::MPNCNonequil> { using type = MPNCIOFields; };
325
328template<class TypeTag>
329struct ModelTraits<TypeTag, TTag::MPNCNonequil>
330{
331private:
333 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
334 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
335 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
336 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
337 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
338 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
339
341public:
343};
344
346template<class TypeTag>
347struct EquilibriumModelTraits<TypeTag, TTag::MPNCNonequil>
348{
349private:
351public:
352 using type = MPNCModelTraits<FluidSystem::numPhases,
353 FluidSystem::numComponents,
354 getPropValue<TypeTag, Properties::PressureFormulation>(),
355 getPropValue<TypeTag, Properties::UseMoles>(),
356 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
357};
358
360template<class TypeTag>
361struct ThermalConductivityModel<TypeTag, TTag::MPNCNonequil>
362{
363private:
365public:
367};
368
370template<class TypeTag>
371struct VolumeVariables<TypeTag, TTag::MPNCNonequil>
372{
373private:
381
384public:
386};
387
388
389} //end namespace Properties
390} //end namespace Dumux
391
392#endif
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 assum...
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system witho...
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
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
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
Traits class encapsulating model specifications.
Definition: common/properties.hh:65
A class helping models to define input and output fields.
Definition: common/properties.hh:78
Definition: common/properties.hh:91
Property whether to use moles or kg as amount unit for balance equations.
Definition: common/properties.hh:102
The component balance index that should be replaced by the total mass/mole balance.
Definition: common/properties.hh:104
The secondary variables within a sub-control volume.
Definition: common/properties.hh:174
The type of the fluid state to use.
Definition: common/properties.hh:225
The employed model for the computation of the effective diffusivity.
Definition: common/properties.hh:231
Model to be used for the calculation of the effective conductivity.
Definition: common/properties.hh:233
Definition: common/properties.hh:312
the formulation of the pressure e.g most wetting first
Definition: common/properties.hh:318
Definition: common/properties.hh:320
Definition: common/properties.hh:324
Relation for the saturation-dependent effective thermal conductivity.
Definition: thermalconductivitysimplefluidlumping.hh:39
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: dumux/porousmediumflow/mpnc/iofields.hh:37
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:137
static constexpr int numConstraintEq()
Definition: porousmediumflow/mpnc/model.hh:142
static constexpr bool enableThermalNonEquilibrium()
Definition: porousmediumflow/mpnc/model.hh:149
static constexpr bool useMoles()
Definition: porousmediumflow/mpnc/model.hh:145
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/mpnc/model.hh:148
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/mpnc/model.hh:147
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/mpnc/model.hh:143
static constexpr int numEq()
Definition: porousmediumflow/mpnc/model.hh:138
static constexpr int numFluidPhases()
Definition: porousmediumflow/mpnc/model.hh:139
static constexpr int numTransportEq()
Definition: porousmediumflow/mpnc/model.hh:141
static constexpr bool enableChemicalNonEquilibrium()
Definition: porousmediumflow/mpnc/model.hh:150
static constexpr bool enableAdvection()
Definition: porousmediumflow/mpnc/model.hh:146
static constexpr MpNcPressureFormulation pressureFormulation()
Definition: porousmediumflow/mpnc/model.hh:152
static constexpr int numFluidComponents()
Definition: porousmediumflow/mpnc/model.hh:140
Specifies a number properties of the m-phase n-component model in conjunction with non-equilibrium....
Definition: porousmediumflow/mpnc/model.hh:169
Traits class for the mpnc volume variables.
Definition: porousmediumflow/mpnc/model.hh:200
PV PrimaryVariables
Definition: porousmediumflow/mpnc/model.hh:201
SSY SolidSystem
Definition: porousmediumflow/mpnc/model.hh:204
FST FluidState
Definition: porousmediumflow/mpnc/model.hh:203
FSY FluidSystem
Definition: porousmediumflow/mpnc/model.hh:202
PT PermeabilityType
Definition: porousmediumflow/mpnc/model.hh:206
SST SolidState
Definition: porousmediumflow/mpnc/model.hh:205
MT ModelTraits
Definition: porousmediumflow/mpnc/model.hh:207
Definition: porousmediumflow/mpnc/model.hh:219
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:219
Definition: porousmediumflow/mpnc/model.hh:220
std::tuple< MPNC > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:220
Definition: porousmediumflow/mpnc/model.hh:221
std::tuple< NonEquilibrium, MPNC > InheritsFrom
Definition: porousmediumflow/mpnc/model.hh:221
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:58
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
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.
Adds I/O fields specific to non-isothermal models.
Adds I/O fields specific to the twop 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.
Base class for the model specific class which provides access to all volume averaged quantities.
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.
Defines the primary variable and equation indices used by the isothermal tracer model.