3.5-git
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 *****************************************************************************/
72#ifndef DUMUX_2P2C_MODEL_HH
73#define DUMUX_2P2C_MODEL_HH
74
75#include <array>
76
77// property forward declarations
79
88
89#include "volumevariables.hh"
90
91namespace Dumux {
92
93namespace Properties {
94
96// Type tags
98// Create new type tags
99namespace TTag {
100struct TwoPTwoC { using InheritsFrom = std::tuple<TwoPNC>; };
101struct TwoPTwoCNI { using InheritsFrom = std::tuple<TwoPTwoC>; };
102} // end namespace TTag
103
105// Property values
107
111template<class TypeTag>
112struct BaseModelTraits<TypeTag, TTag::TwoPTwoC>
113{
114private:
116 static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p-2c model!");
117 static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p-2c model!");
118
119public:
120 using type = TwoPNCModelTraits<FluidSystem::numComponents,
121 getPropValue<TypeTag, Properties::UseMoles>(),
122 /*setMFracForFirstPhase=*/true,
123 getPropValue<TypeTag, Properties::Formulation>(),
124 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
125};
126template<class TypeTag>
127struct ModelTraits<TypeTag, TTag::TwoPTwoC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
128
130template<class TypeTag>
131struct VolumeVariables<TypeTag, TTag::TwoPTwoC>
132{
133private:
142 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
143 static_assert(FSY::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p2c model!");
144 static_assert(FSY::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p2c model!");
145 // class used for scv-wise reconstruction of nonwetting phase saturations
148
151 template<class BaseTraits, class DT, class EDM>
152 struct NCTraits : public BaseTraits
153 {
154 using DiffusionType = DT;
155 using EffectiveDiffusivityModel = EDM;
156 };
157 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
158public:
160};
161
163template<class TypeTag>
164struct UseConstraintSolver<TypeTag, TTag::TwoPTwoC> { static constexpr bool value = true; };
165
167// Properties for the non-isothermal 2p2c model (inherited from 2pnc)
169
171template<class TypeTag>
172struct ModelTraits<TypeTag, TTag::TwoPTwoCNI>
173{
174private:
176public:
178};
179
181template<class TypeTag>
182struct VolumeVariables<TypeTag, TTag::TwoPTwoCNI>
183{
184private:
193 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
194 // class used for scv-wise reconstruction of nonwetting phase saturations
197
201
202 template<class BaseTraits, class DT, class EDM, class ETCM>
203 struct NCNITraits : public BaseTraits
204 {
205 using DiffusionType = DT;
206 using EffectiveDiffusivityModel = EDM;
207 using EffectiveThermalConductivityModel = ETCM;
208 };
209public:
211};
212
213
215template<class TypeTag>
216struct IOFields<TypeTag, TTag::TwoPTwoCNI> { using type = EnergyIOFields<TwoPNCIOFields>; };
217
219template<class TypeTag>
221
222} // end namespace Properties
223
224template<class TwoPTwoCModelTraits>
225struct TwoPTwoCUnconstrainedModelTraits : public TwoPTwoCModelTraits
226{
227 static constexpr int numConstraintEq() { return 0; }
228};
229
230namespace Properties {
232// Type tags
234namespace TTag {
235struct TwoPTwoCNonEquil { using InheritsFrom = std::tuple<NonEquilibrium, TwoPTwoC>; };
236} // end namespace TTag
237
239// Properties for the non-equilibrium TwoPTwoC model
241
242template<class TypeTag>
243struct EquilibriumLocalResidual<TypeTag, TTag::TwoPTwoCNonEquil> { using type = CompositionalLocalResidual<TypeTag>; };
244
246template<class TypeTag>
247struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNonEquil> { using type = TwoPNCIOFields; };
248
249template<class TypeTag>
250struct ModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
251{
252private:
254 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
255 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
256 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
257 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
258 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
259 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
260
262public:
264};
265
267template<class TypeTag>
268struct EquilibriumModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
269{
270private:
273public:
275};
276
279template<class TypeTag>
280struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNonEquil>
282
284template<class TypeTag>
285struct VolumeVariables<TypeTag, TTag::TwoPTwoCNonEquil>
286{
287private:
296 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
297 // class used for scv-wise reconstruction of nonwetting phase saturations
300
303 template<class BaseTraits, class DT, class EDM>
304 struct NCTraits : public BaseTraits
305 {
306 using DiffusionType = DT;
307 using EffectiveDiffusivityModel = EDM;
308 };
309
310 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
312public:
314};
315
317// Properties for the non-equilibrium nonisothermal TwoPTwoC model which assumes thermal equilibrium but chemical nonequilibrium
319
320namespace TTag {
321struct TwoPTwoCNINonEquil { using InheritsFrom = std::tuple<TwoPTwoCNonEquil>; };
322} // end namespace TTag
323
325template<class TypeTag>
326struct ModelTraits<TypeTag, TTag::TwoPTwoCNINonEquil>
327{
328private:
329 private:
331 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
332 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
333 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
334 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
335 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
336 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
337
339public:
341};
342
344template<class TypeTag>
345struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNINonEquil>
346{
347private:
349public:
351};
352
354template<class TypeTag>
355struct VolumeVariables<TypeTag, TTag::TwoPTwoCNINonEquil>
356{
357private:
366 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
367 // class used for scv-wise reconstruction of nonwetting phase saturations
370
374
375 template<class BaseTraits, class DT, class EDM, class ETCM>
376 struct NCNITraits : public BaseTraits
377 {
378 using DiffusionType = DT;
379 using EffectiveDiffusivityModel = EDM;
380 using EffectiveThermalConductivityModel = ETCM;
381 };
382 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
384public:
386};
387
389template<class TypeTag>
390struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNINonEquil>
392
393} // end namespace Properties
394} // end namespace Dumux
395
396#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
Definition: propertysystem.hh:150
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:107
The employed model for the computation of the effective diffusivity.
Definition: common/properties.hh:170
Model to be used for the calculation of the effective conductivity.
Definition: common/properties.hh:172
Whether to use a contraint solver for computing the secondary variables.
Definition: common/properties.hh:179
the formulation of the pressure e.g most wetting first
Definition: common/properties.hh:257
Definition: common/properties.hh:259
Definition: common/properties.hh:263
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:112
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:100
std::tuple< TwoPNC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:100
Definition: porousmediumflow/2p2c/model.hh:101
std::tuple< TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:101
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/2p2c/model.hh:127
Definition: porousmediumflow/2p2c/model.hh:226
static constexpr int numConstraintEq()
Definition: porousmediumflow/2p2c/model.hh:227
Definition: porousmediumflow/2p2c/model.hh:235
std::tuple< NonEquilibrium, TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:235
Definition: porousmediumflow/2p2c/model.hh:321
std::tuple< TwoPTwoCNonEquil > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:321
Definition: porousmediumflow/2p2c/volumevariables.hh:44
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:115
Element-wise calculation of the local residual for problems using compositional fully implicit model.
Definition: porousmediumflow/compositional/localresidual.hh:46
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:49
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.
This class contains the volume variables required for the modules which require the specific interfac...