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>
27template<
class TypeTag,
class DiscretizationMethod>
30template<
class TypeTag>
38 using GridView =
typename GridGeometry::GridView;
39 using Element =
typename GridView::template Codim<0>::Entity;
42 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
43 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
46 using FVElementGeometry =
typename GridGeometry::LocalView;
47 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
48 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
52 dim = GridView::dimension,
53 dimWorld = GridView::dimensionworld
56 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
57 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
58 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
62 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
70 using Sources = Dune::FieldVector<Scalar, dimWorld>;
89 std::shared_ptr<CouplingManager> couplingManager,
90 const std::string& paramGroup =
"")
93 , couplingManager_(couplingManager)
95 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
96 gravity_[dim-1] = -9.81;
98 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
107 const std::string& paramGroup =
"")
130 const FVElementGeometry& fvGeometry,
131 const ElementVolumeVariables& elemVolVars,
132 const SubControlVolume& scv)
const
135 return asImp_().sourceAtPos(scv.dofPosition());
165 const FVElementGeometry& fvGeometry,
166 const ElementVolumeVariables& elemVolVars,
167 const SubControlVolume& scv)
const
169 if (!this->pointSourceMap().empty())
170 DUNE_THROW(Dune::NotImplemented,
"scvPointSources not implemented");
183 const SubControlVolumeFace& scvf)
const
188 return asImp_().boundaryTypesAtPos(scvf.center());
201 return asImp_().dirichletAtPos(scvf.ipGlobal());
213 template<
class ElementFluxVariablesCache>
215 const FVElementGeometry& fvGeometry,
216 const ElementVolumeVariables& elemVolVars,
217 const ElementFluxVariablesCache& elemFluxVarsCache,
218 const SubControlVolumeFace& scvf)
const
219 {
return asImp_().neumannAtPos(scvf.ipGlobal()); }
240 {
return enableInertiaTerms_; }
247 const FVElementGeometry& fvGeometry,
248 const SubControlVolumeFace& scvf)
const
250 if constexpr (isCoupled_)
251 return couplingManager_->pressure(element, fvGeometry, scvf);
253 return asImp_().pressureAtPos(scvf.ipGlobal());
261 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
271 const FVElementGeometry& fvGeometry,
272 const SubControlVolumeFace& scvf)
const
280 const FVElementGeometry& fvGeometry,
281 const SubControlVolumeFace& scvf)
const
283 if constexpr (isCoupled_)
284 return couplingManager_->density(element, fvGeometry, scvf);
286 return asImp_().densityAtPos(scvf.ipGlobal());
294 const SubControlVolume& scv,
295 const bool isPreviousTimeStep =
false)
const
297 if constexpr (isCoupled_)
298 return couplingManager_->density(element, scv, isPreviousTimeStep);
300 return asImp_().densityAtPos(scv.dofPosition());
304 const FVElementGeometry& fvGeometry,
305 const SubControlVolumeFace& scvf,
306 const bool isPreviousTimeStep =
false)
const
308 if constexpr (isCoupled_)
309 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
312 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
313 return std::make_pair(rho, rho);
322 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
330 const FVElementGeometry& fvGeometry,
331 const SubControlVolumeFace& scvf)
const
333 if constexpr (isCoupled_)
334 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
336 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
344 const FVElementGeometry& fvGeometry,
345 const SubControlVolume& scv)
const
347 if constexpr (isCoupled_)
348 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
350 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
358 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
365 template<
class SolutionVector>
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()))
373 fvGeometry.bindElement(element);
374 for (
const auto& scv :
scvs(fvGeometry))
376 const auto dofIdx = scv.dofIndex();
377 if (!dofHandled[dofIdx])
379 dofHandled[dofIdx] =
true;
380 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
391 return asImp_().initialAtPos(scv.dofPosition());
396 const FVElementGeometry& fvGeometry,
397 const ElementVolumeVariables& elemVolVars,
398 const SubControlVolume& scv,
400 const Scalar factor = 8.0)
const
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);
424 const Scalar factor = 8.0)
const
426 static_assert(dim == 2,
"Pseudo 3D wall friction may only be used in 2D");
427 return -factor * velocity *
viscosity / (height*height);
435 bool onSlipBoundary(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
436 {
return asImp_().onSlipBoundaryAtPos(scvf.center()); }
447 if constexpr (isCoupled_)
448 return *couplingManager_;
450 DUNE_THROW(Dune::InvalidStateException,
451 "Accessing coupling manager of an uncoupled problem is not possible."
457 Implementation& asImp_()
458 {
return *
static_cast<Implementation *
>(
this); }
461 const Implementation& asImp_()
const
462 {
return *
static_cast<const Implementation *
>(
this); }
464 GravityVector gravity_;
465 bool enableInertiaTerms_;
466 std::shared_ptr<CouplingManager> couplingManager_;
472template<
class TypeTag,
class DM>
480 using GridView =
typename GridGeometry::GridView;
481 using Element =
typename GridView::template Codim<0>::Entity;
484 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
485 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
488 using FVElementGeometry =
typename GridGeometry::LocalView;
489 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
490 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
493 static constexpr int dim = GridView::dimension;
494 static constexpr int dimWorld = GridView::dimensionworld;
496 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
497 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
498 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
507 using Sources = Dune::FieldVector<Scalar, dimWorld>;
524 std::shared_ptr<CouplingManager> couplingManager,
525 const std::string& paramGroup =
"")
528 , couplingManager_(couplingManager)
530 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
531 gravity_[dim-1] = -9.81;
533 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
542 const std::string& paramGroup =
"")
564 template<
class ElementVolumeVariables>
566 const FVElementGeometry& fvGeometry,
567 const ElementVolumeVariables& elemVolVars,
568 const SubControlVolume &scv)
const
571 return asImp_().sourceAtPos(scv.center());
601 const SubControlVolume& scv)
const
604 return asImp_().boundaryTypesAtPos(scv.dofPosition());
615 const SubControlVolumeFace& scvf)
const
617 DUNE_THROW(Dune::InvalidStateException,
"boundaryTypes(..., scvf) called for a CVFE method.");
630 return asImp_().dirichletAtPos(scv.dofPosition());
643 DUNE_THROW(Dune::InvalidStateException,
"dirichlet(scvf) called for CVFE method.");
659 {
return enableInertiaTerms_; }
675 const FVElementGeometry& fvGeometry,
676 const SubControlVolumeFace& scvf)
const
678 if constexpr (std::is_empty_v<CouplingManager>)
679 return asImp_().pressureAtPos(scvf.ipGlobal());
681 return couplingManager_->pressure(element, fvGeometry, scvf);
689 const FVElementGeometry& fvGeometry,
690 const SubControlVolume& scv,
691 const bool isPreviousTimeStep =
false)
const
693 if constexpr (std::is_empty_v<CouplingManager>)
694 return asImp_().pressureAtPos(scv.dofPosition());
696 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
703 template<
class IpData>
705 const FVElementGeometry& fvGeometry,
706 const IpData& ipData,
707 const bool isPreviousTimeStep =
false)
const
709 if constexpr (std::is_empty_v<CouplingManager>)
710 return asImp_().pressureAtPos(ipData.global());
712 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
720 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
728 const FVElementGeometry& fvGeometry,
729 const SubControlVolumeFace& scvf)
const
731 if constexpr (std::is_empty_v<CouplingManager>)
732 return asImp_().densityAtPos(scvf.ipGlobal());
734 return couplingManager_->density(element, fvGeometry, scvf);
742 const FVElementGeometry& fvGeometry,
743 const SubControlVolume& scv,
744 const bool isPreviousTimeStep =
false)
const
746 if constexpr (std::is_empty_v<CouplingManager>)
747 return asImp_().densityAtPos(scv.dofPosition());
749 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
756 template<
class IpData>
758 const FVElementGeometry& fvGeometry,
759 const IpData& ipData,
760 const bool isPreviousTimeStep =
false)
const
762 if constexpr (std::is_empty_v<CouplingManager>)
763 return asImp_().densityAtPos(ipData.global());
765 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
773 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
781 const FVElementGeometry& fvGeometry,
782 const SubControlVolumeFace& scvf)
const
784 if constexpr (std::is_empty_v<CouplingManager>)
785 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
787 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
795 const FVElementGeometry& fvGeometry,
796 const SubControlVolume& scv,
797 const bool isPreviousTimeStep =
false)
const
799 if constexpr (std::is_empty_v<CouplingManager>)
800 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
802 return couplingManager_->effectiveViscosity(element, fvGeometry, scv, isPreviousTimeStep);
809 template<
class IpData>
811 const FVElementGeometry& fvGeometry,
812 const IpData& ipData,
813 const bool isPreviousTimeStep =
false)
const
815 if constexpr (std::is_empty_v<CouplingManager>)
816 return asImp_().effectiveViscosityAtPos(ipData.global());
818 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
826 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
833 template<
class SolutionVector>
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()))
842 fvGeometry.bindElement(element);
843 for (
const auto& scv :
scvs(fvGeometry))
845 const auto dofIdx = scv.dofIndex();
846 if (!dofHandled[dofIdx])
848 dofHandled[dofIdx] =
true;
849 sol[dofIdx] = asImp_().initial(scv);
861 return asImp_().initialAtPos(scv.dofPosition());
866 Implementation &asImp_()
867 {
return *
static_cast<Implementation *
>(
this); }
870 const Implementation &asImp_()
const
871 {
return *
static_cast<const Implementation *
>(
this); }
873 GravityVector gravity_;
874 bool enableInertiaTerms_;
875 std::shared_ptr<CouplingManager> couplingManager_ = {};
882template<
class TypeTag>
890 using GridView =
typename GridGeometry::GridView;
891 using Element =
typename GridView::template Codim<0>::Entity;
894 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
895 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
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;
903 static constexpr int dim = GridView::dimension;
904 static constexpr int dimWorld = GridView::dimensionworld;
906 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
912 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
930 std::shared_ptr<CouplingManager> couplingManager,
934 , couplingManager_(couplingManager)
936 if (getParamFromGroup<bool>(
paramGroup,
"Problem.EnableGravity"))
937 gravity_[dim-1] = -9.81;
939 enableInertiaTerms_ = getParamFromGroup<bool>(
paramGroup,
"Problem.EnableInertiaTerms");
967 template<
class ElementVariables,
class IpData>
969 const ElementVariables& elemVars,
970 const IpData& ipData)
const
972 return asImp_().sourceAtPos(ipData.global());
1001 template<
class Intersection>
1003 const Intersection& intersection)
const
1006 return asImp_().boundaryTypesAtPos(intersection.geometry().center());
1016 template<
class FaceIpData>
1018 const FaceIpData& faceIpData)
const
1021 return asImp_().dirichletAtPos(faceIpData.global());
1032 template<
class ElementVariables,
class ElementFluxVariablesCache>
1034 const ElementVariables& elemVars,
1035 const ElementFluxVariablesCache& elemFluxVarsCache,
1036 const SubControlVolumeFace& scvf)
const
1040 flux += qpData.weight() * asImp_().boundaryFlux(fvGeometry, elemVars, elemFluxVarsCache, qpData.ipData());
1042 return flux * elemVars[fvGeometry.scv(scvf.insideScvIdx())].extrusionFactor();
1055 template<
class Res
idualVector,
class ElementVariables,
class ElementFluxVariablesCache,
class BoundaryTypes>
1057 const FVElementGeometry& fvGeometry,
1058 const ElementVariables& elemVars,
1059 const ElementFluxVariablesCache& elemFluxVarsCache,
1060 const typename FVElementGeometry::GridGeometry::GridView::Intersection& intersection,
1066 const auto& ipData = qpData.ipData();
1067 const auto& cache = elemFluxVarsCache[ipData];
1068 for (
const auto& localDof : nonCVLocalDofs(fvGeometry))
1071 const auto& shapeValues = cache.shapeValues();
1073 for (
int eqIdx = 0; eqIdx < BoundaryFluxes::dimension; ++eqIdx)
1075 residual[localDof.index()][eqIdx] += shapeValues[localDof.index()] *
boundaryFlux[eqIdx];
1088 template<
class ElementVariables,
class ElementFluxVariablesCache,
class FaceIpData>
1090 const ElementVariables& elemVars,
1091 const ElementFluxVariablesCache& elemFluxVarsCache,
1092 const FaceIpData& faceIpData)
const
1094 return asImp_().boundaryFluxAtPos(faceIpData.global());
1110 {
return gravity_; }
1116 {
return enableInertiaTerms_; }
1131 template<
class IpData>
1133 const FVElementGeometry& fvGeometry,
1134 const IpData& ipData,
1135 const bool isPreviousTimeStep =
false)
const
1137 if constexpr (std::is_empty_v<CouplingManager>)
1138 return asImp_().pressureAtPos(ipData.global());
1140 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
1148 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
1155 template<
class IpData>
1157 const FVElementGeometry& fvGeometry,
1158 const IpData& ipData,
1159 const bool isPreviousTimeStep =
false)
const
1161 if constexpr (std::is_empty_v<CouplingManager>)
1162 return asImp_().densityAtPos(ipData.global());
1164 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
1172 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
1180 template<
class IpData>
1182 const FVElementGeometry& fvGeometry,
1183 const IpData& ipData,
1184 const bool isPreviousTimeStep =
false)
const
1186 if constexpr (std::is_empty_v<CouplingManager>)
1187 return asImp_().effectiveViscosityAtPos(ipData.global());
1189 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
1197 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
1204 template<
class SolutionVector>
1208 std::vector<bool> dofHandled(this->
gridGeometry().numDofs(),
false);
1210 for (
const auto& element : elements(this->
gridGeometry().gridView()))
1212 fvGeometry.bindElement(element);
1213 for (
const auto& localDof :
localDofs(fvGeometry))
1215 const auto dofIdx = localDof.dofIndex();
1216 if (!dofHandled[dofIdx])
1218 dofHandled[dofIdx] =
true;
1219 sol[dofIdx] = asImp_().initial(fvGeometry, ipData(fvGeometry, localDof));
1228 template<
class IpData>
1231 return asImp_().initialAtPos(ipData.global());
1236 Implementation &asImp_()
1237 {
return *
static_cast<Implementation *
>(
this); }
1240 const Implementation &asImp_()
const
1241 {
return *
static_cast<const Implementation *
>(
this); }
1243 GravityVector gravity_;
1244 bool enableInertiaTerms_;
1245 std::shared_ptr<CouplingManager> couplingManager_ = {};
1254template<
class TypeTag>
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 ¶mGroup="")
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 ¶mGroup="")
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 ¶mGroup="")
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 ¶mGroup="")
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 ¶mGroup="")
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 ¶mGroup="")
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
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.