version 3.7
porousmediumflow/2pnc/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//
66#ifndef DUMUX_2PNC_MODEL_HH
67#define DUMUX_2PNC_MODEL_HH
68
69#include <dune/common/fvector.hh>
70
72
75
83
84#include "volumevariables.hh"
85#include "iofields.hh"
86#include "indices.hh"
87
88namespace Dumux {
89
98template<int nComp, bool useMol, bool setMoleFractionForFP, TwoPFormulation formulation, int repCompEqIdx = nComp>
100{
102
103 static constexpr int numEq() { return nComp; }
104 static constexpr int numFluidPhases() { return 2; }
105 static constexpr int numFluidComponents() { return nComp; }
106 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
107
108 static constexpr bool enableAdvection() { return true; }
109 static constexpr bool enableMolecularDiffusion() { return true; }
110 static constexpr bool enableEnergyBalance() { return false; }
111 static constexpr bool enableThermalNonEquilibrium() { return false; }
112 static constexpr bool enableChemicalNonEquilibrium() { return false; }
113 static constexpr bool enableCompositionalDispersion() { return false; }
114 static constexpr bool enableThermalDispersion() { return false; }
115
116 static constexpr bool useMoles() { return useMol; }
117 static constexpr bool setMoleFractionsForFirstPhase() { return setMoleFractionForFP; }
118
119 static constexpr TwoPFormulation priVarFormulation() { return formulation; }
120};
121
122namespace Properties {
124// Type tags
126// Create new type tags
127namespace TTag {
128struct TwoPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
129struct TwoPNCNI { using InheritsFrom = std::tuple<TwoPNC>; };
130} // end namespace TTag
131
133// Properties for the isothermal 2pnc model
136template<class TypeTag>
137struct PrimaryVariables<TypeTag, TTag::TwoPNC>
138{
139private:
140 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
142public:
144};
145
147template<class TypeTag>
148struct VolumeVariables<TypeTag, TTag::TwoPNC>
149{
150private:
159 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
160 // class used for scv-wise reconstruction of nonwetting phase saturations
163
166
167 template<class BaseTraits, class DT, class EDM>
168 struct NCTraits : public BaseTraits
169 {
170 using DiffusionType = DT;
171 using EffectiveDiffusivityModel = EDM;
172 };
173
174public:
176};
177
179template<class TypeTag>
180struct BaseModelTraits<TypeTag, TTag::TwoPNC>
181{
182private:
185 static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!");
186public:
187 using type = TwoPNCModelTraits<FluidSystem::numComponents,
188 getPropValue<TypeTag, Properties::UseMoles>(),
189 getPropValue<TypeTag, Properties::SetMoleFractionsForFirstPhase>(),
190 getPropValue<TypeTag, Properties::Formulation>(), getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
191};
192template<class TypeTag>
193struct ModelTraits<TypeTag, TTag::TwoPNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
194
196template<class TypeTag>
197struct IOFields<TypeTag, TTag::TwoPNC> { using type = TwoPNCIOFields; };
198
199template<class TypeTag>
200struct LocalResidual<TypeTag, TTag::TwoPNC> { using type = CompositionalLocalResidual<TypeTag>; };
201
202template<class TypeTag>
203struct ReplaceCompEqIdx<TypeTag, TTag::TwoPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
204
206template<class TypeTag>
207struct Formulation<TypeTag, TTag::TwoPNC>
208{ static constexpr auto value = TwoPFormulation::p0s1; };
209
210template<class TypeTag>
211struct SetMoleFractionsForFirstPhase<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; };
212template<class TypeTag>
213struct UseMoles<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; };
214
216template<class TypeTag>
217struct EffectiveDiffusivityModel<TypeTag, TTag::TwoPNC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; };
218
220template<class TypeTag>
221struct FluidState<TypeTag, TTag::TwoPNC>
222{
223private:
226public:
228};
229
231// Properties for the non-isothermal 2pnc model
233
235template<class TypeTag>
236struct ModelTraits<TypeTag, TTag::TwoPNCNI>
237{
238private:
240public:
242};
243
245template<class TypeTag>
246struct VolumeVariables<TypeTag, TTag::TwoPNCNI>
247{
248private:
257 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
258 // class used for scv-wise reconstruction of nonwetting phase saturations
261
265
266 template<class BaseTraits, class DT, class EDM, class ETCM>
267 struct NCNITraits : public BaseTraits
268 {
269 using DiffusionType = DT;
270 using EffectiveDiffusivityModel = EDM;
271 using EffectiveThermalConductivityModel = ETCM;
272 };
273public:
275};
276
278template<class TypeTag>
279struct IOFields<TypeTag, TTag::TwoPNCNI> { using type = EnergyIOFields<TwoPNCIOFields>; };
280
282template<class TypeTag>
283struct ThermalConductivityModel<TypeTag, TTag::TwoPNCNI>
284{
285private:
287public:
289};
290
291} // end namespace Properties
292} // end namespace Dumux
293
294#endif
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: compositional.hh:35
Element-wise calculation of the local residual for problems using compositional fully implicit model.
Definition: porousmediumflow/compositional/localresidual.hh:33
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 TwoPNC model.
Definition: porousmediumflow/2pnc/iofields.hh:27
Contains the quantities which are are constant within a finite volume in the two-phase,...
Definition: porousmediumflow/2pnc/volumevariables.hh:46
Class that computes the nonwetting saturation in an scv from the saturation at the global degree of f...
Definition: saturationreconstruction.hh:31
Defines all properties used in Dumux.
Relation for the saturation-dependent effective diffusion coefficient.
Defines an enumeration for the formulations accepted by the two-phase model.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:267
TwoPFormulation
Enumerates the formulations which the two-phase model accepts.
Definition: formulation.hh:23
@ p0s1
first phase pressure and second phase saturation as primary variables
Definition: adapt.hh:17
Element-wise calculation of the local residual for problems using compositional fully implicit 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.
Python wrapper for volume variables (finite volume schemes)
Relation for the saturation-dependent effective thermal conductivity.
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/2pnc/model.hh:193
Definition: porousmediumflow/2pnc/model.hh:128
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/2pnc/model.hh:128
Definition: porousmediumflow/2pnc/model.hh:129
std::tuple< TwoPNC > InheritsFrom
Definition: porousmediumflow/2pnc/model.hh:129
The indices for the isothermal two-phase n-component model.
Definition: porousmediumflow/2pnc/indices.hh:23
Specifies a number properties of two-phase n-component models.
Definition: porousmediumflow/2pnc/model.hh:100
static constexpr int numFluidPhases()
Definition: porousmediumflow/2pnc/model.hh:104
static constexpr int numEq()
Definition: porousmediumflow/2pnc/model.hh:103
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/2pnc/model.hh:106
static constexpr bool enableAdvection()
Definition: porousmediumflow/2pnc/model.hh:108
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/2pnc/model.hh:109
static constexpr bool enableThermalNonEquilibrium()
Definition: porousmediumflow/2pnc/model.hh:111
static constexpr int numFluidComponents()
Definition: porousmediumflow/2pnc/model.hh:105
static constexpr bool useMoles()
Definition: porousmediumflow/2pnc/model.hh:116
static constexpr bool enableChemicalNonEquilibrium()
Definition: porousmediumflow/2pnc/model.hh:112
static constexpr TwoPFormulation priVarFormulation()
Definition: porousmediumflow/2pnc/model.hh:119
static constexpr bool enableThermalDispersion()
Definition: porousmediumflow/2pnc/model.hh:114
static constexpr bool enableCompositionalDispersion()
Definition: porousmediumflow/2pnc/model.hh:113
static constexpr bool setMoleFractionsForFirstPhase()
Definition: porousmediumflow/2pnc/model.hh:117
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/2pnc/model.hh:110
Traits class for the two-phase model.
Definition: porousmediumflow/2p/model.hh:97
A primary variable vector with a state to allow variable switches.