version 3.11-dev
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
freeflow/navierstokes/momentum/problem.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//
12#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_PROBLEM_HH
13#define DUMUX_NAVIERSTOKES_MOMENTUM_PROBLEM_HH
14
15#include <dune/common/exceptions.hh>
16#include <dune/common/fvector.hh>
17#include <dune/common/typetraits.hh>
23
24namespace Dumux {
25
26template<class TypeTag, class DiscretizationMethod>
28
29template<class TypeTag>
30class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::FCStaggered>
31: public FVProblemWithSpatialParams<TypeTag>
32{
34 using Implementation = GetPropType<TypeTag, Properties::Problem>;
35
37 using GridView = typename GridGeometry::GridView;
38 using Element = typename GridView::template Codim<0>::Entity;
39
41 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
42 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
44
45 using FVElementGeometry = typename GridGeometry::LocalView;
46 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
47 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
49
50 enum {
51 dim = GridView::dimension,
52 dimWorld = GridView::dimensionworld
53 };
54
55 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
56 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
57 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
60
61 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
62
63
64public:
68 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
69 using Sources = Dune::FieldVector<Scalar, dimWorld>;
70 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
71 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
72
73 using MomentumFluxType = Dune::FieldVector<Scalar, dimWorld>;
74
77
79 static constexpr bool isMomentumProblem() { return true; }
80
87 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
88 std::shared_ptr<CouplingManager> couplingManager,
89 const std::string& paramGroup = "")
90 : ParentType(gridGeometry, paramGroup)
91 , gravity_(0.0)
92 , couplingManager_(couplingManager)
93 {
94 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
95 gravity_[dim-1] = -9.81;
96
97 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
98 }
99
105 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
106 const std::string& paramGroup = "")
107 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
108 {}
109
128 Sources source(const Element& element,
129 const FVElementGeometry& fvGeometry,
130 const ElementVolumeVariables& elemVolVars,
131 const SubControlVolume& scv) const
132 {
133 // forward to solution independent, fully-implicit specific interface
134 return asImp_().sourceAtPos(scv.dofPosition());
135 }
136
150 Sources sourceAtPos(const GlobalPosition& globalPos) const
151 {
154 return Sources(0.0);
155 }
156
163 Sources scvPointSources(const Element& element,
164 const FVElementGeometry& fvGeometry,
165 const ElementVolumeVariables& elemVolVars,
166 const SubControlVolume& scv) const
167 {
168 if (!this->pointSourceMap().empty())
169 DUNE_THROW(Dune::NotImplemented, "scvPointSources not implemented");
170
171 return Sources(0.0);
172 }
173
181 auto boundaryTypes(const Element& element,
182 const SubControlVolumeFace& scvf) const
183 {
184 // Forward it to the method which only takes the global coordinate.
185 // We evaluate the boundary type at the center of the sub control volume face
186 // in order to avoid ambiguities at domain corners.
187 return asImp_().boundaryTypesAtPos(scvf.center());
188 }
189
198 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
199 {
200 return asImp_().dirichletAtPos(scvf.ipGlobal());
201 }
202
212 template<class ElementFluxVariablesCache>
213 BoundaryFluxes neumann(const Element& element,
214 const FVElementGeometry& fvGeometry,
215 const ElementVolumeVariables& elemVolVars,
216 const ElementFluxVariablesCache& elemFluxVarsCache,
217 const SubControlVolumeFace& scvf) const
218 { return asImp_().neumannAtPos(scvf.ipGlobal()); }
219
223 BoundaryFluxes neumannAtPos(const GlobalPosition& globalPos) const
224 { return BoundaryFluxes(0.0); }
225
232 const GravityVector& gravity() const
233 { return gravity_; }
234
239 { return enableInertiaTerms_; }
240
245 Scalar pressure(const Element& element,
246 const FVElementGeometry& fvGeometry,
247 const SubControlVolumeFace& scvf) const
248 {
249 if constexpr (isCoupled_)
250 return couplingManager_->pressure(element, fvGeometry, scvf);
251 else
252 return asImp_().pressureAtPos(scvf.ipGlobal());
253 }
254
258 Scalar pressureAtPos(const GlobalPosition&) const
259 {
260 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
261 }
262
269 Scalar referencePressure(const Element& element,
270 const FVElementGeometry& fvGeometry,
271 const SubControlVolumeFace& scvf) const
272 { return 0.0; }
273
278 Scalar density(const Element& element,
279 const FVElementGeometry& fvGeometry,
280 const SubControlVolumeFace& scvf) const
281 {
282 if constexpr (isCoupled_)
283 return couplingManager_->density(element, fvGeometry, scvf);
284 else
285 return asImp_().densityAtPos(scvf.ipGlobal());
286 }
287
292 Scalar density(const Element& element,
293 const SubControlVolume& scv,
294 const bool isPreviousTimeStep = false) const
295 {
296 if constexpr (isCoupled_)
297 return couplingManager_->density(element, scv, isPreviousTimeStep);
298 else
299 return asImp_().densityAtPos(scv.dofPosition());
300 }
301
302 auto insideAndOutsideDensity(const Element& element,
303 const FVElementGeometry& fvGeometry,
304 const SubControlVolumeFace& scvf,
305 const bool isPreviousTimeStep = false) const
306 {
307 if constexpr (isCoupled_)
308 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
309 else
310 {
311 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
312 return std::make_pair(rho, rho);
313 }
314 }
315
319 Scalar densityAtPos(const GlobalPosition&) const
320 {
321 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
322 }
323
328 Scalar effectiveViscosity(const Element& element,
329 const FVElementGeometry& fvGeometry,
330 const SubControlVolumeFace& scvf) const
331 {
332 if constexpr (isCoupled_)
333 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
334 else
335 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
336 }
337
342 Scalar effectiveViscosity(const Element& element,
343 const FVElementGeometry& fvGeometry,
344 const SubControlVolume& scv) const
345 {
346 if constexpr (isCoupled_)
347 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
348 else
349 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
350 }
351
355 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
356 {
357 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
358 }
359
364 template<class SolutionVector>
365 void applyInitialSolution(SolutionVector& sol) const
366 {
367 sol.resize(this->gridGeometry().numDofs());
368 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
369 auto fvGeometry = localView(this->gridGeometry());
370 for (const auto& element : elements(this->gridGeometry().gridView()))
371 {
372 fvGeometry.bindElement(element);
373 for (const auto& scv : scvs(fvGeometry))
374 {
375 const auto dofIdx = scv.dofIndex();
376 if (!dofHandled[dofIdx])
377 {
378 dofHandled[dofIdx] = true;
379 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
380 }
381 }
382 }
383 }
384
388 InitialValues initial(const SubControlVolume& scv) const
389 {
390 return asImp_().initialAtPos(scv.dofPosition());
391 }
392
394 Scalar pseudo3DWallFriction(const Element& element,
395 const FVElementGeometry& fvGeometry,
396 const ElementVolumeVariables& elemVolVars,
397 const SubControlVolume& scv,
398 const Scalar height,
399 const Scalar factor = 8.0) const
400 {
401 const Scalar velocity = elemVolVars[scv].velocity();
402 const auto scvf = scvfs(fvGeometry, scv).begin();
403 const Scalar viscosity = effectiveViscosity(element, fvGeometry, *scvf);
404 return pseudo3DWallFriction(velocity, viscosity, height, factor);
405 }
406
420 Scalar pseudo3DWallFriction(const Scalar velocity,
421 const Scalar viscosity,
422 const Scalar height,
423 const Scalar factor = 8.0) const
424 {
425 static_assert(dim == 2, "Pseudo 3D wall friction may only be used in 2D");
426 return -factor * velocity * viscosity / (height*height);
427 }
428
434 bool onSlipBoundary(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf) const
435 { return asImp_().onSlipBoundaryAtPos(scvf.center()); }
436
441 bool onSlipBoundaryAtPos(const GlobalPosition& pos) const
442 { return false; }
443
444 const CouplingManager& couplingManager() const
445 {
446 if constexpr (isCoupled_)
447 return *couplingManager_;
448 else
449 DUNE_THROW(Dune::InvalidStateException,
450 "Accessing coupling manager of an uncoupled problem is not possible."
451 );
452 }
453
454private:
456 Implementation& asImp_()
457 { return *static_cast<Implementation *>(this); }
458
460 const Implementation& asImp_() const
461 { return *static_cast<const Implementation *>(this); }
462
463 GravityVector gravity_;
464 bool enableInertiaTerms_;
465 std::shared_ptr<CouplingManager> couplingManager_;
466};
467
471template<class TypeTag, class DM>
472class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::CVFE<DM>>
473: public FVProblemWithSpatialParams<TypeTag>
474{
476 using Implementation = GetPropType<TypeTag, Properties::Problem>;
477
479 using GridView = typename GridGeometry::GridView;
480 using Element = typename GridView::template Codim<0>::Entity;
481
483 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
484 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
486
487 using FVElementGeometry = typename GridGeometry::LocalView;
488 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
489 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
491
492 static constexpr int dim = GridView::dimension;
493 static constexpr int dimWorld = GridView::dimensionworld;
494
495 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
496 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
497 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
500
501public:
505 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
506 using Sources = Dune::FieldVector<Scalar, dimWorld>;
507 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
508 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
509
512
514 static constexpr bool isMomentumProblem() { return true; }
515
522 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
523 std::shared_ptr<CouplingManager> couplingManager,
524 const std::string& paramGroup = "")
525 : ParentType(gridGeometry, paramGroup)
526 , gravity_(0.0)
527 , couplingManager_(couplingManager)
528 {
529 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
530 gravity_[dim-1] = -9.81;
531
532 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
533 }
534
540 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
541 const std::string& paramGroup = "")
542 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
543 {}
544
563 template<class ElementVolumeVariables>
564 Sources source(const Element &element,
565 const FVElementGeometry& fvGeometry,
566 const ElementVolumeVariables& elemVolVars,
567 const SubControlVolume &scv) const
568 {
569 // forward to solution independent, fully-implicit specific interface
570 return asImp_().sourceAtPos(scv.center());
571 }
572
585 Sources sourceAtPos(const GlobalPosition &globalPos) const
586 {
589 return Sources(0.0);
590 }
591
599 BoundaryTypes boundaryTypes(const Element& element,
600 const SubControlVolume& scv) const
601 {
602 // forward it to the method which only takes the global coordinate
603 return asImp_().boundaryTypesAtPos(scv.dofPosition());
604 }
605
613 BoundaryTypes boundaryTypes(const Element& element,
614 const SubControlVolumeFace& scvf) const
615 {
616 DUNE_THROW(Dune::InvalidStateException, "boundaryTypes(..., scvf) called for a CVFE method.");
617 }
618
626 DirichletValues dirichlet(const Element& element, const SubControlVolume& scv) const
627 {
628 // forward it to the method which only takes the global coordinate
629 return asImp_().dirichletAtPos(scv.dofPosition());
630 }
631
639 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
640 {
641 // forward it to the method which only takes the global coordinate
642 DUNE_THROW(Dune::InvalidStateException, "dirichlet(scvf) called for CVFE method.");
643 }
644
651 const GravityVector& gravity() const
652 { return gravity_; }
653
658 { return enableInertiaTerms_; }
659
666 Scalar referencePressure() const
667 { return 0.0; }
668
673 Scalar pressure(const Element& element,
674 const FVElementGeometry& fvGeometry,
675 const SubControlVolumeFace& scvf) const
676 {
677 if constexpr (std::is_empty_v<CouplingManager>)
678 return asImp_().pressureAtPos(scvf.ipGlobal());
679 else
680 return couplingManager_->pressure(element, fvGeometry, scvf);
681 }
682
687 Scalar pressure(const Element& element,
688 const FVElementGeometry& fvGeometry,
689 const SubControlVolume& scv,
690 const bool isPreviousTimeStep = false) const
691 {
692 if constexpr (std::is_empty_v<CouplingManager>)
693 return asImp_().pressureAtPos(scv.dofPosition());
694 else
695 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
696 }
697
701 Scalar pressureAtPos(const GlobalPosition&) const
702 {
703 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
704 }
705
710 Scalar density(const Element& element,
711 const FVElementGeometry& fvGeometry,
712 const SubControlVolumeFace& scvf) const
713 {
714 if constexpr (std::is_empty_v<CouplingManager>)
715 return asImp_().densityAtPos(scvf.ipGlobal());
716 else
717 return couplingManager_->density(element, fvGeometry, scvf);
718 }
719
724 Scalar density(const Element& element,
725 const FVElementGeometry& fvGeometry,
726 const SubControlVolume& scv,
727 const bool isPreviousTimeStep = false) const
728 {
729 if constexpr (std::is_empty_v<CouplingManager>)
730 return asImp_().densityAtPos(scv.dofPosition());
731 else
732 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
733 }
734
735
739 Scalar densityAtPos(const GlobalPosition&) const
740 {
741 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
742 }
743
748 Scalar effectiveViscosity(const Element& element,
749 const FVElementGeometry& fvGeometry,
750 const SubControlVolumeFace& scvf) const
751 {
752 if constexpr (std::is_empty_v<CouplingManager>)
753 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
754 else
755 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
756 }
757
762 Scalar effectiveViscosity(const Element& element,
763 const FVElementGeometry& fvGeometry,
764 const SubControlVolume& scv,
765 const bool isPreviousTimeStep = false) const
766 {
767 if constexpr (std::is_empty_v<CouplingManager>)
768 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
769 else
770 return couplingManager_->effectiveViscosity(element, fvGeometry, scv, isPreviousTimeStep);
771 }
772
776 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
777 {
778 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
779 }
780
785 template<class SolutionVector>
786 void applyInitialSolution(SolutionVector& sol) const
787 {
788 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
789 sol.resize(this->gridGeometry().numDofs());
790 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
791 auto fvGeometry = localView(this->gridGeometry());
792 for (const auto& element : elements(this->gridGeometry().gridView()))
793 {
794 fvGeometry.bindElement(element);
795 for (const auto& scv : scvs(fvGeometry))
796 {
797 const auto dofIdx = scv.dofIndex();
798 if (!dofHandled[dofIdx])
799 {
800 dofHandled[dofIdx] = true;
801 sol[dofIdx] = asImp_().initial(scv);
802 }
803 }
804 }
805 }
806
810 InitialValues initial(const SubControlVolume& scv) const
811 {
812 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
813 return asImp_().initialAtPos(scv.dofPosition());
814 }
815
816private:
818 Implementation &asImp_()
819 { return *static_cast<Implementation *>(this); }
820
822 const Implementation &asImp_() const
823 { return *static_cast<const Implementation *>(this); }
824
825 GravityVector gravity_;
826 bool enableInertiaTerms_;
827 std::shared_ptr<CouplingManager> couplingManager_ = {};
828};
829
836template<class TypeTag>
839>;
840
841} // end namespace Dumux
842
843#endif
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:26
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:43
Base class for all finite-volume problems using spatial parameters.
Definition: fvproblemwithspatialparams.hh:29
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:25
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the effective dynamic viscosity at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:748
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:506
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:522
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:786
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:701
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the pressure at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:687
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:514
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:739
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:810
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:585
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:564
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:776
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:505
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:613
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: freeflow/navierstokes/momentum/problem.hh:651
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:710
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:507
DirichletValues dirichlet(const Element &element, const SubControlVolume &scv) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:626
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:657
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string &paramGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:540
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolume &scv) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:599
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:724
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:508
Scalar referencePressure() const
Returns a reference pressure This pressure is subtracted from the actual pressure for the momentum ba...
Definition: freeflow/navierstokes/momentum/problem.hh:666
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:762
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:673
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a Dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:639
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:128
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string &paramGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:105
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:245
auto boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:181
Scalar pseudo3DWallFriction(const Scalar velocity, const Scalar viscosity, const Scalar height, const Scalar factor=8.0) const
An additional drag term can be included as source term for the momentum balance to mimic 3D flow beha...
Definition: freeflow/navierstokes/momentum/problem.hh:420
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the effective dynamic viscosity at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:328
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:238
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:87
Scalar pseudo3DWallFriction(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv, const Scalar height, const Scalar factor=8.0) const
Convenience function for staggered grid implementation.
Definition: freeflow/navierstokes/momentum/problem.hh:394
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition: freeflow/navierstokes/momentum/problem.hh:302
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:355
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/momentum/problem.hh:444
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition: freeflow/navierstokes/momentum/problem.hh:73
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:79
Scalar referencePressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns a reference pressure at a given sub control volume face. This pressure is subtracted from the...
Definition: freeflow/navierstokes/momentum/problem.hh:269
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:365
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:278
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition: freeflow/navierstokes/momentum/problem.hh:232
bool onSlipBoundary(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:434
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:68
Scalar density(const Element &element, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:292
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:223
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at a sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:388
Sources scvPointSources(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Adds contribution of point sources for a specific sub control volume to the values....
Definition: freeflow/navierstokes/momentum/problem.hh:163
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv) const
Returns the effective dynamic viscosity at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:342
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:319
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:71
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:198
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:70
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:69
BoundaryFluxes neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:213
bool onSlipBoundaryAtPos(const GlobalPosition &pos) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:441
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:258
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:150
Definition: freeflow/navierstokes/momentum/problem.hh:27
Defines all properties used in Dumux.
Base class for all finite volume problems that are parameterized.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The available discretization methods in Dumux.
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:62
Definition: adapt.hh:17
A helper to deduce a vector with the same size as numbers of equations.
Definition: method.hh:46