25#ifndef DUMUX_STOKES_SUBPROBLEM_HH
26#define DUMUX_STOKES_SUBPROBLEM_HH
28#include <dune/grid/yaspgrid.hh>
35template <
class TypeTag>
36class StokesSubProblem;
45template<
class TypeTag>
46struct Grid<TypeTag, TTag::StokesOneP> {
using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; };
49template<
class TypeTag>
52template<
class TypeTag>
54template<
class TypeTag>
55struct EnableGridFluxVariablesCache<TypeTag, TTag::StokesOneP> {
static constexpr bool value =
true; };
56template<
class TypeTag>
57struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesOneP> {
static constexpr bool value =
true; };
66template <
class TypeTag>
81 using FVElementGeometry =
typename GridGeometry::LocalView;
82 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
83 using Element =
typename GridView::template Codim<0>::Entity;
87 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
96 : ParentType(gridGeometry,
"Stokes"), eps_(1e-6), couplingManager_(
couplingManager)
98 inletVelocity_ = getParamFromGroup<Scalar>(this->paramGroup(),
"Problem.Velocity");
99 pressure_ = getParamFromGroup<Scalar>(this->paramGroup(),
"Problem.Pressure");
100 temperature_ = getParamFromGroup<Scalar>(this->paramGroup(),
"Problem.Temperature");
101 problemName_ = getParam<std::string>(
"Vtk.OutputName") +
"_" + getParamFromGroup<std::string>(this->paramGroup(),
"Problem.Name");
107 const std::string&
name()
const
124 {
return temperature_; }
132 {
return NumEqVector(0.0); }
148 const SubControlVolumeFace& scvf)
const
150 BoundaryTypes values;
152 if(
couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
154 values.setCouplingNeumann(Indices::conti0EqIdx);
155 values.setCouplingNeumann(Indices::momentumYBalanceIdx);
156 values.setBJS(Indices::momentumXBalanceIdx);
160 values.setDirichlet(Indices::velocityXIdx);
161 values.setDirichlet(Indices::velocityYIdx);
172 PrimaryVariables values(0.0);
190 const FVElementGeometry& fvGeometry,
191 const ElementVolumeVariables& elemVolVars,
192 const ElementFaceVariables& elemFaceVars,
193 const SubControlVolumeFace& scvf)
const
195 NumEqVector values(0.0);
197 if(
couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
199 values[Indices::conti0EqIdx] =
couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
200 values[Indices::momentumYBalanceIdx] =
couplingManager().couplingData().momentumCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
211 {
return *couplingManager_; }
225 PrimaryVariables values(0.0);
227 values[Indices::pressureIdx] = pressure_;
228 values[Indices::velocityYIdx] = 4.0 * inletVelocity_ * globalPos[0] * (this->gridGeometry().bBoxMax()[0] - globalPos[0])
229 / (this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0])
230 / (this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0]);
238 Scalar
permeability(
const Element& element,
const SubControlVolumeFace& scvf)
const
240 return couplingManager().couplingData().darcyPermeability(element, scvf);
247 Scalar
alphaBJ(
const SubControlVolumeFace& scvf)
const
255 bool onLeftBoundary_(
const GlobalPosition &globalPos)
const
256 {
return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; }
258 bool onRightBoundary_(
const GlobalPosition &globalPos)
const
259 {
return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; }
261 bool onLowerBoundary_(
const GlobalPosition &globalPos)
const
262 {
return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; }
264 bool onUpperBoundary_(
const GlobalPosition &globalPos)
const
265 {
return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; }
268 Scalar inletVelocity_;
271 std::string problemName_;
272 std::shared_ptr<CouplingManager> couplingManager_;
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
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
The DUNE grid type.
Definition: common/properties.hh:57
Property to specify the type of a problem which has to be solved.
Definition: common/properties.hh:69
Definition: common/properties.hh:169
Navier-Stokes problem base class.
Definition: dumux/freeflow/navierstokes/problem.hh:63
Test problem for the 1pnc (Navier-) Stokes problem.
Definition: 1p_2p/problem_stokes.hh:68
Scalar temperature() const
Returns the temperature within the domain in [K].
Definition: 1p_2p/problem_stokes.hh:123
bool shouldWriteRestartFile() const
Definition: 1p_2p/problem_stokes.hh:117
PrimaryVariables dirichletAtPos(const GlobalPosition &pos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: 1p_2p/problem_stokes.hh:170
Scalar alphaBJ(const SubControlVolumeFace &scvf) const
Returns the alpha value required as input parameter for the Beavers-Joseph-Saffman boundary condition...
Definition: 1p_2p/problem_stokes.hh:247
BoundaryTypes 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: 1p_2p/problem_stokes.hh:147
const CouplingManager & couplingManager() const
Get the coupling manager.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_stokes.hh:254
StokesSubProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager)
Definition: 1p_2p/problem_stokes.hh:95
NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
Returns the sources within the domain.
Definition: 1p_2p/problem_stokes.hh:131
NumEqVector neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFaceVariables &elemFaceVars, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann control volume.
Definition: 1p_2p/problem_stokes.hh:189
const std::string & name() const
The problem name.
Definition: 1p_2p/problem_stokes.hh:107
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: 1p_2p/problem_stokes.hh:238
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_stokes.hh:267
Definition: 1p_1p/problem_stokes.hh:44
std::tuple< NavierStokes, StaggeredFreeFlowModel > InheritsFrom
Definition: 1p_1p/problem_stokes.hh:44
Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< GetPropType< TypeTag, Properties::Scalar >, 2 > > type
Definition: 1p_1p/problem_stokes.hh:57
A single-phase, isothermal Navier-Stokes model.
Defines a type tag and some properties for ree-flow models using the staggered scheme....