24#ifndef DUMUX_NAVIERSTOKES_PROBLEM_HH
25#define DUMUX_NAVIERSTOKES_PROBLEM_HH
27#include <dune/common/exceptions.hh>
28#include <dune/common/typetraits.hh>
42template<
class TypeTag>
49template<
class TypeTag>
54template<
class TypeTag,
class DiscretizationMethod>
57template<
class TypeTag>
65 using GridView =
typename GridGeometry::GridView;
66 using Element =
typename GridView::template Codim<0>::Entity;
69 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
70 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
73 using FVElementGeometry =
typename GridGeometry::LocalView;
74 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
75 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
79 dim = GridView::dimension,
80 dimWorld = GridView::dimensionworld
83 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
84 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
85 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
89 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
97 using Sources = Dune::FieldVector<Scalar, dimWorld>;
123 gravity_[dim-1] = -9.81;
157 const FVElementGeometry& fvGeometry,
158 const ElementVolumeVariables& elemVolVars,
159 const SubControlVolume& scv)
const
162 return asImp_().sourceAtPos(scv.dofPosition());
193 const SubControlVolumeFace& scvf)
const
198 return asImp_().boundaryTypesAtPos(scvf.center());
211 return asImp_().dirichletAtPos(scvf.ipGlobal());
223 template<
class ElementFluxVariablesCache>
225 const FVElementGeometry& fvGeometry,
226 const ElementVolumeVariables& elemVolVars,
227 const ElementFluxVariablesCache& elemFluxVarsCache,
228 const SubControlVolumeFace& scvf)
const
229 {
return asImp_().neumannAtPos(scvf.ipGlobal()); }
250 {
return enableInertiaTerms_; }
257 const FVElementGeometry& fvGeometry,
258 const SubControlVolumeFace& scvf)
const
260 if constexpr (isCoupled_)
261 return couplingManager_->pressure(element, fvGeometry, scvf);
263 return asImp_().pressureAtPos(scvf.ipGlobal());
271 DUNE_THROW(Dune::NotImplemented,
"pressureAtPos not implemented");
281 const FVElementGeometry& fvGeometry,
282 const SubControlVolumeFace& scvf)
const
290 const FVElementGeometry& fvGeometry,
291 const SubControlVolumeFace& scvf)
const
293 if constexpr (isCoupled_)
294 return couplingManager_->density(element, fvGeometry, scvf);
296 return asImp_().densityAtPos(scvf.ipGlobal());
304 const SubControlVolume& scv,
305 const bool isPreviousTimeStep =
false)
const
307 if constexpr (isCoupled_)
308 return couplingManager_->density(element, scv, isPreviousTimeStep);
310 return asImp_().densityAtPos(scv.dofPosition());
314 const FVElementGeometry& fvGeometry,
315 const SubControlVolumeFace& scvf,
316 const bool isPreviousTimeStep =
false)
const
318 if constexpr (isCoupled_)
319 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
322 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
323 return std::make_pair(rho, rho);
332 DUNE_THROW(Dune::NotImplemented,
"densityAtPos not implemented");
340 const FVElementGeometry& fvGeometry,
341 const SubControlVolumeFace& scvf)
const
343 if constexpr (isCoupled_)
344 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
346 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
354 DUNE_THROW(Dune::NotImplemented,
"effectiveViscosityAtPos not implemented");
361 template<
class SolutionVector>
365 std::vector<bool> dofHandled(this->
gridGeometry().numDofs(),
false);
367 for (
const auto& element : elements(this->
gridGeometry().gridView()))
369 fvGeometry.bindElement(element);
370 for (
const auto& scv : scvs(fvGeometry))
372 const auto dofIdx = scv.dofIndex();
373 if (!dofHandled[dofIdx])
375 dofHandled[dofIdx] =
true;
376 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
387 return asImp_().initialAtPos(scv.dofPosition());
392 const FVElementGeometry& fvGeometry,
393 const ElementVolumeVariables& elemVolVars,
394 const SubControlVolume& scv,
396 const Scalar factor = 8.0)
const
398 const Scalar velocity = elemVolVars[scv].velocity();
399 const auto scvf = scvfs(fvGeometry, scv).begin();
418 const Scalar viscosity,
420 const Scalar factor = 8.0)
const
422 static_assert(dim == 2,
"Pseudo 3D wall friction may only be used in 2D");
423 return -factor * velocity * viscosity / (height*height);
431 bool onSlipBoundary(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
432 {
return asImp_().onSlipBoundaryAtPos(scvf.center()); }
445 Scalar
permeability(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
447 DUNE_THROW(Dune::NotImplemented,
448 "When using the Beavers-Joseph-Saffman boundary condition, "
449 "the permeability must be returned in the actual problem"
457 Scalar
alphaBJ(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
459 DUNE_THROW(Dune::NotImplemented,
460 "When using the Beavers-Joseph-Saffman boundary condition, "
461 "the alpha value must be returned in the actual problem"
468 Scalar
betaBJ(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf,
const GlobalPosition& tangentialVector)
const
470 const Scalar interfacePermeability = interfacePermeability_(fvGeometry, scvf, tangentialVector);
472 return asImp_().alphaBJ(fvGeometry, scvf) / sqrt(interfacePermeability);
478 VelocityVector
porousMediumVelocity(
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
const
480 return VelocityVector(0.0);
488 const SubControlVolumeFace& scvf,
489 const ElementVolumeVariables& elemVolVars,
490 Scalar tangentialVelocityGradient)
const
492 assert(scvf.isLateral());
493 assert(scvf.boundary());
495 const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
498 GlobalPosition orientation(0.0);
499 orientation[scv.dofAxis()] = 1.0;
503 const Scalar
betaBJ = asImp_().betaBJ(fvGeometry, scvf, orientation);
504 const Scalar distanceNormalToBoundary = (scvf.ipGlobal() - scv.dofPosition()).two_norm();
507 if (onlyNormalGradient)
508 tangentialVelocityGradient = 0.0;
510 const Scalar scalarSlipVelocity = (tangentialVelocityGradient*distanceNormalToBoundary
511 + asImp_().porousMediumVelocity(fvGeometry, scvf) * orientation *
betaBJ * distanceNormalToBoundary
512 + elemVolVars[scv].velocity()) / (
betaBJ*distanceNormalToBoundary + 1.0);
514 orientation *= scalarSlipVelocity;
520 if constexpr (isCoupled_)
521 return *couplingManager_;
523 DUNE_THROW(Dune::InvalidStateException,
524 "Accessing coupling manager of an uncoupled problem is not possible."
531 Scalar interfacePermeability_(
const FVElementGeometry& fvGeometry,
const Scvf& scvf,
const GlobalPosition& tangentialVector)
const
533 const auto& K = asImp_().permeability(fvGeometry, scvf);
536 if constexpr (Dune::IsNumber<std::decay_t<
decltype(K)>>::value)
539 return vtmv(tangentialVector, K, tangentialVector);
543 Implementation& asImp_()
544 {
return *
static_cast<Implementation *
>(
this); }
547 const Implementation& asImp_()
const
548 {
return *
static_cast<const Implementation *
>(
this); }
550 GravityVector gravity_;
551 bool enableInertiaTerms_;
552 std::shared_ptr<CouplingManager> couplingManager_;
555template<
class TypeTag>
563 using GridView =
typename GridGeometry::GridView;
564 using FVElementGeometry =
typename GridGeometry::LocalView;
565 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
566 using Element =
typename GridView::template Codim<0>::Entity;
567 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
568 using VelocityVector = GlobalPosition;
573 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
582 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
619 const FVElementGeometry& fvGeometry,
620 const SubControlVolumeFace& scvf)
const
622 if constexpr (isCoupled_)
623 return couplingManager_->faceVelocity(element, scvf);
625 return asImp_().velocityAtPos(scvf.ipGlobal());
633 DUNE_THROW(Dune::NotImplemented,
"velocityAtPos not implemented");
645 [[deprecated(
"temperature should now be defined in the spatial params with temperature(globalPos)")]]
647 {
return asImp_().temperature(); }
652 [[deprecated(
"temperature should now be defined in the spatial params with temperature(globalPos)")]]
655 DUNE_THROW(Dune::NotImplemented,
"temperature() method not implemented by the actual problem");
660 if constexpr (isCoupled_)
661 return *couplingManager_;
663 DUNE_THROW(Dune::InvalidStateException,
664 "Accessing coupling manager of an uncoupled problem is not possible."
670 Implementation &asImp_()
671 {
return *
static_cast<Implementation *
>(
this); }
674 const Implementation &asImp_()
const
675 {
return *
static_cast<const Implementation *
>(
this); }
677 std::shared_ptr<CouplingManager> couplingManager_;
687template<
class TypeTag>
695 using GridView =
typename GridGeometry::GridView;
696 using Element =
typename GridView::template Codim<0>::Entity;
699 using GridFaceVariables =
typename GridVariables::GridFaceVariables;
700 using ElementFaceVariables =
typename GridFaceVariables::LocalView;
701 using FaceVariables =
typename GridFaceVariables::FaceVariables;
702 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
703 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
706 using FVElementGeometry =
typename GridGeometry::LocalView;
707 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
708 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
713 dim = GridView::dimension,
714 dimWorld = GridView::dimensionworld
717 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
718 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
719 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
728 : ParentType(gridGeometry, paramGroup)
732 gravity_[dim-1] = -9.81;
746 [[deprecated(
"temperature should now be defined in the spatial params with temperature(globalPos)")]]
748 {
return asImp_().temperature(); }
755 [[deprecated(
"temperature should now be defined in the spatial params with temperature(globalPos)")]]
757 { DUNE_THROW(Dune::NotImplemented,
"temperature() method not implemented by the actual problem"); }
772 {
return enableInertiaTerms_; }
775 template <
class SolutionVector,
class G = Gr
idGeometry>
776 typename std::enable_if<G::discMethod == DiscretizationMethods::staggered, void>::type
778 const SubControlVolumeFace& scvf,
779 const PrimaryVariables& initSol)
const
781 sol[GridGeometry::faceIdx()][scvf.dofIndex()][0] = initSol[Indices::velocity(scvf.directionIndex())];
798 const Scalar viscosity,
800 const Scalar factor = 8.0)
const
802 static_assert(dim == 2,
"Pseudo 3D wall friction may only be used in 2D");
803 return -factor * velocity * viscosity / (height*height);
807 template <
class ElementVolumeVariables,
class ElementFaceVariables,
class G = Gr
idGeometry>
808 typename std::enable_if<G::discMethod == DiscretizationMethods::staggered, Scalar>::type
810 const ElementVolumeVariables& elemVolVars,
811 const ElementFaceVariables& elemFaceVars,
813 const Scalar factor = 8.0)
const
815 const Scalar velocity = elemFaceVars[scvf].velocitySelf();
816 const Scalar viscosity = elemVolVars[scvf.insideScvIdx()].effectiveViscosity();
825 Scalar
permeability(
const Element& element,
const SubControlVolumeFace& scvf)
const
827 DUNE_THROW(Dune::NotImplemented,
828 "When using the Beavers-Joseph-Saffman boundary condition, "
829 "the permeability must be returned in the actual problem"
838 Scalar
alphaBJ(
const SubControlVolumeFace& scvf)
const
840 DUNE_THROW(Dune::NotImplemented,
841 "When using the Beavers-Joseph-Saffman boundary condition, "
842 "the alpha value must be returned in the actual problem"
849 Scalar
betaBJ(
const Element& element,
const SubControlVolumeFace& scvf,
const GlobalPosition& tangentialVector)
const
851 const Scalar interfacePermeability = interfacePermeability_(element, scvf, tangentialVector);
853 return asImp_().alphaBJ(scvf) / sqrt(interfacePermeability);
861 return VelocityVector(0.0);
868 const SubControlVolume& scv,
869 const SubControlVolumeFace& ownScvf,
870 const SubControlVolumeFace& faceOnPorousBoundary,
871 const Scalar velocitySelf,
872 const Scalar tangentialVelocityGradient)
const
875 GlobalPosition orientation = ownScvf.unitOuterNormal();
876 orientation[ownScvf.directionIndex()] = 1.0;
880 const Scalar
betaBJ = asImp_().betaBJ(element, faceOnPorousBoundary, orientation);
881 const Scalar distanceNormalToBoundary = (faceOnPorousBoundary.center() - scv.center()).two_norm();
883 return (tangentialVelocityGradient*distanceNormalToBoundary
885 + velocitySelf) / (
betaBJ*distanceNormalToBoundary + 1.0);
890 Scalar interfacePermeability_(
const Element& element,
const SubControlVolumeFace& scvf,
const GlobalPosition& tangentialVector)
const
892 const auto& K = asImp_().permeability(element, scvf);
895 if constexpr (Dune::IsNumber<std::decay_t<
decltype(K)>>::value)
898 return vtmv(tangentialVector, K, tangentialVector);
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_;
920template<
class TypeTag>
A helper to deduce a vector with the same size as numbers of equations.
Base class for all finite volume problems that are parameterized.
Base class for all staggered fv problems.
The available discretization methods in Dumux.
NavierStokesProblemImpl< TypeTag, typename GetPropType< TypeTag, Properties::GridGeometry >::DiscretizationMethod > NavierStokesProblem
Navier-Stokes problem class.
Definition freeflow/navierstokes/problem.hh:921
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition localview.hh:38
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:863
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:161
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:150
typename NavierStokesParentProblemImpl< TypeTag, typename GetPropType< TypeTag, Properties::GridGeometry >::DiscretizationMethod >::type NavierStokesParentProblem
The actual NavierStokesParentProblem.
Definition freeflow/navierstokes/problem.hh:50
Class to specify the type of a boundary.
Definition common/boundarytypes.hh:38
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition common/fvproblem.hh:586
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition common/fvproblem.hh:582
FVProblemWithSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
Constructor.
Definition fvproblemwithspatialparams.hh:54
Base class for all staggered finite-volume problems.
Definition staggeredfvproblem.hh:48
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition freeflow/navierstokes/momentum/boundarytypes.hh:37
The implementation is specialized for the different discretizations.
Definition freeflow/navierstokes/problem.hh:39
StaggeredFVProblem< TypeTag > type
Definition freeflow/navierstokes/problem.hh:45
Definition freeflow/navierstokes/problem.hh:55
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/problem.hh:156
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/problem.hh:431
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/problem.hh:457
bool enableInertiaTerms() const
Returns whether intertia terms should be considered.
Definition freeflow/navierstokes/problem.hh:249
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition freeflow/navierstokes/problem.hh:330
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/problem.hh:192
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition freeflow/navierstokes/problem.hh:96
Dune::FieldVector< Scalar, dimWorld > Sources
Definition freeflow/navierstokes/problem.hh:97
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/problem.hh:445
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/problem.hh:224
const CouplingManager & couplingManager() const
Definition freeflow/navierstokes/problem.hh:518
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition freeflow/navierstokes/problem.hh:243
NavierStokesProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition freeflow/navierstokes/problem.hh:133
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition freeflow/navierstokes/problem.hh:99
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/problem.hh:487
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/problem.hh:478
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition freeflow/navierstokes/problem.hh:234
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition freeflow/navierstokes/problem.hh:352
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition freeflow/navierstokes/problem.hh:98
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/problem.hh:468
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/problem.hh:303
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition freeflow/navierstokes/problem.hh:107
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition freeflow/navierstokes/problem.hh:313
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/problem.hh:289
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/problem.hh:417
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/problem.hh:256
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a dirichlet control volume face.
Definition freeflow/navierstokes/problem.hh:209
NavierStokesMomentumBoundaryTypes< ModelTraits::dim()> BoundaryTypes
Export the boundary types.
Definition freeflow/navierstokes/problem.hh:104
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition freeflow/navierstokes/problem.hh:269
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition freeflow/navierstokes/problem.hh:101
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/problem.hh:339
NavierStokesProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition freeflow/navierstokes/problem.hh:115
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition freeflow/navierstokes/problem.hh:178
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition freeflow/navierstokes/problem.hh:385
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 substracted from th...
Definition freeflow/navierstokes/problem.hh:280
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/problem.hh:391
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition freeflow/navierstokes/problem.hh:362
bool onSlipBoundaryAtPos(const GlobalPosition &pos) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition freeflow/navierstokes/problem.hh:438
Dune::FieldVector< Scalar, ModelTraits::numEq()> DirichletValues
Definition freeflow/navierstokes/problem.hh:583
NavierStokesProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition freeflow/navierstokes/problem.hh:598
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition freeflow/navierstokes/problem.hh:581
Dumux::BoundaryTypes< ModelTraits::numEq()> BoundaryTypes
Export the boundary types.
Definition freeflow/navierstokes/problem.hh:587
static constexpr bool isMomentumProblem()
this problem is used for the mass balance model
Definition freeflow/navierstokes/problem.hh:590
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition freeflow/navierstokes/problem.hh:582
const CouplingManager & couplingManager() const
Definition freeflow/navierstokes/problem.hh:658
VelocityVector faceVelocity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the normal velocity at a given sub control volume face.
Definition freeflow/navierstokes/problem.hh:618
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition freeflow/navierstokes/problem.hh:584
NavierStokesProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition freeflow/navierstokes/problem.hh:610
Scalar temperatureAtPos(const GlobalPosition &globalPos, int deprecationHelper=0) const
Returns the temperature at a given global position.
Definition freeflow/navierstokes/problem.hh:646
Scalar temperature(int deprecationHelper=0) const
Returns the temperature within the domain.
Definition freeflow/navierstokes/problem.hh:653
VelocityVector velocityAtPos(const GlobalPosition &) const
Returns the velocity at a given position.
Definition freeflow/navierstokes/problem.hh:631
Scalar alphaBJ(const SubControlVolumeFace &scvf) const
Returns the alpha value required as input parameter for the Beavers-Joseph-Saffman boundary condition...
Definition freeflow/navierstokes/problem.hh:838
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/problem.hh:797
std::enable_if< G::discMethod==DiscretizationMethods::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 freeflow/navierstokes/problem.hh:809
VelocityVector porousMediumVelocity(const Element &element, const SubControlVolumeFace &scvf) const
Returns the velocity in the porous medium (which is 0 by default according to Saffmann).
Definition freeflow/navierstokes/problem.hh:859
const Scalar beaversJosephVelocity(const Element &element, const SubControlVolume &scv, const SubControlVolumeFace &ownScvf, const SubControlVolumeFace &faceOnPorousBoundary, const Scalar velocitySelf, const Scalar tangentialVelocityGradient) const
Returns the slip velocity at a porous boundary based on the Beavers-Joseph(-Saffman) condition.
Definition freeflow/navierstokes/problem.hh:867
Scalar betaBJ(const Element &element, 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/problem.hh:849
bool enableInertiaTerms() const
Returns whether interia terms should be considered.
Definition freeflow/navierstokes/problem.hh:771
std::enable_if< G::discMethod==DiscretizationMethods::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 freeflow/navierstokes/problem.hh:777
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 freeflow/navierstokes/problem.hh:825
NavierStokesProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor.
Definition freeflow/navierstokes/problem.hh:727
Scalar temperatureAtPos(const GlobalPosition &globalPos, int deprecationHelper=0) const
Returns the temperature at a given global position.
Definition freeflow/navierstokes/problem.hh:747
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition freeflow/navierstokes/problem.hh:765
Scalar temperature(int deprecationHelper=0) const
Returns the temperature within the domain.
Definition freeflow/navierstokes/problem.hh:756
Class to specify the type of a boundary condition for the Navier-Stokes model.
Declares all properties used in Dumux.