version 3.7
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//
59#ifndef DUMUX_3P3C_MODEL_HH
60#define DUMUX_3P3C_MODEL_HH
61
62#include <dune/common/fvector.hh>
63
71
75
76#include "indices.hh"
77#include "volumevariables.hh"
78#include "iofields.hh"
79#include "localresidual.hh"
80
81namespace Dumux {
82
88template<bool useCS, bool useMol>
90{
92
93 static constexpr int numEq() { return 3; }
94 static constexpr int numFluidPhases() { return 3; }
95 static constexpr int numFluidComponents() { return 3; }
96
97 static constexpr bool enableAdvection() { return true; }
98 static constexpr bool enableMolecularDiffusion() { return true; }
99 static constexpr bool enableEnergyBalance() { return false; }
100
101 static constexpr bool useConstraintSolver() { return useCS; }
102 static constexpr bool useMoles() { return useMol; }
103};
104
105namespace Properties {
106// Create new type tags
107namespace TTag {
109struct ThreePThreeC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
111struct ThreePThreeCNI { using InheritsFrom = std::tuple<ThreePThreeC>; };
112} // end namespace TTag
113
115// Property values
117
119template<class TypeTag>
120struct BaseModelTraits<TypeTag, TTag::ThreePThreeC>
121{
122private:
124 static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p3c model!");
125 static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p3c model!");
126public:
127 using type = ThreePThreeCModelTraits<getPropValue<TypeTag, Properties::UseConstraintSolver>(), getPropValue<TypeTag, Properties::UseMoles>()>;
128};
129template<class TypeTag>
130struct ModelTraits<TypeTag, TTag::ThreePThreeC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
131
133template<class TypeTag>
134struct UseConstraintSolver<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = false; };
135
137template<class TypeTag>
138struct ReplaceCompEqIdx<TypeTag, TTag::ThreePThreeC> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); };
145template<class TypeTag>
146struct FluidState<TypeTag, TTag::ThreePThreeC>{
147 private:
150 public:
152};
153
155template<class TypeTag>
156struct LocalResidual<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCLocalResidual<TypeTag>; };
157
159template<class TypeTag>
160struct PrimaryVariables<TypeTag, TTag::ThreePThreeC>
161{
162private:
163 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
165public:
167};
168
170template<class TypeTag>
171struct VolumeVariables<TypeTag, TTag::ThreePThreeC>
172{
173private:
183
185 template<class BaseTraits, class DT, class EDM>
186 struct NCTraits : public BaseTraits
187 {
188 using DiffusionType = DT;
189 using EffectiveDiffusivityModel = EDM;
190 };
191
192public:
194};
195
197template<class TypeTag>
198struct EffectiveDiffusivityModel<TypeTag, TTag::ThreePThreeC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; };
199
201template<class TypeTag>
202struct IOFields<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCIOFields; };
203
205template<class TypeTag>
206struct UseMoles<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = true; };
207
209// Property values for isothermal model required for the general non-isothermal model
211
213template<class TypeTag>
214struct ModelTraits<TypeTag, TTag::ThreePThreeCNI>
215{
216private:
218public:
220};
221
223template<class TypeTag>
224struct VolumeVariables<TypeTag, TTag::ThreePThreeCNI>
225{
226private:
235
239 template<class BaseTraits, class DT, class EDM, class ETCM>
240 struct NCNITraits : public BaseTraits
241 {
242 using DiffusionType = DT;
243 using EffectiveDiffusivityModel = EDM;
244 using EffectiveThermalConductivityModel = ETCM;
245 };
246public:
248};
249
251template<class TypeTag>
252struct IOFields<TypeTag, TTag::ThreePThreeCNI> { using type = EnergyIOFields<ThreePThreeCIOFields>; };
253
255template<class TypeTag>
256struct ThermalConductivityModel<TypeTag, TTag::ThreePThreeCNI> { using type = ThermalConductivitySomerton<GetPropType<TypeTag, Properties::Scalar>>; };
257
258} // end namespace Properties
259} // end namespace Dumux
260
261#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:267
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:58
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/3p3c/model.hh:130
The type tags for the isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/model.hh:109
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/3p3c/model.hh:109
The type tags for the non-isothermal three-phase three-component model.
Definition: porousmediumflow/3p3c/model.hh:111
std::tuple< ThreePThreeC > InheritsFrom
Definition: porousmediumflow/3p3c/model.hh:111
Specifies a number properties of two-phase models.
Definition: porousmediumflow/3p3c/model.hh:90
static constexpr bool useMoles()
Definition: porousmediumflow/3p3c/model.hh:102
static constexpr int numFluidComponents()
Definition: porousmediumflow/3p3c/model.hh:95
static constexpr int numFluidPhases()
Definition: porousmediumflow/3p3c/model.hh:94
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/3p3c/model.hh:98
static constexpr bool useConstraintSolver()
Definition: porousmediumflow/3p3c/model.hh:101
static constexpr bool enableAdvection()
Definition: porousmediumflow/3p3c/model.hh:97
static constexpr int numEq()
Definition: porousmediumflow/3p3c/model.hh:93
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/3p3c/model.hh:99
Traits class for the two-phase model.
Definition: porousmediumflow/3p/model.hh:86
A primary variable vector with a state to allow variable switches.
Relation for the saturation-dependent effective thermal conductivity.