12#ifndef DUMUX_NAVIERSTOKES_MASS_PROBLEM_HH
13#define DUMUX_NAVIERSTOKES_MASS_PROBLEM_HH
15#include <dune/common/exceptions.hh>
16#include <dune/common/typetraits.hh>
25template<
class TypeTag,
class DiscretizationMethod>
32 using GridView =
typename GridGeometry::GridView;
33 using FVElementGeometry =
typename GridGeometry::LocalView;
34 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
35 using Element =
typename GridView::template Codim<0>::Entity;
36 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
37 using VelocityVector = GlobalPosition;
42 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
51 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
88 const FVElementGeometry& fvGeometry,
89 const SubControlVolumeFace& scvf)
const
91 if constexpr (isCoupled_)
92 return couplingManager_->faceVelocity(element, scvf);
94 return asImp_().velocityAtPos(scvf.ipGlobal());
102 if constexpr (isCoupled_)
103 return couplingManager_->elementVelocity(fvGeometry);
105 return asImp_().velocityAtPos(fvGeometry.element().geometry().center());
113 DUNE_THROW(Dune::NotImplemented,
"velocityAtPos not implemented");
118 if constexpr (isCoupled_)
119 return *couplingManager_;
121 DUNE_THROW(Dune::InvalidStateException,
122 "Accessing coupling manager of an uncoupled problem is not possible."
128 Implementation &asImp_()
129 {
return *
static_cast<Implementation *
>(
this); }
132 const Implementation &asImp_()
const
133 {
return *
static_cast<const Implementation *
>(
this); }
135 std::shared_ptr<CouplingManager> couplingManager_;
144template<
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
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:528
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:524
Base class for all finite-volume problems using spatial parameters.
Definition: fvproblemwithspatialparams.hh:29
Definition: freeflow/navierstokes/mass/problem.hh:27
VelocityVector elementVelocity(const FVElementGeometry &fvGeometry) const
Returns the velocity at the element center.
Definition: freeflow/navierstokes/mass/problem.hh:100
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition: freeflow/navierstokes/mass/problem.hh:53
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/mass/problem.hh:116
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/mass/problem.hh:87
Dune::FieldVector< Scalar, ModelTraits::numEq()> DirichletValues
Definition: freeflow/navierstokes/mass/problem.hh:52
NavierStokesMassProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/mass/problem.hh:79
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition: freeflow/navierstokes/mass/problem.hh:51
NavierStokesMassProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition: freeflow/navierstokes/mass/problem.hh:67
VelocityVector velocityAtPos(const GlobalPosition &) const
Returns the velocity at a given position.
Definition: freeflow/navierstokes/mass/problem.hh:111
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition: freeflow/navierstokes/mass/problem.hh:50
static constexpr bool isMomentumProblem()
this problem is used for the mass balance model
Definition: freeflow/navierstokes/mass/problem.hh:59
Defines all properties used in Dumux.
Base class for all finite volume problems that are parameterized.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The available discretization methods in Dumux.
A helper to deduce a vector with the same size as numbers of equations.