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()>;
90 template<
class SubControlVolumeFace>
92 const FVElementGeometry& fvGeometry,
93 const SubControlVolumeFace& scvf)
const
95 if constexpr (isCoupled_)
96 return couplingManager_->faceVelocity(element, scvf);
98 return asImp_().velocityAtPos(scvf.ipGlobal());
104 template<
class IpData>
105 VelocityVector
velocity(
const FVElementGeometry& fvGeometry,
const IpData& ipData)
const
107 if constexpr (isCoupled_)
108 return couplingManager_->velocity(fvGeometry, ipData);
110 return asImp_().velocityAtPos(ipData.global());
116 template<
class IpData>
119 if constexpr (isCoupled_)
120 return couplingManager_->velocityDivergence(fvGeometry, ipData);
130 if constexpr (isCoupled_)
131 return couplingManager_->elementVelocity(fvGeometry);
133 return asImp_().velocityAtPos(fvGeometry.element().geometry().center());
141 DUNE_THROW(Dune::NotImplemented,
"velocityAtPos not implemented");
146 if constexpr (isCoupled_)
147 return *couplingManager_;
149 DUNE_THROW(Dune::InvalidStateException,
150 "Accessing coupling manager of an uncoupled problem is not possible."
157 {
return *
static_cast<Implementation *
>(
this); }
160 const Implementation &
asImp_()
const
161 {
return *
static_cast<const Implementation *
>(
this); }
163 std::shared_ptr<CouplingManager> couplingManager_;
166template<
class TypeTag>
173 using GridView =
typename GridGeometry::GridView;
174 using FVElementGeometry =
typename GridGeometry::LocalView;
175 using Element =
typename GridView::template Codim<0>::Entity;
176 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
177 using VelocityVector = GlobalPosition;
182 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
191 using Sources = Dune::FieldVector<Scalar, ModelTraits::numEq()>;
196 using BoundaryTypes = Dumux::Experimental::BoundaryTypes<ModelTraits::numEq()>;
227 template<
class SubControlVolumeFace>
229 const FVElementGeometry& fvGeometry,
230 const SubControlVolumeFace& scvf)
const
232 if constexpr (isCoupled_)
233 return couplingManager_->faceVelocity(element, scvf);
235 return asImp_().velocityAtPos(scvf.ipGlobal());
241 template<
class IpData>
242 VelocityVector
velocity(
const FVElementGeometry& fvGeometry,
const IpData& ipData)
const
244 if constexpr (isCoupled_)
245 return couplingManager_->velocity(fvGeometry, ipData);
247 return asImp_().velocityAtPos(ipData.global());
253 template<
class IpData>
256 if constexpr (isCoupled_)
257 return couplingManager_->velocityDivergence(fvGeometry, ipData);
267 if constexpr (isCoupled_)
268 return couplingManager_->elementVelocity(fvGeometry);
270 return asImp_().velocityAtPos(fvGeometry.element().geometry().center());
278 DUNE_THROW(Dune::NotImplemented,
"velocityAtPos not implemented");
283 if constexpr (isCoupled_)
284 return *couplingManager_;
286 DUNE_THROW(Dune::InvalidStateException,
287 "Accessing coupling manager of an uncoupled problem is not possible."
294 {
return *
static_cast<Implementation *
>(
this); }
297 const Implementation &
asImp_()
const
298 {
return *
static_cast<const Implementation *
>(
this); }
300 std::shared_ptr<CouplingManager> couplingManager_;
309template<
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:219
CVFENavierStokesMassProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
The constructor.
Definition freeflow/navierstokes/mass/problem.hh:207
Scalar velocityDivergence(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Returns the velocity divergence at a given interpolation point.
Definition freeflow/navierstokes/mass/problem.hh:254
Dune::FieldVector< Scalar, ModelTraits::numEq()> DirichletValues
Definition freeflow/navierstokes/mass/problem.hh:192
Dune::FieldVector< Scalar, ModelTraits::numEq()> Sources
Definition freeflow/navierstokes/mass/problem.hh:191
Dune::FieldVector< Scalar, ModelTraits::numEq()> BoundaryFluxes
Definition freeflow/navierstokes/mass/problem.hh:193
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:228
static constexpr bool isMomentumProblem()
this problem is used for the mass balance model
Definition freeflow/navierstokes/mass/problem.hh:199
VelocityVector velocity(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Returns the velocity at a given interpolation point.
Definition freeflow/navierstokes/mass/problem.hh:242
Dumux::Experimental::BoundaryTypes< ModelTraits::numEq()> BoundaryTypes
Export the boundary types.
Definition freeflow/navierstokes/mass/problem.hh:196
Dune::FieldVector< Scalar, ModelTraits::numEq()> InitialValues
Definition freeflow/navierstokes/mass/problem.hh:190
VelocityVector velocityAtPos(const GlobalPosition &) const
Returns the velocity at a given position.
Definition freeflow/navierstokes/mass/problem.hh:276
const CouplingManager & couplingManager() const
Definition freeflow/navierstokes/mass/problem.hh:281
VelocityVector elementVelocity(const FVElementGeometry &fvGeometry) const
Returns the velocity at the element center.
Definition freeflow/navierstokes/mass/problem.hh:265
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition common/problem.hh:301
Implementation & asImp_()
Returns the implementation of the problem (i.e. static polymorphism).
Definition common/problem.hh:306
const GridDiscretization & gridGeometry() const
The grid discretization.
Definition common/problem.hh:293
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:128
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:144
VelocityVector velocity(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Returns the velocity at a given interpolation point.
Definition freeflow/navierstokes/mass/problem.hh:105
Dune::FieldVector< Scalar, ModelTraits::numEq()> DirichletValues
Definition freeflow/navierstokes/mass/problem.hh:55
Scalar velocityDivergence(const FVElementGeometry &fvGeometry, const IpData &ipData) const
Returns the velocity divergence at a given interpolation point.
Definition freeflow/navierstokes/mass/problem.hh:117
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
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:91
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:139
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:310
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.