version 3.8
freeflow/navierstokes/mass/1pnc/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//
36#ifndef DUMUX_NAVIERSTOKES_1PNC_MODEL_HH
37#define DUMUX_NAVIERSTOKES_1PNC_MODEL_HH
38
41
48
51
52#include "localresidual.hh"
53#include "volumevariables.hh"
54#include "fluxvariables.hh"
55#include "indices.hh"
56#include "iofields.hh"
57
58namespace Dumux {
59
66template<int nComp, bool useM, int repCompEqIdx = nComp>
68{
71 static constexpr int numEq() { return nComp; }
72
74 static constexpr int numFluidPhases() { return 1; }
75
77 static constexpr int numFluidComponents() { return nComp; }
78
80 static constexpr bool useMoles() { return useM; }
81
82 // Enable advection
83 static constexpr bool enableAdvection() { return true; }
84
86 static constexpr bool enableEnergyBalance() { return false; }
87
89 static constexpr bool enableMolecularDiffusion() { return true; }
90
92 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
93
95 static constexpr bool usesTurbulenceModel() { return false; }
96
98 static constexpr auto turbulenceModel()
99 { return TurbulenceModel::none; }
100
103};
104
114template<class PV,
115 class FSY,
116 class FST,
117 class MT>
119{
121 using FluidSystem = FSY;
122 using FluidState = FST;
123 using ModelTraits = MT;
124};
125
126// \{
128// properties for the single-phase Navier-Stokes model
130namespace Properties {
131
133// Type tags
135
136// Create new type tags
137namespace TTag {
139struct NavierStokesMassOnePNC{ using InheritsFrom = std::tuple<ModelProperties>; };
140struct NavierStokesMassOnePNCNI{ using InheritsFrom = std::tuple<NavierStokesMassOnePNC>; };
141
142}
143
145template<class TypeTag>
146struct BaseModelTraits<TypeTag, TTag::NavierStokesMassOnePNC>
147{
148private:
150public:
152};
153
154
156template<class TypeTag>
157struct ModelTraits<TypeTag, TTag::NavierStokesMassOnePNC>
159
166 template<class TypeTag>
167 struct FluidState<TypeTag, TTag::NavierStokesMassOnePNC>
168 {
169 private:
173 public:
175 };
176
178template<class TypeTag>
179struct LocalResidual<TypeTag, TTag::NavierStokesMassOnePNC>
181
183template<class TypeTag>
184struct VolumeVariables<TypeTag, TTag::NavierStokesMassOnePNC>
185{
186private:
191
192 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
193 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
194 // static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems.");
195
199
200 template<class BaseTraits, class DT, class EDM>
201 struct NCTraits : public BaseTraits
202 {
203 using DiffusionType = DT;
204 using EffectiveDiffusivityModel = EDM;
205 };
206
207public:
209};
210
212template<class TypeTag>
213struct MolecularDiffusionType<TypeTag, TTag::NavierStokesMassOnePNC> { using type = FicksLaw<TypeTag>; };
214
216template<class TypeTag>
217struct EffectiveDiffusivityModel<TypeTag, TTag::NavierStokesMassOnePNC>
218{
219 struct type
220 {
221 template<class VolumeVariables>
222 static auto effectiveDiffusionCoefficient(const VolumeVariables& volVars,
223 const int phaseIdx,
224 const int compIdxI,
225 const int compIdxJ)
226 {
227 return volVars.diffusionCoefficient(phaseIdx, compIdxI, compIdxJ);
228 }
229 };
230};
231
233template<class TypeTag>
234struct FluxVariables<TypeTag, TTag::NavierStokesMassOnePNC>
235{
238
239 struct FluxTypes
240 {
242 };
243
246
248};
249
250template<class TypeTag>
251struct SolutionDependentMolecularDiffusion<TypeTag, TTag::NavierStokesMassOnePNC> { static constexpr bool value = true; };
252
253
254template<class TypeTag>
255struct FluxVariablesCache<TypeTag, TTag::NavierStokesMassOnePNC>
256{
257 struct type : public GetPropType<TypeTag, Properties::MolecularDiffusionType>::Cache
258 {};
259};
260
261template<class TypeTag>
262struct FluxVariablesCacheFiller<TypeTag, TTag::NavierStokesMassOnePNC>
263{
266 static constexpr bool diffusionIsSolDependent = getPropValue<TypeTag, Properties::SolutionDependentMolecularDiffusion>();
267 static constexpr bool heatConductionIsSolDependent = false; // no heat conduction
268
270};
271
272// ! The specific I/O fields
273template<class TypeTag>
274struct IOFields<TypeTag, TTag::NavierStokesMassOnePNC> { using type = NavierStokesMassOnePNCIOFields<NavierStokesIOFields>; };
275
276template<class TypeTag>
277struct CouplingManager<TypeTag, TTag::NavierStokesMassOnePNC>
278{
279private:
280 struct EmptyCouplingManager {};
281public:
282 using type = EmptyCouplingManager;
283};
284
285// Set the default spatial parameters
286template<class TypeTag>
287struct SpatialParams<TypeTag, TTag::NavierStokesMassOnePNC>
288{
292};
294// Properties for the non-isothermal single phase model
296
298template<class TypeTag>
299struct IOFields<TypeTag, TTag::NavierStokesMassOnePNCNI> { using type = NavierStokesEnergyIOFields<NavierStokesMassOnePNCIOFields<NavierStokesIOFields>>; };
300
302template<class TypeTag>
303struct ModelTraits<TypeTag, TTag::NavierStokesMassOnePNCNI> { using type = NavierStokesEnergyModelTraits<GetPropType<TypeTag, Properties::BaseModelTraits>>; };
304
306template<class TypeTag>
307struct VolumeVariables<TypeTag, TTag::NavierStokesMassOnePNCNI>
308{
309private:
314
315 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
316 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
317 static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems.");
318
320
325
326 struct NCNITraits : public BaseTraits
327 {
328 using DiffusionType = DT;
329 using EffectiveDiffusivityModel = EDM;
330 using EffectiveThermalConductivityModel = ETCM;
331 using HeatConductionType = HCT;
332 };
333
334public:
336};
337
339template<class TypeTag>
340struct ThermalConductivityModel<TypeTag, TTag::NavierStokesMassOnePNCNI>
341{
342 struct type
343 {
344 template<class VolVars>
345 static auto effectiveThermalConductivity(const VolVars& volVars)
346 {
347 return volVars.fluidThermalConductivity();
348 }
349 };
350};
351
352template<class TypeTag>
353struct HeatConductionType<TypeTag, TTag::NavierStokesMassOnePNCNI>
355
357template<class TypeTag>
358struct FluxVariables<TypeTag, TTag::NavierStokesMassOnePNCNI>
359{
362
363 struct FluxTypes
364 {
367 };
368
371
373};
374
375template<class TypeTag>
376struct FluxVariablesCache<TypeTag, TTag::NavierStokesMassOnePNCNI>
377{
378 struct type
379 : public GetPropType<TypeTag, Properties::MolecularDiffusionType>::Cache
380 , public GetPropType<TypeTag, Properties::HeatConductionType>::Cache
381 {};
382};
383
384template<class TypeTag>
385struct FluxVariablesCacheFiller<TypeTag, TTag::NavierStokesMassOnePNCNI>
386{
389 static constexpr bool diffusionIsSolDependent = getPropValue<TypeTag, Properties::SolutionDependentMolecularDiffusion>();
390 static constexpr bool heatConductionIsSolDependent = getPropValue<TypeTag, Properties::SolutionDependentHeatConduction>();
391
393};
394
395template<class TypeTag>
396struct SolutionDependentHeatConduction<TypeTag, TTag::NavierStokesMassOnePNCNI> { static constexpr bool value = true; };
397
398} // end namespace Properties
399
400} // end namespace Dumux
401
402#endif // DUMUX_NAVIERSTOKES_MODEL_HH
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: compositional.hh:35
The interface of the coupling manager for multi domain problems.
Definition: multidomain/couplingmanager.hh:48
forward declaration of the method-specific implementation
Definition: flux/box/fickslaw.hh:32
forward declaration of the method-specific implementation
Definition: flux/box/fourierslaw.hh:26
Definition of the spatial parameters for the freeflow problems.
Definition: freeflow/spatialparams.hh:42
Definition: scalarfluxvariablescachefiller.hh:27
The flux variables class for the single-phase flow, multi-component Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1pnc/fluxvariables.hh:42
Element-wise calculation of the Navier-Stokes residual for multicomponent single-phase flow.
Definition: freeflow/navierstokes/mass/1pnc/localresidual.hh:27
Volume variables for the single-phase Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1pnc/volumevariables.hh:29
Defines a type tags and some fundamental properties for all models.
Defines all properties used in Dumux.
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Diffusive mass flux according to Fick's law.
Diffusive heat flux according to Fourier's law.
A single-phase, non-isothermal free-flow model.
Definition of the spatial parameters for the freeflow problems.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
Definition: adapt.hh:17
Base class for the flux variables in porous medium models.
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)
A helper class to fill the flux variables cache.
Adds I/O fields specific to non-isothermal free-flow models.
Definition: freeflow/navierstokes/energy/iofields.hh:25
Specifies a number properties of non-isothermal free-flow flow models based on the specifics of a giv...
Definition: freeflow/navierstokes/energy/model.hh:47
The common indices for the isothermal Navier-Stokes mass conservation model.
Definition: freeflow/navierstokes/mass/1p/indices.hh:22
Adds I/O fields specific to the FreeflowNC model.
Definition: freeflow/navierstokes/mass/1pnc/iofields.hh:26
Traits for the Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:68
static constexpr bool enableMolecularDiffusion()
The one-phase model has no molecular diffusion.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:89
static constexpr auto turbulenceModel()
return the type of turbulence model used
Definition: freeflow/navierstokes/mass/1pnc/model.hh:98
static constexpr bool enableAdvection()
Definition: freeflow/navierstokes/mass/1pnc/model.hh:83
static constexpr int replaceCompEqIdx()
Index of of a component balance eq. to be replaced by a total mass/mole balance.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:92
static constexpr int numFluidPhases()
The number of phases is 1.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:74
static constexpr bool useMoles()
Use moles or not.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:80
static constexpr bool usesTurbulenceModel()
The model does not include a turbulence model.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:95
static constexpr int numFluidComponents()
The number of components is 1.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:77
static constexpr bool enableEnergyBalance()
The model is isothermal.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:86
static constexpr int numEq()
Definition: freeflow/navierstokes/mass/1pnc/model.hh:71
Traits class for the volume variables of the Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:119
MT ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:123
FSY FluidSystem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:121
PV PrimaryVariables
Definition: freeflow/navierstokes/mass/1pnc/model.hh:120
FST FluidState
Definition: freeflow/navierstokes/mass/1pnc/model.hh:122
EmptyCouplingManager type
Definition: freeflow/navierstokes/mass/1pnc/model.hh:282
static auto effectiveDiffusionCoefficient(const VolumeVariables &volVars, const int phaseIdx, const int compIdxI, const int compIdxJ)
Definition: freeflow/navierstokes/mass/1pnc/model.hh:222
GetPropType< TypeTag, Properties::MolecularDiffusionType > MolecularDiffusionType
Definition: freeflow/navierstokes/mass/1pnc/model.hh:365
GetPropType< TypeTag, Properties::HeatConductionType > HeatConductionType
Definition: freeflow/navierstokes/mass/1pnc/model.hh:366
GetPropType< TypeTag, Properties::MolecularDiffusionType > MolecularDiffusionType
Definition: freeflow/navierstokes/mass/1pnc/model.hh:241
typename GetPropType< TypeTag, Properties::GridVolumeVariables >::LocalView ElementVolumeVariables
Definition: freeflow/navierstokes/mass/1pnc/model.hh:244
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:237
GetPropType< TypeTag, Properties::Problem > Problem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:236
typename GetPropType< TypeTag, Properties::GridFluxVariablesCache >::LocalView ElementFluxVariablesCache
Definition: freeflow/navierstokes/mass/1pnc/model.hh:245
typename GetPropType< TypeTag, Properties::GridVolumeVariables >::LocalView ElementVolumeVariables
Definition: freeflow/navierstokes/mass/1pnc/model.hh:369
GetPropType< TypeTag, Properties::Problem > Problem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:360
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:361
typename GetPropType< TypeTag, Properties::GridFluxVariablesCache >::LocalView ElementFluxVariablesCache
Definition: freeflow/navierstokes/mass/1pnc/model.hh:370
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:265
GetPropType< TypeTag, Properties::Problem > Problem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:264
GetPropType< TypeTag, Properties::Problem > Problem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:387
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:388
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: freeflow/navierstokes/mass/1pnc/model.hh:158
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: freeflow/navierstokes/mass/1pnc/model.hh:289
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: freeflow/navierstokes/mass/1pnc/model.hh:290
The type tag for the single-phase, isothermal Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:139
std::tuple< ModelProperties > InheritsFrom
Definition: freeflow/navierstokes/mass/1pnc/model.hh:139
Definition: freeflow/navierstokes/mass/1pnc/model.hh:140
std::tuple< NavierStokesMassOnePNC > InheritsFrom
Definition: freeflow/navierstokes/mass/1pnc/model.hh:140
static auto effectiveThermalConductivity(const VolVars &volVars)
Definition: freeflow/navierstokes/mass/1pnc/model.hh:345
The available free flow turbulence models in Dumux.