12#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_PROBLEM_HH
13#define DUMUX_NAVIERSTOKES_MOMENTUM_PROBLEM_HH
15#include <dune/common/exceptions.hh>
16#include <dune/common/typetraits.hh>
25template<
class TypeTag,
class DiscretizationMethod>
28template<
class TypeTag>
36 using GridView =
typename GridGeometry::GridView;
37 using Element =
typename GridView::template Codim<0>::Entity;
40 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
41 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
44 using FVElementGeometry =
typename GridGeometry::LocalView;
45 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
46 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
50 dim = GridView::dimension,
51 dimWorld = GridView::dimensionworld
54 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
55 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
56 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
60 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
68 using Sources = Dune::FieldVector<Scalar, dimWorld>;
87 std::shared_ptr<CouplingManager> couplingManager,
88 const std::string& paramGroup =
"")
91 , couplingManager_(couplingManager)
93 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
94 gravity_[dim-1] = -9.81;
96 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
105 const std::string& paramGroup =
"")
128 const FVElementGeometry& fvGeometry,
129 const ElementVolumeVariables& elemVolVars,
130 const SubControlVolume& scv)
const
133 return asImp_().sourceAtPos(scv.dofPosition());
164 const SubControlVolumeFace& scvf)
const
169 return asImp_().boundaryTypesAtPos(scvf.center());
182 return asImp_().dirichletAtPos(scvf.ipGlobal());
194 template<
class ElementFluxVariablesCache>
196 const FVElementGeometry& fvGeometry,
197 const ElementVolumeVariables& elemVolVars,
198 const ElementFluxVariablesCache& elemFluxVarsCache,
199 const SubControlVolumeFace& scvf)
const
200 {
return asImp_().neumannAtPos(scvf.ipGlobal()); }
221 {
return enableInertiaTerms_; }
228 const FVElementGeometry& fvGeometry,
229 const SubControlVolumeFace& scvf)
const
231 if constexpr (isCoupled_)
232 return couplingManager_->pressure(element, fvGeometry, scvf);
234 return asImp_().pressureAtPos(scvf.ipGlobal());
242 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
252 const FVElementGeometry& fvGeometry,
253 const SubControlVolumeFace& scvf)
const
261 const FVElementGeometry& fvGeometry,
262 const SubControlVolumeFace& scvf)
const
264 if constexpr (isCoupled_)
265 return couplingManager_->density(element, fvGeometry, scvf);
267 return asImp_().densityAtPos(scvf.ipGlobal());
275 const SubControlVolume& scv,
276 const bool isPreviousTimeStep =
false)
const
278 if constexpr (isCoupled_)
279 return couplingManager_->density(element, scv, isPreviousTimeStep);
281 return asImp_().densityAtPos(scv.dofPosition());
285 const FVElementGeometry& fvGeometry,
286 const SubControlVolumeFace& scvf,
287 const bool isPreviousTimeStep =
false)
const
289 if constexpr (isCoupled_)
290 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
293 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
294 return std::make_pair(rho, rho);
303 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
311 const FVElementGeometry& fvGeometry,
312 const SubControlVolumeFace& scvf)
const
314 if constexpr (isCoupled_)
315 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
317 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
325 const FVElementGeometry& fvGeometry,
326 const SubControlVolume& scv)
const
328 if constexpr (isCoupled_)
329 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
331 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
339 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
346 template<
class SolutionVector>
349 sol.resize(this->gridGeometry().numDofs());
350 std::vector<bool> dofHandled(this->gridGeometry().numDofs(),
false);
351 auto fvGeometry =
localView(this->gridGeometry());
352 for (
const auto& element : elements(this->gridGeometry().gridView()))
354 fvGeometry.bindElement(element);
355 for (
const auto& scv : scvs(fvGeometry))
357 const auto dofIdx = scv.dofIndex();
358 if (!dofHandled[dofIdx])
360 dofHandled[dofIdx] =
true;
361 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
372 return asImp_().initialAtPos(scv.dofPosition());
377 const FVElementGeometry& fvGeometry,
378 const ElementVolumeVariables& elemVolVars,
379 const SubControlVolume& scv,
381 const Scalar factor = 8.0)
const
383 const Scalar velocity = elemVolVars[scv].velocity();
384 const auto scvf = scvfs(fvGeometry, scv).begin();
385 const Scalar
viscosity = effectiveViscosity(element, fvGeometry, *scvf);
386 return pseudo3DWallFriction(velocity,
viscosity, height, factor);
405 const Scalar factor = 8.0)
const
407 static_assert(dim == 2,
"Pseudo 3D wall friction may only be used in 2D");
408 return -factor * velocity *
viscosity / (height*height);
416 bool onSlipBoundary(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
417 {
return asImp_().onSlipBoundaryAtPos(scvf.center()); }
430 [[deprecated(
"Will be removed after release 3.9.")]]
431 Scalar
permeability(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
433 DUNE_THROW(Dune::NotImplemented,
434 "When using the Beavers-Joseph-Saffman boundary condition, "
435 "the permeability must be returned in the actual problem"
443 [[deprecated(
"Will be removed after release 3.9. Implement betaBJ instead. ")]]
444 Scalar
alphaBJ(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
446 DUNE_THROW(Dune::NotImplemented,
447 "When using the Beavers-Joseph-Saffman boundary condition, "
448 "the alpha value must be returned in the actual problem"
455 [[deprecated(
"Needs to be implemented in test problem. Will be removed after release 3.9.")]]
456 Scalar
betaBJ(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf,
const GlobalPosition& tangentialVector)
const
458 const auto& K = asImp_().permeability(fvGeometry, scvf);
459 const auto interfacePermeability =
vtmv(tangentialVector, K, tangentialVector);
461 return asImp_().alphaBJ(fvGeometry, scvf) / sqrt(interfacePermeability);
467 [[deprecated(
"Needs to be implemented in test problem. Will be removed after release 3.9.")]]
468 VelocityVector
porousMediumVelocity(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
470 return VelocityVector(0.0);
477 [[deprecated(
"Will be removed after release 3.9.")]]
479 const SubControlVolumeFace& scvf,
480 const ElementVolumeVariables& elemVolVars,
481 Scalar tangentialVelocityGradient)
const
483 assert(scvf.isLateral());
484 assert(scvf.boundary());
486 const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
489 GlobalPosition orientation(0.0);
490 orientation[scv.dofAxis()] = 1.0;
494 const Scalar betaBJ = asImp_().betaBJ(fvGeometry, scvf, orientation);
495 const Scalar distanceNormalToBoundary = (scvf.ipGlobal() - scv.dofPosition()).two_norm();
497 static const bool onlyNormalGradient = getParamFromGroup<bool>(this->paramGroup(),
"FreeFlow.EnableUnsymmetrizedVelocityGradientForBeaversJoseph",
false);
498 if (onlyNormalGradient)
499 tangentialVelocityGradient = 0.0;
501 const Scalar scalarSlipVelocity = (tangentialVelocityGradient*distanceNormalToBoundary
502 + asImp_().porousMediumVelocity(fvGeometry, scvf) * orientation * betaBJ * distanceNormalToBoundary
503 + elemVolVars[scv].velocity()) / (betaBJ*distanceNormalToBoundary + 1.0);
505 orientation *= scalarSlipVelocity;
511 if constexpr (isCoupled_)
512 return *couplingManager_;
514 DUNE_THROW(Dune::InvalidStateException,
515 "Accessing coupling manager of an uncoupled problem is not possible."
521 Implementation& asImp_()
522 {
return *
static_cast<Implementation *
>(
this); }
525 const Implementation& asImp_()
const
526 {
return *
static_cast<const Implementation *
>(
this); }
528 GravityVector gravity_;
529 bool enableInertiaTerms_;
530 std::shared_ptr<CouplingManager> couplingManager_;
536template<
class TypeTag,
class DM>
544 using GridView =
typename GridGeometry::GridView;
545 using Element =
typename GridView::template Codim<0>::Entity;
548 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
549 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
552 using FVElementGeometry =
typename GridGeometry::LocalView;
553 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
554 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
557 static constexpr int dim = GridView::dimension;
558 static constexpr int dimWorld = GridView::dimensionworld;
560 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
561 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
562 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
567 typename GridGeometry::DiscretizationMethod
575 using Sources = Dune::FieldVector<Scalar, dimWorld>;
592 std::shared_ptr<CouplingManager> couplingManager,
593 const std::string& paramGroup =
"")
596 , couplingManager_(couplingManager)
598 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
599 gravity_[dim-1] = -9.81;
601 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
610 const std::string& paramGroup =
"")
632 template<
class ElementVolumeVariables>
634 const FVElementGeometry& fvGeometry,
635 const ElementVolumeVariables& elemVolVars,
636 const SubControlVolume &scv)
const
639 return asImp_().sourceAtPos(scv.center());
669 const SubControlVolume& scv)
const
672 DUNE_THROW(Dune::InvalidStateException,
673 "boundaryTypes(..., scv) called for for a non CVFE method.");
676 return asImp_().boundaryTypesAtPos(scv.dofPosition());
687 const SubControlVolumeFace& scvf)
const
690 DUNE_THROW(Dune::InvalidStateException,
691 "boundaryTypes(..., scvf) called for a CVFE method.");
694 return asImp_().boundaryTypesAtPos(scvf.ipGlobal());
708 DUNE_THROW(Dune::InvalidStateException,
"dirichlet(scv) called for a non CVFE method.");
710 return asImp_().dirichletAtPos(scv.dofPosition());
724 DUNE_THROW(Dune::InvalidStateException,
"dirichlet(scvf) called for CVFE method.");
726 return asImp_().dirichletAtPos(scvf.ipGlobal());
742 {
return enableInertiaTerms_; }
758 const FVElementGeometry& fvGeometry,
759 const SubControlVolumeFace& scvf)
const
761 if constexpr (std::is_empty_v<CouplingManager>)
762 return asImp_().pressureAtPos(scvf.ipGlobal());
764 return couplingManager_->pressure(element, fvGeometry, scvf);
772 const FVElementGeometry& fvGeometry,
773 const SubControlVolume& scv,
774 const bool isPreviousTimeStep =
false)
const
776 if constexpr (std::is_empty_v<CouplingManager>)
777 return asImp_().pressureAtPos(scv.dofPosition());
779 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
787 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
795 const FVElementGeometry& fvGeometry,
796 const SubControlVolumeFace& scvf)
const
798 if constexpr (std::is_empty_v<CouplingManager>)
799 return asImp_().densityAtPos(scvf.ipGlobal());
801 return couplingManager_->density(element, fvGeometry, scvf);
809 const FVElementGeometry& fvGeometry,
810 const SubControlVolume& scv,
811 const bool isPreviousTimeStep =
false)
const
813 if constexpr (std::is_empty_v<CouplingManager>)
814 return asImp_().densityAtPos(scv.dofPosition());
816 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
825 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
833 const FVElementGeometry& fvGeometry,
834 const SubControlVolumeFace& scvf)
const
836 if constexpr (std::is_empty_v<CouplingManager>)
837 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
839 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
847 const FVElementGeometry& fvGeometry,
848 const SubControlVolume& scv,
849 const bool isPreviousTimeStep =
false)
const
851 if constexpr (std::is_empty_v<CouplingManager>)
852 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
854 return couplingManager_->effectiveViscosity(element, fvGeometry, scv, isPreviousTimeStep);
862 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
869 template<
class SolutionVector>
873 sol.resize(this->gridGeometry().numDofs());
874 std::vector<bool> dofHandled(this->gridGeometry().numDofs(),
false);
875 auto fvGeometry =
localView(this->gridGeometry());
876 for (
const auto& element : elements(this->gridGeometry().gridView()))
878 fvGeometry.bindElement(element);
879 for (
const auto& scv : scvs(fvGeometry))
881 const auto dofIdx = scv.dofIndex();
882 if (!dofHandled[dofIdx])
884 dofHandled[dofIdx] =
true;
885 sol[dofIdx] = asImp_().initial(scv);
897 return asImp_().initialAtPos(scv.dofPosition());
902 Implementation &asImp_()
903 {
return *
static_cast<Implementation *
>(
this); }
906 const Implementation &asImp_()
const
907 {
return *
static_cast<const Implementation *
>(
this); }
909 GravityVector gravity_;
910 bool enableInertiaTerms_;
911 std::shared_ptr<CouplingManager> couplingManager_ = {};
920template<
class TypeTag>
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:26
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:43
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:832
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:575
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:591
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:870
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:785
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:771
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:583
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:823
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:894
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:654
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:633
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:860
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:574
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:686
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: freeflow/navierstokes/momentum/problem.hh:735
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:794
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:576
DirichletValues dirichlet(const Element &element, const SubControlVolume &scv) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:704
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:741
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:609
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:668
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:808
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:577
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:750
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:846
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:757
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:720
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:127
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:104
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:227
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:163
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:402
const VelocityVector beaversJosephVelocity(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const ElementVolumeVariables &elemVolVars, Scalar tangentialVelocityGradient) const
Returns the slip velocity at a porous boundary based on the Beavers-Joseph(-Saffman) condition.
Definition: freeflow/navierstokes/momentum/problem.hh:478
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:310
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:220
Scalar permeability(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the intrinsic permeability of required as input parameter for the Beavers-Joseph-Saffman boun...
Definition: freeflow/navierstokes/momentum/problem.hh:431
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:86
Scalar betaBJ(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const GlobalPosition &tangentialVector) const
Returns the beta value which is the alpha value divided by the square root of the (scalar-valued) int...
Definition: freeflow/navierstokes/momentum/problem.hh:456
VelocityVector porousMediumVelocity(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the velocity in the porous medium (which is 0 by default according to Saffmann).
Definition: freeflow/navierstokes/momentum/problem.hh:468
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:376
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition: freeflow/navierstokes/momentum/problem.hh:284
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:337
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/momentum/problem.hh:509
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition: freeflow/navierstokes/momentum/problem.hh:72
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:78
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:251
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:347
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:260
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition: freeflow/navierstokes/momentum/problem.hh:214
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:416
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:67
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:274
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:205
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at a sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:370
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:324
Scalar alphaBJ(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the alpha value required as input parameter for the Beavers-Joseph-Saffman boundary condition...
Definition: freeflow/navierstokes/momentum/problem.hh:444
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:301
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:70
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:180
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:69
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:68
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:195
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:423
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:240
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:149
Definition: freeflow/navierstokes/momentum/problem.hh:26
Defines all properties used in Dumux.
Base class for all finite volume problems that are parameterized.
Dune::DenseMatrix< MAT >::value_type vtmv(const Dune::DenseVector< V1 > &v1, const Dune::DenseMatrix< MAT > &M, const Dune::DenseVector< V2 > &v2)
Evaluates the scalar product of a vector v2, projected by a matrix M, with a vector v1.
Definition: math.hh:880
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.
constexpr bool isCVFE
Definition: method.hh:67
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:62
A helper to deduce a vector with the same size as numbers of equations.