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>
20#include <dumux/common/concepts/variables_.hh>
28template<
class TypeTag,
class DiscretizationMethod>
31template<
class TypeTag>
39 using GridView =
typename GridGeometry::GridView;
40 using Element =
typename GridView::template Codim<0>::Entity;
43 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
44 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
47 using FVElementGeometry =
typename GridGeometry::LocalView;
48 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
49 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
53 dim = GridView::dimension,
54 dimWorld = GridView::dimensionworld
57 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
58 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
59 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
63 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
71 using Sources = Dune::FieldVector<Scalar, dimWorld>;
90 std::shared_ptr<CouplingManager> couplingManager,
91 const std::string& paramGroup =
"")
94 , couplingManager_(couplingManager)
96 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
97 gravity_[dim-1] = -9.81;
99 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
108 const std::string& paramGroup =
"")
131 const FVElementGeometry& fvGeometry,
132 const ElementVolumeVariables& elemVolVars,
133 const SubControlVolume& scv)
const
136 return asImp_().sourceAtPos(scv.dofPosition());
166 const FVElementGeometry& fvGeometry,
167 const ElementVolumeVariables& elemVolVars,
168 const SubControlVolume& scv)
const
170 if (!this->pointSourceMap().empty())
171 DUNE_THROW(Dune::NotImplemented,
"scvPointSources not implemented");
184 const SubControlVolumeFace& scvf)
const
189 return asImp_().boundaryTypesAtPos(scvf.center());
202 return asImp_().dirichletAtPos(scvf.ipGlobal());
214 template<
class ElementFluxVariablesCache>
216 const FVElementGeometry& fvGeometry,
217 const ElementVolumeVariables& elemVolVars,
218 const ElementFluxVariablesCache& elemFluxVarsCache,
219 const SubControlVolumeFace& scvf)
const
220 {
return asImp_().neumannAtPos(scvf.ipGlobal()); }
241 {
return enableInertiaTerms_; }
248 const FVElementGeometry& fvGeometry,
249 const SubControlVolumeFace& scvf)
const
251 if constexpr (isCoupled_)
252 return couplingManager_->pressure(element, fvGeometry, scvf);
254 return asImp_().pressureAtPos(scvf.ipGlobal());
262 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
272 const FVElementGeometry& fvGeometry,
273 const SubControlVolumeFace& scvf)
const
281 const FVElementGeometry& fvGeometry,
282 const SubControlVolumeFace& scvf)
const
284 if constexpr (isCoupled_)
285 return couplingManager_->density(element, fvGeometry, scvf);
287 return asImp_().densityAtPos(scvf.ipGlobal());
295 const SubControlVolume& scv,
296 const bool isPreviousTimeStep =
false)
const
298 if constexpr (isCoupled_)
299 return couplingManager_->density(element, scv, isPreviousTimeStep);
301 return asImp_().densityAtPos(scv.dofPosition());
305 const FVElementGeometry& fvGeometry,
306 const SubControlVolumeFace& scvf,
307 const bool isPreviousTimeStep =
false)
const
309 if constexpr (isCoupled_)
310 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
313 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
314 return std::make_pair(rho, rho);
323 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
331 const FVElementGeometry& fvGeometry,
332 const SubControlVolumeFace& scvf)
const
334 if constexpr (isCoupled_)
335 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
337 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
345 const FVElementGeometry& fvGeometry,
346 const SubControlVolume& scv)
const
348 if constexpr (isCoupled_)
349 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
351 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
359 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
366 template<
class SolutionVector>
369 sol.resize(this->gridGeometry().numDofs());
370 std::vector<bool> dofHandled(this->gridGeometry().numDofs(),
false);
371 auto fvGeometry =
localView(this->gridGeometry());
372 for (
const auto& element : elements(this->gridGeometry().gridView()))
374 fvGeometry.bindElement(element);
375 for (
const auto& scv :
scvs(fvGeometry))
377 const auto dofIdx = scv.dofIndex();
378 if (!dofHandled[dofIdx])
380 dofHandled[dofIdx] =
true;
381 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
392 return asImp_().initialAtPos(scv.dofPosition());
397 const FVElementGeometry& fvGeometry,
398 const ElementVolumeVariables& elemVolVars,
399 const SubControlVolume& scv,
401 const Scalar factor = 8.0)
const
403 const Scalar velocity = elemVolVars[scv].velocity();
404 const auto scvf = scvfs(fvGeometry, scv).begin();
405 const Scalar
viscosity = effectiveViscosity(element, fvGeometry, *scvf);
406 return pseudo3DWallFriction(velocity,
viscosity, height, factor);
425 const Scalar factor = 8.0)
const
427 static_assert(dim == 2,
"Pseudo 3D wall friction may only be used in 2D");
428 return -factor * velocity *
viscosity / (height*height);
436 bool onSlipBoundary(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
437 {
return asImp_().onSlipBoundaryAtPos(scvf.center()); }
448 if constexpr (isCoupled_)
449 return *couplingManager_;
451 DUNE_THROW(Dune::InvalidStateException,
452 "Accessing coupling manager of an uncoupled problem is not possible."
458 Implementation& asImp_()
459 {
return *
static_cast<Implementation *
>(
this); }
462 const Implementation& asImp_()
const
463 {
return *
static_cast<const Implementation *
>(
this); }
465 GravityVector gravity_;
466 bool enableInertiaTerms_;
467 std::shared_ptr<CouplingManager> couplingManager_;
473template<
class TypeTag,
class DM>
481 using GridView =
typename GridGeometry::GridView;
482 using Element =
typename GridView::template Codim<0>::Entity;
485 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
486 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
489 using FVElementGeometry =
typename GridGeometry::LocalView;
490 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
491 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
494 static constexpr int dim = GridView::dimension;
495 static constexpr int dimWorld = GridView::dimensionworld;
497 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
498 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
499 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
508 using Sources = Dune::FieldVector<Scalar, dimWorld>;
525 std::shared_ptr<CouplingManager> couplingManager,
526 const std::string& paramGroup =
"")
529 , couplingManager_(couplingManager)
531 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
532 gravity_[dim-1] = -9.81;
534 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
543 const std::string& paramGroup =
"")
565 template<
class ElementVolumeVariables>
567 const FVElementGeometry& fvGeometry,
568 const ElementVolumeVariables& elemVolVars,
569 const SubControlVolume &scv)
const
572 return asImp_().sourceAtPos(scv.center());
602 const SubControlVolume& scv)
const
605 return asImp_().boundaryTypesAtPos(scv.dofPosition());
616 const SubControlVolumeFace& scvf)
const
618 DUNE_THROW(Dune::InvalidStateException,
"boundaryTypes(..., scvf) called for a CVFE method.");
631 return asImp_().dirichletAtPos(scv.dofPosition());
644 DUNE_THROW(Dune::InvalidStateException,
"dirichlet(scvf) called for CVFE method.");
660 {
return enableInertiaTerms_; }
676 const FVElementGeometry& fvGeometry,
677 const SubControlVolumeFace& scvf)
const
679 if constexpr (std::is_empty_v<CouplingManager>)
680 return asImp_().pressureAtPos(scvf.ipGlobal());
682 return couplingManager_->pressure(element, fvGeometry, scvf);
690 const FVElementGeometry& fvGeometry,
691 const SubControlVolume& scv,
692 const bool isPreviousTimeStep =
false)
const
694 if constexpr (std::is_empty_v<CouplingManager>)
695 return asImp_().pressureAtPos(scv.dofPosition());
697 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
704 template<
class IpData>
706 const FVElementGeometry& fvGeometry,
707 const IpData& ipData,
708 const bool isPreviousTimeStep =
false)
const
710 if constexpr (std::is_empty_v<CouplingManager>)
711 return asImp_().pressureAtPos(ipData.global());
713 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
721 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
729 const FVElementGeometry& fvGeometry,
730 const SubControlVolumeFace& scvf)
const
732 if constexpr (std::is_empty_v<CouplingManager>)
733 return asImp_().densityAtPos(scvf.ipGlobal());
735 return couplingManager_->density(element, fvGeometry, scvf);
743 const FVElementGeometry& fvGeometry,
744 const SubControlVolume& scv,
745 const bool isPreviousTimeStep =
false)
const
747 if constexpr (std::is_empty_v<CouplingManager>)
748 return asImp_().densityAtPos(scv.dofPosition());
750 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
757 template<
class IpData>
759 const FVElementGeometry& fvGeometry,
760 const IpData& ipData,
761 const bool isPreviousTimeStep =
false)
const
763 if constexpr (std::is_empty_v<CouplingManager>)
764 return asImp_().densityAtPos(ipData.global());
766 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
774 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
782 const FVElementGeometry& fvGeometry,
783 const SubControlVolumeFace& scvf)
const
785 if constexpr (std::is_empty_v<CouplingManager>)
786 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
788 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
796 const FVElementGeometry& fvGeometry,
797 const SubControlVolume& scv,
798 const bool isPreviousTimeStep =
false)
const
800 if constexpr (std::is_empty_v<CouplingManager>)
801 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
803 return couplingManager_->effectiveViscosity(element, fvGeometry, scv, isPreviousTimeStep);
810 template<
class IpData>
812 const FVElementGeometry& fvGeometry,
813 const IpData& ipData,
814 const bool isPreviousTimeStep =
false)
const
816 if constexpr (std::is_empty_v<CouplingManager>)
817 return asImp_().effectiveViscosityAtPos(ipData.global());
819 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
827 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
834 template<
class SolutionVector>
838 sol.resize(this->gridGeometry().numDofs());
839 std::vector<bool> dofHandled(this->gridGeometry().numDofs(),
false);
840 auto fvGeometry =
localView(this->gridGeometry());
841 for (
const auto& element : elements(this->gridGeometry().gridView()))
843 fvGeometry.bindElement(element);
844 for (
const auto& scv :
scvs(fvGeometry))
846 const auto dofIdx = scv.dofIndex();
847 if (!dofHandled[dofIdx])
849 dofHandled[dofIdx] =
true;
850 sol[dofIdx] = asImp_().initial(scv);
862 return asImp_().initialAtPos(scv.dofPosition());
867 Implementation &asImp_()
868 {
return *
static_cast<Implementation *
>(
this); }
871 const Implementation &asImp_()
const
872 {
return *
static_cast<const Implementation *
>(
this); }
874 GravityVector gravity_;
875 bool enableInertiaTerms_;
876 std::shared_ptr<CouplingManager> couplingManager_ = {};
883template<
class TypeTag>
891 using GridView =
typename GridGeometry::GridView;
892 using Element =
typename GridView::template Codim<0>::Entity;
895 using GridVariablesCache = Concept::GridVariablesCache_t<GridVariables>;
896 using ElementVariables =
typename GridVariablesCache::LocalView;
899 using FVElementGeometry =
typename GridGeometry::LocalView;
900 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
901 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
902 using LocalPosition =
typename Element::Geometry::LocalCoordinate;
904 static constexpr int dim = GridView::dimension;
905 static constexpr int dimWorld = GridView::dimensionworld;
907 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
913 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
931 std::shared_ptr<CouplingManager> couplingManager,
935 , couplingManager_(couplingManager)
937 if (getParamFromGroup<bool>(
paramGroup,
"Problem.EnableGravity"))
938 gravity_[dim-1] = -9.81;
940 enableInertiaTerms_ = getParamFromGroup<bool>(
paramGroup,
"Problem.EnableInertiaTerms");
968 template<
class IpData>
970 const ElementVariables& elemVars,
971 const IpData& ipData)
const
973 return asImp_().sourceAtPos(ipData.global());
1002 template<
class Intersection>
1004 const Intersection& intersection)
const
1007 return asImp_().boundaryTypesAtPos(intersection.geometry().center());
1017 template<
class FaceIpData>
1019 const FaceIpData& faceIpData)
const
1022 return asImp_().dirichletAtPos(faceIpData.global());
1033 const ElementVariables& elemVars,
1034 const SubControlVolumeFace& scvf)
const
1038 flux += qpData.weight() * asImp_().boundaryFlux(fvGeometry, elemVars, qpData.ipData());
1040 return flux * elemVars[fvGeometry.scv(scvf.insideScvIdx())].extrusionFactor();
1051 template<
class ElementFluxVariablesCache>
1052 [[deprecated(
"This function is deprecated and will be removed after release 3.11. "
1053 "Use boundaryFluxIntegral without elemFluxVarsCache instead.")]]
1055 const ElementVariables& elemVars,
1056 const ElementFluxVariablesCache& elemFluxVarsCache,
1057 const SubControlVolumeFace& scvf)
const
1061 flux += qpData.weight() * asImp_().boundaryFlux(fvGeometry, elemVars, elemFluxVarsCache, qpData.ipData());
1063 return flux * elemVars[fvGeometry.scv(scvf.insideScvIdx())].extrusionFactor();
1075 template<
class Res
idualVector,
class BoundaryTypes>
1077 const FVElementGeometry& fvGeometry,
1078 const ElementVariables& elemVars,
1079 const typename FVElementGeometry::GridGeometry::GridView::Intersection& intersection,
1085 const auto& ipData = qpData.ipData();
1086 const auto& ipCache = cache(elemVars, ipData);
1087 for (
const auto& localDof : nonCVLocalDofs(fvGeometry))
1090 const auto& shapeValues = ipCache.shapeValues();
1092 for (
int eqIdx = 0; eqIdx < BoundaryFluxes::dimension; ++eqIdx)
1094 residual[localDof.index()][eqIdx] += shapeValues[localDof.index()] *
boundaryFlux[eqIdx];
1109 template<
class Res
idualVector,
class ElementFluxVariablesCache,
class BoundaryTypes>
1110 [[deprecated(
"This function is deprecated and will be removed after release 3.11. "
1111 "Use addBoundaryFluxIntegrals without elemFluxVarsCache instead.")]]
1113 const FVElementGeometry& fvGeometry,
1114 const ElementVariables& elemVars,
1115 const ElementFluxVariablesCache& elemFluxVarsCache,
1116 const typename FVElementGeometry::GridGeometry::GridView::Intersection& intersection,
1122 const auto& ipData = qpData.ipData();
1123 const auto& cache = elemFluxVarsCache[ipData];
1124 for (
const auto& localDof : nonCVLocalDofs(fvGeometry))
1127 const auto& shapeValues = cache.shapeValues();
1129 for (
int eqIdx = 0; eqIdx < BoundaryFluxes::dimension; ++eqIdx)
1131 residual[localDof.index()][eqIdx] += shapeValues[localDof.index()] *
boundaryFlux[eqIdx];
1143 template<
class FaceIpData>
1145 const ElementVariables& elemVars,
1146 const FaceIpData& faceIpData)
const
1148 return asImp_().boundaryFluxAtPos(faceIpData.global());
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.")]]
1163 const ElementVariables& elemVars,
1164 const ElementFluxVariablesCache& elemFluxVarsCache,
1165 const FaceIpData& faceIpData)
const
1167 return asImp_().boundaryFluxAtPos(faceIpData.global());
1183 {
return gravity_; }
1189 {
return enableInertiaTerms_; }
1204 template<
class IpData>
1206 const FVElementGeometry& fvGeometry,
1207 const IpData& ipData,
1208 const bool isPreviousTimeStep =
false)
const
1210 if constexpr (std::is_empty_v<CouplingManager>)
1211 return asImp_().pressureAtPos(ipData.global());
1213 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
1221 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
1228 template<
class IpData>
1230 const FVElementGeometry& fvGeometry,
1231 const IpData& ipData,
1232 const bool isPreviousTimeStep =
false)
const
1234 if constexpr (std::is_empty_v<CouplingManager>)
1235 return asImp_().densityAtPos(ipData.global());
1237 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
1245 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
1253 template<
class IpData>
1255 const FVElementGeometry& fvGeometry,
1256 const IpData& ipData,
1257 const bool isPreviousTimeStep =
false)
const
1259 if constexpr (std::is_empty_v<CouplingManager>)
1260 return asImp_().effectiveViscosityAtPos(ipData.global());
1262 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
1270 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
1277 template<
class SolutionVector>
1281 std::vector<bool> dofHandled(this->
gridGeometry().numDofs(),
false);
1283 for (
const auto& element : elements(this->
gridGeometry().gridView()))
1285 fvGeometry.bindElement(element);
1286 for (
const auto& localDof :
localDofs(fvGeometry))
1288 const auto dofIdx = localDof.dofIndex();
1289 if (!dofHandled[dofIdx])
1291 dofHandled[dofIdx] =
true;
1292 sol[dofIdx] = asImp_().initial(fvGeometry, ipData(fvGeometry, localDof));
1301 template<
class IpData>
1304 return asImp_().initialAtPos(ipData.global());
1309 Implementation &asImp_()
1310 {
return *
static_cast<Implementation *
>(
this); }
1313 const Implementation &asImp_()
const
1314 {
return *
static_cast<const Implementation *
>(
this); }
1316 GravityVector gravity_;
1317 bool enableInertiaTerms_;
1318 std::shared_ptr<CouplingManager> couplingManager_ = {};
1327template<
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:886
void addBoundaryFluxIntegrals(ResidualVector &residual, const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const typename FVElementGeometry::GridGeometry::GridView::Intersection &intersection, const BoundaryTypes &bcTypes) const
Evaluates the boundary flux integrals for an intersection related to finite element residuals.
Definition: freeflow/navierstokes/momentum/problem.hh:1112
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1243
BoundaryFluxes boundaryFluxAtPos(const GlobalPosition &globalPos) const
Returns the boundary flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1173
void addBoundaryFluxIntegrals(ResidualVector &residual, const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const typename FVElementGeometry::GridGeometry::GridView::Intersection &intersection, const BoundaryTypes &bcTypes) const
Evaluates the boundary flux integrals for an intersection related to finite element residuals.
Definition: freeflow/navierstokes/momentum/problem.hh:1076
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:930
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:915
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:1188
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1254
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:1278
BoundaryFluxes boundaryFlux(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const FaceIpData &faceIpData) const
Evaluates the boundary flux related to a localDof at a given interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1162
DirichletValues dirichlet(const FVElementGeometry &fvGeometry, const FaceIpData &faceIpData) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:1018
BoundaryTypes boundaryTypes(const FVElementGeometry &fvGeometry, const Intersection &intersection) const
Specifies which kind of boundary condition should be used for which equation on a given boundary face...
Definition: freeflow/navierstokes/momentum/problem.hh:1003
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1219
Scalar referencePressure() const
Returns a reference pressure This pressure is subtracted from the actual pressure for the momentum ba...
Definition: freeflow/navierstokes/momentum/problem.hh:1197
InitialValues initial(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Evaluate the initial value at an interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1302
BoundaryFluxes boundaryFluxIntegral(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const SubControlVolumeFace &scvf) const
Evaluates the boundary flux integral for a scvf.
Definition: freeflow/navierstokes/momentum/problem.hh:1032
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:988
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the pressure at given interpolation point data.
Definition: freeflow/navierstokes/momentum/problem.hh:1205
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:948
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the density at given interpolation point data.
Definition: freeflow/navierstokes/momentum/problem.hh:1229
Sources source(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const IpData &ipData) const
Evaluate the source term at a given interpolation point, related to the residual of a local dof.
Definition: freeflow/navierstokes/momentum/problem.hh:969
BoundaryFluxes boundaryFlux(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const FaceIpData &faceIpData) const
Evaluates the boundary flux related to a localDof at a given interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1144
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:912
static constexpr bool providesIntegralInterface()
Definition: freeflow/navierstokes/momentum/problem.hh:922
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition: freeflow/navierstokes/momentum/problem.hh:913
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:921
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any boundaryFlux method.
Definition: freeflow/navierstokes/momentum/problem.hh:1182
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1268
BoundaryFluxes boundaryFluxIntegral(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary flux integral for a scvf.
Definition: freeflow/navierstokes/momentum/problem.hh:1054
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:914
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:43
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:524
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:520
Base class for all finite-volume problems using spatial parameters.
Definition: fvproblemwithspatialparams.hh:29
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:25
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the effective dynamic viscosity at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:781
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:758
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:508
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:524
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:705
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:835
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:719
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:811
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the pressure at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:689
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:516
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:772
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:859
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:587
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:566
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:825
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:507
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:615
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: freeflow/navierstokes/momentum/problem.hh:653
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:728
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:509
DirichletValues dirichlet(const Element &element, const SubControlVolume &scv) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:628
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:659
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:542
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolume &scv) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:601
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:742
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:510
Scalar referencePressure() const
Returns a reference pressure This pressure is subtracted from the actual pressure for the momentum ba...
Definition: freeflow/navierstokes/momentum/problem.hh:668
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:795
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:675
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a Dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:641
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:130
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:107
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:247
auto boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:183
Scalar pseudo3DWallFriction(const Scalar velocity, const Scalar viscosity, const Scalar height, const Scalar factor=8.0) const
An additional drag term can be included as source term for the momentum balance to mimic 3D flow beha...
Definition: freeflow/navierstokes/momentum/problem.hh:422
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the effective dynamic viscosity at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:330
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:240
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:89
Scalar pseudo3DWallFriction(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv, const Scalar height, const Scalar factor=8.0) const
Convenience function for staggered grid implementation.
Definition: freeflow/navierstokes/momentum/problem.hh:396
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition: freeflow/navierstokes/momentum/problem.hh:304
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:357
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/momentum/problem.hh:446
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition: freeflow/navierstokes/momentum/problem.hh:75
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:81
Scalar referencePressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns a reference pressure at a given sub control volume face. This pressure is subtracted from the...
Definition: freeflow/navierstokes/momentum/problem.hh:271
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:367
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:280
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition: freeflow/navierstokes/momentum/problem.hh:234
bool onSlipBoundary(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:436
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:70
Scalar density(const Element &element, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:294
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:225
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at a sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:390
Sources scvPointSources(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Adds contribution of point sources for a specific sub control volume to the values....
Definition: freeflow/navierstokes/momentum/problem.hh:165
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv) const
Returns the effective dynamic viscosity at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:344
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:321
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:73
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:200
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:72
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:71
BoundaryFluxes neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:215
bool onSlipBoundaryAtPos(const GlobalPosition &pos) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:443
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:260
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:152
Definition: freeflow/navierstokes/momentum/problem.hh:29
Defines all properties used in Dumux.
Base class for all finite volume problems that are parameterized.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The available discretization methods in Dumux.
auto quadratureRule(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolume &scv, QuadratureRules::MidpointQuadrature)
Midpoint quadrature for scv.
Definition: quadraturerules.hh:148
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:62
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.