version 3.10-dev
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//
48#ifndef DUMUX_1PNC_MODEL_HH
49#define DUMUX_1PNC_MODEL_HH
50
52
55
65
66#include "indices.hh"
67#include "volumevariables.hh"
68#include "iofields.hh"
69
70namespace Dumux {
71
79template<int nComp, bool useM, int enableCompDisp, int enableThermDisp, int repCompEqIdx = nComp, class CDM = void>
81{
84
85 static constexpr int numEq() { return nComp; }
86 static constexpr int numFluidPhases() { return 1; }
87 static constexpr int numFluidComponents() { return nComp; }
88 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
89
90 static constexpr bool useMoles() { return useM; }
91 static constexpr bool enableAdvection() { return true; }
92 static constexpr bool enableMolecularDiffusion() { return true; }
93 static constexpr bool enableCompositionalDispersion() { return enableCompDisp; }
94 static constexpr bool enableThermalDispersion() { return enableThermDisp; }
95 static constexpr bool enableEnergyBalance() { return false; }
96};
97
98namespace Properties {
99
101// Type tags
103
105// Create new type tags
106namespace TTag {
107struct OnePNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
108struct OnePNCNI { using InheritsFrom = std::tuple<OnePNC>; };
109} // end namespace TTag
110
112// Properties for the isothermal single phase model
114
116template<class TypeTag>
117struct ReplaceCompEqIdx<TypeTag, TTag::OnePNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
118
120template<class TypeTag>
121struct BaseModelTraits<TypeTag, TTag::OnePNC>
122{
123private:
126public:
127 using type = OnePNCModelTraits<FluidSystem::numComponents,
128 getPropValue<TypeTag, Properties::UseMoles>(),
129 getPropValue<TypeTag, Properties::EnableCompositionalDispersion>(),
130 getPropValue<TypeTag, Properties::EnableThermalDispersion>(),
131 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(),
132 CDM>;
133};
134template<class TypeTag>
135struct ModelTraits<TypeTag, TTag::OnePNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
136
144template<class TypeTag>
145struct FluidState<TypeTag, TTag::OnePNC>
146{
147private:
151public:
153};
154
156template<class TypeTag>
157struct EffectiveDiffusivityModel<TypeTag, TTag::OnePNC>
159
161template<class TypeTag>
162struct UseMoles<TypeTag, TTag::OnePNC> { static constexpr bool value = true; };
163
165template<class TypeTag>
166struct LocalResidual<TypeTag, TTag::OnePNC> { using type = CompositionalLocalResidual<TypeTag>; };
167
169template<class TypeTag>
170struct VolumeVariables<TypeTag, TTag::OnePNC>
171{
172private:
180 static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system");
181 static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
182 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
183 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
185
188 template<class BaseTraits, class DT, class EDM>
189 struct NCTraits : public BaseTraits
190 {
191 using DiffusionType = DT;
192 using EffectiveDiffusivityModel = EDM;
193 };
194
195public:
197};
198
200template<class TypeTag>
201struct IOFields<TypeTag, TTag::OnePNC> { using type = OnePNCIOFields; };
202
204// Properties for the non-isothermal single phase model
206
208template<class TypeTag>
209struct IOFields<TypeTag, TTag::OnePNCNI> { using type = EnergyIOFields<OnePNCIOFields>; };
210
212template<class TypeTag>
213struct ThermalConductivityModel<TypeTag, TTag::OnePNCNI>
215
217template<class TypeTag>
218struct ModelTraits<TypeTag, TTag::OnePNCNI>
219{
220private:
223public:
225};
226
227template<class TypeTag>
228struct VolumeVariables<TypeTag, TTag::OnePNCNI>
229{
230private:
238 static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system");
239 static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
240 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
241 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
243
247 template<class BaseTraits, class DT, class EDM, class ETCM>
248 struct NCNITraits : public BaseTraits
249 {
250 using DiffusionType = DT;
251 using EffectiveDiffusivityModel = EDM;
252 using EffectiveThermalConductivityModel = ETCM;
253 };
254
255public:
257};
258
259} // end namespace Properties
260
261template<class OnePNCModelTraits>
263{
264 static constexpr int numConstraintEq() { return 0; }
265};
266
267namespace Properties {
269// Type tags
271namespace TTag {
272struct OnePNCNonEquil { using InheritsFrom = std::tuple<NonEquilibrium, OnePNC>; };
273} // end namespace TTag
274
275
277// Properties for the non-equilibrium OnePNC model
279
280template<class TypeTag>
281struct EquilibriumLocalResidual<TypeTag, TTag::OnePNCNonEquil> { using type = CompositionalLocalResidual<TypeTag>; };
282
284template<class TypeTag>
285struct EquilibriumIOFields<TypeTag, TTag::OnePNCNonEquil> { using type = OnePNCIOFields; };
286
287template<class TypeTag>
288struct ModelTraits<TypeTag, TTag::OnePNCNonEquil>
289{
290private:
292 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
293 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
294 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
295 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
296 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
297 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
298
300public:
302};
303
304// by default chemical non equilibrium is enabled in the nonequil model, switch that off here
305template<class TypeTag>
306struct EnableChemicalNonEquilibrium<TypeTag, TTag::OnePNCNonEquil> { static constexpr bool value = false; };
307
309template<class TypeTag>
310struct EquilibriumModelTraits<TypeTag, TTag::OnePNCNonEquil>
311{
312private:
314 using EquilibriumTraits = OnePNCModelTraits<FluidSystem::numComponents,
315 getPropValue<TypeTag, Properties::UseMoles>(),
316 getPropValue<TypeTag, Properties::EnableCompositionalDispersion>(),
317 getPropValue<TypeTag, Properties::EnableThermalDispersion>(),
318 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
319public:
321};
322
324template<class TypeTag>
325struct ThermalConductivityModel<TypeTag, TTag::OnePNCNonEquil>
326{
327private:
329public:
331};
332
334template<class TypeTag>
335struct VolumeVariables<TypeTag, TTag::OnePNCNonEquil>
336{
337private:
346
350 template<class BaseTraits, class DT, class EDM, class ETCM>
351 struct NCNITraits : public BaseTraits
352 {
353 using DiffusionType = DT;
354 using EffectiveDiffusivityModel = EDM;
355 using EffectiveThermalConductivityModel = ETCM;
356 };
357
359public:
361};
362
363} // end namespace Properties
364} // end namespace Dumux
365
366#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 effective diffusion coefficient after Millington and Quirk.
Definition: diffusivitymillingtonquirk.hh:37
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
Effective thermal conductivity based on weighted arithmetic average.
Definition: thermalconductivityaverage.hh:43
Defines all properties used in Dumux.
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
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:81
static constexpr int numEq()
Definition: porousmediumflow/1pnc/model.hh:85
static constexpr bool enableAdvection()
Definition: porousmediumflow/1pnc/model.hh:91
static constexpr int numFluidComponents()
Definition: porousmediumflow/1pnc/model.hh:87
static constexpr int numFluidPhases()
Definition: porousmediumflow/1pnc/model.hh:86
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/1pnc/model.hh:88
static constexpr bool useMoles()
Definition: porousmediumflow/1pnc/model.hh:90
static constexpr bool enableCompositionalDispersion()
Definition: porousmediumflow/1pnc/model.hh:93
CDM CompositionalDispersionModel
Definition: porousmediumflow/1pnc/model.hh:83
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/1pnc/model.hh:92
static constexpr bool enableThermalDispersion()
Definition: porousmediumflow/1pnc/model.hh:94
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/1pnc/model.hh:95
Definition: porousmediumflow/1pnc/model.hh:263
static constexpr int numConstraintEq()
Definition: porousmediumflow/1pnc/model.hh:264
Traits class for the volume variables of the single-phase model.
Definition: porousmediumflow/1p/model.hh:83
Specifies a number properties of non-isothermal porous medium flow models based on the specifics of a...
Definition: porousmediumflow/nonisothermal/model.hh:76
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/1pnc/model.hh:135
Definition: porousmediumflow/1pnc/model.hh:107
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/1pnc/model.hh:107
Definition: porousmediumflow/1pnc/model.hh:108
std::tuple< OnePNC > InheritsFrom
Definition: porousmediumflow/1pnc/model.hh:108
Definition: porousmediumflow/1pnc/model.hh:272
std::tuple< NonEquilibrium, OnePNC > InheritsFrom
Definition: porousmediumflow/1pnc/model.hh:272