3.1-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 *****************************************************************************/
78#ifndef DUMUX_2P2C_MODEL_HH
79#define DUMUX_2P2C_MODEL_HH
80
81#include <array>
82
83// property forward declarations
85
94
95
96#include "volumevariables.hh"
97
98namespace Dumux {
99
100namespace Properties {
101
103// Type tags
105// Create new type tags
106namespace TTag {
107struct TwoPTwoC { using InheritsFrom = std::tuple<TwoPNC>; };
108struct TwoPTwoCNI { using InheritsFrom = std::tuple<TwoPTwoC>; };
109} // end namespace TTag
110
112// Property values
114
118template<class TypeTag>
119struct BaseModelTraits<TypeTag, TTag::TwoPTwoC>
120{
121private:
123 static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p-2c model!");
124 static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p-2c model!");
125
126public:
127 using type = TwoPNCModelTraits<FluidSystem::numComponents,
128 getPropValue<TypeTag, Properties::UseMoles>(),
129 /*setMFracForFirstPhase=*/true,
130 getPropValue<TypeTag, Properties::Formulation>(),
131 getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
132};
133template<class TypeTag>
134struct ModelTraits<TypeTag, TTag::TwoPTwoC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
135
137template<class TypeTag>
138struct VolumeVariables<TypeTag, TTag::TwoPTwoC>
139{
140private:
148
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
152 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
153
155public:
157};
158
160template<class TypeTag>
161struct UseConstraintSolver<TypeTag, TTag::TwoPTwoC> { static constexpr bool value = true; };
162
164// Properties for the non-isothermal 2p2c model (inherited from 2pnc)
166
168template<class TypeTag>
169struct ModelTraits<TypeTag, TTag::TwoPTwoCNI>
170{
171private:
173public:
175};
176
178template<class TypeTag>
179struct IOFields<TypeTag, TTag::TwoPTwoCNI> { using type = EnergyIOFields<TwoPNCIOFields>; };
180
182template<class TypeTag>
184
185} // end namespace Properties
186
187template<class TwoPTwoCModelTraits>
188struct TwoPTwoCUnconstrainedModelTraits : public TwoPTwoCModelTraits
189{
190 static constexpr int numConstraintEq() { return 0; }
191};
192
193namespace Properties {
195// Type tags
197namespace TTag {
198struct TwoPTwoCNonEquil { using InheritsFrom = std::tuple<NonEquilibrium, TwoPTwoC>; };
199} // end namespace TTag
200
202// Properties for the non-equilibrium TwoPTwoC model
204
205template<class TypeTag>
206struct EquilibriumLocalResidual<TypeTag, TTag::TwoPTwoCNonEquil> { using type = CompositionalLocalResidual<TypeTag>; };
207
209template<class TypeTag>
210struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNonEquil> { using type = TwoPNCIOFields; };
211
212template<class TypeTag>
213struct ModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
214{
215private:
217 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
218 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
219 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
220 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
221 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
222 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
223
225public:
227};
228
230template<class TypeTag>
231struct EquilibriumModelTraits<TypeTag, TTag::TwoPTwoCNonEquil>
232{
233private:
236public:
238};
239
241template<class TypeTag>
242struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNonEquil>
243{
244private:
246public:
248};
249
251template<class TypeTag>
252struct VolumeVariables<TypeTag, TTag::TwoPTwoCNonEquil>
253{
254private:
262
263 static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>();
264
267public:
269};
270
272// Properties for the non-equilibrium nonisothermal TwoPTwoC model which assumes thermal equilibrium but chemical nonequilibrium
274
275namespace TTag {
276struct TwoPTwoCNINonEquil { using InheritsFrom = std::tuple<TwoPTwoCNonEquil>; };
277} // end namespace TTag
278
280template<class TypeTag>
281struct ModelTraits<TypeTag, TTag::TwoPTwoCNINonEquil>
282{
283private:
284 private:
286 static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>();
287 static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>();
288 static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
289 static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>();
290 static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>();
291 static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>();
292
294public:
296};
297
299template<class TypeTag>
300struct EquilibriumIOFields<TypeTag, TTag::TwoPTwoCNINonEquil>
301{
302private:
304public:
306};
307
309template<class TypeTag>
311
312} // end namespace Properties
313} // end namespace Dumux
314
315#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.
make the local view function available whenever we use the grid geometry
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:65
Model traits to be used as a base for nonisothermal, mineralization ... models.
Definition: common/properties.hh:67
A class helping models to define input and output fields.
Definition: common/properties.hh:78
The secondary variables within a sub-control volume.
Definition: common/properties.hh:174
Model to be used for the calculation of the effective conductivity.
Definition: common/properties.hh:233
Whether to use a contraint solver for computing the secondary variables.
Definition: common/properties.hh:240
the formulation of the pressure e.g most wetting first
Definition: common/properties.hh:318
Definition: common/properties.hh:320
Definition: common/properties.hh:324
Relation for the saturation-dependent effective thermal conductivity.
Definition: thermalconductivitysimplefluidlumping.hh:39
Relation for the saturation-dependent effective thermal conductivity.
Definition: thermalconductivitysomerton.hh:60
Definition: porousmediumflow/2p2c/model.hh:107
std::tuple< TwoPNC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:107
Definition: porousmediumflow/2p2c/model.hh:108
std::tuple< TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:108
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/2p2c/model.hh:134
Definition: porousmediumflow/2p2c/model.hh:189
static constexpr int numConstraintEq()
Definition: porousmediumflow/2p2c/model.hh:190
Definition: porousmediumflow/2p2c/model.hh:198
std::tuple< NonEquilibrium, TwoPTwoC > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:198
Definition: porousmediumflow/2p2c/model.hh:276
std::tuple< TwoPTwoCNonEquil > InheritsFrom
Definition: porousmediumflow/2p2c/model.hh:276
Definition: porousmediumflow/2p2c/volumevariables.hh:44
Adds I/O fields specific to the TwoPNC model.
Definition: dumux/porousmediumflow/2pnc/iofields.hh:39
Specifies a number properties of two-phase n-component models.
Definition: porousmediumflow/2pnc/model.hh:120
Traits class for the volume variables of the single-phase model.
Definition: porousmediumflow/2pnc/model.hh:152
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:58
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: dumux/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...