24#ifndef DUMUX_NAVIERSTOKES_PROBLEM_HH
25#define DUMUX_NAVIERSTOKES_PROBLEM_HH
27#include <dune/common/deprecated.hh>
29#include <dune/common/exceptions.hh>
41template<
class TypeTag>
48template<
class TypeTag>
61template<
class TypeTag>
68 using GridView =
typename GridGeometry::GridView;
69 using Element =
typename GridView::template Codim<0>::Entity;
72 using GridFaceVariables =
typename GridVariables::GridFaceVariables;
73 using ElementFaceVariables =
typename GridFaceVariables::LocalView;
74 using FaceVariables =
typename GridFaceVariables::FaceVariables;
75 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
76 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
79 using FVElementGeometry =
typename GridGeometry::LocalView;
80 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
81 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
86 dim = GridView::dimension,
87 dimWorld = GridView::dimensionworld
90 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
91 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
99 NavierStokesProblem(std::shared_ptr<const GridGeometry> gridGeometry,
const std::string& paramGroup =
"")
100 : ParentType(gridGeometry, paramGroup)
103 if (getParamFromGroup<bool>(paramGroup,
"Problem.EnableGravity"))
104 gravity_[dim-1] = -9.81;
106 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup,
"Problem.EnableInertiaTerms");
118 {
return asImp_().temperature(); }
126 { DUNE_THROW(Dune::NotImplemented,
"temperature() method not implemented by the actual problem"); }
141 {
return enableInertiaTerms_; }
144 template <
class SolutionVector,
class G = Gr
idGeometry>
145 typename std::enable_if<G::discMethod == DiscretizationMethod::staggered, void>::type
147 const SubControlVolumeFace& scvf,
148 const PrimaryVariables& initSol)
const
150 sol[GridGeometry::faceIdx()][scvf.dofIndex()][0] = initSol[Indices::velocity(scvf.directionIndex())];
170 const Scalar factor = 8.0)
const
172 static_assert(dim == 2,
"Pseudo 3D wall friction may only be used in 2D");
173 return -factor * velocity *
viscosity / (height*height);
177 template <
class ElementVolumeVariables,
class ElementFaceVariables,
class G = Gr
idGeometry>
178 typename std::enable_if<G::discMethod == DiscretizationMethod::staggered, Scalar>::type
180 const ElementVolumeVariables& elemVolVars,
181 const ElementFaceVariables& elemFaceVars,
183 const Scalar factor = 8.0)
const
185 const Scalar velocity = elemFaceVars[scvf].velocitySelf();
186 const Scalar
viscosity = elemVolVars[scvf.insideScvIdx()].effectiveViscosity();
195 Scalar
permeability(
const Element& element,
const SubControlVolumeFace& scvf)
const
197 DUNE_THROW(Dune::NotImplemented,
"When using the Beavers-Joseph-Saffman boundary condition, the permeability must be returned in the acutal problem");
205 Scalar
alphaBJ(
const SubControlVolumeFace& scvf)
const
207 DUNE_THROW(Dune::NotImplemented,
"When using the Beavers-Joseph-Saffman boundary condition, the alpha value must be returned in the acutal problem");
215 Scalar
betaBJ(
const Element& element,
const SubControlVolumeFace& scvf)
const
218 return asImp_().alphaBJ(scvf) / sqrt(asImp_().
permeability(element, scvf));
228 DUNE_DEPRECATED_MSG(
"Use beaversJosephVelocity(element, scv, faceOnPorousBoundary, velocitySelf, tangentialVelocityGradient) instead")
230 const SubControlVolume& scv,
231 const SubControlVolumeFace& faceOnPorousBoundary,
232 const Scalar velocitySelf)
const
240 const SubControlVolume& scv,
241 const SubControlVolumeFace& faceOnPorousBoundary,
242 const Scalar velocitySelf,
243 const Scalar tangentialVelocityGradient)
const
247 const Scalar
betaBJ = asImp_().betaBJ(element, faceOnPorousBoundary);
248 const Scalar distance = (faceOnPorousBoundary.center() - scv.center()).two_norm();
249 return (tangentialVelocityGradient*distance + asImp_().velocityPorousMedium(element,faceOnPorousBoundary)*
betaBJ*distance + velocitySelf) / (
betaBJ*distance + 1.0);
255 Implementation &asImp_()
256 {
return *
static_cast<Implementation *
>(
this); }
259 const Implementation &asImp_()
const
260 {
return *
static_cast<const Implementation *
>(
this); }
262 GravityVector gravity_;
263 bool enableInertiaTerms_;
Base class for all staggered fv problems.
The available discretization methods in Dumux.
DiscretizationMethod
The available discretization methods in Dumux.
Definition: method.hh:37
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
typename NavierStokesParentProblemImpl< TypeTag, GetPropType< TypeTag, Properties::GridGeometry >::discMethod >::type NavierStokesParentProblem
The actual NavierStokesParentProblem.
Definition: dumux/freeflow/navierstokes/problem.hh:51
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:74
Base class for all staggered finite-volume problems.
Definition: staggeredfvproblem.hh:45
The implementation is specialized for the different discretizations.
Definition: dumux/freeflow/navierstokes/problem.hh:39
Navier-Stokes problem base class.
Definition: dumux/freeflow/navierstokes/problem.hh:63
Scalar temperature() const
Returns the temperature within the domain.
Definition: dumux/freeflow/navierstokes/problem.hh:125
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: dumux/freeflow/navierstokes/problem.hh:167
Scalar permeability(const Element &element, const SubControlVolumeFace &scvf) const
Returns the intrinsic permeability of required as input parameter for the Beavers-Joseph-Saffman boun...
Definition: dumux/freeflow/navierstokes/problem.hh:195
std::enable_if< G::discMethod==DiscretizationMethod::staggered, void >::type applyInitialFaceSolution(SolutionVector &sol, const SubControlVolumeFace &scvf, const PrimaryVariables &initSol) const
Applys the initial face solution (velocities on the faces). Specialization for staggered grid discret...
Definition: dumux/freeflow/navierstokes/problem.hh:146
Scalar alphaBJ(const SubControlVolumeFace &scvf) const
Returns the alpha value required as input parameter for the Beavers-Joseph-Saffman boundary condition...
Definition: dumux/freeflow/navierstokes/problem.hh:205
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: dumux/freeflow/navierstokes/problem.hh:134
Scalar velocityPorousMedium(const Element &element, const SubControlVolumeFace &scvf) const
Returns the velocity in the porous medium (which is 0 by default according to Saffmann).
Definition: dumux/freeflow/navierstokes/problem.hh:224
std::enable_if< G::discMethod==DiscretizationMethod::staggered, Scalar >::type pseudo3DWallFriction(const SubControlVolumeFace &scvf, const ElementVolumeVariables &elemVolVars, const ElementFaceVariables &elemFaceVars, const Scalar height, const Scalar factor=8.0) const
Convenience function for staggered grid implementation.
Definition: dumux/freeflow/navierstokes/problem.hh:179
Scalar betaBJ(const Element &element, const SubControlVolumeFace &scvf) const
Returns the alpha value required as input parameter for the Beavers-Joseph-Saffman boundary condition...
Definition: dumux/freeflow/navierstokes/problem.hh:215
const Scalar beaversJosephVelocity(const Element &element, const SubControlVolume &scv, const SubControlVolumeFace &faceOnPorousBoundary, const Scalar velocitySelf, const Scalar tangentialVelocityGradient) const
helper function to evaluate the slip velocity on the boundary when the Beavers-Joseph condition is us...
Definition: dumux/freeflow/navierstokes/problem.hh:239
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature at a given global position.
Definition: dumux/freeflow/navierstokes/problem.hh:117
bool enableInertiaTerms() const
Returns whether interia terms should be considered.
Definition: dumux/freeflow/navierstokes/problem.hh:140
const Scalar bjsVelocity(const Element &element, const SubControlVolume &scv, const SubControlVolumeFace &faceOnPorousBoundary, const Scalar velocitySelf) const
helper function to evaluate the slip velocity on the boundary when the Beavers-Joseph-Saffman conditi...
Definition: dumux/freeflow/navierstokes/problem.hh:229
NavierStokesProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor.
Definition: dumux/freeflow/navierstokes/problem.hh:99
Declares all properties used in Dumux.
Adaption of the fully implicit scheme to the tracer transport model.