25#ifndef DUMUX_STOKES_SUBPROBLEM_ONEPTHREEC_HH
26#define DUMUX_STOKES_SUBPROBLEM_ONEPTHREEC_HH
28#include <dune/grid/yaspgrid.hh>
41template <
class TypeTag>
42class StokesSubProblem;
51template<
class TypeTag>
55template<
class TypeTag>
56struct Grid<TypeTag, TTag::StokesOnePThreeC> {
using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; };
59template<
class TypeTag>
62template<
class TypeTag>
64template<
class TypeTag>
66template<
class TypeTag>
70template<
class TypeTag>
71struct UseMoles<TypeTag, TTag::StokesOnePThreeC> {
static constexpr bool value =
true; };
74template<
class TypeTag>
78template<
class TypeTag>
79struct ReplaceCompEqIdx<TypeTag, TTag::StokesOnePThreeC> {
static constexpr int value = 3; };
88template <
class TypeTag>
98 using FVElementGeometry =
typename GridGeometry::LocalView;
99 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
104 using Element =
typename GridView::template Codim<0>::Entity;
105 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
111 : ParentType(gridGeometry,
"Stokes"), eps_(1e-6),
114 inletVelocity_ = getParamFromGroup<Scalar>(this->paramGroup(),
"Problem.Velocity");
115 pressure_ = getParamFromGroup<Scalar>(this->paramGroup(),
"Problem.Pressure");
132 {
return 273.15 + 10; }
140 {
return NumEqVector(0.0); }
156 const SubControlVolumeFace& scvf)
const
158 BoundaryTypes values;
160 const auto& globalPos = scvf.dofPosition();
162 if(onLeftBoundary_(globalPos))
164 values.setDirichlet(Indices::conti0EqIdx + 2);
165 values.setDirichlet(Indices::conti0EqIdx + 1);
166 values.setDirichlet(Indices::velocityXIdx);
167 values.setDirichlet(Indices::velocityYIdx);
170 else if(onRightBoundary_(globalPos))
172 values.setDirichlet(Indices::pressureIdx);
173 values.setOutflow(Indices::conti0EqIdx + 1);
174 values.setOutflow(Indices::conti0EqIdx + 2);
179 values.setDirichlet(Indices::velocityXIdx);
180 values.setDirichlet(Indices::velocityYIdx);
181 values.setNeumann(Indices::conti0EqIdx);
182 values.setNeumann(Indices::conti0EqIdx + 1);
183 values.setNeumann(Indices::conti0EqIdx + 2);
188 values.setNeumann(Indices::conti0EqIdx);
189 values.setNeumann(Indices::conti0EqIdx+1);
190 values.setNeumann(Indices::conti0EqIdx+2);
191 values.setNeumann(Indices::momentumYBalanceIdx);
192 values.setBJS(Indices::velocityXIdx);
203 PrimaryVariables values(0.0);
217 template<
class ElementVolumeVariables,
class ElementFaceVariables>
219 const FVElementGeometry& fvGeometry,
220 const ElementVolumeVariables& elemVolVars,
221 const ElementFaceVariables& elemFaceVars,
222 const SubControlVolumeFace& scvf)
const
224 NumEqVector values(0.0);
228 values[Indices::momentumYBalanceIdx] =
couplingManager().couplingData().momentumCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
230 const auto tmp =
couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf, DiffusionCoefficientAveragingType::harmonic);
231 values[Indices::conti0EqIdx] = tmp[0];
232 values[Indices::conti0EqIdx + 1] = tmp[1];
233 values[Indices::conti0EqIdx + 2] = tmp[2];
242 {
return *couplingManager_; }
256 PrimaryVariables values(0.0);
257 values[Indices::pressureIdx] = pressure_;
258 values[Indices::velocityXIdx] = inletVelocity_ * (globalPos[1] - this->gridGeometry().bBoxMin()[1])
259 * (this->gridGeometry().bBoxMax()[1] - globalPos[1])
260 / (0.25 * (this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1])
261 * (this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1]));
269 Scalar
permeability(
const Element& element,
const SubControlVolumeFace& scvf)
const
271 return couplingManager().couplingData().darcyPermeability(element, scvf);
278 Scalar
alphaBJ(
const SubControlVolumeFace& scvf)
const
286 bool onLeftBoundary_(
const GlobalPosition &globalPos)
const
287 {
return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; }
289 bool onRightBoundary_(
const GlobalPosition &globalPos)
const
290 {
return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; }
292 bool onLowerBoundary_(
const GlobalPosition &globalPos)
const
293 {
return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; }
295 bool onUpperBoundary_(
const GlobalPosition &globalPos)
const
296 {
return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; }
299 Scalar inletVelocity_;
301 std::shared_ptr<CouplingManager> couplingManager_;
This file contains the data which is required to calculate diffusive mass fluxes due to molecular dif...
A fluid system for one phase with the components h2, n2 and co2.
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
Property whether to use moles or kg as amount unit for balance equations.
Definition: common/properties.hh:102
The component balance index that should be replaced by the total mass/mole balance.
Definition: common/properties.hh:104
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 for the calculation of the molecular diffusion fluxes.
Definition: common/properties.hh:212
The type of the fluid system to use.
Definition: common/properties.hh:223
Definition: maxwellstefanslaw.hh:37
Navier-Stokes problem base class.
Definition: dumux/freeflow/navierstokes/problem.hh:63
DiffusionCoefficientAveragingType
Defines which kind of averanging of diffusion coefficiencients (moleculat diffusion or thermal conduc...
Definition: couplingdata.hh:52
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: 1p3c_1p3c/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: 1p3c_1p3c/problem_stokes.hh:218
bool shouldWriteRestartFile() const
Definition: 1p3c_1p3c/problem_stokes.hh:123
Scalar alphaBJ(const SubControlVolumeFace &scvf) const
Returns the alpha value required as input parameter for the Beavers-Joseph-Saffman boundary condition...
Definition: 1p3c_1p3c/problem_stokes.hh:278
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: 1p3c_1p3c/problem_stokes.hh:155
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: 1p3c_1p3c/problem_stokes.hh:110
NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
Returns the sources within the domain.
Definition: 1p3c_1p3c/problem_stokes.hh:139
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: 1p3c_1p3c/problem_stokes.hh:201
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: 1p3c_1p3c/problem_stokes.hh:269
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_stokes.hh:267
A simple fluid system with one Maxwell-Stefan component.
Definition: h2n2co2fluidsystem.hh:39
Definition: 1p3c_1p3c/problem_stokes.hh:47
std::tuple< NavierStokesNC, StaggeredFreeFlowModel > InheritsFrom
Definition: 1p3c_1p3c/problem_stokes.hh:47
Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< GetPropType< TypeTag, Properties::Scalar >, 2 > > type
Definition: 1p3c_1p3c/problem_stokes.hh:56
Defines a type tag and some properties for ree-flow models using the staggered scheme....