3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/1pnc/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 *****************************************************************************/
49#ifndef DUMUX_1PNC_MODEL_HH
50#define DUMUX_1PNC_MODEL_HH
51
53
56
66
67#include "indices.hh"
68#include "volumevariables.hh"
69#include "iofields.hh"
70
71namespace Dumux {
72
80template<int nComp, bool useM, int enableCompDisp, int enableThermDisp, int repCompEqIdx = nComp, class CDM = void>
82{
85
86 static constexpr int numEq() { return nComp; }
87 static constexpr int numFluidPhases() { return 1; }
88 static constexpr int numFluidComponents() { return nComp; }
89 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
90
91 static constexpr bool useMoles() { return useM; }
92 static constexpr bool enableAdvection() { return true; }
93 static constexpr bool enableMolecularDiffusion() { return true; }
94 static constexpr bool enableCompositionalDispersion() { return enableCompDisp; }
95 static constexpr bool enableThermalDispersion() { return enableThermDisp; }
96 static constexpr bool enableEnergyBalance() { return false; }
97};
98
99namespace Properties {
100
102// Type tags
104
106// Create new type tags
107namespace TTag {
108struct OnePNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
109struct OnePNCNI { using InheritsFrom = std::tuple<OnePNC>; };
110} // end namespace TTag
111
113// Properties for the isothermal single phase model
115
117template<class TypeTag>
118struct ReplaceCompEqIdx<TypeTag, TTag::OnePNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
119
121template<class TypeTag>
122struct BaseModelTraits<TypeTag, TTag::OnePNC>
123{
124private:
127public:
128 using type = OnePNCModelTraits<FluidSystem::numComponents,
129 getPropValue<TypeTag, Properties::UseMoles>(),
130 getPropValue<TypeTag, Properties::EnableCompositionalDispersion>(),
131 getPropValue<TypeTag, Properties::EnableThermalDispersion>(),
132 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(),
133 CDM>;
134};
135template<class TypeTag>
136struct ModelTraits<TypeTag, TTag::OnePNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
137
145template<class TypeTag>
146struct FluidState<TypeTag, TTag::OnePNC>
147{
148private:
152public:
154};
155
157template<class TypeTag>
158struct EffectiveDiffusivityModel<TypeTag, TTag::OnePNC>
160
162template<class TypeTag>
163struct UseMoles<TypeTag, TTag::OnePNC> { static constexpr bool value = true; };
164
166template<class TypeTag>
167struct LocalResidual<TypeTag, TTag::OnePNC> { using type = CompositionalLocalResidual<TypeTag>; };
168
170template<class TypeTag>
171struct VolumeVariables<TypeTag, TTag::OnePNC>
172{
173private:
181 static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system");
182 static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
183 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
184 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
186
189 template<class BaseTraits, class DT, class EDM>
190 struct NCTraits : public BaseTraits
191 {
192 using DiffusionType = DT;
193 using EffectiveDiffusivityModel = EDM;
194 };
195
196public:
198};
199
201template<class TypeTag>
202struct IOFields<TypeTag, TTag::OnePNC> { using type = OnePNCIOFields; };
203
205// Properties for the non-isothermal single phase model
207
209template<class TypeTag>
210struct IOFields<TypeTag, TTag::OnePNCNI> { using type = EnergyIOFields<OnePNCIOFields>; };
211
213template<class TypeTag>
214struct ThermalConductivityModel<TypeTag, TTag::OnePNCNI>
216
218template<class TypeTag>
219struct ModelTraits<TypeTag, TTag::OnePNCNI>
220{
221private:
224public:
226};
227
228template<class TypeTag>
229struct VolumeVariables<TypeTag, TTag::OnePNCNI>
230{
231private:
239 static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system");
240 static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
241 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
242 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
244
248 template<class BaseTraits, class DT, class EDM, class ETCM>
249 struct NCNITraits : public BaseTraits
250 {
251 using DiffusionType = DT;
252 using EffectiveDiffusivityModel = EDM;
253 using EffectiveThermalConductivityModel = ETCM;
254 };
255
256public:
258};
259
260} // end namespace Properties
261
262template<class OnePNCModelTraits>
264{
265 static constexpr int numConstraintEq() { return 0; }
266};
267
268namespace Properties {
270// Type tags
272namespace TTag {
273struct OnePNCNonEquil { using InheritsFrom = std::tuple<NonEquilibrium, OnePNC>; };
274} // end namespace TTag
275
276
278// Properties for the non-equilibrium OnePNC model
280
281template<class TypeTag>
282struct EquilibriumLocalResidual<TypeTag, TTag::OnePNCNonEquil> { using type = CompositionalLocalResidual<TypeTag>; };
283
285template<class TypeTag>
286struct EquilibriumIOFields<TypeTag, TTag::OnePNCNonEquil> { using type = OnePNCIOFields; };
287
288template<class TypeTag>
289struct ModelTraits<TypeTag, TTag::OnePNCNonEquil>
290{
291private:
293 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
294 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
295 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
296 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
297 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
298 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
299
301public:
303};
304
305// by default chemical non equilibrium is enabled in the nonequil model, switch that off here
306template<class TypeTag>
307struct EnableChemicalNonEquilibrium<TypeTag, TTag::OnePNCNonEquil> { static constexpr bool value = false; };
308
310template<class TypeTag>
311struct EquilibriumModelTraits<TypeTag, TTag::OnePNCNonEquil>
312{
313private:
315 using EquilibriumTraits = OnePNCModelTraits<FluidSystem::numComponents,
316 getPropValue<TypeTag, Properties::UseMoles>(),
317 getPropValue<TypeTag, Properties::EnableCompositionalDispersion>(),
318 getPropValue<TypeTag, Properties::EnableThermalDispersion>(),
319 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
320public:
322};
323
325template<class TypeTag>
326struct ThermalConductivityModel<TypeTag, TTag::OnePNCNonEquil>
327{
328private:
330public:
332};
333
335template<class TypeTag>
336struct VolumeVariables<TypeTag, TTag::OnePNCNonEquil>
337{
338private:
347
351 template<class BaseTraits, class DT, class EDM, class ETCM>
352 struct NCNITraits : public BaseTraits
353 {
354 using DiffusionType = DT;
355 using EffectiveDiffusivityModel = EDM;
356 using EffectiveThermalConductivityModel = ETCM;
357 };
358
360public:
362};
363
364} // end namespace Properties
365} // end namespace Dumux
366
367#endif
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Relation for the saturation-dependent effective diffusion coefficient.
Reation for a simple effective thermal conductivity.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:180
Traits class encapsulating model specifications.
Definition: common/properties.hh:51
Model traits to be used as a base for nonisothermal, mineralization ... models.
Definition: common/properties.hh:53
A class helping models to define input and output fields.
Definition: common/properties.hh:61
Definition: common/properties.hh:72
Property whether to use moles or kg as amount unit for balance equations.
Definition: common/properties.hh:83
The component balance index that should be replaced by the total mass/mole balance.
Definition: common/properties.hh:85
The secondary variables within a sub-control volume.
Definition: common/properties.hh:105
The type of the fluid state to use.
Definition: common/properties.hh:162
The employed model for the computation of the effective diffusivity.
Definition: common/properties.hh:168
Model to be used for the calculation of the effective conductivity.
Definition: common/properties.hh:170
the formulation of the pressure e.g most wetting first
Definition: common/properties.hh:255
Definition: common/properties.hh:257
Definition: common/properties.hh:261
Definition: common/properties.hh:267
Relation for a simple effective thermal conductivity.
Definition: thermalconductivityaverage.hh:37
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
Traits class for the volume variables of the single-phase model.
Definition: porousmediumflow/1p/model.hh:86
The indices for the isothermal one-phase n-component model.
Definition: porousmediumflow/1pnc/indices.hh:38
Adds I/O fields specific to the OnePNC model.
Definition: porousmediumflow/1pnc/iofields.hh:38
Specifies a number properties of models that consider a single-phase with multiple components.
Definition: porousmediumflow/1pnc/model.hh:82
static constexpr int numEq()
Definition: porousmediumflow/1pnc/model.hh:86
static constexpr bool enableAdvection()
Definition: porousmediumflow/1pnc/model.hh:92
static constexpr int numFluidComponents()
Definition: porousmediumflow/1pnc/model.hh:88
static constexpr int numFluidPhases()
Definition: porousmediumflow/1pnc/model.hh:87
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/1pnc/model.hh:89
static constexpr bool useMoles()
Definition: porousmediumflow/1pnc/model.hh:91
static constexpr bool enableCompositionalDispersion()
Definition: porousmediumflow/1pnc/model.hh:94
CDM CompositionalDispersionModel
Definition: porousmediumflow/1pnc/model.hh:84
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/1pnc/model.hh:93
static constexpr bool enableThermalDispersion()
Definition: porousmediumflow/1pnc/model.hh:95
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/1pnc/model.hh:96
Definition: porousmediumflow/1pnc/model.hh:108
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/1pnc/model.hh:108
Definition: porousmediumflow/1pnc/model.hh:109
std::tuple< OnePNC > InheritsFrom
Definition: porousmediumflow/1pnc/model.hh:109
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/1pnc/model.hh:136
Definition: porousmediumflow/1pnc/model.hh:264
static constexpr int numConstraintEq()
Definition: porousmediumflow/1pnc/model.hh:265
Definition: porousmediumflow/1pnc/model.hh:273
std::tuple< NonEquilibrium, OnePNC > InheritsFrom
Definition: porousmediumflow/1pnc/model.hh:273
Contains the quantities which are are constant within a finite volume in the one-phase,...
Definition: porousmediumflow/1pnc/volumevariables.hh:50
Element-wise calculation of the local residual for problems using compositional fully implicit model.
Definition: porousmediumflow/compositional/localresidual.hh:45
Specifies a number properties of porous-medium flow non-equilibrium models.
Definition: porousmediumflow/nonequilibrium/model.hh:57
This class contains the volume variables required for the modules which require the specific interfac...
Definition: porousmediumflow/nonequilibrium/volumevariables.hh:49
Adds I/O fields specific to non-isothermal models.
Definition: porousmediumflow/nonisothermal/iofields.hh:39
Specifies a number properties of non-isothermal porous medium flow models based on the specifics of a...
Definition: porousmediumflow/nonisothermal/model.hh:70
A single-phase, isothermal flow model using the fully implicit scheme.
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.
Declares all properties used in Dumux.
Defines a type tag and some properties for models using the box scheme.
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.
Adds I/O fields specific to non-isothermal models.
Adds I/O fields specific to the tracer model.
This class contains the volume variables required for the modules which require the specific interfac...
Python wrapper for volume variables (finite volume schemes)