version 3.10-dev
porousmediumflow/2p2c/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//
68#ifndef DUMUX_2P2C_MODEL_HH
69#define DUMUX_2P2C_MODEL_HH
70
71#include <array>
72
73// property forward declarations
75
84
85#include "volumevariables.hh"
86
87namespace Dumux {
88
89namespace Properties {
90
92// Type tags
94// Create new type tags
95namespace TTag {
96struct TwoPTwoC { using InheritsFrom = std::tuple<TwoPNC>; };
97struct TwoPTwoCNI { using InheritsFrom = std::tuple<TwoPTwoC>; };
98} // end namespace TTag
99
101// Property values
103
107template<class TypeTag>
108struct BaseModelTraits<TypeTag, TTag::TwoPTwoC>
109{
110private:
112 static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p-2c model!");
113 static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p-2c model!");
114
115public:
116 using type = TwoPNCModelTraits<FluidSystem::numComponents,
117 getPropValue<TypeTag, Properties::UseMoles>(),
118 /*setMFracForFirstPhase=*/true,
119 getPropValue<TypeTag, Properties::Formulation>(),
120 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
121};
122template<class TypeTag>
123struct ModelTraits<TypeTag, TTag::TwoPTwoC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
124
126template<class TypeTag>
127struct VolumeVariables<TypeTag, TTag::TwoPTwoC>
128{
129private:
138 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
139 static_assert(FSY::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p2c model!");
140 static_assert(FSY::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p2c model!");
141 // class used for scv-wise reconstruction of nonwetting phase saturations
144
147 template<class BaseTraits, class DT, class EDM>
148 struct NCTraits : public BaseTraits
149 {
150 using DiffusionType = DT;
151 using EffectiveDiffusivityModel = EDM;
152 };
153 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
154public:
156};
157
159template<class TypeTag>
160struct UseConstraintSolver<TypeTag, TTag::TwoPTwoC> { static constexpr bool value = true; };
161
163// Properties for the non-isothermal 2p2c model (inherited from 2pnc)
165
167template<class TypeTag>
168struct ModelTraits<TypeTag, TTag::TwoPTwoCNI>
169{
170private:
172public:
174};
175
177template<class TypeTag>
178struct VolumeVariables<TypeTag, TTag::TwoPTwoCNI>
179{
180private:
189 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
190 // class used for scv-wise reconstruction of nonwetting phase saturations
193
197
198 template<class BaseTraits, class DT, class EDM, class ETCM>
199 struct NCNITraits : public BaseTraits
200 {
201 using DiffusionType = DT;
202 using EffectiveDiffusivityModel = EDM;
203 using EffectiveThermalConductivityModel = ETCM;
204 };
205public:
207};
208
209
211template<class TypeTag>
212struct IOFields<TypeTag, TTag::TwoPTwoCNI> { using type = EnergyIOFields<TwoPNCIOFields>; };
213
215template<class TypeTag>
216struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNI> { using type = ThermalConductivitySomertonTwoP<GetPropType<TypeTag, Properties::Scalar>>; };
217
218} // end namespace Properties
219
220template<class TwoPTwoCModelTraits>
221struct TwoPTwoCUnconstrainedModelTraits : public TwoPTwoCModelTraits
222{
223 static constexpr int numConstraintEq() { return 0; }
224};
225
226namespace Properties {
228// Type tags
230namespace TTag {
231struct TwoPTwoCNonEquil { using InheritsFrom = std::tuple<NonEquilibrium, TwoPTwoC>; };
232} // end namespace TTag
233
235// Properties for the non-equilibrium TwoPTwoC model
237
238template<class TypeTag>
239struct EquilibriumLocalResidual<TypeTag, TTag::TwoPTwoCNonEquil> { using type = CompositionalLocalResidual<TypeTag>; };
240
242template<class TypeTag>
243struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNonEquil> { using type = TwoPNCIOFields; };
244
245template<class TypeTag>
246struct ModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
247{
248private:
250 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
251 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
252 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
253 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
254 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
255 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
256
258public:
260};
261
263template<class TypeTag>
264struct EquilibriumModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
265{
266private:
269public:
271};
272
275template<class TypeTag>
276struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNonEquil>
278
280template<class TypeTag>
281struct VolumeVariables<TypeTag, TTag::TwoPTwoCNonEquil>
282{
283private:
292 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
293 // class used for scv-wise reconstruction of nonwetting phase saturations
296
299 template<class BaseTraits, class DT, class EDM>
300 struct NCTraits : public BaseTraits
301 {
302 using DiffusionType = DT;
303 using EffectiveDiffusivityModel = EDM;
304 };
305
306 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
308public:
310};
311
313// Properties for the non-equilibrium nonisothermal TwoPTwoC model which assumes thermal equilibrium but chemical nonequilibrium
315
316namespace TTag {
317struct TwoPTwoCNINonEquil { using InheritsFrom = std::tuple<TwoPTwoCNonEquil>; };
318} // end namespace TTag
319
321template<class TypeTag>
322struct ModelTraits<TypeTag, TTag::TwoPTwoCNINonEquil>
323{
324private:
325 private:
327 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
328 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
329 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
330 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
331 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
332 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
333
335public:
337};
338
340template<class TypeTag>
341struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNINonEquil>
342{
343private:
345public:
347};
348
350template<class TypeTag>
351struct VolumeVariables<TypeTag, TTag::TwoPTwoCNINonEquil>
352{
353private:
362 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
363 // class used for scv-wise reconstruction of nonwetting phase saturations
366
370
371 template<class BaseTraits, class DT, class EDM, class ETCM>
372 struct NCNITraits : public BaseTraits
373 {
374 using DiffusionType = DT;
375 using EffectiveDiffusivityModel = EDM;
376 using EffectiveThermalConductivityModel = ETCM;
377 };
378 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
380public:
382};
383
385template<class TypeTag>
386struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNINonEquil>
388
389} // end namespace Properties
390} // end namespace Dumux
391
392#endif
Element-wise calculation of the local residual for problems using compositional fully implicit model.
Definition: porousmediumflow/compositional/localresidual.hh:33
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
Effective thermal conductivity based on weighted arithmetic average.
Definition: thermalconductivityaverage.hh:43
Effective thermal conductivity after Somerton.
Definition: somerton.hh:46
Adds I/O fields specific to the TwoPNC model.
Definition: porousmediumflow/2pnc/iofields.hh:27
Class that computes the nonwetting saturation in an scv from the saturation at the global degree of f...
Definition: saturationreconstruction.hh:31
Definition: porousmediumflow/2p2c/volumevariables.hh:32
Defines all properties used in Dumux.
Defines an enumeration for the formulations accepted by the two-phase model.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
Definition: adapt.hh:17
Adaption of the fully implicit scheme to the two-phase n-component 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...
Adds I/O fields specific to non-isothermal models.
The implicit non-isothermal 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
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/2p2c/model.hh:123
Definition: porousmediumflow/2p2c/model.hh:96
std::tuple< TwoPNC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:96
Definition: porousmediumflow/2p2c/model.hh:97
std::tuple< TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:97
Definition: porousmediumflow/2p2c/model.hh:317
std::tuple< TwoPTwoCNonEquil > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:317
Definition: porousmediumflow/2p2c/model.hh:231
std::tuple< NonEquilibrium, TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:231
Specifies a number properties of two-phase n-component models.
Definition: porousmediumflow/2pnc/model.hh:114
Definition: porousmediumflow/2p2c/model.hh:222
static constexpr int numConstraintEq()
Definition: porousmediumflow/2p2c/model.hh:223
Traits class for the two-phase model.
Definition: porousmediumflow/2p/model.hh:107