version 3.11-dev
Loading...
Searching...
No Matches
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-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
35
36#ifndef DUMUX_NAVIERSTOKES_1PNC_MODEL_HH
37#define DUMUX_NAVIERSTOKES_1PNC_MODEL_HH
38
41
47
50
51#include "localresidual.hh"
52#include "volumevariables.hh"
53#include "fluxvariables.hh"
54#include "indices.hh"
55#include "iofields.hh"
56
57namespace Dumux {
58
64template<int nComp, bool useM, int repCompEqIdx = nComp>
66{
69 static constexpr int numEq() { return nComp; }
70
72 static constexpr int numFluidPhases() { return 1; }
73
75 static constexpr int numFluidComponents() { return nComp; }
76
78 static constexpr bool useMoles() { return useM; }
79
80 // Enable advection
81 static constexpr bool enableAdvection() { return true; }
82
84 static constexpr bool enableEnergyBalance() { return false; }
85
87 static constexpr bool enableMolecularDiffusion() { return true; }
88
90 static constexpr int replaceCompEqIdx() { return repCompEqIdx; }
91
94};
95
105template<class PV,
106 class FSY,
107 class FST,
108 class MT>
116
117// \{
119// properties for the single-phase Navier-Stokes model
121namespace Properties {
122
124// Type tags
126
127// Create new type tags
128namespace TTag {
130struct NavierStokesMassOnePNC{ using InheritsFrom = std::tuple<ModelProperties>; };
131struct NavierStokesMassOnePNCNI{ using InheritsFrom = std::tuple<NavierStokesMassOnePNC>; };
132
133}
134
136template<class TypeTag>
144
145
147template<class TypeTag>
148struct ModelTraits<TypeTag, TTag::NavierStokesMassOnePNC>
150
157 template<class TypeTag>
158 struct FluidState<TypeTag, TTag::NavierStokesMassOnePNC>
159 {
160 private:
164 public:
166 };
167
169template<class TypeTag>
170struct LocalResidual<TypeTag, TTag::NavierStokesMassOnePNC>
172
174template<class TypeTag>
175struct VolumeVariables<TypeTag, TTag::NavierStokesMassOnePNC>
176{
177private:
182
183 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
184 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
185 // static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems.");
186
190
191 template<class BaseTraits, class DT, class EDM>
192 struct NCTraits : public BaseTraits
193 {
194 using DiffusionType = DT;
195 using EffectiveDiffusivityModel = EDM;
196 };
197
198public:
200};
201
203template<class TypeTag>
204struct MolecularDiffusionType<TypeTag, TTag::NavierStokesMassOnePNC> { using type = FicksLaw<TypeTag>; };
205
207template<class TypeTag>
208struct EffectiveDiffusivityModel<TypeTag, TTag::NavierStokesMassOnePNC>
209{
210 struct type
211 {
212 template<class VolumeVariables>
213 static auto effectiveDiffusionCoefficient(const VolumeVariables& volVars,
214 const int phaseIdx,
215 const int compIdxI,
216 const int compIdxJ)
217 {
218 return volVars.diffusionCoefficient(phaseIdx, compIdxI, compIdxJ);
219 }
220 };
221};
222
224template<class TypeTag>
240
241template<class TypeTag>
242struct SolutionDependentMolecularDiffusion<TypeTag, TTag::NavierStokesMassOnePNC> { static constexpr bool value = true; };
243
244
245template<class TypeTag>
246struct FluxVariablesCache<TypeTag, TTag::NavierStokesMassOnePNC>
247{
248 struct type : public GetPropType<TypeTag, Properties::MolecularDiffusionType>::Cache
249 {};
250};
251
252template<class TypeTag>
262
263// ! The specific I/O fields
264template<class TypeTag>
265struct IOFields<TypeTag, TTag::NavierStokesMassOnePNC> { using type = NavierStokesMassOnePNCIOFields<NavierStokesMassOnePIOFields>; };
266
267template<class TypeTag>
268struct CouplingManager<TypeTag, TTag::NavierStokesMassOnePNC>
269{
270private:
271 struct EmptyCouplingManager {};
272public:
273 using type = EmptyCouplingManager;
274};
275
276// Set the default spatial parameters
277template<class TypeTag>
284
285// Properties for the non-isothermal single phase model
287
289template<class TypeTag>
290struct IOFields<TypeTag, TTag::NavierStokesMassOnePNCNI> { using type = NavierStokesEnergyIOFields<NavierStokesMassOnePNCIOFields<NavierStokesMassOnePIOFields>>; };
291
293template<class TypeTag>
294struct ModelTraits<TypeTag, TTag::NavierStokesMassOnePNCNI> { using type = NavierStokesEnergyModelTraits<GetPropType<TypeTag, Properties::BaseModelTraits>>; };
295
297template<class TypeTag>
298struct VolumeVariables<TypeTag, TTag::NavierStokesMassOnePNCNI>
299{
300private:
305
306 static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
307 static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
308 static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems.");
309
311
316
317 struct NCNITraits : public BaseTraits
318 {
319 using DiffusionType = DT;
320 using EffectiveDiffusivityModel = EDM;
321 using EffectiveThermalConductivityModel = ETCM;
322 using HeatConductionType = HCT;
323 };
324
325public:
327};
328
330template<class TypeTag>
331struct ThermalConductivityModel<TypeTag, TTag::NavierStokesMassOnePNCNI>
332{
333 struct type
334 {
335 template<class VolVars>
336 static auto effectiveThermalConductivity(const VolVars& volVars)
337 {
338 return volVars.fluidThermalConductivity();
339 }
340 };
341};
342
343template<class TypeTag>
344struct HeatConductionType<TypeTag, TTag::NavierStokesMassOnePNCNI>
346
348template<class TypeTag>
365
366template<class TypeTag>
367struct FluxVariablesCache<TypeTag, TTag::NavierStokesMassOnePNCNI>
368{
369 struct type
370 : public GetPropType<TypeTag, Properties::MolecularDiffusionType>::Cache
371 , public GetPropType<TypeTag, Properties::HeatConductionType>::Cache
372 {};
373};
374
375template<class TypeTag>
385
386template<class TypeTag>
387struct SolutionDependentHeatConduction<TypeTag, TTag::NavierStokesMassOnePNCNI> { static constexpr bool value = true; };
388
389} // end namespace Properties
390
391} // end namespace Dumux
392
393#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
Definition of the spatial parameters for the freeflow problems.
Definition freeflow/spatialparams.hh:117
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:29
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.
Adds I/O fields for the Navier-Stokes model.
The flux variables class for the single-phase flow, multi-component Navier-Stokes model.
The common indices for the isothermal Navier-Stokes mass conservation model.
Adds I/O fields specific to the FreeflowNC model.
Element-wise calculation of the Navier-Stokes residual for multicomponent single-phase flow.
Volume variables for the single-phase Navier-Stokes model.
Definition of the spatial parameters for the freeflow problems.
FicksLawImplementation< TypeTag, typename GetPropType< TypeTag, Properties::GridGeometry >::DiscretizationMethod, referenceSystem > FicksLaw
Evaluates the diffusive mass flux according to Fick's law.
Definition fickslaw_fwd.hh:33
FouriersLawImplementation< TypeTag, typename GetPropType< TypeTag, Properties::GridGeometry >::DiscretizationMethod > FouriersLaw
Evaluates the heat conduction flux according to Fouriers's law.
Definition fourierslaw_fwd.hh:31
FreeFlowScalarFluxVariablesCacheFillerImplementation< Problem, ModelTraits, diffusionIsSolDependent, heatConductionIsSolDependent, typename ProblemTraits< Problem >::GridGeometry::DiscretizationMethod > FreeFlowScalarFluxVariablesCacheFiller
The flux variables cache filler class for free flow.
Definition scalarfluxvariablescachefiller.hh:36
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:310
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
Type tag for numeric models.
Definition grid.hh:24
The energy balance equation for a porous solid.
Definition common/properties.hh:26
Definition adapt.hh:17
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:55
Adds I/O fields specific to the FreeflowNC model.
Definition freeflow/navierstokes/mass/1pnc/iofields.hh:25
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:66
static constexpr bool enableMolecularDiffusion()
The one-phase model has no molecular diffusion.
Definition freeflow/navierstokes/mass/1pnc/model.hh:87
static constexpr bool enableAdvection()
Definition freeflow/navierstokes/mass/1pnc/model.hh:81
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:90
static constexpr int numFluidPhases()
The number of phases is 1.
Definition freeflow/navierstokes/mass/1pnc/model.hh:72
static constexpr bool useMoles()
Use moles or not.
Definition freeflow/navierstokes/mass/1pnc/model.hh:78
static constexpr int numFluidComponents()
The number of components can be freely chosen.
Definition freeflow/navierstokes/mass/1pnc/model.hh:75
NavierStokesMassOnePNCIndices Indices
the indices
Definition freeflow/navierstokes/mass/1pnc/model.hh:93
static constexpr bool enableEnergyBalance()
The model is isothermal.
Definition freeflow/navierstokes/mass/1pnc/model.hh:84
static constexpr int numEq()
Definition freeflow/navierstokes/mass/1pnc/model.hh:69
Traits class for the volume variables of the Navier-Stokes model.
Definition freeflow/navierstokes/mass/1pnc/model.hh:110
MT ModelTraits
Definition freeflow/navierstokes/mass/1pnc/model.hh:114
FSY FluidSystem
Definition freeflow/navierstokes/mass/1pnc/model.hh:112
PV PrimaryVariables
Definition freeflow/navierstokes/mass/1pnc/model.hh:111
FST FluidState
Definition freeflow/navierstokes/mass/1pnc/model.hh:113
NavierStokesMassOnePNCModelTraits< FluidSystem::numComponents, getPropValue< TypeTag, Properties::UseMoles >(), getPropValue< TypeTag, Properties::ReplaceCompEqIdx >()> type
Definition freeflow/navierstokes/mass/1pnc/model.hh:142
EmptyCouplingManager type
Definition freeflow/navierstokes/mass/1pnc/model.hh:273
static auto effectiveDiffusionCoefficient(const VolumeVariables &volVars, const int phaseIdx, const int compIdxI, const int compIdxJ)
Definition freeflow/navierstokes/mass/1pnc/model.hh:213
CompositionalFluidState< Scalar, FluidSystem > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:165
GetPropType< TypeTag, Properties::MolecularDiffusionType > MolecularDiffusionType
Definition freeflow/navierstokes/mass/1pnc/model.hh:356
GetPropType< TypeTag, Properties::HeatConductionType > HeatConductionType
Definition freeflow/navierstokes/mass/1pnc/model.hh:357
GetPropType< TypeTag, Properties::MolecularDiffusionType > MolecularDiffusionType
Definition freeflow/navierstokes/mass/1pnc/model.hh:232
typename GetPropType< TypeTag, Properties::GridVolumeVariables >::LocalView ElementVolumeVariables
Definition freeflow/navierstokes/mass/1pnc/model.hh:235
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition freeflow/navierstokes/mass/1pnc/model.hh:228
GetPropType< TypeTag, Properties::Problem > Problem
Definition freeflow/navierstokes/mass/1pnc/model.hh:227
NavierStokesMassOnePNCFluxVariables< Problem, ModelTraits, FluxTypes, ElementVolumeVariables, ElementFluxVariablesCache > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:238
typename GetPropType< TypeTag, Properties::GridFluxVariablesCache >::LocalView ElementFluxVariablesCache
Definition freeflow/navierstokes/mass/1pnc/model.hh:236
typename GetPropType< TypeTag, Properties::GridVolumeVariables >::LocalView ElementVolumeVariables
Definition freeflow/navierstokes/mass/1pnc/model.hh:360
GetPropType< TypeTag, Properties::Problem > Problem
Definition freeflow/navierstokes/mass/1pnc/model.hh:351
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition freeflow/navierstokes/mass/1pnc/model.hh:352
NavierStokesMassOnePNCFluxVariables< Problem, ModelTraits, FluxTypes, ElementVolumeVariables, ElementFluxVariablesCache > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:363
typename GetPropType< TypeTag, Properties::GridFluxVariablesCache >::LocalView ElementFluxVariablesCache
Definition freeflow/navierstokes/mass/1pnc/model.hh:361
FreeFlowScalarFluxVariablesCacheFiller< Problem, ModelTraits, diffusionIsSolDependent, heatConductionIsSolDependent > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:260
static constexpr bool diffusionIsSolDependent
Definition freeflow/navierstokes/mass/1pnc/model.hh:257
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition freeflow/navierstokes/mass/1pnc/model.hh:256
GetPropType< TypeTag, Properties::Problem > Problem
Definition freeflow/navierstokes/mass/1pnc/model.hh:255
static constexpr bool heatConductionIsSolDependent
Definition freeflow/navierstokes/mass/1pnc/model.hh:258
GetPropType< TypeTag, Properties::Problem > Problem
Definition freeflow/navierstokes/mass/1pnc/model.hh:378
FreeFlowScalarFluxVariablesCacheFiller< Problem, ModelTraits, diffusionIsSolDependent, heatConductionIsSolDependent > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:383
static constexpr bool heatConductionIsSolDependent
Definition freeflow/navierstokes/mass/1pnc/model.hh:381
GetPropType< TypeTag, Properties::ModelTraits > ModelTraits
Definition freeflow/navierstokes/mass/1pnc/model.hh:379
static constexpr bool diffusionIsSolDependent
Definition freeflow/navierstokes/mass/1pnc/model.hh:380
FouriersLaw< TypeTag > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:345
NavierStokesMassOnePNCIOFields< NavierStokesMassOnePIOFields > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:265
NavierStokesEnergyIOFields< NavierStokesMassOnePNCIOFields< NavierStokesMassOnePIOFields > > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:290
NavierStokesMassOnePNCLocalResidual< TypeTag > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:171
GetPropType< TypeTag, Properties::BaseModelTraits > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:149
NavierStokesEnergyModelTraits< GetPropType< TypeTag, Properties::BaseModelTraits > > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:294
FicksLaw< TypeTag > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:204
static constexpr bool value
Definition freeflow/navierstokes/mass/1pnc/model.hh:387
static constexpr bool value
Definition freeflow/navierstokes/mass/1pnc/model.hh:242
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition freeflow/navierstokes/mass/1pnc/model.hh:280
FreeFlowDefaultSpatialParams< GridGeometry, Scalar > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:282
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition freeflow/navierstokes/mass/1pnc/model.hh:281
The type tag for the single-phase, isothermal Navier-Stokes model.
Definition freeflow/navierstokes/mass/1pnc/model.hh:130
std::tuple< ModelProperties > InheritsFrom
Definition freeflow/navierstokes/mass/1pnc/model.hh:130
Definition freeflow/navierstokes/mass/1pnc/model.hh:131
std::tuple< NavierStokesMassOnePNC > InheritsFrom
Definition freeflow/navierstokes/mass/1pnc/model.hh:131
static auto effectiveThermalConductivity(const VolVars &volVars)
Definition freeflow/navierstokes/mass/1pnc/model.hh:336
NavierStokesMassOnePNCVolumeVariables< NCTraits< BaseTraits, DT, EDM > > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:199
NavierStokesMassOnePNCVolumeVariables< NCNITraits > type
Definition freeflow/navierstokes/mass/1pnc/model.hh:326