version 3.7
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//
60#ifndef DUMUX_2P2C_MODEL_HH
61#define DUMUX_2P2C_MODEL_HH
62
63#include <array>
64
65// property forward declarations
67
76
77#include "volumevariables.hh"
78
79namespace Dumux {
80
81namespace Properties {
82
84// Type tags
86// Create new type tags
87namespace TTag {
88struct TwoPTwoC { using InheritsFrom = std::tuple<TwoPNC>; };
89struct TwoPTwoCNI { using InheritsFrom = std::tuple<TwoPTwoC>; };
90} // end namespace TTag
91
93// Property values
95
99template<class TypeTag>
100struct BaseModelTraits<TypeTag, TTag::TwoPTwoC>
101{
102private:
104 static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p-2c model!");
105 static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p-2c model!");
106
107public:
108 using type = TwoPNCModelTraits<FluidSystem::numComponents,
109 getPropValue<TypeTag, Properties::UseMoles>(),
110 /*setMFracForFirstPhase=*/true,
111 getPropValue<TypeTag, Properties::Formulation>(),
112 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
113};
114template<class TypeTag>
115struct ModelTraits<TypeTag, TTag::TwoPTwoC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
116
118template<class TypeTag>
119struct VolumeVariables<TypeTag, TTag::TwoPTwoC>
120{
121private:
130 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
131 static_assert(FSY::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p2c model!");
132 static_assert(FSY::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p2c model!");
133 // class used for scv-wise reconstruction of nonwetting phase saturations
136
139 template<class BaseTraits, class DT, class EDM>
140 struct NCTraits : public BaseTraits
141 {
142 using DiffusionType = DT;
143 using EffectiveDiffusivityModel = EDM;
144 };
145 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
146public:
148};
149
151template<class TypeTag>
152struct UseConstraintSolver<TypeTag, TTag::TwoPTwoC> { static constexpr bool value = true; };
153
155// Properties for the non-isothermal 2p2c model (inherited from 2pnc)
157
159template<class TypeTag>
160struct ModelTraits<TypeTag, TTag::TwoPTwoCNI>
161{
162private:
164public:
166};
167
169template<class TypeTag>
170struct VolumeVariables<TypeTag, TTag::TwoPTwoCNI>
171{
172private:
181 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
182 // class used for scv-wise reconstruction of nonwetting phase saturations
185
189
190 template<class BaseTraits, class DT, class EDM, class ETCM>
191 struct NCNITraits : public BaseTraits
192 {
193 using DiffusionType = DT;
194 using EffectiveDiffusivityModel = EDM;
195 using EffectiveThermalConductivityModel = ETCM;
196 };
197public:
199};
200
201
203template<class TypeTag>
204struct IOFields<TypeTag, TTag::TwoPTwoCNI> { using type = EnergyIOFields<TwoPNCIOFields>; };
205
207template<class TypeTag>
208struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNI> { using type = ThermalConductivitySomerton<GetPropType<TypeTag, Properties::Scalar>>; };
209
210} // end namespace Properties
211
212template<class TwoPTwoCModelTraits>
213struct TwoPTwoCUnconstrainedModelTraits : public TwoPTwoCModelTraits
214{
215 static constexpr int numConstraintEq() { return 0; }
216};
217
218namespace Properties {
220// Type tags
222namespace TTag {
223struct TwoPTwoCNonEquil { using InheritsFrom = std::tuple<NonEquilibrium, TwoPTwoC>; };
224} // end namespace TTag
225
227// Properties for the non-equilibrium TwoPTwoC model
229
230template<class TypeTag>
231struct EquilibriumLocalResidual<TypeTag, TTag::TwoPTwoCNonEquil> { using type = CompositionalLocalResidual<TypeTag>; };
232
234template<class TypeTag>
235struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNonEquil> { using type = TwoPNCIOFields; };
236
237template<class TypeTag>
238struct ModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
239{
240private:
242 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
243 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
244 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
245 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
246 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
247 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
248
250public:
252};
253
255template<class TypeTag>
256struct EquilibriumModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
257{
258private:
261public:
263};
264
267template<class TypeTag>
268struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNonEquil>
270
272template<class TypeTag>
273struct VolumeVariables<TypeTag, TTag::TwoPTwoCNonEquil>
274{
275private:
284 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
285 // class used for scv-wise reconstruction of nonwetting phase saturations
288
291 template<class BaseTraits, class DT, class EDM>
292 struct NCTraits : public BaseTraits
293 {
294 using DiffusionType = DT;
295 using EffectiveDiffusivityModel = EDM;
296 };
297
298 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
300public:
302};
303
305// Properties for the non-equilibrium nonisothermal TwoPTwoC model which assumes thermal equilibrium but chemical nonequilibrium
307
308namespace TTag {
309struct TwoPTwoCNINonEquil { using InheritsFrom = std::tuple<TwoPTwoCNonEquil>; };
310} // end namespace TTag
311
313template<class TypeTag>
314struct ModelTraits<TypeTag, TTag::TwoPTwoCNINonEquil>
315{
316private:
317 private:
319 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
320 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
321 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
322 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
323 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
324 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
325
327public:
329};
330
332template<class TypeTag>
333struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNINonEquil>
334{
335private:
337public:
339};
340
342template<class TypeTag>
343struct VolumeVariables<TypeTag, TTag::TwoPTwoCNINonEquil>
344{
345private:
354 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
355 // class used for scv-wise reconstruction of nonwetting phase saturations
358
362
363 template<class BaseTraits, class DT, class EDM, class ETCM>
364 struct NCNITraits : public BaseTraits
365 {
366 using DiffusionType = DT;
367 using EffectiveDiffusivityModel = EDM;
368 using EffectiveThermalConductivityModel = ETCM;
369 };
370 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
372public:
374};
375
377template<class TypeTag>
378struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNINonEquil>
380
381} // end namespace Properties
382} // end namespace Dumux
383
384#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
Relation for the saturation-dependent effective thermal conductivity.
Definition: simplefluidlumping.hh:26
Relation for the saturation-dependent effective thermal conductivity.
Definition: somerton.hh:48
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:267
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)
Relation for the saturation-dependent effective thermal conductivity.
Relation for the saturation-dependent effective thermal conductivity.
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:58
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/2p2c/model.hh:115
Definition: porousmediumflow/2p2c/model.hh:88
std::tuple< TwoPNC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:88
Definition: porousmediumflow/2p2c/model.hh:89
std::tuple< TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:89
Definition: porousmediumflow/2p2c/model.hh:309
std::tuple< TwoPTwoCNonEquil > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:309
Definition: porousmediumflow/2p2c/model.hh:223
std::tuple< NonEquilibrium, TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:223
Specifies a number properties of two-phase n-component models.
Definition: porousmediumflow/2pnc/model.hh:100
Definition: porousmediumflow/2p2c/model.hh:214
static constexpr int numConstraintEq()
Definition: porousmediumflow/2p2c/model.hh:215
Traits class for the two-phase model.
Definition: porousmediumflow/2p/model.hh:97