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>
18#include <dumux/common/boundarytypes_.hh>
21#include <dumux/common/concepts/variables_.hh>
26
27namespace Dumux {
28
29template<class TypeTag, class DiscretizationMethod>
31
32template<class TypeTag>
33class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::FCStaggered>
34: public FVProblemWithSpatialParams<TypeTag>
35{
37 using Implementation = GetPropType<TypeTag, Properties::Problem>;
38
40 using GridView = typename GridGeometry::GridView;
41 using Element = typename GridView::template Codim<0>::Entity;
42
44 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
45 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
47
48 using FVElementGeometry = typename GridGeometry::LocalView;
49 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
50 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
52
53 enum {
54 dim = GridView::dimension,
55 dimWorld = GridView::dimensionworld
56 };
57
58 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
59 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
60 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
63
64 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
65
66
67public:
71 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
72 using Sources = Dune::FieldVector<Scalar, dimWorld>;
73 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
74 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
75
76 using MomentumFluxType = Dune::FieldVector<Scalar, dimWorld>;
77
80
82 static constexpr bool isMomentumProblem() { return true; }
83
90 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
91 std::shared_ptr<CouplingManager> couplingManager,
92 const std::string& paramGroup = "")
93 : ParentType(gridGeometry, paramGroup)
94 , gravity_(0.0)
95 , couplingManager_(couplingManager)
96 {
97 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
98 gravity_[dim-1] = -9.81;
99
100 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
101 }
102
108 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
109 const std::string& paramGroup = "")
110 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
111 {}
112
131 Sources source(const Element& element,
132 const FVElementGeometry& fvGeometry,
133 const ElementVolumeVariables& elemVolVars,
134 const SubControlVolume& scv) const
135 {
136 // forward to solution independent, fully-implicit specific interface
137 return asImp_().sourceAtPos(scv.dofPosition());
138 }
139
153 Sources sourceAtPos(const GlobalPosition& globalPos) const
154 {
157 return Sources(0.0);
158 }
159
166 Sources scvPointSources(const Element& element,
167 const FVElementGeometry& fvGeometry,
168 const ElementVolumeVariables& elemVolVars,
169 const SubControlVolume& scv) const
170 {
171 if (!this->pointSourceMap().empty())
172 DUNE_THROW(Dune::NotImplemented, "scvPointSources not implemented");
173
174 return Sources(0.0);
175 }
176
184 auto boundaryTypes(const Element& element,
185 const SubControlVolumeFace& scvf) const
186 {
187 // Forward it to the method which only takes the global coordinate.
188 // We evaluate the boundary type at the center of the sub control volume face
189 // in order to avoid ambiguities at domain corners.
190 return asImp_().boundaryTypesAtPos(scvf.center());
191 }
192
201 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
202 {
203 return asImp_().dirichletAtPos(scvf.ipGlobal());
204 }
205
215 template<class ElementFluxVariablesCache>
216 BoundaryFluxes neumann(const Element& element,
217 const FVElementGeometry& fvGeometry,
218 const ElementVolumeVariables& elemVolVars,
219 const ElementFluxVariablesCache& elemFluxVarsCache,
220 const SubControlVolumeFace& scvf) const
221 { return asImp_().neumannAtPos(scvf.ipGlobal()); }
222
226 BoundaryFluxes neumannAtPos(const GlobalPosition& globalPos) const
227 { return BoundaryFluxes(0.0); }
228
235 const GravityVector& gravity() const
236 { return gravity_; }
237
242 { return enableInertiaTerms_; }
243
248 Scalar pressure(const Element& element,
249 const FVElementGeometry& fvGeometry,
250 const SubControlVolumeFace& scvf) const
251 {
252 if constexpr (isCoupled_)
253 return couplingManager_->pressure(element, fvGeometry, scvf);
254 else
255 return asImp_().pressureAtPos(scvf.ipGlobal());
256 }
257
261 Scalar pressureAtPos(const GlobalPosition&) const
262 {
263 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
264 }
265
272 Scalar referencePressure(const Element& element,
273 const FVElementGeometry& fvGeometry,
274 const SubControlVolumeFace& scvf) const
275 { return 0.0; }
276
281 Scalar density(const Element& element,
282 const FVElementGeometry& fvGeometry,
283 const SubControlVolumeFace& scvf) const
284 {
285 if constexpr (isCoupled_)
286 return couplingManager_->density(element, fvGeometry, scvf);
287 else
288 return asImp_().densityAtPos(scvf.ipGlobal());
289 }
290
295 Scalar density(const Element& element,
296 const SubControlVolume& scv,
297 const bool isPreviousTimeStep = false) const
298 {
299 if constexpr (isCoupled_)
300 return couplingManager_->density(element, scv, isPreviousTimeStep);
301 else
302 return asImp_().densityAtPos(scv.dofPosition());
303 }
304
305 auto insideAndOutsideDensity(const Element& element,
306 const FVElementGeometry& fvGeometry,
307 const SubControlVolumeFace& scvf,
308 const bool isPreviousTimeStep = false) const
309 {
310 if constexpr (isCoupled_)
311 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
312 else
313 {
314 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
315 return std::make_pair(rho, rho);
316 }
317 }
318
322 Scalar densityAtPos(const GlobalPosition&) const
323 {
324 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
325 }
326
331 Scalar effectiveViscosity(const Element& element,
332 const FVElementGeometry& fvGeometry,
333 const SubControlVolumeFace& scvf) const
334 {
335 if constexpr (isCoupled_)
336 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
337 else
338 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
339 }
340
345 Scalar effectiveViscosity(const Element& element,
346 const FVElementGeometry& fvGeometry,
347 const SubControlVolume& scv) const
348 {
349 if constexpr (isCoupled_)
350 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
351 else
352 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
353 }
354
358 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
359 {
360 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
361 }
362
367 template<class SolutionVector>
368 void applyInitialSolution(SolutionVector& sol) const
369 {
370 sol.resize(this->gridGeometry().numDofs());
371 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
372 auto fvGeometry = localView(this->gridGeometry());
373 for (const auto& element : elements(this->gridGeometry().gridView()))
374 {
375 fvGeometry.bindElement(element);
376 for (const auto& scv : scvs(fvGeometry))
377 {
378 const auto dofIdx = scv.dofIndex();
379 if (!dofHandled[dofIdx])
380 {
381 dofHandled[dofIdx] = true;
382 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
383 }
384 }
385 }
386 }
387
391 InitialValues initial(const SubControlVolume& scv) const
392 {
393 return asImp_().initialAtPos(scv.dofPosition());
394 }
395
397 Scalar pseudo3DWallFriction(const Element& element,
398 const FVElementGeometry& fvGeometry,
399 const ElementVolumeVariables& elemVolVars,
400 const SubControlVolume& scv,
401 const Scalar height,
402 const Scalar factor = 8.0) const
403 {
404 const Scalar velocity = elemVolVars[scv].velocity();
405 const auto scvf = scvfs(fvGeometry, scv).begin();
406 const Scalar viscosity = effectiveViscosity(element, fvGeometry, *scvf);
407 return pseudo3DWallFriction(velocity, viscosity, height, factor);
408 }
409
423 Scalar pseudo3DWallFriction(const Scalar velocity,
424 const Scalar viscosity,
425 const Scalar height,
426 const Scalar factor = 8.0) const
427 {
428 static_assert(dim == 2, "Pseudo 3D wall friction may only be used in 2D");
429 return -factor * velocity * viscosity / (height*height);
430 }
431
437 bool onSlipBoundary(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf) const
438 { return asImp_().onSlipBoundaryAtPos(scvf.center()); }
439
444 bool onSlipBoundaryAtPos(const GlobalPosition& pos) const
445 { return false; }
446
447 const CouplingManager& couplingManager() const
448 {
449 if constexpr (isCoupled_)
450 return *couplingManager_;
451 else
452 DUNE_THROW(Dune::InvalidStateException,
453 "Accessing coupling manager of an uncoupled problem is not possible."
454 );
455 }
456
457private:
459 Implementation& asImp_()
460 { return *static_cast<Implementation *>(this); }
461
463 const Implementation& asImp_() const
464 { return *static_cast<const Implementation *>(this); }
465
466 GravityVector gravity_;
467 bool enableInertiaTerms_;
468 std::shared_ptr<CouplingManager> couplingManager_;
469};
470
474template<class TypeTag, class DM>
475class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::CVFE<DM>>
476: public FVProblemWithSpatialParams<TypeTag>
477{
479 using Implementation = GetPropType<TypeTag, Properties::Problem>;
480
482 using GridView = typename GridGeometry::GridView;
483 using Element = typename GridView::template Codim<0>::Entity;
484
486 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
487 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
489
490 using FVElementGeometry = typename GridGeometry::LocalView;
491 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
492 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
494
495 static constexpr int dim = GridView::dimension;
496 static constexpr int dimWorld = GridView::dimensionworld;
497
498 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
499 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
500 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
503
504public:
508 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
509 using Sources = Dune::FieldVector<Scalar, dimWorld>;
510 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
511 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
512
515
517 static constexpr bool isMomentumProblem() { return true; }
518
525 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
526 std::shared_ptr<CouplingManager> couplingManager,
527 const std::string& paramGroup = "")
528 : ParentType(gridGeometry, paramGroup)
529 , gravity_(0.0)
530 , couplingManager_(couplingManager)
531 {
532 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
533 gravity_[dim-1] = -9.81;
534
535 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
536 }
537
543 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
544 const std::string& paramGroup = "")
545 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
546 {}
547
566 template<class ElementVolumeVariables>
567 Sources source(const Element &element,
568 const FVElementGeometry& fvGeometry,
569 const ElementVolumeVariables& elemVolVars,
570 const SubControlVolume &scv) const
571 {
572 // forward to solution independent, fully-implicit specific interface
573 return asImp_().sourceAtPos(scv.center());
574 }
575
588 Sources sourceAtPos(const GlobalPosition &globalPos) const
589 {
592 return Sources(0.0);
593 }
594
602 BoundaryTypes boundaryTypes(const Element& element,
603 const SubControlVolume& scv) const
604 {
605 // forward it to the method which only takes the global coordinate
606 return asImp_().boundaryTypesAtPos(scv.dofPosition());
607 }
608
616 BoundaryTypes boundaryTypes(const Element& element,
617 const SubControlVolumeFace& scvf) const
618 {
619 DUNE_THROW(Dune::InvalidStateException, "boundaryTypes(..., scvf) called for a CVFE method.");
620 }
621
629 DirichletValues dirichlet(const Element& element, const SubControlVolume& scv) const
630 {
631 // forward it to the method which only takes the global coordinate
632 return asImp_().dirichletAtPos(scv.dofPosition());
633 }
634
642 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
643 {
644 // forward it to the method which only takes the global coordinate
645 DUNE_THROW(Dune::InvalidStateException, "dirichlet(scvf) called for CVFE method.");
646 }
647
654 const GravityVector& gravity() const
655 { return gravity_; }
656
661 { return enableInertiaTerms_; }
662
669 Scalar referencePressure() const
670 { return 0.0; }
671
676 Scalar pressure(const Element& element,
677 const FVElementGeometry& fvGeometry,
678 const SubControlVolumeFace& scvf) const
679 {
680 if constexpr (std::is_empty_v<CouplingManager>)
681 return asImp_().pressureAtPos(scvf.ipGlobal());
682 else
683 return couplingManager_->pressure(element, fvGeometry, scvf);
684 }
685
690 Scalar pressure(const Element& element,
691 const FVElementGeometry& fvGeometry,
692 const SubControlVolume& scv,
693 const bool isPreviousTimeStep = false) const
694 {
695 if constexpr (std::is_empty_v<CouplingManager>)
696 return asImp_().pressureAtPos(scv.dofPosition());
697 else
698 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
699 }
700
705 template<class IpData>
706 Scalar pressure(const Element& element,
707 const FVElementGeometry& fvGeometry,
708 const IpData& ipData,
709 const bool isPreviousTimeStep = false) const
710 {
711 if constexpr (std::is_empty_v<CouplingManager>)
712 return asImp_().pressureAtPos(ipData.global());
713 else
714 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
715 }
716
720 Scalar pressureAtPos(const GlobalPosition&) const
721 {
722 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
723 }
724
729 Scalar density(const Element& element,
730 const FVElementGeometry& fvGeometry,
731 const SubControlVolumeFace& scvf) const
732 {
733 if constexpr (std::is_empty_v<CouplingManager>)
734 return asImp_().densityAtPos(scvf.ipGlobal());
735 else
736 return couplingManager_->density(element, fvGeometry, scvf);
737 }
738
743 Scalar density(const Element& element,
744 const FVElementGeometry& fvGeometry,
745 const SubControlVolume& scv,
746 const bool isPreviousTimeStep = false) const
747 {
748 if constexpr (std::is_empty_v<CouplingManager>)
749 return asImp_().densityAtPos(scv.dofPosition());
750 else
751 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
752 }
753
758 template<class IpData>
759 Scalar density(const Element& element,
760 const FVElementGeometry& fvGeometry,
761 const IpData& ipData,
762 const bool isPreviousTimeStep = false) const
763 {
764 if constexpr (std::is_empty_v<CouplingManager>)
765 return asImp_().densityAtPos(ipData.global());
766 else
767 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
768 }
769
773 Scalar densityAtPos(const GlobalPosition&) const
774 {
775 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
776 }
777
782 Scalar effectiveViscosity(const Element& element,
783 const FVElementGeometry& fvGeometry,
784 const SubControlVolumeFace& scvf) const
785 {
786 if constexpr (std::is_empty_v<CouplingManager>)
787 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
788 else
789 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
790 }
791
796 Scalar effectiveViscosity(const Element& element,
797 const FVElementGeometry& fvGeometry,
798 const SubControlVolume& scv,
799 const bool isPreviousTimeStep = false) const
800 {
801 if constexpr (std::is_empty_v<CouplingManager>)
802 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
803 else
804 return couplingManager_->effectiveViscosity(element, fvGeometry, scv, isPreviousTimeStep);
805 }
806
811 template<class IpData>
812 Scalar effectiveViscosity(const Element& element,
813 const FVElementGeometry& fvGeometry,
814 const IpData& ipData,
815 const bool isPreviousTimeStep = false) const
816 {
817 if constexpr (std::is_empty_v<CouplingManager>)
818 return asImp_().effectiveViscosityAtPos(ipData.global());
819 else
820 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
821 }
822
826 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
827 {
828 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
829 }
830
835 template<class SolutionVector>
836 void applyInitialSolution(SolutionVector& sol) const
837 {
838 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
839 sol.resize(this->gridGeometry().numDofs());
840 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
841 auto fvGeometry = localView(this->gridGeometry());
842 for (const auto& element : elements(this->gridGeometry().gridView()))
843 {
844 fvGeometry.bindElement(element);
845 for (const auto& scv : scvs(fvGeometry))
846 {
847 const auto dofIdx = scv.dofIndex();
848 if (!dofHandled[dofIdx])
849 {
850 dofHandled[dofIdx] = true;
851 sol[dofIdx] = asImp_().initial(scv);
852 }
853 }
854 }
855 }
856
860 InitialValues initial(const SubControlVolume& scv) const
861 {
862 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
863 return asImp_().initialAtPos(scv.dofPosition());
864 }
865
866private:
868 Implementation &asImp_()
869 { return *static_cast<Implementation *>(this); }
870
872 const Implementation &asImp_() const
873 { return *static_cast<const Implementation *>(this); }
874
875 GravityVector gravity_;
876 bool enableInertiaTerms_;
877 std::shared_ptr<CouplingManager> couplingManager_ = {};
878};
879
880
884template<class TypeTag>
886: public FVProblemWithSpatialParams<TypeTag>
887{
889 using Implementation = GetPropType<TypeTag, Properties::Problem>;
890
892 using GridView = typename GridGeometry::GridView;
893 using Element = typename GridView::template Codim<0>::Entity;
894
896 using GridVariablesCache = Concept::GridVariablesCache_t<GridVariables>;
897 using ElementVariables = typename GridVariablesCache::LocalView;
899
900 using FVElementGeometry = typename GridGeometry::LocalView;
901 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
902 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
903 using LocalPosition = typename Element::Geometry::LocalCoordinate;
904
905 static constexpr int dim = GridView::dimension;
906 static constexpr int dimWorld = GridView::dimensionworld;
907
908 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
911
912public:
913 using InitialValues = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
914 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
915 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
916 using BoundaryFluxes = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
917
919 using BoundaryTypes = typename Dumux::Experimental::BoundaryTypes<ModelTraits::numEq()>;
920
922 static constexpr bool isMomentumProblem() { return true; }
923 static constexpr bool providesIntegralInterface() { return true; }
924
931 CVFENavierStokesMomentumProblem(std::shared_ptr<const GridGeometry> gridGeometry,
932 std::shared_ptr<CouplingManager> couplingManager,
933 const std::string& paramGroup = "")
935 , gravity_(0.0)
936 , couplingManager_(couplingManager)
937 {
938 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
939 gravity_[dim-1] = -9.81;
940
941 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
942 }
943
949 CVFENavierStokesMomentumProblem(std::shared_ptr<const GridGeometry> gridGeometry,
950 const std::string& paramGroup = "")
952 {}
953
969 template<class IpData>
970 Sources source(const FVElementGeometry& fvGeometry,
971 const ElementVariables& elemVars,
972 const IpData& ipData) const
973 {
974 return asImp_().sourceAtPos(ipData.global());
975 }
976
989 Sources sourceAtPos(const GlobalPosition &globalPos) const
990 {
993 return Sources(0.0);
994 }
995
1003 BoundaryTypes boundaryTypes(const FVElementGeometry& fvGeometry,
1004 const FVElementGeometry::BoundaryFace& boundaryFace) const
1005 {
1006 // forward it to the method which only takes the global coordinate
1007 return asImp_().boundaryTypesAtPos(boundaryFace.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::BoundaryFace& boundaryFace,
1080 const BoundaryTypes& bcTypes) const
1081 {
1082 // quadrature rule for boundary face
1083 for (const auto& qpData : CVFE::quadratureRule(fvGeometry, boundaryFace))
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 flux boundary conditions are set
1092 for (int eqIdx = 0; eqIdx < BoundaryFluxes::dimension; ++eqIdx)
1093 if (bcTypes.isFluxBoundary(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::BoundaryFace& boundaryFace,
1117 const BoundaryTypes& bcTypes) const
1118 {
1119 // quadrature rule for boundary face
1120 for (const auto& qpData : CVFE::quadratureRule(fvGeometry, boundaryFace))
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 flux boundary conditions are set
1129 for (int eqIdx = 0; eqIdx < BoundaryFluxes::dimension; ++eqIdx)
1130 if (bcTypes.isFluxBoundary(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
Navier-Stokes default problem implementation for CVFE discretizations.
Definition: freeflow/navierstokes/momentum/problem.hh:887
void addBoundaryFluxIntegrals(ResidualVector &residual, const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const typename FVElementGeometry::GridGeometry::BoundaryFace &boundaryFace, const BoundaryTypes &bcTypes) const
Evaluates the boundary flux integrals for an intersection related to finite element residuals.
Definition: freeflow/navierstokes/momentum/problem.hh:1076
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
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:931
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:916
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
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
BoundaryTypes boundaryTypes(const FVElementGeometry &fvGeometry, const FVElementGeometry::BoundaryFace &boundaryFace) 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
void addBoundaryFluxIntegrals(ResidualVector &residual, const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const typename FVElementGeometry::GridGeometry::BoundaryFace &boundaryFace, const BoundaryTypes &bcTypes) const
Evaluates the boundary flux integrals for an intersection related to finite element residuals.
Definition: freeflow/navierstokes/momentum/problem.hh:1112
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:989
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:949
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:970
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:913
static constexpr bool providesIntegralInterface()
Definition: freeflow/navierstokes/momentum/problem.hh:923
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition: freeflow/navierstokes/momentum/problem.hh:914
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:922
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:915
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:782
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:759
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:509
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:525
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:706
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:836
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:720
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:812
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:690
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:517
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:773
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:860
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:588
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:567
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:826
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:508
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:616
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: freeflow/navierstokes/momentum/problem.hh:654
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:729
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:510
DirichletValues dirichlet(const Element &element, const SubControlVolume &scv) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:629
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:660
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:543
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:602
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:743
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:511
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:669
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:796
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:676
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:642
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:131
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:108
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:248
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:184
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:423
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:331
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:241
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:90
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:397
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition: freeflow/navierstokes/momentum/problem.hh:305
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:358
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/momentum/problem.hh:447
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition: freeflow/navierstokes/momentum/problem.hh:76
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:82
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:272
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:368
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:281
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition: freeflow/navierstokes/momentum/problem.hh:235
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:437
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:71
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:295
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:226
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at a sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:391
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:166
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:345
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:322
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:74
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:201
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:73
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:72
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:216
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:444
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:261
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:153
Definition: freeflow/navierstokes/momentum/problem.hh:30
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:159
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