version 3.8
freeflow/navierstokes/mass/1p/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//
34#ifndef DUMUX_FREEFLOW_NAVIERSTOKES_1P_MODEL_HH
35#define DUMUX_FREEFLOW_NAVIERSTOKES_1P_MODEL_HH
36
39
41
47
49
50#include "localresidual.hh"
51#include "volumevariables.hh"
52#include "fluxvariables.hh"
53#include "indices.hh"
54
55namespace Dumux {
56
62{
65 static constexpr int numEq() { return 1; }
66
68 static constexpr int numFluidPhases() { return 1; }
69
71 static constexpr int numFluidComponents() { return 1; }
72
74 static constexpr bool enableAdvection() { return true; }
75
77 static constexpr bool enableMolecularDiffusion() { return false; }
78
80 static constexpr bool enableEnergyBalance() { return false; }
81
83 static constexpr bool usesTurbulenceModel() { return false; }
84
86 static constexpr auto turbulenceModel()
87 { return TurbulenceModel::none; }
88
91};
92
102template<class PV,
103 class FSY,
104 class FST,
105 class MT>
107{
109 using FluidSystem = FSY;
110 using FluidState = FST;
111 using ModelTraits = MT;
112};
113
114// \{
116// properties for the single-phase Navier-Stokes model
118namespace Properties {
119
121// Type tags
123
124// Create new type tags
125namespace TTag {
127struct NavierStokesMassOneP{ using InheritsFrom = std::tuple<ModelProperties>; };
128struct NavierStokesMassOnePNI{ using InheritsFrom = std::tuple<NavierStokesMassOneP>; };
129} // end namespace TTag
130
131
132template<class TypeTag>
133struct ModelTraits<TypeTag, TTag::NavierStokesMassOneP>
135
142template<class TypeTag>
143struct FluidState<TypeTag, TTag::NavierStokesMassOneP>
144{
145private:
148public:
150};
151
153template<class TypeTag>
154struct LocalResidual<TypeTag, TTag::NavierStokesMassOneP>
156
158template<class TypeTag>
159struct VolumeVariables<TypeTag, TTag::NavierStokesMassOneP>
160{
161private:
166
167 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
168 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
169 static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems.");
170
172public:
174};
175
177template<class TypeTag>
178struct FluxVariables<TypeTag, TTag::NavierStokesMassOneP>
179{
180private:
183 struct DiffusiveFluxTypes {}; // no diffusion
184 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
185 using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView;
186public:
188 Problem, ModelTraits, DiffusiveFluxTypes, ElementVolumeVariables, ElementFluxVariablesCache
189 >;
190};
191
192// ! The specific I/O fields
193template<class TypeTag>
194struct IOFields<TypeTag, TTag::NavierStokesMassOneP> { using type = NavierStokesIOFields; };
195
196template<class TypeTag>
197struct CouplingManager<TypeTag, TTag::NavierStokesMassOneP>
198{
199public:
200 using type = struct EmptyCouplingManager {};
201};
202
203// Set the default spatial parameters
204template<class TypeTag>
205struct SpatialParams<TypeTag, TTag::NavierStokesMassOneP>
206{
210};
212// Properties for the non-isothermal single phase model
214
216template<class TypeTag>
217struct IOFields<TypeTag, TTag::NavierStokesMassOnePNI>
219
221template<class TypeTag>
222struct ModelTraits<TypeTag, TTag::NavierStokesMassOnePNI>
224
226template<class TypeTag>
227struct VolumeVariables<TypeTag, TTag::NavierStokesMassOnePNI>
228{
229private:
234
235 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
236 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
237 static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems.");
238
242 struct NITraits : public BaseTraits
243 {
244 using EffectiveThermalConductivityModel = ETCM;
245 using HeatConductionType = HCT;
246 };
247public:
249};
250
252template<class TypeTag>
253struct ThermalConductivityModel<TypeTag, TTag::NavierStokesMassOnePNI>
254{
255 struct type
256 {
257 template<class VolVars>
258 static auto effectiveThermalConductivity(const VolVars& volVars)
259 {
260 return volVars.fluidThermalConductivity();
261 }
262 };
263};
264
265template<class TypeTag>
266struct HeatConductionType<TypeTag, TTag::NavierStokesMassOnePNI>
268
270template<class TypeTag>
271struct FluxVariables<TypeTag, TTag::NavierStokesMassOnePNI>
272{
273private:
276
277 struct DiffusiveFluxTypes
278 {
280 };
281
282 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
283 using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView;
284
285public:
287 Problem, ModelTraits, DiffusiveFluxTypes, ElementVolumeVariables, ElementFluxVariablesCache
288 >;
289};
290
291template<class TypeTag>
292struct FluxVariablesCache<TypeTag, TTag::NavierStokesMassOnePNI>
293{
294 struct type : public GetPropType<TypeTag, Properties::HeatConductionType>::Cache
295 {};
296};
297
298template<class TypeTag>
299struct FluxVariablesCacheFiller<TypeTag, TTag::NavierStokesMassOnePNI>
300{
303 static constexpr bool diffusionIsSolDependent = false; // no diffusion;
304 static constexpr bool heatConductionIsSolDependent
305 = getPropValue<TypeTag, Properties::SolutionDependentHeatConduction>();
306
308 Problem, ModelTraits, diffusionIsSolDependent, heatConductionIsSolDependent
309 >;
310};
311
312template<class TypeTag>
313struct SolutionDependentHeatConduction<TypeTag, TTag::NavierStokesMassOnePNI>
314{ static constexpr bool value = true; };
315
316} // end namespace Properties
317} // end namespace Dumux
318
319#endif
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/fourierslaw.hh:26
Definition of the spatial parameters for the freeflow problems.
Definition: freeflow/spatialparams.hh:42
Definition: scalarfluxvariablescachefiller.hh:27
Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility...
Definition: immiscible.hh:30
Adds I/O fields for the Navier-Stokes model.
Definition: freeflow/navierstokes/iofields.hh:67
The flux variables class for the single-phase flow Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1p/fluxvariables.hh:39
Element-wise calculation of the Navier-Stokes residual for single-phase flow.
Definition: freeflow/navierstokes/mass/1p/localresidual.hh:38
Volume variables for the single-phase Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1p/volumevariables.hh:29
Defines a type tags and some fundamental properties for all models.
Defines all properties used in Dumux.
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
Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility...
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.
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
Traits for the single-phase flow Navier-Stokes mass model.
Definition: freeflow/navierstokes/mass/1p/model.hh:62
static constexpr bool enableMolecularDiffusion()
The one-phase model has no molecular diffusion.
Definition: freeflow/navierstokes/mass/1p/model.hh:77
static constexpr auto turbulenceModel()
return the type of turbulence model used
Definition: freeflow/navierstokes/mass/1p/model.hh:86
static constexpr bool enableAdvection()
Enable advection.
Definition: freeflow/navierstokes/mass/1p/model.hh:74
static constexpr bool usesTurbulenceModel()
The model does not include a turbulence model.
Definition: freeflow/navierstokes/mass/1p/model.hh:83
static constexpr int numFluidComponents()
The number of components is 1.
Definition: freeflow/navierstokes/mass/1p/model.hh:71
static constexpr bool enableEnergyBalance()
The model is isothermal.
Definition: freeflow/navierstokes/mass/1p/model.hh:80
static constexpr int numEq()
Definition: freeflow/navierstokes/mass/1p/model.hh:65
static constexpr int numFluidPhases()
The number of phases is 1.
Definition: freeflow/navierstokes/mass/1p/model.hh:68
Traits class for the volume variables of the Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1p/model.hh:107
FST FluidState
Definition: freeflow/navierstokes/mass/1p/model.hh:110
PV PrimaryVariables
Definition: freeflow/navierstokes/mass/1p/model.hh:108
FSY FluidSystem
Definition: freeflow/navierstokes/mass/1p/model.hh:109
MT ModelTraits
Definition: freeflow/navierstokes/mass/1p/model.hh:111
EmptyCouplingManager {} type
Definition: freeflow/navierstokes/mass/1p/model.hh:200
GetPropType< TypeTag, Properties::Problem > Problem
Definition: freeflow/navierstokes/mass/1p/model.hh:301
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition: freeflow/navierstokes/mass/1p/model.hh:302
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: freeflow/navierstokes/mass/1p/model.hh:207
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: freeflow/navierstokes/mass/1p/model.hh:208
The type tag for the single-phase, isothermal Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1p/model.hh:127
std::tuple< ModelProperties > InheritsFrom
Definition: freeflow/navierstokes/mass/1p/model.hh:127
Definition: freeflow/navierstokes/mass/1p/model.hh:128
std::tuple< NavierStokesMassOneP > InheritsFrom
Definition: freeflow/navierstokes/mass/1p/model.hh:128
static auto effectiveThermalConductivity(const VolVars &volVars)
Definition: freeflow/navierstokes/mass/1p/model.hh:258
The available free flow turbulence models in Dumux.