3.3.0
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * 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 *****************************************************************************/
78#ifndef DUMUX_2P2C_MODEL_HH
79#define DUMUX_2P2C_MODEL_HH
80
81#include <array>
82
83// property forward declarations
85
94
95#include "volumevariables.hh"
96
97namespace Dumux {
98
99namespace Properties {
100
102// Type tags
104// Create new type tags
105namespace TTag {
106struct TwoPTwoC { using InheritsFrom = std::tuple<TwoPNC>; };
107struct TwoPTwoCNI { using InheritsFrom = std::tuple<TwoPTwoC>; };
108} // end namespace TTag
109
111// Property values
113
117template<class TypeTag>
118struct BaseModelTraits<TypeTag, TTag::TwoPTwoC>
119{
120private:
122 static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p-2c model!");
123 static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p-2c model!");
124
125public:
126 using type = TwoPNCModelTraits<FluidSystem::numComponents,
127 getPropValue<TypeTag, Properties::UseMoles>(),
128 /*setMFracForFirstPhase=*/true,
129 getPropValue<TypeTag, Properties::Formulation>(),
130 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
131};
132template<class TypeTag>
133struct ModelTraits<TypeTag, TTag::TwoPTwoC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
134
136template<class TypeTag>
137struct VolumeVariables<TypeTag, TTag::TwoPTwoC>
138{
139private:
148 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
149 static_assert(FSY::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p2c model!");
150 static_assert(FSY::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p2c model!");
151 // class used for scv-wise reconstruction of nonwetting phase saturations
154
157 template<class BaseTraits, class DT, class EDM>
158 struct NCTraits : public BaseTraits
159 {
160 using DiffusionType = DT;
161 using EffectiveDiffusivityModel = EDM;
162 };
163 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
164public:
166};
167
169template<class TypeTag>
170struct UseConstraintSolver<TypeTag, TTag::TwoPTwoC> { static constexpr bool value = true; };
171
173// Properties for the non-isothermal 2p2c model (inherited from 2pnc)
175
177template<class TypeTag>
178struct ModelTraits<TypeTag, TTag::TwoPTwoCNI>
179{
180private:
182public:
184};
185
187template<class TypeTag>
188struct VolumeVariables<TypeTag, TTag::TwoPTwoCNI>
189{
190private:
199 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
200 // class used for scv-wise reconstruction of nonwetting phase saturations
203
207
208 template<class BaseTraits, class DT, class EDM, class ETCM>
209 struct NCNITraits : public BaseTraits
210 {
211 using DiffusionType = DT;
212 using EffectiveDiffusivityModel = EDM;
213 using EffectiveThermalConductivityModel = ETCM;
214 };
215public:
217};
218
219
221template<class TypeTag>
222struct IOFields<TypeTag, TTag::TwoPTwoCNI> { using type = EnergyIOFields<TwoPNCIOFields>; };
223
225template<class TypeTag>
227
228} // end namespace Properties
229
230template<class TwoPTwoCModelTraits>
231struct TwoPTwoCUnconstrainedModelTraits : public TwoPTwoCModelTraits
232{
233 static constexpr int numConstraintEq() { return 0; }
234};
235
236namespace Properties {
238// Type tags
240namespace TTag {
241struct TwoPTwoCNonEquil { using InheritsFrom = std::tuple<NonEquilibrium, TwoPTwoC>; };
242} // end namespace TTag
243
245// Properties for the non-equilibrium TwoPTwoC model
247
248template<class TypeTag>
249struct EquilibriumLocalResidual<TypeTag, TTag::TwoPTwoCNonEquil> { using type = CompositionalLocalResidual<TypeTag>; };
250
252template<class TypeTag>
253struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNonEquil> { using type = TwoPNCIOFields; };
254
255template<class TypeTag>
256struct ModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
257{
258private:
260 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
261 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
262 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
263 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
264 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
265 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
266
268public:
270};
271
273template<class TypeTag>
274struct EquilibriumModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
275{
276private:
279public:
281};
282
285template<class TypeTag>
286struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNonEquil>
288
290template<class TypeTag>
291struct VolumeVariables<TypeTag, TTag::TwoPTwoCNonEquil>
292{
293private:
302 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
303 // class used for scv-wise reconstruction of nonwetting phase saturations
306
309 template<class BaseTraits, class DT, class EDM>
310 struct NCTraits : public BaseTraits
311 {
312 using DiffusionType = DT;
313 using EffectiveDiffusivityModel = EDM;
314 };
315
316 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
318public:
320};
321
323// Properties for the non-equilibrium nonisothermal TwoPTwoC model which assumes thermal equilibrium but chemical nonequilibrium
325
326namespace TTag {
327struct TwoPTwoCNINonEquil { using InheritsFrom = std::tuple<TwoPTwoCNonEquil>; };
328} // end namespace TTag
329
331template<class TypeTag>
332struct ModelTraits<TypeTag, TTag::TwoPTwoCNINonEquil>
333{
334private:
335 private:
337 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
338 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
339 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
340 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
341 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
342 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
343
345public:
347};
348
350template<class TypeTag>
351struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNINonEquil>
352{
353private:
355public:
357};
358
360template<class TypeTag>
361struct VolumeVariables<TypeTag, TTag::TwoPTwoCNINonEquil>
362{
363private:
372 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
373 // class used for scv-wise reconstruction of nonwetting phase saturations
376
380
381 template<class BaseTraits, class DT, class EDM, class ETCM>
382 struct NCNITraits : public BaseTraits
383 {
384 using DiffusionType = DT;
385 using EffectiveDiffusivityModel = EDM;
386 using EffectiveThermalConductivityModel = ETCM;
387 };
388 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
390public:
392};
393
395template<class TypeTag>
396struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNINonEquil>
398
399} // end namespace Properties
400} // end namespace Dumux
401
402#endif
Relation for the saturation-dependent effective thermal conductivity.
Relation for the saturation-dependent effective thermal conductivity.
Defines an enumeration for the formulations accepted by the two-phase model.
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
Traits class encapsulating model specifications.
Definition: common/properties.hh:53
Model traits to be used as a base for nonisothermal, mineralization ... models.
Definition: common/properties.hh:55
A class helping models to define input and output fields.
Definition: common/properties.hh:63
The secondary variables within a sub-control volume.
Definition: common/properties.hh:106
The employed model for the computation of the effective diffusivity.
Definition: common/properties.hh:163
Model to be used for the calculation of the effective conductivity.
Definition: common/properties.hh:165
Whether to use a contraint solver for computing the secondary variables.
Definition: common/properties.hh:172
the formulation of the pressure e.g most wetting first
Definition: common/properties.hh:250
Definition: common/properties.hh:252
Definition: common/properties.hh:256
Relation for the saturation-dependent effective thermal conductivity.
Definition: simplefluidlumping.hh:38
Relation for the saturation-dependent effective thermal conductivity.
Definition: somerton.hh:60
Traits class for the two-phase model.
Definition: porousmediumflow/2p/model.hh:117
Class that computes the nonwetting saturation in an scv from the saturation at the global degree of f...
Definition: saturationreconstruction.hh:43
Definition: porousmediumflow/2p2c/model.hh:106
std::tuple< TwoPNC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:106
Definition: porousmediumflow/2p2c/model.hh:107
std::tuple< TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:107
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/2p2c/model.hh:133
Definition: porousmediumflow/2p2c/model.hh:232
static constexpr int numConstraintEq()
Definition: porousmediumflow/2p2c/model.hh:233
Definition: porousmediumflow/2p2c/model.hh:241
std::tuple< NonEquilibrium, TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:241
Definition: porousmediumflow/2p2c/model.hh:327
std::tuple< TwoPTwoCNonEquil > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:327
Definition: porousmediumflow/2p2c/volumevariables.hh:46
Adds I/O fields specific to the TwoPNC model.
Definition: porousmediumflow/2pnc/iofields.hh:39
Specifies a number properties of two-phase n-component models.
Definition: porousmediumflow/2pnc/model.hh:120
Element-wise calculation of the local residual for problems using compositional fully implicit model.
Definition: porousmediumflow/compositional/localresidual.hh:43
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:51
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
Declares all properties used in Dumux.
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.
The implicit non-isothermal model.
Adds I/O fields specific to non-isothermal models.
Base class for the model specific class which provides access to all volume averaged quantities.
This class contains the volume variables required for the modules which require the specific interfac...