28#ifndef DUMUX_3D_CHANNEL_PROBLEM_HH
29#define DUMUX_3D_CHANNEL_PROBLEM_HH
31#include <dune/grid/yaspgrid.hh>
39#include <dune/common/float_cmp.hh>
47template <
class TypeTag>
48class ThreeDChannelTestProblem;
57template<
class TypeTag>
66template<
class TypeTag>
67struct Grid<TypeTag, TTag::ThreeDChannelTest> {
using type = Dune::YaspGrid<3>; };
69template<
class TypeTag>
70struct Grid<TypeTag, TTag::ThreeDChannelTest> {
using type = Dune::YaspGrid<2>; };
74template<
class TypeTag>
77template<
class TypeTag>
79template<
class TypeTag>
81template<
class TypeTag>
96template <
class TypeTag>
106 using Element =
typename GridView::template Codim<0>::Entity;
109 using FVElementGeometry =
typename GridGeometry::LocalView;
110 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
111 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
113 static constexpr int dim = GridView::dimension;
114 static constexpr int dimWorld = GridView::dimensionworld;
115 using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
123 static constexpr bool enablePseudoThreeDWallFriction = !
DIM_3D;
127 : ParentType(gridGeometry), eps_(1e-6)
129 deltaP_ = getParam<Scalar>(
"Problem.DeltaP");
130 height_ = getParam<Scalar>(
"Problem.Height");
131 rho_ = getParam<Scalar>(
"Component.LiquidDensity");
132 nu_ = getParam<Scalar>(
"Component.LiquidKinematicViscosity");
134 if(dim == 3 && !Dune::FloatCmp::eq(height_, this->gridGeometry().bBoxMax()[2]))
135 DUNE_THROW(Dune::InvalidStateException,
"z-dimension must equal height");
137 if(enablePseudoThreeDWallFriction)
138 extrusionFactor_ = 2.0/3.0 * height_;
140 extrusionFactor_ = 1.0;
154 {
return 273.15 + 10; }
161 using ParentType::source;
162 template<
class ElementVolumeVariables,
class ElementFaceVariables>
163 NumEqVector
source(
const Element &element,
164 const FVElementGeometry& fvGeometry,
165 const ElementVolumeVariables& elemVolVars,
166 const ElementFaceVariables& elemFaceVars,
167 const SubControlVolumeFace &scvf)
const
169 auto source = NumEqVector(0.0);
172 static const Scalar height = getParam<Scalar>(
"Problem.Height");
173 static const Scalar factor = getParam<Scalar>(
"Problem.PseudoWallFractionFactor", 8.0);
181 {
return extrusionFactor_; }
198 BoundaryTypes values;
201 if (isOutlet_(globalPos) || isInlet_(globalPos))
202 values.setDirichlet(Indices::pressureIdx);
205 values.setDirichlet(Indices::velocityXIdx);
206 values.setDirichlet(Indices::velocityYIdx);
208 values.setDirichlet(Indices::velocityZIdx);
221 PrimaryVariables values(0.0);
223 if(isInlet_(globalPos))
224 values[Indices::pressureIdx] = 1e5 + deltaP_;
226 if(isOutlet_(globalPos))
227 values[Indices::pressureIdx] = 1e5;
241 PrimaryVariables values(0.0);
248 const Scalar h = height_;
249 const Scalar w = this->gridGeometry().bBoxMax()[1];
250 const Scalar L = this->gridGeometry().bBoxMax()[0];
252 const Scalar mu = nu_*rho_;
254 return h*h*h * w * deltaP_ / (12*mu*L) * (1.0 - 0.630 * h/w);
259 bool isInlet_(
const GlobalPosition& globalPos)
const
261 return globalPos[0] < eps_;
264 bool isOutlet_(
const GlobalPosition& globalPos)
const
266 return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_;
271 Scalar extrusionFactor_;
Setting constant fluid properties via the input file.
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
The DUNE grid type.
Definition: common/properties.hh:57
UndefinedProperty 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
Scalar pseudo3DWallFriction(const Scalar velocity, const Scalar viscosity, const Scalar height, const Scalar factor=8.0) const
An additional drag term can be included as source term for the momentum balance to mimic 3D flow beha...
Definition: dumux/freeflow/navierstokes/problem.hh:167
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
Test problem for the one-phase (Navier-) Stokes model in a 3D or pseudo 3D channel.
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:98
Scalar analyticalFlux() const
Returns the analytical solution for the flux through the rectangular channel.
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:246
Scalar extrusionFactorAtPos(const GlobalPosition &pos) const
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:180
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary cont...
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:196
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:219
ThreeDChannelTestProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:126
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:239
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFaceVariables &elemFaceVars, const SubControlVolumeFace &scvf) const
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:163
Scalar temperature() const
Returns the temperature within the domain in [K].
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:153
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:53
std::tuple< NavierStokes, StaggeredFreeFlowModel > InheritsFrom
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:53
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:60
Dune::YaspGrid< 2 > type
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:70
Defines a type tag and some properties for ree-flow models using the staggered scheme....
A single-phase, isothermal Navier-Stokes model.
#define DIM_3D
Definition: test/freeflow/navierstokes/channel/3d/problem.hh:42