version 3.8
porousmediumflow/3p3c/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//
69#ifndef DUMUX_3P3C_MODEL_HH
70#define DUMUX_3P3C_MODEL_HH
71
72#include <dune/common/fvector.hh>
73
81
85
86#include "indices.hh"
87#include "volumevariables.hh"
88#include "iofields.hh"
89#include "localresidual.hh"
90
91namespace Dumux {
92
98template<bool useCS, bool useMol>
100{
102
103 static constexpr int numEq() { return 3; }
104 static constexpr int numFluidPhases() { return 3; }
105 static constexpr int numFluidComponents() { return 3; }
106
107 static constexpr bool enableAdvection() { return true; }
108 static constexpr bool enableMolecularDiffusion() { return true; }
109 static constexpr bool enableEnergyBalance() { return false; }
110
111 static constexpr bool useConstraintSolver() { return useCS; }
112 static constexpr bool useMoles() { return useMol; }
113};
114
115namespace Properties {
116// Create new type tags
117namespace TTag {
119struct ThreePThreeC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
121struct ThreePThreeCNI { using InheritsFrom = std::tuple<ThreePThreeC>; };
122} // end namespace TTag
123
125// Property values
127
129template<class TypeTag>
130struct BaseModelTraits<TypeTag, TTag::ThreePThreeC>
131{
132private:
134 static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p3c model!");
135 static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p3c model!");
136public:
137 using type = ThreePThreeCModelTraits<getPropValue<TypeTag, Properties::UseConstraintSolver>(), getPropValue<TypeTag, Properties::UseMoles>()>;
138};
139template<class TypeTag>
140struct ModelTraits<TypeTag, TTag::ThreePThreeC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
141
143template<class TypeTag>
144struct UseConstraintSolver<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = false; };
145
147template<class TypeTag>
148struct ReplaceCompEqIdx<TypeTag, TTag::ThreePThreeC> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); };
155template<class TypeTag>
156struct FluidState<TypeTag, TTag::ThreePThreeC>{
157 private:
160 public:
162};
163
165template<class TypeTag>
166struct LocalResidual<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCLocalResidual<TypeTag>; };
167
169template<class TypeTag>
170struct PrimaryVariables<TypeTag, TTag::ThreePThreeC>
171{
172private:
173 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
175public:
177};
178
180template<class TypeTag>
181struct VolumeVariables<TypeTag, TTag::ThreePThreeC>
182{
183private:
193
195 template<class BaseTraits, class DT, class EDM>
196 struct NCTraits : public BaseTraits
197 {
198 using DiffusionType = DT;
199 using EffectiveDiffusivityModel = EDM;
200 };
201
202public:
204};
205
207template<class TypeTag>
208struct EffectiveDiffusivityModel<TypeTag, TTag::ThreePThreeC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; };
209
211template<class TypeTag>
212struct IOFields<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCIOFields; };
213
215template<class TypeTag>
216struct UseMoles<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = true; };
217
219// Property values for isothermal model required for the general non-isothermal model
221
223template<class TypeTag>
224struct ModelTraits<TypeTag, TTag::ThreePThreeCNI>
225{
226private:
228public:
230};
231
233template<class TypeTag>
234struct VolumeVariables<TypeTag, TTag::ThreePThreeCNI>
235{
236private:
245
249 template<class BaseTraits, class DT, class EDM, class ETCM>
250 struct NCNITraits : public BaseTraits
251 {
252 using DiffusionType = DT;
253 using EffectiveDiffusivityModel = EDM;
254 using EffectiveThermalConductivityModel = ETCM;
255 };
256public:
258};
259
261template<class TypeTag>
262struct IOFields<TypeTag, TTag::ThreePThreeCNI> { using type = EnergyIOFields<ThreePThreeCIOFields>; };
263
265template<class TypeTag>
266struct ThermalConductivityModel<TypeTag, TTag::ThreePThreeCNI> { using type = ThermalConductivitySomerton<GetPropType<TypeTag, Properties::Scalar>>; };
267
268} // end namespace Properties
269} // end namespace Dumux
270
271#endif
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: compositional.hh:35
Relation for the saturation-dependent effective diffusion coefficient.
Definition: diffusivitymillingtonquirk.hh:40
Adds I/O fields specific to non-isothermal models.
Definition: porousmediumflow/nonisothermal/iofields.hh:27
A primary variable vector with a state to allow variable switches.
Definition: switchableprimaryvariables.hh:28
Relation for the saturation-dependent effective thermal conductivity.
Definition: somerton.hh:48
Adds I/O fields specific to the three-phase three-component model.
Definition: porousmediumflow/3p3c/iofields.hh:26
The indices for the isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/indices.hh:23
Element-wise calculation of the Jacobian matrix for problems using the three-phase three-component fu...
Definition: porousmediumflow/3p3c/localresidual.hh:30
Contains the quantities which are are constant within a finite volume in the three-phase three-compon...
Definition: porousmediumflow/3p3c/volumevariables.hh:50
Defines all properties used in Dumux.
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Relation for the saturation-dependent effective diffusion coefficient.
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 three-phase flow model.
Defines the indices used by the non-isothermal two-phase two-component model.
Adds I/O fields specific to non-isothermal models.
The implicit non-isothermal model.
Defines a type tag and some properties for models using the box scheme.
Defines the primary variable and equation indices used by the isothermal tracer model.
Adds I/O fields specific to the tracer model.
Element-wise calculation of the local residual for problems using fully implicit tracer model.
Python wrapper for volume variables (finite volume schemes)
Specifies a number properties of non-isothermal porous medium flow models based on the specifics of a...
Definition: porousmediumflow/nonisothermal/model.hh:71
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/3p3c/model.hh:140
The type tags for the isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/model.hh:119
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/3p3c/model.hh:119
The type tags for the non-isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/model.hh:121
std::tuple< ThreePThreeC > InheritsFrom
Definition: porousmediumflow/3p3c/model.hh:121
Specifies a number properties of two-phase models.
Definition: porousmediumflow/3p3c/model.hh:100
static constexpr bool useMoles()
Definition: porousmediumflow/3p3c/model.hh:112
static constexpr int numFluidComponents()
Definition: porousmediumflow/3p3c/model.hh:105
static constexpr int numFluidPhases()
Definition: porousmediumflow/3p3c/model.hh:104
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/3p3c/model.hh:108
static constexpr bool useConstraintSolver()
Definition: porousmediumflow/3p3c/model.hh:111
static constexpr bool enableAdvection()
Definition: porousmediumflow/3p3c/model.hh:107
static constexpr int numEq()
Definition: porousmediumflow/3p3c/model.hh:103
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/3p3c/model.hh:109
Traits class for the two-phase model.
Definition: porousmediumflow/3p/model.hh:96
A primary variable vector with a state to allow variable switches.
Relation for the saturation-dependent effective thermal conductivity.