12#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_PROBLEM_HH
13#define DUMUX_NAVIERSTOKES_MOMENTUM_PROBLEM_HH
15#include <dune/common/exceptions.hh>
16#include <dune/common/fvector.hh>
17#include <dune/common/typetraits.hh>
26template<
class TypeTag,
class DiscretizationMethod>
29template<
class TypeTag>
37 using GridView =
typename GridGeometry::GridView;
38 using Element =
typename GridView::template Codim<0>::Entity;
41 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
42 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
45 using FVElementGeometry =
typename GridGeometry::LocalView;
46 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
47 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
51 dim = GridView::dimension,
52 dimWorld = GridView::dimensionworld
55 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
56 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
57 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
61 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
69 using Sources = Dune::FieldVector<Scalar, dimWorld>;
88 std::shared_ptr<CouplingManager> couplingManager,
89 const std::string& paramGroup =
"")
92 , couplingManager_(couplingManager)
94 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
95 gravity_[dim-1] = -9.81;
97 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
106 const std::string& paramGroup =
"")
129 const FVElementGeometry& fvGeometry,
130 const ElementVolumeVariables& elemVolVars,
131 const SubControlVolume& scv)
const
134 return asImp_().sourceAtPos(scv.dofPosition());
164 const FVElementGeometry& fvGeometry,
165 const ElementVolumeVariables& elemVolVars,
166 const SubControlVolume& scv)
const
168 if (!this->pointSourceMap().empty())
169 DUNE_THROW(Dune::NotImplemented,
"scvPointSources not implemented");
182 const SubControlVolumeFace& scvf)
const
187 return asImp_().boundaryTypesAtPos(scvf.center());
200 return asImp_().dirichletAtPos(scvf.ipGlobal());
212 template<
class ElementFluxVariablesCache>
214 const FVElementGeometry& fvGeometry,
215 const ElementVolumeVariables& elemVolVars,
216 const ElementFluxVariablesCache& elemFluxVarsCache,
217 const SubControlVolumeFace& scvf)
const
218 {
return asImp_().neumannAtPos(scvf.ipGlobal()); }
239 {
return enableInertiaTerms_; }
246 const FVElementGeometry& fvGeometry,
247 const SubControlVolumeFace& scvf)
const
249 if constexpr (isCoupled_)
250 return couplingManager_->pressure(element, fvGeometry, scvf);
252 return asImp_().pressureAtPos(scvf.ipGlobal());
260 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
270 const FVElementGeometry& fvGeometry,
271 const SubControlVolumeFace& scvf)
const
279 const FVElementGeometry& fvGeometry,
280 const SubControlVolumeFace& scvf)
const
282 if constexpr (isCoupled_)
283 return couplingManager_->density(element, fvGeometry, scvf);
285 return asImp_().densityAtPos(scvf.ipGlobal());
293 const SubControlVolume& scv,
294 const bool isPreviousTimeStep =
false)
const
296 if constexpr (isCoupled_)
297 return couplingManager_->density(element, scv, isPreviousTimeStep);
299 return asImp_().densityAtPos(scv.dofPosition());
303 const FVElementGeometry& fvGeometry,
304 const SubControlVolumeFace& scvf,
305 const bool isPreviousTimeStep =
false)
const
307 if constexpr (isCoupled_)
308 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
311 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
312 return std::make_pair(rho, rho);
321 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
329 const FVElementGeometry& fvGeometry,
330 const SubControlVolumeFace& scvf)
const
332 if constexpr (isCoupled_)
333 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
335 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
343 const FVElementGeometry& fvGeometry,
344 const SubControlVolume& scv)
const
346 if constexpr (isCoupled_)
347 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
349 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
357 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
364 template<
class SolutionVector>
367 sol.resize(this->gridGeometry().numDofs());
368 std::vector<bool> dofHandled(this->gridGeometry().numDofs(),
false);
369 auto fvGeometry =
localView(this->gridGeometry());
370 for (
const auto& element : elements(this->gridGeometry().gridView()))
372 fvGeometry.bindElement(element);
373 for (
const auto& scv :
scvs(fvGeometry))
375 const auto dofIdx = scv.dofIndex();
376 if (!dofHandled[dofIdx])
378 dofHandled[dofIdx] =
true;
379 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
390 return asImp_().initialAtPos(scv.dofPosition());
395 const FVElementGeometry& fvGeometry,
396 const ElementVolumeVariables& elemVolVars,
397 const SubControlVolume& scv,
399 const Scalar factor = 8.0)
const
401 const Scalar velocity = elemVolVars[scv].velocity();
402 const auto scvf = scvfs(fvGeometry, scv).begin();
403 const Scalar
viscosity = effectiveViscosity(element, fvGeometry, *scvf);
404 return pseudo3DWallFriction(velocity,
viscosity, height, factor);
423 const Scalar factor = 8.0)
const
425 static_assert(dim == 2,
"Pseudo 3D wall friction may only be used in 2D");
426 return -factor * velocity *
viscosity / (height*height);
434 bool onSlipBoundary(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
435 {
return asImp_().onSlipBoundaryAtPos(scvf.center()); }
446 if constexpr (isCoupled_)
447 return *couplingManager_;
449 DUNE_THROW(Dune::InvalidStateException,
450 "Accessing coupling manager of an uncoupled problem is not possible."
456 Implementation& asImp_()
457 {
return *
static_cast<Implementation *
>(
this); }
460 const Implementation& asImp_()
const
461 {
return *
static_cast<const Implementation *
>(
this); }
463 GravityVector gravity_;
464 bool enableInertiaTerms_;
465 std::shared_ptr<CouplingManager> couplingManager_;
471template<
class TypeTag,
class DM>
479 using GridView =
typename GridGeometry::GridView;
480 using Element =
typename GridView::template Codim<0>::Entity;
483 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
484 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
487 using FVElementGeometry =
typename GridGeometry::LocalView;
488 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
489 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
492 static constexpr int dim = GridView::dimension;
493 static constexpr int dimWorld = GridView::dimensionworld;
495 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
496 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
497 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
506 using Sources = Dune::FieldVector<Scalar, dimWorld>;
523 std::shared_ptr<CouplingManager> couplingManager,
524 const std::string& paramGroup =
"")
527 , couplingManager_(couplingManager)
529 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
530 gravity_[dim-1] = -9.81;
532 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
541 const std::string& paramGroup =
"")
563 template<
class ElementVolumeVariables>
565 const FVElementGeometry& fvGeometry,
566 const ElementVolumeVariables& elemVolVars,
567 const SubControlVolume &scv)
const
570 return asImp_().sourceAtPos(scv.center());
600 const SubControlVolume& scv)
const
603 return asImp_().boundaryTypesAtPos(scv.dofPosition());
614 const SubControlVolumeFace& scvf)
const
616 DUNE_THROW(Dune::InvalidStateException,
"boundaryTypes(..., scvf) called for a CVFE method.");
629 return asImp_().dirichletAtPos(scv.dofPosition());
642 DUNE_THROW(Dune::InvalidStateException,
"dirichlet(scvf) called for CVFE method.");
658 {
return enableInertiaTerms_; }
674 const FVElementGeometry& fvGeometry,
675 const SubControlVolumeFace& scvf)
const
677 if constexpr (std::is_empty_v<CouplingManager>)
678 return asImp_().pressureAtPos(scvf.ipGlobal());
680 return couplingManager_->pressure(element, fvGeometry, scvf);
688 const FVElementGeometry& fvGeometry,
689 const SubControlVolume& scv,
690 const bool isPreviousTimeStep =
false)
const
692 if constexpr (std::is_empty_v<CouplingManager>)
693 return asImp_().pressureAtPos(scv.dofPosition());
695 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
702 template<
class IpData>
704 const FVElementGeometry& fvGeometry,
705 const IpData& ipData,
706 const bool isPreviousTimeStep =
false)
const
708 if constexpr (std::is_empty_v<CouplingManager>)
709 return asImp_().pressureAtPos(ipData.global());
711 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
719 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
727 const FVElementGeometry& fvGeometry,
728 const SubControlVolumeFace& scvf)
const
730 if constexpr (std::is_empty_v<CouplingManager>)
731 return asImp_().densityAtPos(scvf.ipGlobal());
733 return couplingManager_->density(element, fvGeometry, scvf);
741 const FVElementGeometry& fvGeometry,
742 const SubControlVolume& scv,
743 const bool isPreviousTimeStep =
false)
const
745 if constexpr (std::is_empty_v<CouplingManager>)
746 return asImp_().densityAtPos(scv.dofPosition());
748 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
755 template<
class IpData>
757 const FVElementGeometry& fvGeometry,
758 const IpData& ipData,
759 const bool isPreviousTimeStep =
false)
const
761 if constexpr (std::is_empty_v<CouplingManager>)
762 return asImp_().densityAtPos(ipData.global());
764 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
772 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
780 const FVElementGeometry& fvGeometry,
781 const SubControlVolumeFace& scvf)
const
783 if constexpr (std::is_empty_v<CouplingManager>)
784 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
786 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
794 const FVElementGeometry& fvGeometry,
795 const SubControlVolume& scv,
796 const bool isPreviousTimeStep =
false)
const
798 if constexpr (std::is_empty_v<CouplingManager>)
799 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
801 return couplingManager_->effectiveViscosity(element, fvGeometry, scv, isPreviousTimeStep);
808 template<
class IpData>
810 const FVElementGeometry& fvGeometry,
811 const IpData& ipData,
812 const bool isPreviousTimeStep =
false)
const
814 if constexpr (std::is_empty_v<CouplingManager>)
815 return asImp_().effectiveViscosityAtPos(ipData.global());
817 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
825 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
832 template<
class SolutionVector>
836 sol.resize(this->gridGeometry().numDofs());
837 std::vector<bool> dofHandled(this->gridGeometry().numDofs(),
false);
838 auto fvGeometry =
localView(this->gridGeometry());
839 for (
const auto& element : elements(this->gridGeometry().gridView()))
841 fvGeometry.bindElement(element);
842 for (
const auto& scv :
scvs(fvGeometry))
844 const auto dofIdx = scv.dofIndex();
845 if (!dofHandled[dofIdx])
847 dofHandled[dofIdx] =
true;
848 sol[dofIdx] = asImp_().initial(scv);
860 return asImp_().initialAtPos(scv.dofPosition());
865 Implementation &asImp_()
866 {
return *
static_cast<Implementation *
>(
this); }
869 const Implementation &asImp_()
const
870 {
return *
static_cast<const Implementation *
>(
this); }
872 GravityVector gravity_;
873 bool enableInertiaTerms_;
874 std::shared_ptr<CouplingManager> couplingManager_ = {};
881template<
class TypeTag>
889 using GridView =
typename GridGeometry::GridView;
890 using Element =
typename GridView::template Codim<0>::Entity;
893 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
894 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
897 using FVElementGeometry =
typename GridGeometry::LocalView;
898 using GlobalPosition =
typename FVElementGeometry::SubControlVolumeFace::GlobalPosition;
899 using LocalPosition =
typename Element::Geometry::LocalCoordinate;
901 static constexpr int dim = GridView::dimension;
902 static constexpr int dimWorld = GridView::dimensionworld;
904 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
910 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
927 std::shared_ptr<CouplingManager> couplingManager,
931 , couplingManager_(couplingManager)
933 if (getParamFromGroup<bool>(
paramGroup,
"Problem.EnableGravity"))
934 gravity_[dim-1] = -9.81;
936 enableInertiaTerms_ = getParamFromGroup<bool>(
paramGroup,
"Problem.EnableInertiaTerms");
964 template<
class ElementVariables,
class IpData>
966 const ElementVariables& elemVars,
967 const IpData& ipData)
const
969 return asImp_().sourceAtPos(ipData.global());
998 template<
class Intersection>
1000 const Intersection& intersection)
const
1003 return asImp_().boundaryTypesAtPos(intersection.geometry().center());
1013 template<
class FaceIpData>
1015 const FaceIpData& faceIpData)
const
1018 return asImp_().dirichletAtPos(faceIpData.global());
1029 template<
class ElementVariables,
class ElementFluxVariablesCache,
class FaceIpData>
1031 const ElementVariables& elemVars,
1032 const ElementFluxVariablesCache& elemFluxVarsCache,
1033 const FaceIpData& faceIpData)
const
1035 return asImp_().boundaryFluxAtPos(faceIpData.global());
1051 {
return gravity_; }
1057 {
return enableInertiaTerms_; }
1072 template<
class IpData>
1074 const FVElementGeometry& fvGeometry,
1075 const IpData& ipData,
1076 const bool isPreviousTimeStep =
false)
const
1078 if constexpr (std::is_empty_v<CouplingManager>)
1079 return asImp_().pressureAtPos(ipData.global());
1081 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
1089 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
1096 template<
class IpData>
1098 const FVElementGeometry& fvGeometry,
1099 const IpData& ipData,
1100 const bool isPreviousTimeStep =
false)
const
1102 if constexpr (std::is_empty_v<CouplingManager>)
1103 return asImp_().densityAtPos(ipData.global());
1105 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
1113 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
1121 template<
class IpData>
1123 const FVElementGeometry& fvGeometry,
1124 const IpData& ipData,
1125 const bool isPreviousTimeStep =
false)
const
1127 if constexpr (std::is_empty_v<CouplingManager>)
1128 return asImp_().effectiveViscosityAtPos(ipData.global());
1130 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
1138 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
1145 template<
class SolutionVector>
1149 std::vector<bool> dofHandled(this->
gridGeometry().numDofs(),
false);
1151 for (
const auto& element : elements(this->
gridGeometry().gridView()))
1153 fvGeometry.bindElement(element);
1154 for (
const auto& localDof :
localDofs(fvGeometry))
1156 const auto dofIdx = localDof.dofIndex();
1157 if (!dofHandled[dofIdx])
1159 dofHandled[dofIdx] =
true;
1160 sol[dofIdx] = asImp_().initial(fvGeometry, ipData(fvGeometry, localDof));
1169 template<
class IpData>
1172 return asImp_().initialAtPos(ipData.global());
1177 Implementation &asImp_()
1178 {
return *
static_cast<Implementation *
>(
this); }
1181 const Implementation &asImp_()
const
1182 {
return *
static_cast<const Implementation *
>(
this); }
1184 GravityVector gravity_;
1185 bool enableInertiaTerms_;
1186 std::shared_ptr<CouplingManager> couplingManager_ = {};
1195template<
class TypeTag>
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:884
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1111
BoundaryFluxes boundaryFluxAtPos(const GlobalPosition &globalPos) const
Returns the boundary flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1041
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:926
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:912
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:1056
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:1122
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:1146
DirichletValues dirichlet(const FVElementGeometry &fvGeometry, const FaceIpData &faceIpData) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:1014
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:999
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1087
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:1065
InitialValues initial(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Evaluate the initial value at an interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1170
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:984
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:1073
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:944
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:965
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:1097
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:909
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition: freeflow/navierstokes/momentum/problem.hh:910
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:1030
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:918
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any boundaryFlux method.
Definition: freeflow/navierstokes/momentum/problem.hh:1050
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1136
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:911
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:779
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:756
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:506
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:522
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:703
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:833
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:717
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:809
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the pressure at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:687
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:514
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:770
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:857
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:585
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:564
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:823
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:505
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:613
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: freeflow/navierstokes/momentum/problem.hh:651
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:726
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:507
DirichletValues dirichlet(const Element &element, const SubControlVolume &scv) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:626
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:657
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:540
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolume &scv) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:599
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:740
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:508
Scalar referencePressure() const
Returns a reference pressure This pressure is subtracted from the actual pressure for the momentum ba...
Definition: freeflow/navierstokes/momentum/problem.hh:666
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:793
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:673
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a Dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:639
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:128
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:105
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:245
auto boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:181
Scalar pseudo3DWallFriction(const Scalar velocity, const Scalar viscosity, const Scalar height, const Scalar factor=8.0) const
An additional drag term can be included as source term for the momentum balance to mimic 3D flow beha...
Definition: freeflow/navierstokes/momentum/problem.hh:420
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the effective dynamic viscosity at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:328
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:238
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:87
Scalar pseudo3DWallFriction(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv, const Scalar height, const Scalar factor=8.0) const
Convenience function for staggered grid implementation.
Definition: freeflow/navierstokes/momentum/problem.hh:394
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition: freeflow/navierstokes/momentum/problem.hh:302
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:355
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/momentum/problem.hh:444
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition: freeflow/navierstokes/momentum/problem.hh:73
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:79
Scalar referencePressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns a reference pressure at a given sub control volume face. This pressure is subtracted from the...
Definition: freeflow/navierstokes/momentum/problem.hh:269
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:365
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:278
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition: freeflow/navierstokes/momentum/problem.hh:232
bool onSlipBoundary(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:434
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:68
Scalar density(const Element &element, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:292
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:223
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at a sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:388
Sources scvPointSources(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Adds contribution of point sources for a specific sub control volume to the values....
Definition: freeflow/navierstokes/momentum/problem.hh:163
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv) const
Returns the effective dynamic viscosity at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:342
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:319
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:71
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:198
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:70
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:69
BoundaryFluxes neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:213
bool onSlipBoundaryAtPos(const GlobalPosition &pos) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:441
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:258
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:150
Definition: freeflow/navierstokes/momentum/problem.hh:27
Defines all properties used in Dumux.
Base class for all finite volume problems that are parameterized.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The available discretization methods in Dumux.
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:62
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.