version 3.8
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//
80#ifndef DUMUX_2PNC_MODEL_HH
81#define DUMUX_2PNC_MODEL_HH
82
83#include <dune/common/fvector.hh>
84
86
89
97
98#include "volumevariables.hh"
99#include "iofields.hh"
100#include "indices.hh"
101
102namespace Dumux {
103
112template<int nComp, bool useMol, bool setMoleFractionForFP, TwoPFormulation formulation, int repCompEqIdx = nComp>
114{
116
117 static constexpr int numEq() { return nComp; }
118 static constexpr int numFluidPhases() { return 2; }
119 static constexpr int numFluidComponents() { return nComp; }
120 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
121
122 static constexpr bool enableAdvection() { return true; }
123 static constexpr bool enableMolecularDiffusion() { return true; }
124 static constexpr bool enableEnergyBalance() { return false; }
125 static constexpr bool enableThermalNonEquilibrium() { return false; }
126 static constexpr bool enableChemicalNonEquilibrium() { return false; }
127 static constexpr bool enableCompositionalDispersion() { return false; }
128 static constexpr bool enableThermalDispersion() { return false; }
129
130 static constexpr bool useMoles() { return useMol; }
131 static constexpr bool setMoleFractionsForFirstPhase() { return setMoleFractionForFP; }
132
133 static constexpr TwoPFormulation priVarFormulation() { return formulation; }
134};
135
136namespace Properties {
138// Type tags
140// Create new type tags
141namespace TTag {
142struct TwoPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; };
143struct TwoPNCNI { using InheritsFrom = std::tuple<TwoPNC>; };
144} // end namespace TTag
145
147// Properties for the isothermal 2pnc model
150template<class TypeTag>
151struct PrimaryVariables<TypeTag, TTag::TwoPNC>
152{
153private:
154 using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
156public:
158};
159
161template<class TypeTag>
162struct VolumeVariables<TypeTag, TTag::TwoPNC>
163{
164private:
173 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
174 // class used for scv-wise reconstruction of nonwetting phase saturations
177
180
181 template<class BaseTraits, class DT, class EDM>
182 struct NCTraits : public BaseTraits
183 {
184 using DiffusionType = DT;
185 using EffectiveDiffusivityModel = EDM;
186 };
187
188public:
190};
191
193template<class TypeTag>
194struct BaseModelTraits<TypeTag, TTag::TwoPNC>
195{
196private:
199 static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!");
200public:
201 using type = TwoPNCModelTraits<FluidSystem::numComponents,
202 getPropValue<TypeTag, Properties::UseMoles>(),
203 getPropValue<TypeTag, Properties::SetMoleFractionsForFirstPhase>(),
204 getPropValue<TypeTag, Properties::Formulation>(), getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>;
205};
206template<class TypeTag>
207struct ModelTraits<TypeTag, TTag::TwoPNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; };
208
210template<class TypeTag>
211struct IOFields<TypeTag, TTag::TwoPNC> { using type = TwoPNCIOFields; };
212
213template<class TypeTag>
214struct LocalResidual<TypeTag, TTag::TwoPNC> { using type = CompositionalLocalResidual<TypeTag>; };
215
216template<class TypeTag>
217struct ReplaceCompEqIdx<TypeTag, TTag::TwoPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
218
220template<class TypeTag>
221struct Formulation<TypeTag, TTag::TwoPNC>
222{ static constexpr auto value = TwoPFormulation::p0s1; };
223
224template<class TypeTag>
225struct SetMoleFractionsForFirstPhase<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; };
226template<class TypeTag>
227struct UseMoles<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; };
228
230template<class TypeTag>
231struct EffectiveDiffusivityModel<TypeTag, TTag::TwoPNC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; };
232
234template<class TypeTag>
235struct FluidState<TypeTag, TTag::TwoPNC>
236{
237private:
240public:
242};
243
245// Properties for the non-isothermal 2pnc model
247
249template<class TypeTag>
250struct ModelTraits<TypeTag, TTag::TwoPNCNI>
251{
252private:
254public:
256};
257
259template<class TypeTag>
260struct VolumeVariables<TypeTag, TTag::TwoPNCNI>
261{
262private:
271 static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>();
272 // class used for scv-wise reconstruction of nonwetting phase saturations
275
279
280 template<class BaseTraits, class DT, class EDM, class ETCM>
281 struct NCNITraits : public BaseTraits
282 {
283 using DiffusionType = DT;
284 using EffectiveDiffusivityModel = EDM;
285 using EffectiveThermalConductivityModel = ETCM;
286 };
287public:
289};
290
292template<class TypeTag>
293struct IOFields<TypeTag, TTag::TwoPNCNI> { using type = EnergyIOFields<TwoPNCIOFields>; };
294
296template<class TypeTag>
297struct ThermalConductivityModel<TypeTag, TTag::TwoPNCNI>
298{
299private:
301public:
303};
304
305} // end namespace Properties
306} // end namespace Dumux
307
308#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:296
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:71
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: porousmediumflow/2pnc/model.hh:207
Definition: porousmediumflow/2pnc/model.hh:142
std::tuple< PorousMediumFlow > InheritsFrom
Definition: porousmediumflow/2pnc/model.hh:142
Definition: porousmediumflow/2pnc/model.hh:143
std::tuple< TwoPNC > InheritsFrom
Definition: porousmediumflow/2pnc/model.hh:143
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:114
static constexpr int numFluidPhases()
Definition: porousmediumflow/2pnc/model.hh:118
static constexpr int numEq()
Definition: porousmediumflow/2pnc/model.hh:117
static constexpr int replaceCompEqIdx()
Definition: porousmediumflow/2pnc/model.hh:120
static constexpr bool enableAdvection()
Definition: porousmediumflow/2pnc/model.hh:122
static constexpr bool enableMolecularDiffusion()
Definition: porousmediumflow/2pnc/model.hh:123
static constexpr bool enableThermalNonEquilibrium()
Definition: porousmediumflow/2pnc/model.hh:125
static constexpr int numFluidComponents()
Definition: porousmediumflow/2pnc/model.hh:119
static constexpr bool useMoles()
Definition: porousmediumflow/2pnc/model.hh:130
static constexpr bool enableChemicalNonEquilibrium()
Definition: porousmediumflow/2pnc/model.hh:126
static constexpr TwoPFormulation priVarFormulation()
Definition: porousmediumflow/2pnc/model.hh:133
static constexpr bool enableThermalDispersion()
Definition: porousmediumflow/2pnc/model.hh:128
static constexpr bool enableCompositionalDispersion()
Definition: porousmediumflow/2pnc/model.hh:127
static constexpr bool setMoleFractionsForFirstPhase()
Definition: porousmediumflow/2pnc/model.hh:131
static constexpr bool enableEnergyBalance()
Definition: porousmediumflow/2pnc/model.hh:124
Traits class for the two-phase model.
Definition: porousmediumflow/2p/model.hh:107
A primary variable vector with a state to allow variable switches.