version 3.7
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
37#ifndef DUMUX_1PNC_MODEL_HH
38#define DUMUX_1PNC_MODEL_HH
39
41
44
54
55#include "indices.hh"
56#include "volumevariables.hh"
57#include "iofields.hh"
58
59namespace Dumux {
60
68template<int nComp, bool useM, int enableCompDisp, int enableThermDisp, int repCompEqIdx = nComp, class CDM = void>
70{
73
74 static constexpr int numEq() { return nComp; }
75 static constexpr int numFluidPhases() { return 1; }
76 static constexpr int numFluidComponents() { return nComp; }
77 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
78
79 static constexpr bool useMoles() { return useM; }
80 static constexpr bool enableAdvection() { return true; }
81 static constexpr bool enableMolecularDiffusion() { return true; }
82 static constexpr bool enableCompositionalDispersion() { return enableCompDisp; }
83 static constexpr bool enableThermalDispersion() { return enableThermDisp; }
84 static constexpr bool enableEnergyBalance() { return false; }
85};
86
87namespace Properties {
88
90// Type tags
92
94// Create new type tags
95namespace TTag {
96struct OnePNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
97struct OnePNCNI { using InheritsFrom = std::tuple<OnePNC>; };
98} // end namespace TTag
99
101// Properties for the isothermal single phase model
103
105template<class TypeTag>
106struct ReplaceCompEqIdx<TypeTag, TTag::OnePNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
107
109template<class TypeTag>
110struct BaseModelTraits<TypeTag, TTag::OnePNC>
111{
112private:
115public:
116 using type = OnePNCModelTraits<FluidSystem::numComponents,
117 getPropValue<TypeTag, Properties::UseMoles>(),
118 getPropValue<TypeTag, Properties::EnableCompositionalDispersion>(),
119 getPropValue<TypeTag, Properties::EnableThermalDispersion>(),
120 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(),
121 CDM>;
122};
123template<class TypeTag>
124struct ModelTraits<TypeTag, TTag::OnePNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
125
133template<class TypeTag>
134struct FluidState<TypeTag, TTag::OnePNC>
135{
136private:
140public:
142};
143
145template<class TypeTag>
146struct EffectiveDiffusivityModel<TypeTag, TTag::OnePNC>
148
150template<class TypeTag>
151struct UseMoles<TypeTag, TTag::OnePNC> { static constexpr bool value = true; };
152
154template<class TypeTag>
155struct LocalResidual<TypeTag, TTag::OnePNC> { using type = CompositionalLocalResidual<TypeTag>; };
156
158template<class TypeTag>
159struct VolumeVariables<TypeTag, TTag::OnePNC>
160{
161private:
169 static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system");
170 static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
171 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
172 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
174
177 template<class BaseTraits, class DT, class EDM>
178 struct NCTraits : public BaseTraits
179 {
180 using DiffusionType = DT;
181 using EffectiveDiffusivityModel = EDM;
182 };
183
184public:
186};
187
189template<class TypeTag>
190struct IOFields<TypeTag, TTag::OnePNC> { using type = OnePNCIOFields; };
191
193// Properties for the non-isothermal single phase model
195
197template<class TypeTag>
198struct IOFields<TypeTag, TTag::OnePNCNI> { using type = EnergyIOFields<OnePNCIOFields>; };
199
201template<class TypeTag>
202struct ThermalConductivityModel<TypeTag, TTag::OnePNCNI>
204
206template<class TypeTag>
207struct ModelTraits<TypeTag, TTag::OnePNCNI>
208{
209private:
212public:
214};
215
216template<class TypeTag>
217struct VolumeVariables<TypeTag, TTag::OnePNCNI>
218{
219private:
227 static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system");
228 static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
229 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
230 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
232
236 template<class BaseTraits, class DT, class EDM, class ETCM>
237 struct NCNITraits : public BaseTraits
238 {
239 using DiffusionType = DT;
240 using EffectiveDiffusivityModel = EDM;
241 using EffectiveThermalConductivityModel = ETCM;
242 };
243
244public:
246};
247
248} // end namespace Properties
249
250template<class OnePNCModelTraits>
252{
253 static constexpr int numConstraintEq() { return 0; }
254};
255
256namespace Properties {
258// Type tags
260namespace TTag {
261struct OnePNCNonEquil { using InheritsFrom = std::tuple<NonEquilibrium, OnePNC>; };
262} // end namespace TTag
263
264
266// Properties for the non-equilibrium OnePNC model
268
269template<class TypeTag>
270struct EquilibriumLocalResidual<TypeTag, TTag::OnePNCNonEquil> { using type = CompositionalLocalResidual<TypeTag>; };
271
273template<class TypeTag>
274struct EquilibriumIOFields<TypeTag, TTag::OnePNCNonEquil> { using type = OnePNCIOFields; };
275
276template<class TypeTag>
277struct ModelTraits<TypeTag, TTag::OnePNCNonEquil>
278{
279private:
281 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
282 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
283 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
284 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
285 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
286 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
287
289public:
291};
292
293// by default chemical non equilibrium is enabled in the nonequil model, switch that off here
294template<class TypeTag>
295struct EnableChemicalNonEquilibrium<TypeTag, TTag::OnePNCNonEquil> { static constexpr bool value = false; };
296
298template<class TypeTag>
299struct EquilibriumModelTraits<TypeTag, TTag::OnePNCNonEquil>
300{
301private:
303 using EquilibriumTraits = OnePNCModelTraits<FluidSystem::numComponents,
304 getPropValue<TypeTag, Properties::UseMoles>(),
305 getPropValue<TypeTag, Properties::EnableCompositionalDispersion>(),
306 getPropValue<TypeTag, Properties::EnableThermalDispersion>(),
307 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
308public:
310};
311
313template<class TypeTag>
314struct ThermalConductivityModel<TypeTag, TTag::OnePNCNonEquil>
315{
316private:
318public:
320};
321
323template<class TypeTag>
324struct VolumeVariables<TypeTag, TTag::OnePNCNonEquil>
325{
326private:
335
339 template<class BaseTraits, class DT, class EDM, class ETCM>
340 struct NCNITraits : public BaseTraits
341 {
342 using DiffusionType = DT;
343 using EffectiveDiffusivityModel = EDM;
344 using EffectiveThermalConductivityModel = ETCM;
345 };
346
348public:
350};
351
352} // end namespace Properties
353} // end namespace Dumux
354
355#endif
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: compositional.hh:35
Element-wise calculation of the local residual for problems using compositional fully implicit model.
Definition: porousmediumflow/compositional/localresidual.hh:33
Relation for the saturation-dependent effective diffusion coefficient.
Definition: diffusivitymillingtonquirk.hh:40
Adds I/O fields specific to non-isothermal models.
Definition: porousmediumflow/nonisothermal/iofields.hh:27
This class contains the volume variables required for the modules which require the specific interfac...
Definition: porousmediumflow/nonequilibrium/volumevariables.hh:37
Adds I/O fields specific to the OnePNC model.
Definition: porousmediumflow/1pnc/iofields.hh:26
Contains the quantities which are are constant within a finite volume in the one-phase,...
Definition: porousmediumflow/1pnc/volumevariables.hh:38
Relation for a simple effective thermal conductivity.
Definition: thermalconductivityaverage.hh:25
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.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:267
Definition: adapt.hh:17
A single-phase, isothermal flow model using the fully implicit scheme.
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.
Python wrapper for volume variables (finite volume schemes)
Specifies a number properties of porous-medium flow non-equilibrium models.
Definition: porousmediumflow/nonequilibrium/model.hh:45
The indices for the isothermal one-phase n-component model.
Definition: porousmediumflow/1pnc/indices.hh:26
Specifies a number properties of models that consider a single-phase with multiple components.
Definition: porousmediumflow/1pnc/model.hh:70
static constexpr int numEq()
Definition: porousmediumflow/1pnc/model.hh:74
static constexpr bool enableAdvection()
Definition: porousmediumflow/1pnc/model.hh:80
static constexpr int numFluidComponents()
Definition: porousmediumflow/1pnc/model.hh:76
static constexpr int numFluidPhases()
Definition: porousmediumflow/1pnc/model.hh:75
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/1pnc/model.hh:77
static constexpr bool useMoles()
Definition: porousmediumflow/1pnc/model.hh:79
static constexpr bool enableCompositionalDispersion()
Definition: porousmediumflow/1pnc/model.hh:82
CDM CompositionalDispersionModel
Definition: porousmediumflow/1pnc/model.hh:72
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/1pnc/model.hh:81
static constexpr bool enableThermalDispersion()
Definition: porousmediumflow/1pnc/model.hh:83
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/1pnc/model.hh:84
Definition: porousmediumflow/1pnc/model.hh:252
static constexpr int numConstraintEq()
Definition: porousmediumflow/1pnc/model.hh:253
Traits class for the volume variables of the single-phase model.
Definition: porousmediumflow/1p/model.hh:74
Specifies a number properties of non-isothermal porous medium flow models based on the specifics of a...
Definition: porousmediumflow/nonisothermal/model.hh:58
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/1pnc/model.hh:124
Definition: porousmediumflow/1pnc/model.hh:96
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/1pnc/model.hh:96
Definition: porousmediumflow/1pnc/model.hh:97
std::tuple< OnePNC > InheritsFrom
Definition: porousmediumflow/1pnc/model.hh:97
Definition: porousmediumflow/1pnc/model.hh:261
std::tuple< NonEquilibrium, OnePNC > InheritsFrom
Definition: porousmediumflow/1pnc/model.hh:261
Reation for a simple effective thermal conductivity.