25#ifndef DUMUX_STOKES_SUBPROBLEM_HH
26#define DUMUX_STOKES_SUBPROBLEM_HH
28#include <dune/grid/yaspgrid.hh>
38template <
class TypeTag>
39class StokesSubProblem;
48template<
class TypeTag>
56template<
class TypeTag>
57struct Grid<TypeTag, TTag::StokesOneP> {
using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; };
60template<
class TypeTag>
63template<
class TypeTag>
65template<
class TypeTag>
67template<
class TypeTag>
77template <
class TypeTag>
90 using FVElementGeometry =
typename GridGeometry::LocalView;
91 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
92 using Element =
typename GridView::template Codim<0>::Entity;
94 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
103 : ParentType(gridGeometry,
"Stokes"), eps_(1e-6), couplingManager_(
couplingManager)
105 problemName_ = getParam<std::string>(
"Vtk.OutputName") +
"_" + getParamFromGroup<std::string>(this->paramGroup(),
"Problem.Name");
108 verticalFlow_ = problemName_.find(
"vertical") != std::string::npos;
114 const std::string&
name()
const
130 {
return 273.15 + 10; }
138 {
return NumEqVector(0.0); }
154 const SubControlVolumeFace& scvf)
const
156 BoundaryTypes values;
158 const auto& globalPos = scvf.dofPosition();
163 if(onUpperBoundary_(globalPos))
165 values.setDirichlet(Indices::velocityXIdx);
166 values.setDirichlet(Indices::velocityYIdx);
170 if (onRightBoundary_(globalPos) || (onLeftBoundary_(globalPos)))
172 values.setDirichlet(Indices::velocityXIdx);
173 values.setDirichlet(Indices::velocityYIdx);
179 if(onLeftBoundary_(globalPos) || onRightBoundary_(globalPos))
180 values.setDirichlet(Indices::pressureIdx);
183 values.setDirichlet(Indices::velocityXIdx);
184 values.setDirichlet(Indices::velocityYIdx);
189 if(
couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
191 values.setCouplingNeumann(Indices::conti0EqIdx);
192 values.setCouplingNeumann(Indices::momentumYBalanceIdx);
193 values.setBJS(Indices::momentumXBalanceIdx);
216 template<
class ElementVolumeVariables,
class ElementFaceVariables>
218 const FVElementGeometry& fvGeometry,
219 const ElementVolumeVariables& elemVolVars,
220 const ElementFaceVariables& elemFaceVars,
221 const SubControlVolumeFace& scvf)
const
223 NumEqVector values(0.0);
225 if(
couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
227 values[Indices::conti0EqIdx] =
couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
228 values[Indices::momentumYBalanceIdx] =
couplingManager().couplingData().momentumCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
237 {
return *couplingManager_; }
251 PrimaryVariables values(0.0);
255 static const Scalar inletVelocity = getParamFromGroup<Scalar>(this->paramGroup(),
"Problem.Velocity");
256 values[Indices::velocityYIdx] = inletVelocity * globalPos[0] * (this->gridGeometry().bBoxMax()[0] - globalPos[0]);
260 static const Scalar deltaP = getParamFromGroup<Scalar>(this->paramGroup(),
"Problem.PressureDifference");
261 if(onLeftBoundary_(globalPos))
262 values[Indices::pressureIdx] = deltaP;
272 Scalar
permeability(
const Element& element,
const SubControlVolumeFace& scvf)
const
274 return couplingManager().couplingData().darcyPermeability(element, scvf);
281 Scalar
alphaBJ(
const SubControlVolumeFace& scvf)
const
283 return couplingManager().problem(CouplingManager::darcyIdx).spatialParams().beaversJosephCoeffAtPos(scvf.center());
289 bool onLeftBoundary_(
const GlobalPosition &globalPos)
const
290 {
return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; }
292 bool onRightBoundary_(
const GlobalPosition &globalPos)
const
293 {
return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; }
295 bool onLowerBoundary_(
const GlobalPosition &globalPos)
const
296 {
return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; }
298 bool onUpperBoundary_(
const GlobalPosition &globalPos)
const
299 {
return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; }
302 std::string problemName_;
305 std::shared_ptr<CouplingManager> couplingManager_;
A much simpler (and thus potentially less buggy) version of pure water.
A liquid phase consisting of a single component.
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
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
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
If disabled, the volume variables are not stored (reduces memory, but is slower)
Definition: common/properties.hh:178
specifies if data on flux vars should be saved (faster, but more memory consuming)
Definition: common/properties.hh:188
The type of the fluid system to use.
Definition: common/properties.hh:223
Navier-Stokes problem base class.
Definition: dumux/freeflow/navierstokes/problem.hh:63
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
Definition: multidomain/couplingmanager.hh:46
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_1p/problem_stokes.hh:129
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_1p/problem_stokes.hh:217
Scalar alphaBJ(const SubControlVolumeFace &scvf) const
Returns the alpha value required as input parameter for the Beavers-Joseph-Saffman boundary condition...
Definition: 1p_1p/problem_stokes.hh:281
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_1p/problem_stokes.hh:153
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_1p/problem_stokes.hh:102
NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
Returns the sources within the domain.
Definition: 1p_1p/problem_stokes.hh:137
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: 1p_1p/problem_stokes.hh:202
const std::string & name() const
The problem name.
Definition: 1p_1p/problem_stokes.hh:114
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_1p/problem_stokes.hh:272
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
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: 1p_1p/problem_stokes.hh:51
Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< GetPropType< TypeTag, Properties::Scalar >, 2 > > type
Definition: 1p_1p/problem_stokes.hh:57
Defines a type tag and some properties for ree-flow models using the staggered scheme....
A single-phase, isothermal Navier-Stokes model.