version 3.10-dev
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
65template<int nComp, bool useM, int repCompEqIdx = nComp>
67{
70 static constexpr int numEq() { return nComp; }
71
73 static constexpr int numFluidPhases() { return 1; }
74
76 static constexpr int numFluidComponents() { return nComp; }
77
79 static constexpr bool useMoles() { return useM; }
80
81 // Enable advection
82 static constexpr bool enableAdvection() { return true; }
83
85 static constexpr bool enableEnergyBalance() { return false; }
86
88 static constexpr bool enableMolecularDiffusion() { return true; }
89
91 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
92
94 static constexpr bool usesTurbulenceModel() { return false; }
95
97 static constexpr auto turbulenceModel()
98 { return TurbulenceModel::none; }
99
102};
103
113template<class PV,
114 class FSY,
115 class FST,
116 class MT>
118{
120 using FluidSystem = FSY;
121 using FluidState = FST;
122 using ModelTraits = MT;
123};
124
125// \{
127// properties for the single-phase Navier-Stokes model
129namespace Properties {
130
132// Type tags
134
135// Create new type tags
136namespace TTag {
138struct NavierStokesMassOnePNC{ using InheritsFrom = std::tuple<ModelProperties>; };
139struct NavierStokesMassOnePNCNI{ using InheritsFrom = std::tuple<NavierStokesMassOnePNC>; };
140
141}
142
144template<class TypeTag>
145struct BaseModelTraits<TypeTag, TTag::NavierStokesMassOnePNC>
146{
147private:
149public:
151};
152
153
155template<class TypeTag>
156struct ModelTraits<TypeTag, TTag::NavierStokesMassOnePNC>
158
165 template<class TypeTag>
166 struct FluidState<TypeTag, TTag::NavierStokesMassOnePNC>
167 {
168 private:
172 public:
174 };
175
177template<class TypeTag>
178struct LocalResidual<TypeTag, TTag::NavierStokesMassOnePNC>
180
182template<class TypeTag>
183struct VolumeVariables<TypeTag, TTag::NavierStokesMassOnePNC>
184{
185private:
190
191 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
192 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
193 // static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems.");
194
198
199 template<class BaseTraits, class DT, class EDM>
200 struct NCTraits : public BaseTraits
201 {
202 using DiffusionType = DT;
203 using EffectiveDiffusivityModel = EDM;
204 };
205
206public:
208};
209
211template<class TypeTag>
212struct MolecularDiffusionType<TypeTag, TTag::NavierStokesMassOnePNC> { using type = FicksLaw<TypeTag>; };
213
215template<class TypeTag>
216struct EffectiveDiffusivityModel<TypeTag, TTag::NavierStokesMassOnePNC>
217{
218 struct type
219 {
220 template<class VolumeVariables>
221 static auto effectiveDiffusionCoefficient(const VolumeVariables& volVars,
222 const int phaseIdx,
223 const int compIdxI,
224 const int compIdxJ)
225 {
226 return volVars.diffusionCoefficient(phaseIdx, compIdxI, compIdxJ);
227 }
228 };
229};
230
232template<class TypeTag>
233struct FluxVariables<TypeTag, TTag::NavierStokesMassOnePNC>
234{
237
238 struct FluxTypes
239 {
241 };
242
245
247};
248
249template<class TypeTag>
250struct SolutionDependentMolecularDiffusion<TypeTag, TTag::NavierStokesMassOnePNC> { static constexpr bool value = true; };
251
252
253template<class TypeTag>
254struct FluxVariablesCache<TypeTag, TTag::NavierStokesMassOnePNC>
255{
256 struct type : public GetPropType<TypeTag, Properties::MolecularDiffusionType>::Cache
257 {};
258};
259
260template<class TypeTag>
261struct FluxVariablesCacheFiller<TypeTag, TTag::NavierStokesMassOnePNC>
262{
265 static constexpr bool diffusionIsSolDependent = getPropValue<TypeTag, Properties::SolutionDependentMolecularDiffusion>();
266 static constexpr bool heatConductionIsSolDependent = false; // no heat conduction
267
269};
270
271// ! The specific I/O fields
272template<class TypeTag>
273struct IOFields<TypeTag, TTag::NavierStokesMassOnePNC> { using type = NavierStokesMassOnePNCIOFields<NavierStokesIOFields>; };
274
275template<class TypeTag>
276struct CouplingManager<TypeTag, TTag::NavierStokesMassOnePNC>
277{
278private:
279 struct EmptyCouplingManager {};
280public:
281 using type = EmptyCouplingManager;
282};
283
284// Set the default spatial parameters
285template<class TypeTag>
286struct SpatialParams<TypeTag, TTag::NavierStokesMassOnePNC>
287{
291};
293// Properties for the non-isothermal single phase model
295
297template<class TypeTag>
298struct IOFields<TypeTag, TTag::NavierStokesMassOnePNCNI> { using type = NavierStokesEnergyIOFields<NavierStokesMassOnePNCIOFields<NavierStokesIOFields>>; };
299
301template<class TypeTag>
302struct ModelTraits<TypeTag, TTag::NavierStokesMassOnePNCNI> { using type = NavierStokesEnergyModelTraits<GetPropType<TypeTag, Properties::BaseModelTraits>>; };
303
305template<class TypeTag>
306struct VolumeVariables<TypeTag, TTag::NavierStokesMassOnePNCNI>
307{
308private:
313
314 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
315 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
316 static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems.");
317
319
324
325 struct NCNITraits : public BaseTraits
326 {
327 using DiffusionType = DT;
328 using EffectiveDiffusivityModel = EDM;
329 using EffectiveThermalConductivityModel = ETCM;
330 using HeatConductionType = HCT;
331 };
332
333public:
335};
336
338template<class TypeTag>
339struct ThermalConductivityModel<TypeTag, TTag::NavierStokesMassOnePNCNI>
340{
341 struct type
342 {
343 template<class VolVars>
344 static auto effectiveThermalConductivity(const VolVars& volVars)
345 {
346 return volVars.fluidThermalConductivity();
347 }
348 };
349};
350
351template<class TypeTag>
352struct HeatConductionType<TypeTag, TTag::NavierStokesMassOnePNCNI>
354
356template<class TypeTag>
357struct FluxVariables<TypeTag, TTag::NavierStokesMassOnePNCNI>
358{
361
362 struct FluxTypes
363 {
366 };
367
370
372};
373
374template<class TypeTag>
375struct FluxVariablesCache<TypeTag, TTag::NavierStokesMassOnePNCNI>
376{
377 struct type
378 : public GetPropType<TypeTag, Properties::MolecularDiffusionType>::Cache
379 , public GetPropType<TypeTag, Properties::HeatConductionType>::Cache
380 {};
381};
382
383template<class TypeTag>
384struct FluxVariablesCacheFiller<TypeTag, TTag::NavierStokesMassOnePNCNI>
385{
388 static constexpr bool diffusionIsSolDependent = getPropValue<TypeTag, Properties::SolutionDependentMolecularDiffusion>();
389 static constexpr bool heatConductionIsSolDependent = getPropValue<TypeTag, Properties::SolutionDependentHeatConduction>();
390
392};
393
394template<class TypeTag>
395struct SolutionDependentHeatConduction<TypeTag, TTag::NavierStokesMassOnePNCNI> { static constexpr bool value = true; };
396
397} // end namespace Properties
398
399} // end namespace Dumux
400
401#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:37
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:117
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
Adds I/O fields specific to the FreeflowNC model.
Definition: freeflow/navierstokes/mass/1pnc/iofields.hh:26
The common indices for the isothermal Navier-Stokes mass conservation model.
Definition: freeflow/navierstokes/mass/1pnc/indices.hh:22
Traits for the Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:67
static constexpr bool enableMolecularDiffusion()
The one-phase model has no molecular diffusion.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:88
static constexpr auto turbulenceModel()
return the type of turbulence model used
Definition: freeflow/navierstokes/mass/1pnc/model.hh:97
static constexpr bool enableAdvection()
Definition: freeflow/navierstokes/mass/1pnc/model.hh:82
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:91
static constexpr int numFluidPhases()
The number of phases is 1.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:73
static constexpr bool useMoles()
Use moles or not.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:79
static constexpr bool usesTurbulenceModel()
The model does not include a turbulence model.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:94
static constexpr int numFluidComponents()
The number of components can be freely chosen.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:76
static constexpr bool enableEnergyBalance()
The model is isothermal.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:85
static constexpr int numEq()
Definition: freeflow/navierstokes/mass/1pnc/model.hh:70
Traits class for the volume variables of the Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:118
MT ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:122
FSY FluidSystem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:120
PV PrimaryVariables
Definition: freeflow/navierstokes/mass/1pnc/model.hh:119
FST FluidState
Definition: freeflow/navierstokes/mass/1pnc/model.hh:121
EmptyCouplingManager type
Definition: freeflow/navierstokes/mass/1pnc/model.hh:281
static auto effectiveDiffusionCoefficient(const VolumeVariables &volVars, const int phaseIdx, const int compIdxI, const int compIdxJ)
Definition: freeflow/navierstokes/mass/1pnc/model.hh:221
GetPropType< TypeTag, Properties::MolecularDiffusionType > MolecularDiffusionType
Definition: freeflow/navierstokes/mass/1pnc/model.hh:364
GetPropType< TypeTag, Properties::HeatConductionType > HeatConductionType
Definition: freeflow/navierstokes/mass/1pnc/model.hh:365
GetPropType< TypeTag, Properties::MolecularDiffusionType > MolecularDiffusionType
Definition: freeflow/navierstokes/mass/1pnc/model.hh:240
typename GetPropType< TypeTag, Properties::GridVolumeVariables >::LocalView ElementVolumeVariables
Definition: freeflow/navierstokes/mass/1pnc/model.hh:243
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:236
GetPropType< TypeTag, Properties::Problem > Problem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:235
typename GetPropType< TypeTag, Properties::GridFluxVariablesCache >::LocalView ElementFluxVariablesCache
Definition: freeflow/navierstokes/mass/1pnc/model.hh:244
typename GetPropType< TypeTag, Properties::GridVolumeVariables >::LocalView ElementVolumeVariables
Definition: freeflow/navierstokes/mass/1pnc/model.hh:368
GetPropType< TypeTag, Properties::Problem > Problem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:359
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:360
typename GetPropType< TypeTag, Properties::GridFluxVariablesCache >::LocalView ElementFluxVariablesCache
Definition: freeflow/navierstokes/mass/1pnc/model.hh:369
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:264
GetPropType< TypeTag, Properties::Problem > Problem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:263
GetPropType< TypeTag, Properties::Problem > Problem
Definition: freeflow/navierstokes/mass/1pnc/model.hh:386
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition: freeflow/navierstokes/mass/1pnc/model.hh:387
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition: freeflow/navierstokes/mass/1pnc/model.hh:157
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: freeflow/navierstokes/mass/1pnc/model.hh:288
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: freeflow/navierstokes/mass/1pnc/model.hh:289
The type tag for the single-phase, isothermal Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:138
std::tuple< ModelProperties > InheritsFrom
Definition: freeflow/navierstokes/mass/1pnc/model.hh:138
Definition: freeflow/navierstokes/mass/1pnc/model.hh:139
std::tuple< NavierStokesMassOnePNC > InheritsFrom
Definition: freeflow/navierstokes/mass/1pnc/model.hh:139
static auto effectiveThermalConductivity(const VolVars &volVars)
Definition: freeflow/navierstokes/mass/1pnc/model.hh:344
The available free flow turbulence models in Dumux.