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>
24
25namespace Dumux {
26
27template<class TypeTag, class DiscretizationMethod>
29
30template<class TypeTag>
31class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::FCStaggered>
32: public FVProblemWithSpatialParams<TypeTag>
33{
35 using Implementation = GetPropType<TypeTag, Properties::Problem>;
36
38 using GridView = typename GridGeometry::GridView;
39 using Element = typename GridView::template Codim<0>::Entity;
40
42 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
43 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
45
46 using FVElementGeometry = typename GridGeometry::LocalView;
47 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
48 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
50
51 enum {
52 dim = GridView::dimension,
53 dimWorld = GridView::dimensionworld
54 };
55
56 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
57 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
58 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
61
62 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
63
64
65public:
69 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
70 using Sources = Dune::FieldVector<Scalar, dimWorld>;
71 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
72 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
73
74 using MomentumFluxType = Dune::FieldVector<Scalar, dimWorld>;
75
78
80 static constexpr bool isMomentumProblem() { return true; }
81
88 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
89 std::shared_ptr<CouplingManager> couplingManager,
90 const std::string& paramGroup = "")
91 : ParentType(gridGeometry, paramGroup)
92 , gravity_(0.0)
93 , couplingManager_(couplingManager)
94 {
95 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
96 gravity_[dim-1] = -9.81;
97
98 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
99 }
100
106 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
107 const std::string& paramGroup = "")
108 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
109 {}
110
129 Sources source(const Element& element,
130 const FVElementGeometry& fvGeometry,
131 const ElementVolumeVariables& elemVolVars,
132 const SubControlVolume& scv) const
133 {
134 // forward to solution independent, fully-implicit specific interface
135 return asImp_().sourceAtPos(scv.dofPosition());
136 }
137
151 Sources sourceAtPos(const GlobalPosition& globalPos) const
152 {
155 return Sources(0.0);
156 }
157
164 Sources scvPointSources(const Element& element,
165 const FVElementGeometry& fvGeometry,
166 const ElementVolumeVariables& elemVolVars,
167 const SubControlVolume& scv) const
168 {
169 if (!this->pointSourceMap().empty())
170 DUNE_THROW(Dune::NotImplemented, "scvPointSources not implemented");
171
172 return Sources(0.0);
173 }
174
182 auto boundaryTypes(const Element& element,
183 const SubControlVolumeFace& scvf) const
184 {
185 // Forward it to the method which only takes the global coordinate.
186 // We evaluate the boundary type at the center of the sub control volume face
187 // in order to avoid ambiguities at domain corners.
188 return asImp_().boundaryTypesAtPos(scvf.center());
189 }
190
199 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
200 {
201 return asImp_().dirichletAtPos(scvf.ipGlobal());
202 }
203
213 template<class ElementFluxVariablesCache>
214 BoundaryFluxes neumann(const Element& element,
215 const FVElementGeometry& fvGeometry,
216 const ElementVolumeVariables& elemVolVars,
217 const ElementFluxVariablesCache& elemFluxVarsCache,
218 const SubControlVolumeFace& scvf) const
219 { return asImp_().neumannAtPos(scvf.ipGlobal()); }
220
224 BoundaryFluxes neumannAtPos(const GlobalPosition& globalPos) const
225 { return BoundaryFluxes(0.0); }
226
233 const GravityVector& gravity() const
234 { return gravity_; }
235
240 { return enableInertiaTerms_; }
241
246 Scalar pressure(const Element& element,
247 const FVElementGeometry& fvGeometry,
248 const SubControlVolumeFace& scvf) const
249 {
250 if constexpr (isCoupled_)
251 return couplingManager_->pressure(element, fvGeometry, scvf);
252 else
253 return asImp_().pressureAtPos(scvf.ipGlobal());
254 }
255
259 Scalar pressureAtPos(const GlobalPosition&) const
260 {
261 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
262 }
263
270 Scalar referencePressure(const Element& element,
271 const FVElementGeometry& fvGeometry,
272 const SubControlVolumeFace& scvf) const
273 { return 0.0; }
274
279 Scalar density(const Element& element,
280 const FVElementGeometry& fvGeometry,
281 const SubControlVolumeFace& scvf) const
282 {
283 if constexpr (isCoupled_)
284 return couplingManager_->density(element, fvGeometry, scvf);
285 else
286 return asImp_().densityAtPos(scvf.ipGlobal());
287 }
288
293 Scalar density(const Element& element,
294 const SubControlVolume& scv,
295 const bool isPreviousTimeStep = false) const
296 {
297 if constexpr (isCoupled_)
298 return couplingManager_->density(element, scv, isPreviousTimeStep);
299 else
300 return asImp_().densityAtPos(scv.dofPosition());
301 }
302
303 auto insideAndOutsideDensity(const Element& element,
304 const FVElementGeometry& fvGeometry,
305 const SubControlVolumeFace& scvf,
306 const bool isPreviousTimeStep = false) const
307 {
308 if constexpr (isCoupled_)
309 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
310 else
311 {
312 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
313 return std::make_pair(rho, rho);
314 }
315 }
316
320 Scalar densityAtPos(const GlobalPosition&) const
321 {
322 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
323 }
324
329 Scalar effectiveViscosity(const Element& element,
330 const FVElementGeometry& fvGeometry,
331 const SubControlVolumeFace& scvf) const
332 {
333 if constexpr (isCoupled_)
334 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
335 else
336 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
337 }
338
343 Scalar effectiveViscosity(const Element& element,
344 const FVElementGeometry& fvGeometry,
345 const SubControlVolume& scv) const
346 {
347 if constexpr (isCoupled_)
348 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
349 else
350 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
351 }
352
356 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
357 {
358 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
359 }
360
365 template<class SolutionVector>
366 void applyInitialSolution(SolutionVector& sol) const
367 {
368 sol.resize(this->gridGeometry().numDofs());
369 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
370 auto fvGeometry = localView(this->gridGeometry());
371 for (const auto& element : elements(this->gridGeometry().gridView()))
372 {
373 fvGeometry.bindElement(element);
374 for (const auto& scv : scvs(fvGeometry))
375 {
376 const auto dofIdx = scv.dofIndex();
377 if (!dofHandled[dofIdx])
378 {
379 dofHandled[dofIdx] = true;
380 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
381 }
382 }
383 }
384 }
385
389 InitialValues initial(const SubControlVolume& scv) const
390 {
391 return asImp_().initialAtPos(scv.dofPosition());
392 }
393
395 Scalar pseudo3DWallFriction(const Element& element,
396 const FVElementGeometry& fvGeometry,
397 const ElementVolumeVariables& elemVolVars,
398 const SubControlVolume& scv,
399 const Scalar height,
400 const Scalar factor = 8.0) const
401 {
402 const Scalar velocity = elemVolVars[scv].velocity();
403 const auto scvf = scvfs(fvGeometry, scv).begin();
404 const Scalar viscosity = effectiveViscosity(element, fvGeometry, *scvf);
405 return pseudo3DWallFriction(velocity, viscosity, height, factor);
406 }
407
421 Scalar pseudo3DWallFriction(const Scalar velocity,
422 const Scalar viscosity,
423 const Scalar height,
424 const Scalar factor = 8.0) const
425 {
426 static_assert(dim == 2, "Pseudo 3D wall friction may only be used in 2D");
427 return -factor * velocity * viscosity / (height*height);
428 }
429
435 bool onSlipBoundary(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf) const
436 { return asImp_().onSlipBoundaryAtPos(scvf.center()); }
437
442 bool onSlipBoundaryAtPos(const GlobalPosition& pos) const
443 { return false; }
444
445 const CouplingManager& couplingManager() const
446 {
447 if constexpr (isCoupled_)
448 return *couplingManager_;
449 else
450 DUNE_THROW(Dune::InvalidStateException,
451 "Accessing coupling manager of an uncoupled problem is not possible."
452 );
453 }
454
455private:
457 Implementation& asImp_()
458 { return *static_cast<Implementation *>(this); }
459
461 const Implementation& asImp_() const
462 { return *static_cast<const Implementation *>(this); }
463
464 GravityVector gravity_;
465 bool enableInertiaTerms_;
466 std::shared_ptr<CouplingManager> couplingManager_;
467};
468
472template<class TypeTag, class DM>
473class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::CVFE<DM>>
474: public FVProblemWithSpatialParams<TypeTag>
475{
477 using Implementation = GetPropType<TypeTag, Properties::Problem>;
478
480 using GridView = typename GridGeometry::GridView;
481 using Element = typename GridView::template Codim<0>::Entity;
482
484 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
485 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
487
488 using FVElementGeometry = typename GridGeometry::LocalView;
489 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
490 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
492
493 static constexpr int dim = GridView::dimension;
494 static constexpr int dimWorld = GridView::dimensionworld;
495
496 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
497 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
498 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
501
502public:
506 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
507 using Sources = Dune::FieldVector<Scalar, dimWorld>;
508 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
509 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
510
513
515 static constexpr bool isMomentumProblem() { return true; }
516
523 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
524 std::shared_ptr<CouplingManager> couplingManager,
525 const std::string& paramGroup = "")
526 : ParentType(gridGeometry, paramGroup)
527 , gravity_(0.0)
528 , couplingManager_(couplingManager)
529 {
530 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
531 gravity_[dim-1] = -9.81;
532
533 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
534 }
535
541 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
542 const std::string& paramGroup = "")
543 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
544 {}
545
564 template<class ElementVolumeVariables>
565 Sources source(const Element &element,
566 const FVElementGeometry& fvGeometry,
567 const ElementVolumeVariables& elemVolVars,
568 const SubControlVolume &scv) const
569 {
570 // forward to solution independent, fully-implicit specific interface
571 return asImp_().sourceAtPos(scv.center());
572 }
573
586 Sources sourceAtPos(const GlobalPosition &globalPos) const
587 {
590 return Sources(0.0);
591 }
592
600 BoundaryTypes boundaryTypes(const Element& element,
601 const SubControlVolume& scv) const
602 {
603 // forward it to the method which only takes the global coordinate
604 return asImp_().boundaryTypesAtPos(scv.dofPosition());
605 }
606
614 BoundaryTypes boundaryTypes(const Element& element,
615 const SubControlVolumeFace& scvf) const
616 {
617 DUNE_THROW(Dune::InvalidStateException, "boundaryTypes(..., scvf) called for a CVFE method.");
618 }
619
627 DirichletValues dirichlet(const Element& element, const SubControlVolume& scv) const
628 {
629 // forward it to the method which only takes the global coordinate
630 return asImp_().dirichletAtPos(scv.dofPosition());
631 }
632
640 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
641 {
642 // forward it to the method which only takes the global coordinate
643 DUNE_THROW(Dune::InvalidStateException, "dirichlet(scvf) called for CVFE method.");
644 }
645
652 const GravityVector& gravity() const
653 { return gravity_; }
654
659 { return enableInertiaTerms_; }
660
667 Scalar referencePressure() const
668 { return 0.0; }
669
674 Scalar pressure(const Element& element,
675 const FVElementGeometry& fvGeometry,
676 const SubControlVolumeFace& scvf) const
677 {
678 if constexpr (std::is_empty_v<CouplingManager>)
679 return asImp_().pressureAtPos(scvf.ipGlobal());
680 else
681 return couplingManager_->pressure(element, fvGeometry, scvf);
682 }
683
688 Scalar pressure(const Element& element,
689 const FVElementGeometry& fvGeometry,
690 const SubControlVolume& scv,
691 const bool isPreviousTimeStep = false) const
692 {
693 if constexpr (std::is_empty_v<CouplingManager>)
694 return asImp_().pressureAtPos(scv.dofPosition());
695 else
696 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
697 }
698
703 template<class IpData>
704 Scalar pressure(const Element& element,
705 const FVElementGeometry& fvGeometry,
706 const IpData& ipData,
707 const bool isPreviousTimeStep = false) const
708 {
709 if constexpr (std::is_empty_v<CouplingManager>)
710 return asImp_().pressureAtPos(ipData.global());
711 else
712 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
713 }
714
718 Scalar pressureAtPos(const GlobalPosition&) const
719 {
720 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
721 }
722
727 Scalar density(const Element& element,
728 const FVElementGeometry& fvGeometry,
729 const SubControlVolumeFace& scvf) const
730 {
731 if constexpr (std::is_empty_v<CouplingManager>)
732 return asImp_().densityAtPos(scvf.ipGlobal());
733 else
734 return couplingManager_->density(element, fvGeometry, scvf);
735 }
736
741 Scalar density(const Element& element,
742 const FVElementGeometry& fvGeometry,
743 const SubControlVolume& scv,
744 const bool isPreviousTimeStep = false) const
745 {
746 if constexpr (std::is_empty_v<CouplingManager>)
747 return asImp_().densityAtPos(scv.dofPosition());
748 else
749 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
750 }
751
756 template<class IpData>
757 Scalar density(const Element& element,
758 const FVElementGeometry& fvGeometry,
759 const IpData& ipData,
760 const bool isPreviousTimeStep = false) const
761 {
762 if constexpr (std::is_empty_v<CouplingManager>)
763 return asImp_().densityAtPos(ipData.global());
764 else
765 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
766 }
767
771 Scalar densityAtPos(const GlobalPosition&) const
772 {
773 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
774 }
775
780 Scalar effectiveViscosity(const Element& element,
781 const FVElementGeometry& fvGeometry,
782 const SubControlVolumeFace& scvf) const
783 {
784 if constexpr (std::is_empty_v<CouplingManager>)
785 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
786 else
787 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
788 }
789
794 Scalar effectiveViscosity(const Element& element,
795 const FVElementGeometry& fvGeometry,
796 const SubControlVolume& scv,
797 const bool isPreviousTimeStep = false) const
798 {
799 if constexpr (std::is_empty_v<CouplingManager>)
800 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
801 else
802 return couplingManager_->effectiveViscosity(element, fvGeometry, scv, isPreviousTimeStep);
803 }
804
809 template<class IpData>
810 Scalar effectiveViscosity(const Element& element,
811 const FVElementGeometry& fvGeometry,
812 const IpData& ipData,
813 const bool isPreviousTimeStep = false) const
814 {
815 if constexpr (std::is_empty_v<CouplingManager>)
816 return asImp_().effectiveViscosityAtPos(ipData.global());
817 else
818 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
819 }
820
824 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
825 {
826 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
827 }
828
833 template<class SolutionVector>
834 void applyInitialSolution(SolutionVector& sol) const
835 {
836 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
837 sol.resize(this->gridGeometry().numDofs());
838 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
839 auto fvGeometry = localView(this->gridGeometry());
840 for (const auto& element : elements(this->gridGeometry().gridView()))
841 {
842 fvGeometry.bindElement(element);
843 for (const auto& scv : scvs(fvGeometry))
844 {
845 const auto dofIdx = scv.dofIndex();
846 if (!dofHandled[dofIdx])
847 {
848 dofHandled[dofIdx] = true;
849 sol[dofIdx] = asImp_().initial(scv);
850 }
851 }
852 }
853 }
854
858 InitialValues initial(const SubControlVolume& scv) const
859 {
860 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
861 return asImp_().initialAtPos(scv.dofPosition());
862 }
863
864private:
866 Implementation &asImp_()
867 { return *static_cast<Implementation *>(this); }
868
870 const Implementation &asImp_() const
871 { return *static_cast<const Implementation *>(this); }
872
873 GravityVector gravity_;
874 bool enableInertiaTerms_;
875 std::shared_ptr<CouplingManager> couplingManager_ = {};
876};
877
878
882template<class TypeTag>
884: public FVProblemWithSpatialParams<TypeTag>
885{
887 using Implementation = GetPropType<TypeTag, Properties::Problem>;
888
890 using GridView = typename GridGeometry::GridView;
891 using Element = typename GridView::template Codim<0>::Entity;
892
894 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
895 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
897
898 using FVElementGeometry = typename GridGeometry::LocalView;
899 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
900 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
901 using LocalPosition = typename Element::Geometry::LocalCoordinate;
902
903 static constexpr int dim = GridView::dimension;
904 static constexpr int dimWorld = GridView::dimensionworld;
905
906 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
909
910public:
911 using InitialValues = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
912 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
913 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
914 using BoundaryFluxes = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
915
918
920 static constexpr bool isMomentumProblem() { return true; }
921 static constexpr bool providesIntegralInterface() { return true; }
922
929 CVFENavierStokesMomentumProblem(std::shared_ptr<const GridGeometry> gridGeometry,
930 std::shared_ptr<CouplingManager> couplingManager,
931 const std::string& paramGroup = "")
933 , gravity_(0.0)
934 , couplingManager_(couplingManager)
935 {
936 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
937 gravity_[dim-1] = -9.81;
938
939 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
940 }
941
947 CVFENavierStokesMomentumProblem(std::shared_ptr<const GridGeometry> gridGeometry,
948 const std::string& paramGroup = "")
950 {}
951
967 template<class ElementVariables, class IpData>
968 Sources source(const FVElementGeometry& fvGeometry,
969 const ElementVariables& elemVars,
970 const IpData& ipData) const
971 {
972 return asImp_().sourceAtPos(ipData.global());
973 }
974
987 Sources sourceAtPos(const GlobalPosition &globalPos) const
988 {
991 return Sources(0.0);
992 }
993
1001 template<class Intersection>
1002 BoundaryTypes boundaryTypes(const FVElementGeometry& fvGeometry,
1003 const Intersection& intersection) const
1004 {
1005 // forward it to the method which only takes the global coordinate
1006 return asImp_().boundaryTypesAtPos(intersection.geometry().center());
1007 }
1008
1016 template<class FaceIpData>
1017 DirichletValues dirichlet(const FVElementGeometry& fvGeometry,
1018 const FaceIpData& faceIpData) const
1019 {
1020 // forward it to the method which only takes the global coordinate
1021 return asImp_().dirichletAtPos(faceIpData.global());
1022 }
1023
1032 template<class ElementVariables, class ElementFluxVariablesCache>
1033 BoundaryFluxes boundaryFluxIntegral(const FVElementGeometry& fvGeometry,
1034 const ElementVariables& elemVars,
1035 const ElementFluxVariablesCache& elemFluxVarsCache,
1036 const SubControlVolumeFace& scvf) const
1037 {
1038 BoundaryFluxes flux(0.0);
1039 for (const auto& qpData : CVFE::quadratureRule(fvGeometry, scvf))
1040 flux += qpData.weight() * asImp_().boundaryFlux(fvGeometry, elemVars, elemFluxVarsCache, qpData.ipData());
1041
1042 return flux * elemVars[fvGeometry.scv(scvf.insideScvIdx())].extrusionFactor();
1043 }
1044
1055 template<class ResidualVector, class ElementVariables, class ElementFluxVariablesCache, class BoundaryTypes>
1056 void addBoundaryFluxIntegrals(ResidualVector& residual,
1057 const FVElementGeometry& fvGeometry,
1058 const ElementVariables& elemVars,
1059 const ElementFluxVariablesCache& elemFluxVarsCache,
1060 const typename FVElementGeometry::GridGeometry::GridView::Intersection& intersection,
1061 const BoundaryTypes& bcTypes) const
1062 {
1063 // quadrature rule for intersections (dim-1)
1064 for (const auto& qpData : CVFE::quadratureRule(fvGeometry, intersection))
1065 {
1066 const auto& ipData = qpData.ipData();
1067 const auto& cache = elemFluxVarsCache[ipData];
1068 for (const auto& localDof : nonCVLocalDofs(fvGeometry))
1069 {
1070 const BoundaryFluxes& boundaryFlux = qpData.weight()*asImp_().boundaryFlux(fvGeometry, elemVars, elemFluxVarsCache, ipData);
1071 const auto& shapeValues = cache.shapeValues();
1072 // only add fluxes to equations for which Neumann is set
1073 for (int eqIdx = 0; eqIdx < BoundaryFluxes::dimension; ++eqIdx)
1074 if (bcTypes.isNeumann(eqIdx))
1075 residual[localDof.index()][eqIdx] += shapeValues[localDof.index()] * boundaryFlux[eqIdx];
1076 }
1077 }
1078 }
1079
1088 template<class ElementVariables, class ElementFluxVariablesCache, class FaceIpData>
1089 BoundaryFluxes boundaryFlux(const FVElementGeometry& fvGeometry,
1090 const ElementVariables& elemVars,
1091 const ElementFluxVariablesCache& elemFluxVarsCache,
1092 const FaceIpData& faceIpData) const
1093 {
1094 return asImp_().boundaryFluxAtPos(faceIpData.global());
1095 }
1096
1100 BoundaryFluxes boundaryFluxAtPos(const GlobalPosition& globalPos) const
1101 { return BoundaryFluxes(0.0); }
1102
1109 const GravityVector& gravity() const
1110 { return gravity_; }
1111
1116 { return enableInertiaTerms_; }
1117
1124 Scalar referencePressure() const
1125 { return 0.0; }
1126
1131 template<class IpData>
1132 Scalar pressure(const Element& element,
1133 const FVElementGeometry& fvGeometry,
1134 const IpData& ipData,
1135 const bool isPreviousTimeStep = false) const
1136 {
1137 if constexpr (std::is_empty_v<CouplingManager>)
1138 return asImp_().pressureAtPos(ipData.global());
1139 else
1140 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
1141 }
1142
1146 Scalar pressureAtPos(const GlobalPosition&) const
1147 {
1148 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
1149 }
1150
1155 template<class IpData>
1156 Scalar density(const Element& element,
1157 const FVElementGeometry& fvGeometry,
1158 const IpData& ipData,
1159 const bool isPreviousTimeStep = false) const
1160 {
1161 if constexpr (std::is_empty_v<CouplingManager>)
1162 return asImp_().densityAtPos(ipData.global());
1163 else
1164 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
1165 }
1166
1170 Scalar densityAtPos(const GlobalPosition&) const
1171 {
1172 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
1173 }
1174
1175
1180 template<class IpData>
1181 Scalar effectiveViscosity(const Element& element,
1182 const FVElementGeometry& fvGeometry,
1183 const IpData& ipData,
1184 const bool isPreviousTimeStep = false) const
1185 {
1186 if constexpr (std::is_empty_v<CouplingManager>)
1187 return asImp_().effectiveViscosityAtPos(ipData.global());
1188 else
1189 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
1190 }
1191
1195 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
1196 {
1197 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
1198 }
1199
1204 template<class SolutionVector>
1205 void applyInitialSolution(SolutionVector& sol) const
1206 {
1207 sol.resize(this->gridGeometry().numDofs());
1208 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
1209 auto fvGeometry = localView(this->gridGeometry());
1210 for (const auto& element : elements(this->gridGeometry().gridView()))
1211 {
1212 fvGeometry.bindElement(element);
1213 for (const auto& localDof : localDofs(fvGeometry))
1214 {
1215 const auto dofIdx = localDof.dofIndex();
1216 if (!dofHandled[dofIdx])
1217 {
1218 dofHandled[dofIdx] = true;
1219 sol[dofIdx] = asImp_().initial(fvGeometry, ipData(fvGeometry, localDof));
1220 }
1221 }
1222 }
1223 }
1224
1228 template<class IpData>
1229 InitialValues initial(const FVElementGeometry& fvGeometry, const IpData& ipData) const
1230 {
1231 return asImp_().initialAtPos(ipData.global());
1232 }
1233
1234private:
1236 Implementation &asImp_()
1237 { return *static_cast<Implementation *>(this); }
1238
1240 const Implementation &asImp_() const
1241 { return *static_cast<const Implementation *>(this); }
1242
1243 GravityVector gravity_;
1244 bool enableInertiaTerms_;
1245 std::shared_ptr<CouplingManager> couplingManager_ = {};
1246};
1247
1254template<class TypeTag>
1257>;
1258
1259} // end namespace Dumux
1260
1261#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:885
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1170
BoundaryFluxes boundaryFluxAtPos(const GlobalPosition &globalPos) const
Returns the boundary flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1100
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:929
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:914
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:1115
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:1181
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:1205
DirichletValues dirichlet(const FVElementGeometry &fvGeometry, const FaceIpData &faceIpData) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:1017
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:1002
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1146
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:1033
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:1124
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:1056
InitialValues initial(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Evaluate the initial value at an interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1229
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:987
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:1132
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:947
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:968
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:1156
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:911
static constexpr bool providesIntegralInterface()
Definition: freeflow/navierstokes/momentum/problem.hh:921
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition: freeflow/navierstokes/momentum/problem.hh:912
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:1089
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:920
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any boundaryFlux method.
Definition: freeflow/navierstokes/momentum/problem.hh:1109
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1195
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:913
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:780
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:757
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:507
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:523
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:704
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:834
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:718
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:810
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:688
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:515
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:771
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:858
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:586
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:565
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:824
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:506
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:614
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: freeflow/navierstokes/momentum/problem.hh:652
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:727
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:508
DirichletValues dirichlet(const Element &element, const SubControlVolume &scv) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:627
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:658
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:541
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:600
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:741
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:509
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:667
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:794
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:674
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:640
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:129
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:106
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:246
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:182
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:421
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:329
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:239
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:88
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:395
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition: freeflow/navierstokes/momentum/problem.hh:303
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:356
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/momentum/problem.hh:445
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition: freeflow/navierstokes/momentum/problem.hh:74
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:80
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:270
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:366
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:279
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition: freeflow/navierstokes/momentum/problem.hh:233
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:435
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:69
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:293
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:224
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at a sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:389
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:164
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:343
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:320
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:72
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:199
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:71
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:70
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:214
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:442
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:259
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:151
Definition: freeflow/navierstokes/momentum/problem.hh:28
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