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>
19#include <dumux/common/boundarytypes_.hh>
28template<
class TypeTag,
class DiscretizationMethod>
35 using GridView =
typename GridGeometry::GridView;
36 using FVElementGeometry =
typename GridGeometry::LocalView;
37 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
38 using Element =
typename GridView::template Codim<0>::Entity;
39 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
40 using VelocityVector = GlobalPosition;
45 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
54 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
91 const FVElementGeometry& fvGeometry,
92 const SubControlVolumeFace& scvf)
const
94 if constexpr (isCoupled_)
95 return couplingManager_->faceVelocity(element, scvf);
97 return asImp_().velocityAtPos(scvf.ipGlobal());
103 template<
class IpData>
104 VelocityVector
velocity(
const FVElementGeometry& fvGeometry,
const IpData& ipData)
const
106 if constexpr (isCoupled_)
107 return couplingManager_->velocity(fvGeometry, ipData);
109 return asImp_().velocityAtPos(ipData.global());
117 if constexpr (isCoupled_)
118 return couplingManager_->elementVelocity(fvGeometry);
120 return asImp_().velocityAtPos(fvGeometry.element().geometry().center());
128 DUNE_THROW(Dune::NotImplemented,
"velocityAtPos not implemented");
133 if constexpr (isCoupled_)
134 return *couplingManager_;
136 DUNE_THROW(Dune::InvalidStateException,
137 "Accessing coupling manager of an uncoupled problem is not possible."
144 {
return *
static_cast<Implementation *
>(
this); }
147 const Implementation &
asImp_()
const
148 {
return *
static_cast<const Implementation *
>(
this); }
150 std::shared_ptr<CouplingManager> couplingManager_;
153template<
class TypeTag>
160 using GridView =
typename GridGeometry::GridView;
161 using FVElementGeometry =
typename GridGeometry::LocalView;
162 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
163 using Element =
typename GridView::template Codim<0>::Entity;
164 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
165 using VelocityVector = GlobalPosition;
170 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
179 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
184 using BoundaryTypes = Dumux::Experimental::BoundaryTypes<ModelTraits::numEq()>;
216 const FVElementGeometry& fvGeometry,
217 const SubControlVolumeFace& scvf)
const
219 if constexpr (isCoupled_)
220 return couplingManager_->faceVelocity(element, scvf);
222 return asImp_().velocityAtPos(scvf.ipGlobal());
228 template<
class IpData>
229 VelocityVector
velocity(
const FVElementGeometry& fvGeometry,
const IpData& ipData)
const
231 if constexpr (isCoupled_)
232 return couplingManager_->velocity(fvGeometry, ipData);
234 return asImp_().velocityAtPos(ipData.global());
242 if constexpr (isCoupled_)
243 return couplingManager_->elementVelocity(fvGeometry);
245 return asImp_().velocityAtPos(fvGeometry.element().geometry().center());
253 DUNE_THROW(Dune::NotImplemented,
"velocityAtPos not implemented");
258 if constexpr (isCoupled_)
259 return *couplingManager_;
261 DUNE_THROW(Dune::InvalidStateException,
262 "Accessing coupling manager of an uncoupled problem is not possible."
269 {
return *
static_cast<Implementation *
>(
this); }
272 const Implementation &
asImp_()
const
273 {
return *
static_cast<const Implementation *
>(
this); }
275 std::shared_ptr<CouplingManager> couplingManager_;
284template<
class TypeTag>
Class to specify the type of a boundary.
Definition common/boundarytypes.hh:26
CVFENavierStokesMassProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor for usage without a coupling manager.
Definition freeflow/navierstokes/mass/problem.hh:207
CVFENavierStokesMassProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition freeflow/navierstokes/mass/problem.hh:195
Dune::FieldVector< Scalar, ModelTraits::numEq()> DirichletValues
Definition freeflow/navierstokes/mass/problem.hh:180
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:215
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition freeflow/navierstokes/mass/problem.hh:179
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition freeflow/navierstokes/mass/problem.hh:181
static constexpr bool isMomentumProblem()
this problem is used for the mass balance model
Definition freeflow/navierstokes/mass/problem.hh:187
VelocityVector velocity(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Returns the velocity at a given interpolation point.
Definition freeflow/navierstokes/mass/problem.hh:229
Dumux::Experimental::BoundaryTypes< ModelTraits::numEq()> BoundaryTypes
Export the boundary types.
Definition freeflow/navierstokes/mass/problem.hh:184
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition freeflow/navierstokes/mass/problem.hh:178
VelocityVector velocityAtPos(const GlobalPosition &) const
Returns the velocity at a given position.
Definition freeflow/navierstokes/mass/problem.hh:251
const CouplingManager & couplingManager() const
Definition freeflow/navierstokes/mass/problem.hh:256
VelocityVector elementVelocity(const FVElementGeometry &fvGeometry) const
Returns the velocity at the element center.
Definition freeflow/navierstokes/mass/problem.hh:240
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition common/problem.hh:304
Implementation & asImp_()
Returns the implementation of the problem (i.e. static polymorphism).
Definition common/problem.hh:309
const GridDiscretization & gridGeometry() const
The grid discretization.
Definition common/problem.hh:296
Base class for all problems using spatial parameters.
Definition problemwithspatialparams.hh:29
const std::string & paramGroup() const
Definition common/fvproblem.hh:524
const GridGeometry & gridGeometry() const
Definition common/fvproblem.hh:520
Implementation & asImp_()
Returns the implementation of the problem (i.e. static polymorphism).
Definition common/fvproblem.hh:529
FVProblemWithSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
Constructor.
Definition fvproblemwithspatialparams.hh:42
Definition freeflow/navierstokes/mass/problem.hh:30
VelocityVector elementVelocity(const FVElementGeometry &fvGeometry) const
Returns the velocity at the element center.
Definition freeflow/navierstokes/mass/problem.hh:115
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition freeflow/navierstokes/mass/problem.hh:56
Dumux::BoundaryTypes< ModelTraits::numEq()> BoundaryTypes
Export the boundary types.
Definition freeflow/navierstokes/mass/problem.hh:59
const CouplingManager & couplingManager() const
Definition freeflow/navierstokes/mass/problem.hh:131
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:90
VelocityVector velocity(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Returns the velocity at a given interpolation point.
Definition freeflow/navierstokes/mass/problem.hh:104
Dune::FieldVector< Scalar, ModelTraits::numEq()> DirichletValues
Definition freeflow/navierstokes/mass/problem.hh:55
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:82
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition freeflow/navierstokes/mass/problem.hh:54
NavierStokesMassProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition freeflow/navierstokes/mass/problem.hh:70
VelocityVector velocityAtPos(const GlobalPosition &) const
Returns the velocity at a given position.
Definition freeflow/navierstokes/mass/problem.hh:126
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition freeflow/navierstokes/mass/problem.hh:53
static constexpr bool isMomentumProblem()
this problem is used for the mass balance model
Definition freeflow/navierstokes/mass/problem.hh:62
Defines all properties used in Dumux.
Base class for all finite volume problems that are parameterized.
NavierStokesMassProblemImpl< TypeTag, typename GetPropType< TypeTag, Properties::GridGeometry >::DiscretizationMethod > NavierStokesMassProblem
Navier-Stokes mass problem class.
Definition freeflow/navierstokes/mass/problem.hh:285
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.
Base class for all problems using spatial parameters.
Quadrature rules over sub-control volumes and sub-control volume faces.