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>
18#include <dumux/common/boundarytypes_.hh>
21#include <dumux/common/concepts/variables_.hh>
29template<
class TypeTag,
class DiscretizationMethod>
32template<
class TypeTag>
40 using GridView =
typename GridGeometry::GridView;
41 using Element =
typename GridView::template Codim<0>::Entity;
44 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
45 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
48 using FVElementGeometry =
typename GridGeometry::LocalView;
49 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
50 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
54 dim = GridView::dimension,
55 dimWorld = GridView::dimensionworld
58 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
59 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
60 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
64 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
72 using Sources = Dune::FieldVector<Scalar, dimWorld>;
91 std::shared_ptr<CouplingManager> couplingManager,
92 const std::string& paramGroup =
"")
95 , couplingManager_(couplingManager)
97 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
98 gravity_[dim-1] = -9.81;
100 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
109 const std::string& paramGroup =
"")
132 const FVElementGeometry& fvGeometry,
133 const ElementVolumeVariables& elemVolVars,
134 const SubControlVolume& scv)
const
137 return asImp_().sourceAtPos(scv.dofPosition());
167 const FVElementGeometry& fvGeometry,
168 const ElementVolumeVariables& elemVolVars,
169 const SubControlVolume& scv)
const
171 if (!this->pointSourceMap().empty())
172 DUNE_THROW(Dune::NotImplemented,
"scvPointSources not implemented");
185 const SubControlVolumeFace& scvf)
const
190 return asImp_().boundaryTypesAtPos(scvf.center());
203 return asImp_().dirichletAtPos(scvf.ipGlobal());
215 template<
class ElementFluxVariablesCache>
217 const FVElementGeometry& fvGeometry,
218 const ElementVolumeVariables& elemVolVars,
219 const ElementFluxVariablesCache& elemFluxVarsCache,
220 const SubControlVolumeFace& scvf)
const
221 {
return asImp_().neumannAtPos(scvf.ipGlobal()); }
242 {
return enableInertiaTerms_; }
249 const FVElementGeometry& fvGeometry,
250 const SubControlVolumeFace& scvf)
const
252 if constexpr (isCoupled_)
253 return couplingManager_->pressure(element, fvGeometry, scvf);
255 return asImp_().pressureAtPos(scvf.ipGlobal());
263 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
273 const FVElementGeometry& fvGeometry,
274 const SubControlVolumeFace& scvf)
const
282 const FVElementGeometry& fvGeometry,
283 const SubControlVolumeFace& scvf)
const
285 if constexpr (isCoupled_)
286 return couplingManager_->density(element, fvGeometry, scvf);
288 return asImp_().densityAtPos(scvf.ipGlobal());
296 const SubControlVolume& scv,
297 const bool isPreviousTimeStep =
false)
const
299 if constexpr (isCoupled_)
300 return couplingManager_->density(element, scv, isPreviousTimeStep);
302 return asImp_().densityAtPos(scv.dofPosition());
306 const FVElementGeometry& fvGeometry,
307 const SubControlVolumeFace& scvf,
308 const bool isPreviousTimeStep =
false)
const
310 if constexpr (isCoupled_)
311 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
314 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
315 return std::make_pair(rho, rho);
324 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
332 const FVElementGeometry& fvGeometry,
333 const SubControlVolumeFace& scvf)
const
335 if constexpr (isCoupled_)
336 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
338 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
346 const FVElementGeometry& fvGeometry,
347 const SubControlVolume& scv)
const
349 if constexpr (isCoupled_)
350 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
352 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
360 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
367 template<
class SolutionVector>
370 sol.resize(this->gridGeometry().numDofs());
371 std::vector<bool> dofHandled(this->gridGeometry().numDofs(),
false);
372 auto fvGeometry =
localView(this->gridGeometry());
373 for (
const auto& element : elements(this->gridGeometry().gridView()))
375 fvGeometry.bindElement(element);
376 for (
const auto& scv :
scvs(fvGeometry))
378 const auto dofIdx = scv.dofIndex();
379 if (!dofHandled[dofIdx])
381 dofHandled[dofIdx] =
true;
382 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
393 return asImp_().initialAtPos(scv.dofPosition());
398 const FVElementGeometry& fvGeometry,
399 const ElementVolumeVariables& elemVolVars,
400 const SubControlVolume& scv,
402 const Scalar factor = 8.0)
const
404 const Scalar velocity = elemVolVars[scv].velocity();
405 const auto scvf = scvfs(fvGeometry, scv).begin();
406 const Scalar
viscosity = effectiveViscosity(element, fvGeometry, *scvf);
407 return pseudo3DWallFriction(velocity,
viscosity, height, factor);
426 const Scalar factor = 8.0)
const
428 static_assert(dim == 2,
"Pseudo 3D wall friction may only be used in 2D");
429 return -factor * velocity *
viscosity / (height*height);
437 bool onSlipBoundary(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
438 {
return asImp_().onSlipBoundaryAtPos(scvf.center()); }
449 if constexpr (isCoupled_)
450 return *couplingManager_;
452 DUNE_THROW(Dune::InvalidStateException,
453 "Accessing coupling manager of an uncoupled problem is not possible."
459 Implementation& asImp_()
460 {
return *
static_cast<Implementation *
>(
this); }
463 const Implementation& asImp_()
const
464 {
return *
static_cast<const Implementation *
>(
this); }
466 GravityVector gravity_;
467 bool enableInertiaTerms_;
468 std::shared_ptr<CouplingManager> couplingManager_;
474template<
class TypeTag,
class DM>
482 using GridView =
typename GridGeometry::GridView;
483 using Element =
typename GridView::template Codim<0>::Entity;
486 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
487 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
490 using FVElementGeometry =
typename GridGeometry::LocalView;
491 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
492 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
495 static constexpr int dim = GridView::dimension;
496 static constexpr int dimWorld = GridView::dimensionworld;
498 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
499 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
500 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
509 using Sources = Dune::FieldVector<Scalar, dimWorld>;
526 std::shared_ptr<CouplingManager> couplingManager,
527 const std::string& paramGroup =
"")
530 , couplingManager_(couplingManager)
532 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
533 gravity_[dim-1] = -9.81;
535 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
544 const std::string& paramGroup =
"")
566 template<
class ElementVolumeVariables>
568 const FVElementGeometry& fvGeometry,
569 const ElementVolumeVariables& elemVolVars,
570 const SubControlVolume &scv)
const
573 return asImp_().sourceAtPos(scv.center());
603 const SubControlVolume& scv)
const
606 return asImp_().boundaryTypesAtPos(scv.dofPosition());
617 const SubControlVolumeFace& scvf)
const
619 DUNE_THROW(Dune::InvalidStateException,
"boundaryTypes(..., scvf) called for a CVFE method.");
632 return asImp_().dirichletAtPos(scv.dofPosition());
645 DUNE_THROW(Dune::InvalidStateException,
"dirichlet(scvf) called for CVFE method.");
661 {
return enableInertiaTerms_; }
677 const FVElementGeometry& fvGeometry,
678 const SubControlVolumeFace& scvf)
const
680 if constexpr (std::is_empty_v<CouplingManager>)
681 return asImp_().pressureAtPos(scvf.ipGlobal());
683 return couplingManager_->pressure(element, fvGeometry, scvf);
691 const FVElementGeometry& fvGeometry,
692 const SubControlVolume& scv,
693 const bool isPreviousTimeStep =
false)
const
695 if constexpr (std::is_empty_v<CouplingManager>)
696 return asImp_().pressureAtPos(scv.dofPosition());
698 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
705 template<
class IpData>
707 const FVElementGeometry& fvGeometry,
708 const IpData& ipData,
709 const bool isPreviousTimeStep =
false)
const
711 if constexpr (std::is_empty_v<CouplingManager>)
712 return asImp_().pressureAtPos(ipData.global());
714 return couplingManager_->pressure(element, fvGeometry, ipData, isPreviousTimeStep);
722 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
730 const FVElementGeometry& fvGeometry,
731 const SubControlVolumeFace& scvf)
const
733 if constexpr (std::is_empty_v<CouplingManager>)
734 return asImp_().densityAtPos(scvf.ipGlobal());
736 return couplingManager_->density(element, fvGeometry, scvf);
744 const FVElementGeometry& fvGeometry,
745 const SubControlVolume& scv,
746 const bool isPreviousTimeStep =
false)
const
748 if constexpr (std::is_empty_v<CouplingManager>)
749 return asImp_().densityAtPos(scv.dofPosition());
751 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
758 template<
class IpData>
760 const FVElementGeometry& fvGeometry,
761 const IpData& ipData,
762 const bool isPreviousTimeStep =
false)
const
764 if constexpr (std::is_empty_v<CouplingManager>)
765 return asImp_().densityAtPos(ipData.global());
767 return couplingManager_->density(element, fvGeometry, ipData, isPreviousTimeStep);
775 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
783 const FVElementGeometry& fvGeometry,
784 const SubControlVolumeFace& scvf)
const
786 if constexpr (std::is_empty_v<CouplingManager>)
787 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
789 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
797 const FVElementGeometry& fvGeometry,
798 const SubControlVolume& scv,
799 const bool isPreviousTimeStep =
false)
const
801 if constexpr (std::is_empty_v<CouplingManager>)
802 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
804 return couplingManager_->effectiveViscosity(element, fvGeometry, scv, isPreviousTimeStep);
811 template<
class IpData>
813 const FVElementGeometry& fvGeometry,
814 const IpData& ipData,
815 const bool isPreviousTimeStep =
false)
const
817 if constexpr (std::is_empty_v<CouplingManager>)
818 return asImp_().effectiveViscosityAtPos(ipData.global());
820 return couplingManager_->effectiveViscosity(element, fvGeometry, ipData, isPreviousTimeStep);
828 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
835 template<
class SolutionVector>
839 sol.resize(this->gridGeometry().numDofs());
840 std::vector<bool> dofHandled(this->gridGeometry().numDofs(),
false);
841 auto fvGeometry =
localView(this->gridGeometry());
842 for (
const auto& element : elements(this->gridGeometry().gridView()))
844 fvGeometry.bindElement(element);
845 for (
const auto& scv :
scvs(fvGeometry))
847 const auto dofIdx = scv.dofIndex();
848 if (!dofHandled[dofIdx])
850 dofHandled[dofIdx] =
true;
851 sol[dofIdx] = asImp_().initial(scv);
863 return asImp_().initialAtPos(scv.dofPosition());
868 Implementation &asImp_()
869 {
return *
static_cast<Implementation *
>(
this); }
872 const Implementation &asImp_()
const
873 {
return *
static_cast<const Implementation *
>(
this); }
875 GravityVector gravity_;
876 bool enableInertiaTerms_;
877 std::shared_ptr<CouplingManager> couplingManager_ = {};
884template<
class TypeTag>
892 using GridView =
typename GridGeometry::GridView;
893 using Element =
typename GridView::template Codim<0>::Entity;
896 using GridVariablesCache = Concept::GridVariablesCache_t<GridVariables>;
897 using ElementVariables =
typename GridVariablesCache::LocalView;
900 using FVElementGeometry =
typename GridGeometry::LocalView;
901 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
902 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
903 using LocalPosition =
typename Element::Geometry::LocalCoordinate;
905 static constexpr int dim = GridView::dimension;
906 static constexpr int dimWorld = GridView::dimensionworld;
908 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
914 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
919 using BoundaryTypes =
typename Dumux::Experimental::BoundaryTypes<ModelTraits::numEq()>;
932 std::shared_ptr<CouplingManager> couplingManager,
936 , couplingManager_(couplingManager)
938 if (getParamFromGroup<bool>(
paramGroup,
"Problem.EnableGravity"))
939 gravity_[dim-1] = -9.81;
941 enableInertiaTerms_ = getParamFromGroup<bool>(
paramGroup,
"Problem.EnableInertiaTerms");
969 template<
class IpData>
971 const ElementVariables& elemVars,
972 const IpData& ipData)
const
974 return asImp_().sourceAtPos(ipData.global());
1004 const FVElementGeometry::BoundaryFace& boundaryFace)
const
1007 return asImp_().boundaryTypesAtPos(boundaryFace.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::BoundaryFace& boundaryFace,
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)
1093 if (bcTypes.isFluxBoundary(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::BoundaryFace& boundaryFace,
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)
1130 if (bcTypes.isFluxBoundary(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
Navier-Stokes default problem implementation for CVFE discretizations.
Definition: freeflow/navierstokes/momentum/problem.hh:887
void addBoundaryFluxIntegrals(ResidualVector &residual, const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const typename FVElementGeometry::GridGeometry::BoundaryFace &boundaryFace, const BoundaryTypes &bcTypes) const
Evaluates the boundary flux integrals for an intersection related to finite element residuals.
Definition: freeflow/navierstokes/momentum/problem.hh:1076
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1243
BoundaryFluxes boundaryFluxAtPos(const GlobalPosition &globalPos) const
Returns the boundary flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1173
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:931
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:916
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:1188
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1254
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:1278
BoundaryFluxes boundaryFlux(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const FaceIpData &faceIpData) const
Evaluates the boundary flux related to a localDof at a given interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1162
DirichletValues dirichlet(const FVElementGeometry &fvGeometry, const FaceIpData &faceIpData) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:1018
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1219
Scalar referencePressure() const
Returns a reference pressure This pressure is subtracted from the actual pressure for the momentum ba...
Definition: freeflow/navierstokes/momentum/problem.hh:1197
BoundaryTypes boundaryTypes(const FVElementGeometry &fvGeometry, const FVElementGeometry::BoundaryFace &boundaryFace) const
Specifies which kind of boundary condition should be used for which equation on a given boundary face...
Definition: freeflow/navierstokes/momentum/problem.hh:1003
void addBoundaryFluxIntegrals(ResidualVector &residual, const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const typename FVElementGeometry::GridGeometry::BoundaryFace &boundaryFace, const BoundaryTypes &bcTypes) const
Evaluates the boundary flux integrals for an intersection related to finite element residuals.
Definition: freeflow/navierstokes/momentum/problem.hh:1112
InitialValues initial(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Evaluate the initial value at an interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1302
BoundaryFluxes boundaryFluxIntegral(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const SubControlVolumeFace &scvf) const
Evaluates the boundary flux integral for a scvf.
Definition: freeflow/navierstokes/momentum/problem.hh:1032
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:989
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the pressure at given interpolation point data.
Definition: freeflow/navierstokes/momentum/problem.hh:1205
CVFENavierStokesMomentumProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:949
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the density at given interpolation point data.
Definition: freeflow/navierstokes/momentum/problem.hh:1229
Sources source(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const IpData &ipData) const
Evaluate the source term at a given interpolation point, related to the residual of a local dof.
Definition: freeflow/navierstokes/momentum/problem.hh:970
BoundaryFluxes boundaryFlux(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const FaceIpData &faceIpData) const
Evaluates the boundary flux related to a localDof at a given interpolation point.
Definition: freeflow/navierstokes/momentum/problem.hh:1144
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:913
static constexpr bool providesIntegralInterface()
Definition: freeflow/navierstokes/momentum/problem.hh:923
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition: freeflow/navierstokes/momentum/problem.hh:914
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:922
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any boundaryFlux method.
Definition: freeflow/navierstokes/momentum/problem.hh:1182
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:1268
BoundaryFluxes boundaryFluxIntegral(const FVElementGeometry &fvGeometry, const ElementVariables &elemVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary flux integral for a scvf.
Definition: freeflow/navierstokes/momentum/problem.hh:1054
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:915
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:43
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:524
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:520
Base class for all finite-volume problems using spatial parameters.
Definition: fvproblemwithspatialparams.hh:29
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:25
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the effective dynamic viscosity at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:782
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:759
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:509
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:525
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:706
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:836
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:720
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const IpData &ipData, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:812
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the pressure at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:690
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:517
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:773
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:860
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:588
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:567
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:826
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:508
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:616
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: freeflow/navierstokes/momentum/problem.hh:654
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:729
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:510
DirichletValues dirichlet(const Element &element, const SubControlVolume &scv) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:629
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:660
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:543
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolume &scv) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:602
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:743
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:511
Scalar referencePressure() const
Returns a reference pressure This pressure is subtracted from the actual pressure for the momentum ba...
Definition: freeflow/navierstokes/momentum/problem.hh:669
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the effective dynamic viscosity at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:796
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:676
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a Dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:642
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:131
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:108
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:248
auto boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:184
Scalar pseudo3DWallFriction(const Scalar velocity, const Scalar viscosity, const Scalar height, const Scalar factor=8.0) const
An additional drag term can be included as source term for the momentum balance to mimic 3D flow beha...
Definition: freeflow/navierstokes/momentum/problem.hh:423
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the effective dynamic viscosity at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:331
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:241
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:90
Scalar pseudo3DWallFriction(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv, const Scalar height, const Scalar factor=8.0) const
Convenience function for staggered grid implementation.
Definition: freeflow/navierstokes/momentum/problem.hh:397
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition: freeflow/navierstokes/momentum/problem.hh:305
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:358
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/momentum/problem.hh:447
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition: freeflow/navierstokes/momentum/problem.hh:76
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:82
Scalar referencePressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns a reference pressure at a given sub control volume face. This pressure is subtracted from the...
Definition: freeflow/navierstokes/momentum/problem.hh:272
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:368
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:281
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition: freeflow/navierstokes/momentum/problem.hh:235
bool onSlipBoundary(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:437
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:71
Scalar density(const Element &element, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:295
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:226
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at a sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:391
Sources scvPointSources(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Adds contribution of point sources for a specific sub control volume to the values....
Definition: freeflow/navierstokes/momentum/problem.hh:166
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv) const
Returns the effective dynamic viscosity at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:345
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:322
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:74
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:201
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:73
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:72
BoundaryFluxes neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:216
bool onSlipBoundaryAtPos(const GlobalPosition &pos) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:444
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:261
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:153
Definition: freeflow/navierstokes/momentum/problem.hh:30
Defines all properties used in Dumux.
Base class for all finite volume problems that are parameterized.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The available discretization methods in Dumux.
auto quadratureRule(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolume &scv, QuadratureRules::MidpointQuadrature)
Midpoint quadrature for scv.
Definition: quadraturerules.hh:159
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:62
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.