version 3.11-dev
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>
20#include <dumux/common/concepts/variables_.hh>
25
26namespace Dumux {
27
28template<class TypeTag, class DiscretizationMethod>
30
31template<class TypeTag>
32class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::FCStaggered>
33: public FVProblemWithSpatialParams<TypeTag>
34{
36 using Implementation = GetPropType<TypeTag, Properties::Problem>;
37
39 using GridView = typename GridGeometry::GridView;
40 using Element = typename GridView::template Codim<0>::Entity;
41
43 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
44 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
46
47 using FVElementGeometry = typename GridGeometry::LocalView;
48 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
49 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
51
52 enum {
53 dim = GridView::dimension,
54 dimWorld = GridView::dimensionworld
55 };
56
57 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
58 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
59 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
62
63 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
64
65
66public:
70 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
71 using Sources = Dune::FieldVector<Scalar, dimWorld>;
72 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
73 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
74
75 using MomentumFluxType = Dune::FieldVector<Scalar, dimWorld>;
76
79
81 static constexpr bool isMomentumProblem() { return true; }
82
89 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
90 std::shared_ptr<CouplingManager> couplingManager,
91 const std::string& paramGroup = "")
92 : ParentType(gridGeometry, paramGroup)
93 , gravity_(0.0)
94 , couplingManager_(couplingManager)
95 {
96 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
97 gravity_[dim-1] = -9.81;
98
99 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
100 }
101
107 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
108 const std::string& paramGroup = "")
109 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
110 {}
111
130 Sources source(const Element& element,
131 const FVElementGeometry& fvGeometry,
132 const ElementVolumeVariables& elemVolVars,
133 const SubControlVolume& scv) const
134 {
135 // forward to solution independent, fully-implicit specific interface
136 return asImp_().sourceAtPos(scv.dofPosition());
137 }
138
152 Sources sourceAtPos(const GlobalPosition& globalPos) const
153 {
156 return Sources(0.0);
157 }
158
165 Sources scvPointSources(const Element& element,
166 const FVElementGeometry& fvGeometry,
167 const ElementVolumeVariables& elemVolVars,
168 const SubControlVolume& scv) const
169 {
170 if (!this->pointSourceMap().empty())
171 DUNE_THROW(Dune::NotImplemented, "scvPointSources not implemented");
172
173 return Sources(0.0);
174 }
175
183 auto boundaryTypes(const Element& element,
184 const SubControlVolumeFace& scvf) const
185 {
186 // Forward it to the method which only takes the global coordinate.
187 // We evaluate the boundary type at the center of the sub control volume face
188 // in order to avoid ambiguities at domain corners.
189 return asImp_().boundaryTypesAtPos(scvf.center());
190 }
191
200 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
201 {
202 return asImp_().dirichletAtPos(scvf.ipGlobal());
203 }
204
214 template<class ElementFluxVariablesCache>
215 BoundaryFluxes neumann(const Element& element,
216 const FVElementGeometry& fvGeometry,
217 const ElementVolumeVariables& elemVolVars,
218 const ElementFluxVariablesCache& elemFluxVarsCache,
219 const SubControlVolumeFace& scvf) const
220 { return asImp_().neumannAtPos(scvf.ipGlobal()); }
221
225 BoundaryFluxes neumannAtPos(const GlobalPosition& globalPos) const
226 { return BoundaryFluxes(0.0); }
227
234 const GravityVector& gravity() const
235 { return gravity_; }
236
241 { return enableInertiaTerms_; }
242
247 Scalar pressure(const Element& element,
248 const FVElementGeometry& fvGeometry,
249 const SubControlVolumeFace& scvf) const
250 {
251 if constexpr (isCoupled_)
252 return couplingManager_->pressure(element, fvGeometry, scvf);
253 else
254 return asImp_().pressureAtPos(scvf.ipGlobal());
255 }
256
260 Scalar pressureAtPos(const GlobalPosition&) const
261 {
262 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
263 }
264
271 Scalar referencePressure(const Element& element,
272 const FVElementGeometry& fvGeometry,
273 const SubControlVolumeFace& scvf) const
274 { return 0.0; }
275
280 Scalar density(const Element& element,
281 const FVElementGeometry& fvGeometry,
282 const SubControlVolumeFace& scvf) const
283 {
284 if constexpr (isCoupled_)
285 return couplingManager_->density(element, fvGeometry, scvf);
286 else
287 return asImp_().densityAtPos(scvf.ipGlobal());
288 }
289
294 Scalar density(const Element& element,
295 const SubControlVolume& scv,
296 const bool isPreviousTimeStep = false) const
297 {
298 if constexpr (isCoupled_)
299 return couplingManager_->density(element, scv, isPreviousTimeStep);
300 else
301 return asImp_().densityAtPos(scv.dofPosition());
302 }
303
304 auto insideAndOutsideDensity(const Element& element,
305 const FVElementGeometry& fvGeometry,
306 const SubControlVolumeFace& scvf,
307 const bool isPreviousTimeStep = false) const
308 {
309 if constexpr (isCoupled_)
310 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
311 else
312 {
313 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
314 return std::make_pair(rho, rho);
315 }
316 }
317
321 Scalar densityAtPos(const GlobalPosition&) const
322 {
323 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
324 }
325
330 Scalar effectiveViscosity(const Element& element,
331 const FVElementGeometry& fvGeometry,
332 const SubControlVolumeFace& scvf) const
333 {
334 if constexpr (isCoupled_)
335 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
336 else
337 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
338 }
339
344 Scalar effectiveViscosity(const Element& element,
345 const FVElementGeometry& fvGeometry,
346 const SubControlVolume& scv) const
347 {
348 if constexpr (isCoupled_)
349 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
350 else
351 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
352 }
353
357 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
358 {
359 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
360 }
361
366 template<class SolutionVector>
367 void applyInitialSolution(SolutionVector& sol) const
368 {
369 sol.resize(this->gridGeometry().numDofs());
370 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
371 auto fvGeometry = localView(this->gridGeometry());
372 for (const auto& element : elements(this->gridGeometry().gridView()))
373 {
374 fvGeometry.bindElement(element);
375 for (const auto& scv : scvs(fvGeometry))
376 {
377 const auto dofIdx = scv.dofIndex();
378 if (!dofHandled[dofIdx])
379 {
380 dofHandled[dofIdx] = true;
381 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
382 }
383 }
384 }
385 }
386
390 InitialValues initial(const SubControlVolume& scv) const
391 {
392 return asImp_().initialAtPos(scv.dofPosition());
393 }
394
396 Scalar pseudo3DWallFriction(const Element& element,
397 const FVElementGeometry& fvGeometry,
398 const ElementVolumeVariables& elemVolVars,
399 const SubControlVolume& scv,
400 const Scalar height,
401 const Scalar factor = 8.0) const
402 {
403 const Scalar velocity = elemVolVars[scv].velocity();
404 const auto scvf = scvfs(fvGeometry, scv).begin();
405 const Scalar viscosity = effectiveViscosity(element, fvGeometry, *scvf);
406 return pseudo3DWallFriction(velocity, viscosity, height, factor);
407 }
408
422 Scalar pseudo3DWallFriction(const Scalar velocity,
423 const Scalar viscosity,
424 const Scalar height,
425 const Scalar factor = 8.0) const
426 {
427 static_assert(dim == 2, "Pseudo 3D wall friction may only be used in 2D");
428 return -factor * velocity * viscosity / (height*height);
429 }
430
436 bool onSlipBoundary(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf) const
437 { return asImp_().onSlipBoundaryAtPos(scvf.center()); }
438
443 bool onSlipBoundaryAtPos(const GlobalPosition& pos) const
444 { return false; }
445
446 const CouplingManager& couplingManager() const
447 {
448 if constexpr (isCoupled_)
449 return *couplingManager_;
450 else
451 DUNE_THROW(Dune::InvalidStateException,
452 "Accessing coupling manager of an uncoupled problem is not possible."
453 );
454 }
455
456private:
458 Implementation& asImp_()
459 { return *static_cast<Implementation *>(this); }
460
462 const Implementation& asImp_() const
463 { return *static_cast<const Implementation *>(this); }
464
465 GravityVector gravity_;
466 bool enableInertiaTerms_;
467 std::shared_ptr<CouplingManager> couplingManager_;
468};
469
473template<class TypeTag, class DM>
474class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::CVFE<DM>>
475: public FVProblemWithSpatialParams<TypeTag>
476{
478 using Implementation = GetPropType<TypeTag, Properties::Problem>;
479
481 using GridView = typename GridGeometry::GridView;
482 using Element = typename GridView::template Codim<0>::Entity;
483
485 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
486 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
488
489 using FVElementGeometry = typename GridGeometry::LocalView;
490 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
491 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
493
494 static constexpr int dim = GridView::dimension;
495 static constexpr int dimWorld = GridView::dimensionworld;
496
497 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
498 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
499 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
502
503public:
507 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
508 using Sources = Dune::FieldVector<Scalar, dimWorld>;
509 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
510 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
511
514
516 static constexpr bool isMomentumProblem() { return true; }
517
524 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
525 std::shared_ptr<CouplingManager> couplingManager,
526 const std::string& paramGroup = "")
527 : ParentType(gridGeometry, paramGroup)
528 , gravity_(0.0)
529 , couplingManager_(couplingManager)
530 {
531 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
532 gravity_[dim-1] = -9.81;
533
534 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
535 }
536
542 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
543 const std::string& paramGroup = "")
544 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
545 {}
546
565 template<class ElementVolumeVariables>
566 Sources source(const Element &element,
567 const FVElementGeometry& fvGeometry,
568 const ElementVolumeVariables& elemVolVars,
569 const SubControlVolume &scv) const
570 {
571 // forward to solution independent, fully-implicit specific interface
572 return asImp_().sourceAtPos(scv.center());
573 }
574
587 Sources sourceAtPos(const GlobalPosition &globalPos) const
588 {
591 return Sources(0.0);
592 }
593
601 BoundaryTypes boundaryTypes(const Element& element,
602 const SubControlVolume& scv) const
603 {
604 // forward it to the method which only takes the global coordinate
605 return asImp_().boundaryTypesAtPos(scv.dofPosition());
606 }
607
615 BoundaryTypes boundaryTypes(const Element& element,
616 const SubControlVolumeFace& scvf) const
617 {
618 DUNE_THROW(Dune::InvalidStateException, "boundaryTypes(..., scvf) called for a CVFE method.");
619 }
620
628 DirichletValues dirichlet(const Element& element, const SubControlVolume& scv) const
629 {
630 // forward it to the method which only takes the global coordinate
631 return asImp_().dirichletAtPos(scv.dofPosition());
632 }
633
641 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
642 {
643 // forward it to the method which only takes the global coordinate
644 DUNE_THROW(Dune::InvalidStateException, "dirichlet(scvf) called for CVFE method.");
645 }
646
653 const GravityVector& gravity() const
654 { return gravity_; }
655
660 { return enableInertiaTerms_; }
661
668 Scalar referencePressure() const
669 { return 0.0; }
670
675 Scalar pressure(const Element& element,
676 const FVElementGeometry& fvGeometry,
677 const SubControlVolumeFace& scvf) const
678 {
679 if constexpr (std::is_empty_v<CouplingManager>)
680 return asImp_().pressureAtPos(scvf.ipGlobal());
681 else
682 return couplingManager_->pressure(element, fvGeometry, scvf);
683 }
684
689 Scalar pressure(const Element& element,
690 const FVElementGeometry& fvGeometry,
691 const SubControlVolume& scv,
692 const bool isPreviousTimeStep = false) const
693 {
694 if constexpr (std::is_empty_v<CouplingManager>)
695 return asImp_().pressureAtPos(scv.dofPosition());
696 else
697 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
698 }
699
704 template<class IpData>
705 Scalar pressure(const Element& element,
706 const FVElementGeometry& fvGeometry,
707 const IpData& ipData,
708 const bool isPreviousTimeStep = false) const
709 {
710 if constexpr (std::is_empty_v<CouplingManager>)
711 return asImp_().pressureAtPos(ipData.global());
712 else
713 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
714 }
715
719 Scalar pressureAtPos(const GlobalPosition&) const
720 {
721 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
722 }
723
728 Scalar density(const Element& element,
729 const FVElementGeometry& fvGeometry,
730 const SubControlVolumeFace& scvf) const
731 {
732 if constexpr (std::is_empty_v<CouplingManager>)
733 return asImp_().densityAtPos(scvf.ipGlobal());
734 else
735 return couplingManager_->density(element, fvGeometry, scvf);
736 }
737
742 Scalar density(const Element& element,
743 const FVElementGeometry& fvGeometry,
744 const SubControlVolume& scv,
745 const bool isPreviousTimeStep = false) const
746 {
747 if constexpr (std::is_empty_v<CouplingManager>)
748 return asImp_().densityAtPos(scv.dofPosition());
749 else
750 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
751 }
752
757 template<class IpData>
758 Scalar density(const Element& element,
759 const FVElementGeometry& fvGeometry,
760 const IpData& ipData,
761 const bool isPreviousTimeStep = false) const
762 {
763 if constexpr (std::is_empty_v<CouplingManager>)
764 return asImp_().densityAtPos(ipData.global());
765 else
766 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
767 }
768
772 Scalar densityAtPos(const GlobalPosition&) const
773 {
774 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
775 }
776
781 Scalar effectiveViscosity(const Element& element,
782 const FVElementGeometry& fvGeometry,
783 const SubControlVolumeFace& scvf) const
784 {
785 if constexpr (std::is_empty_v<CouplingManager>)
786 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
787 else
788 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
789 }
790
795 Scalar effectiveViscosity(const Element& element,
796 const FVElementGeometry& fvGeometry,
797 const SubControlVolume& scv,
798 const bool isPreviousTimeStep = false) const
799 {
800 if constexpr (std::is_empty_v<CouplingManager>)
801 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
802 else
803 return couplingManager_->effectiveViscosity(element, fvGeometry, scv, isPreviousTimeStep);
804 }
805
810 template<class IpData>
811 Scalar effectiveViscosity(const Element& element,
812 const FVElementGeometry& fvGeometry,
813 const IpData& ipData,
814 const bool isPreviousTimeStep = false) const
815 {
816 if constexpr (std::is_empty_v<CouplingManager>)
817 return asImp_().effectiveViscosityAtPos(ipData.global());
818 else
819 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
820 }
821
825 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
826 {
827 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
828 }
829
834 template<class SolutionVector>
835 void applyInitialSolution(SolutionVector& sol) const
836 {
837 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
838 sol.resize(this->gridGeometry().numDofs());
839 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
840 auto fvGeometry = localView(this->gridGeometry());
841 for (const auto& element : elements(this->gridGeometry().gridView()))
842 {
843 fvGeometry.bindElement(element);
844 for (const auto& scv : scvs(fvGeometry))
845 {
846 const auto dofIdx = scv.dofIndex();
847 if (!dofHandled[dofIdx])
848 {
849 dofHandled[dofIdx] = true;
850 sol[dofIdx] = asImp_().initial(scv);
851 }
852 }
853 }
854 }
855
859 InitialValues initial(const SubControlVolume& scv) const
860 {
861 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
862 return asImp_().initialAtPos(scv.dofPosition());
863 }
864
865private:
867 Implementation &asImp_()
868 { return *static_cast<Implementation *>(this); }
869
871 const Implementation &asImp_() const
872 { return *static_cast<const Implementation *>(this); }
873
874 GravityVector gravity_;
875 bool enableInertiaTerms_;
876 std::shared_ptr<CouplingManager> couplingManager_ = {};
877};
878
879
883template<class TypeTag>
885: public FVProblemWithSpatialParams<TypeTag>
886{
888 using Implementation = GetPropType<TypeTag, Properties::Problem>;
889
891 using GridView = typename GridGeometry::GridView;
892 using Element = typename GridView::template Codim<0>::Entity;
893
895 using GridVariablesCache = Concept::GridVariablesCache_t<GridVariables>;
896 using ElementVariables = typename GridVariablesCache::LocalView;
898
899 using FVElementGeometry = typename GridGeometry::LocalView;
900 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
901 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
902 using LocalPosition = typename Element::Geometry::LocalCoordinate;
903
904 static constexpr int dim = GridView::dimension;
905 static constexpr int dimWorld = GridView::dimensionworld;
906
907 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
910
911public:
912 using InitialValues = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
913 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
914 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
915 using BoundaryFluxes = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
916
919
921 static constexpr bool isMomentumProblem() { return true; }
922 static constexpr bool providesIntegralInterface() { return true; }
923
930 CVFENavierStokesMomentumProblem(std::shared_ptr<const GridGeometry> gridGeometry,
931 std::shared_ptr<CouplingManager> couplingManager,
932 const std::string& paramGroup = "")
934 , gravity_(0.0)
935 , couplingManager_(couplingManager)
936 {
937 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
938 gravity_[dim-1] = -9.81;
939
940 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
941 }
942
948 CVFENavierStokesMomentumProblem(std::shared_ptr<const GridGeometry> gridGeometry,
949 const std::string& paramGroup = "")
951 {}
952
968 template<class IpData>
969 Sources source(const FVElementGeometry& fvGeometry,
970 const ElementVariables& elemVars,
971 const IpData& ipData) const
972 {
973 return asImp_().sourceAtPos(ipData.global());
974 }
975
988 Sources sourceAtPos(const GlobalPosition &globalPos) const
989 {
992 return Sources(0.0);
993 }
994
1002 template<class Intersection>
1003 BoundaryTypes boundaryTypes(const FVElementGeometry& fvGeometry,
1004 const Intersection& intersection) const
1005 {
1006 // forward it to the method which only takes the global coordinate
1007 return asImp_().boundaryTypesAtPos(intersection.geometry().center());
1008 }
1009
1017 template<class FaceIpData>
1018 DirichletValues dirichlet(const FVElementGeometry& fvGeometry,
1019 const FaceIpData& faceIpData) const
1020 {
1021 // forward it to the method which only takes the global coordinate
1022 return asImp_().dirichletAtPos(faceIpData.global());
1023 }
1024
1032 BoundaryFluxes boundaryFluxIntegral(const FVElementGeometry& fvGeometry,
1033 const ElementVariables& elemVars,
1034 const SubControlVolumeFace& scvf) const
1035 {
1036 BoundaryFluxes flux(0.0);
1037 for (const auto& qpData : CVFE::quadratureRule(fvGeometry, scvf))
1038 flux += qpData.weight() * asImp_().boundaryFlux(fvGeometry, elemVars, qpData.ipData());
1039
1040 return flux * elemVars[fvGeometry.scv(scvf.insideScvIdx())].extrusionFactor();
1041 }
1042
1051 template<class ElementFluxVariablesCache>
1052 [[deprecated("This function is deprecated and will be removed after release 3.11. "
1053 "Use boundaryFluxIntegral without elemFluxVarsCache instead.")]]
1054 BoundaryFluxes boundaryFluxIntegral(const FVElementGeometry& fvGeometry,
1055 const ElementVariables& elemVars,
1056 const ElementFluxVariablesCache& elemFluxVarsCache,
1057 const SubControlVolumeFace& scvf) const
1058 {
1059 BoundaryFluxes flux(0.0);
1060 for (const auto& qpData : CVFE::quadratureRule(fvGeometry, scvf))
1061 flux += qpData.weight() * asImp_().boundaryFlux(fvGeometry, elemVars, elemFluxVarsCache, qpData.ipData());
1062
1063 return flux * elemVars[fvGeometry.scv(scvf.insideScvIdx())].extrusionFactor();
1064 }
1065
1075 template<class ResidualVector, class BoundaryTypes>
1076 void addBoundaryFluxIntegrals(ResidualVector& residual,
1077 const FVElementGeometry& fvGeometry,
1078 const ElementVariables& elemVars,
1079 const typename FVElementGeometry::GridGeometry::GridView::Intersection& intersection,
1080 const BoundaryTypes& bcTypes) const
1081 {
1082 // quadrature rule for intersections (dim-1)
1083 for (const auto& qpData : CVFE::quadratureRule(fvGeometry, intersection))
1084 {
1085 const auto& ipData = qpData.ipData();
1086 const auto& ipCache = cache(elemVars, ipData);
1087 for (const auto& localDof : nonCVLocalDofs(fvGeometry))
1088 {
1089 const BoundaryFluxes& boundaryFlux = qpData.weight()*asImp_().boundaryFlux(fvGeometry, elemVars, ipData);
1090 const auto& shapeValues = ipCache.shapeValues();
1091 // only add fluxes to equations for which Neumann is set
1092 for (int eqIdx = 0; eqIdx < BoundaryFluxes::dimension; ++eqIdx)
1093 if (bcTypes.isNeumann(eqIdx))
1094 residual[localDof.index()][eqIdx] += shapeValues[localDof.index()] * boundaryFlux[eqIdx];
1095 }
1096 }
1097 }
1098
1109 template<class ResidualVector, class ElementFluxVariablesCache, class BoundaryTypes>
1110 [[deprecated("This function is deprecated and will be removed after release 3.11. "
1111 "Use addBoundaryFluxIntegrals without elemFluxVarsCache instead.")]]
1112 void addBoundaryFluxIntegrals(ResidualVector& residual,
1113 const FVElementGeometry& fvGeometry,
1114 const ElementVariables& elemVars,
1115 const ElementFluxVariablesCache& elemFluxVarsCache,
1116 const typename FVElementGeometry::GridGeometry::GridView::Intersection& intersection,
1117 const BoundaryTypes& bcTypes) const
1118 {
1119 // quadrature rule for intersections (dim-1)
1120 for (const auto& qpData : CVFE::quadratureRule(fvGeometry, intersection))
1121 {
1122 const auto& ipData = qpData.ipData();
1123 const auto& cache = elemFluxVarsCache[ipData];
1124 for (const auto& localDof : nonCVLocalDofs(fvGeometry))
1125 {
1126 const BoundaryFluxes& boundaryFlux = qpData.weight()*asImp_().boundaryFlux(fvGeometry, elemVars, elemFluxVarsCache, ipData);
1127 const auto& shapeValues = cache.shapeValues();
1128 // only add fluxes to equations for which Neumann is set
1129 for (int eqIdx = 0; eqIdx < BoundaryFluxes::dimension; ++eqIdx)
1130 if (bcTypes.isNeumann(eqIdx))
1131 residual[localDof.index()][eqIdx] += shapeValues[localDof.index()] * boundaryFlux[eqIdx];
1132 }
1133 }
1134 }
1135
1143 template<class FaceIpData>
1144 BoundaryFluxes boundaryFlux(const FVElementGeometry& fvGeometry,
1145 const ElementVariables& elemVars,
1146 const FaceIpData& faceIpData) const
1147 {
1148 return asImp_().boundaryFluxAtPos(faceIpData.global());
1149 }
1150
1159 template<class ElementFluxVariablesCache, class FaceIpData>
1160 [[deprecated("This function is deprecated and will be removed after release 3.11. "
1161 "Use boundaryFlux without elemFluxVarsCache instead.")]]
1162 BoundaryFluxes boundaryFlux(const FVElementGeometry& fvGeometry,
1163 const ElementVariables& elemVars,
1164 const ElementFluxVariablesCache& elemFluxVarsCache,
1165 const FaceIpData& faceIpData) const
1166 {
1167 return asImp_().boundaryFluxAtPos(faceIpData.global());
1168 }
1169
1173 BoundaryFluxes boundaryFluxAtPos(const GlobalPosition& globalPos) const
1174 { return BoundaryFluxes(0.0); }
1175
1182 const GravityVector& gravity() const
1183 { return gravity_; }
1184
1189 { return enableInertiaTerms_; }
1190
1197 Scalar referencePressure() const
1198 { return 0.0; }
1199
1204 template<class IpData>
1205 Scalar pressure(const Element& element,
1206 const FVElementGeometry& fvGeometry,
1207 const IpData& ipData,
1208 const bool isPreviousTimeStep = false) const
1209 {
1210 if constexpr (std::is_empty_v<CouplingManager>)
1211 return asImp_().pressureAtPos(ipData.global());
1212 else
1213 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
1214 }
1215
1219 Scalar pressureAtPos(const GlobalPosition&) const
1220 {
1221 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
1222 }
1223
1228 template<class IpData>
1229 Scalar density(const Element& element,
1230 const FVElementGeometry& fvGeometry,
1231 const IpData& ipData,
1232 const bool isPreviousTimeStep = false) const
1233 {
1234 if constexpr (std::is_empty_v<CouplingManager>)
1235 return asImp_().densityAtPos(ipData.global());
1236 else
1237 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
1238 }
1239
1243 Scalar densityAtPos(const GlobalPosition&) const
1244 {
1245 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
1246 }
1247
1248
1253 template<class IpData>
1254 Scalar effectiveViscosity(const Element& element,
1255 const FVElementGeometry& fvGeometry,
1256 const IpData& ipData,
1257 const bool isPreviousTimeStep = false) const
1258 {
1259 if constexpr (std::is_empty_v<CouplingManager>)
1260 return asImp_().effectiveViscosityAtPos(ipData.global());
1261 else
1262 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
1263 }
1264
1268 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
1269 {
1270 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
1271 }
1272
1277 template<class SolutionVector>
1278 void applyInitialSolution(SolutionVector& sol) const
1279 {
1280 sol.resize(this->gridGeometry().numDofs());
1281 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
1282 auto fvGeometry = localView(this->gridGeometry());
1283 for (const auto& element : elements(this->gridGeometry().gridView()))
1284 {
1285 fvGeometry.bindElement(element);
1286 for (const auto& localDof : localDofs(fvGeometry))
1287 {
1288 const auto dofIdx = localDof.dofIndex();
1289 if (!dofHandled[dofIdx])
1290 {
1291 dofHandled[dofIdx] = true;
1292 sol[dofIdx] = asImp_().initial(fvGeometry, ipData(fvGeometry, localDof));
1293 }
1294 }
1295 }
1296 }
1297
1301 template<class IpData>
1302 InitialValues initial(const FVElementGeometry& fvGeometry, const IpData& ipData) const
1303 {
1304 return asImp_().initialAtPos(ipData.global());
1305 }
1306
1307private:
1309 Implementation &asImp_()
1310 { return *static_cast<Implementation *>(this); }
1311
1313 const Implementation &asImp_() const
1314 { return *static_cast<const Implementation *>(this); }
1315
1316 GravityVector gravity_;
1317 bool enableInertiaTerms_;
1318 std::shared_ptr<CouplingManager> couplingManager_ = {};
1319};
1320
1327template<class TypeTag>
1330>;
1331
1332} // end namespace Dumux
1333
1334#endif
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:26
bool isNeumann(unsigned eqIdx) const
Returns true if an equation is used to specify a Neumann condition.
Definition: common/boundarytypes.hh:237
Navier-Stokes default problem implementation for CVFE discretizations.
Definition: freeflow/navierstokes/momentum/problem.hh:886
void addBoundaryFluxIntegrals(ResidualVector &residual, const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const typename FVElementGeometry::GridGeometry::GridView::Intersection &intersection, const BoundaryTypes &bcTypes) const
Evaluates the boundary flux integrals for an intersection related to finite element residuals.
Definition: freeflow/navierstokes/momentum/problem.hh:1112
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1243
BoundaryFluxes boundaryFluxAtPos(const GlobalPosition &globalPos) const
Returns the boundary flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1173
void addBoundaryFluxIntegrals(ResidualVector &residual, const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const typename FVElementGeometry::GridGeometry::GridView::Intersection &intersection, const BoundaryTypes &bcTypes) const
Evaluates the boundary flux integrals for an intersection related to finite element residuals.
Definition: freeflow/navierstokes/momentum/problem.hh:1076
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:930
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:915
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:1188
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1254
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:1278
BoundaryFluxes boundaryFlux(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const FaceIpData &faceIpData) const
Evaluates the boundary flux related to a localDof at a given interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1162
DirichletValues dirichlet(const FVElementGeometry &fvGeometry, const FaceIpData &faceIpData) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:1018
BoundaryTypes boundaryTypes(const FVElementGeometry &fvGeometry, const Intersection &intersection) const
Specifies which kind of boundary condition should be used for which equation on a given boundary face...
Definition: freeflow/navierstokes/momentum/problem.hh:1003
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1219
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:1197
InitialValues initial(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Evaluate the initial value at an interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1302
BoundaryFluxes boundaryFluxIntegral(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const SubControlVolumeFace &scvf) const
Evaluates the boundary flux integral for a scvf.
Definition: freeflow/navierstokes/momentum/problem.hh:1032
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:988
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the pressure at given interpolation point data.
Definition: freeflow/navierstokes/momentum/problem.hh:1205
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string &paramGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:948
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the density at given interpolation point data.
Definition: freeflow/navierstokes/momentum/problem.hh:1229
Sources source(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const IpData &ipData) const
Evaluate the source term at a given interpolation point, related to the residual of a local dof.
Definition: freeflow/navierstokes/momentum/problem.hh:969
BoundaryFluxes boundaryFlux(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const FaceIpData &faceIpData) const
Evaluates the boundary flux related to a localDof at a given interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1144
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:912
static constexpr bool providesIntegralInterface()
Definition: freeflow/navierstokes/momentum/problem.hh:922
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition: freeflow/navierstokes/momentum/problem.hh:913
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:921
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any boundaryFlux method.
Definition: freeflow/navierstokes/momentum/problem.hh:1182
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1268
BoundaryFluxes boundaryFluxIntegral(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary flux integral for a scvf.
Definition: freeflow/navierstokes/momentum/problem.hh:1054
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:914
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:43
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:524
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:520
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:781
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:758
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:508
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:524
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:705
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:835
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:719
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:811
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:689
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:516
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:772
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:859
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:587
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:566
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:825
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:507
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:615
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: freeflow/navierstokes/momentum/problem.hh:653
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:728
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:509
DirichletValues dirichlet(const Element &element, const SubControlVolume &scv) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:628
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:659
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:542
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:601
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:742
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:510
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:668
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:795
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:675
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:641
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:130
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:107
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:247
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:183
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:422
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:330
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:240
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:89
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:396
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition: freeflow/navierstokes/momentum/problem.hh:304
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:357
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/momentum/problem.hh:446
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition: freeflow/navierstokes/momentum/problem.hh:75
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:81
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:271
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:367
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:280
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition: freeflow/navierstokes/momentum/problem.hh:234
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:436
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:70
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:294
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:225
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at a sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:390
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:165
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:344
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:321
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:73
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:200
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:72
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:71
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:215
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:443
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:260
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:152
Definition: freeflow/navierstokes/momentum/problem.hh:29
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.
auto quadratureRule(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolume &scv, QuadratureRules::MidpointQuadrature)
Midpoint quadrature for scv.
Definition: quadraturerules.hh:148
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:62
Definition: adapt.hh:17
std::ranges::range auto scvs(const FVElementGeometry &fvGeometry, const LocalDof &localDof)
Definition: localdof.hh:79
auto localDofs(const FVElementGeometry &fvGeometry)
range over local dofs
Definition: localdof.hh:50
A helper to deduce a vector with the same size as numbers of equations.
Quadrature rules over sub-control volumes and sub-control volume faces.
Definition: method.hh:46