25#ifndef DUMUX_DENSITY_FLOW_NC_TEST_PROBLEM_HH
26#define DUMUX_DENSITY_FLOW_NC_TEST_PROBLEM_HH
28#include <dune/grid/yaspgrid.hh>
41template <
class TypeTag>
52template<
class TypeTag>
60template<
class TypeTag>
64template<
class TypeTag>
65struct Grid<TypeTag,
TTag::DensityDrivenFlow> {
using type = Dune::YaspGrid<2>; };
68template<
class TypeTag>
71template<
class TypeTag>
74template<
class TypeTag>
76template<
class TypeTag>
79template<
class TypeTag>
94template <
class TypeTag>
107 using Element =
typename GridGeometry::GridView::template Codim<0>::Entity;
108 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
110 using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
114 static constexpr auto transportCompIdx = Indices::conti0EqIdx + 1;
115 static constexpr auto transportEqIdx = Indices::conti0EqIdx + 1;
119 : ParentType(gridGeometry), eps_(1e-6)
123 deltaRho_.resize(this->gridGeometry().numCellCenterDofs());
142 {
return 273.15 + 10; }
151 return NumEqVector(0.0);
168 BoundaryTypes values;
171 values.setDirichlet(Indices::velocityXIdx);
172 values.setDirichlet(Indices::velocityYIdx);
173 values.setNeumann(Indices::conti0EqIdx);
174 values.setNeumann(transportEqIdx);
176 if(globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_)
179 values.setDirichlet(transportCompIdx);
181 if(globalPos[0] > 0.4 && globalPos[0] < 0.6)
182 values.setDirichlet(transportCompIdx);
196 template<
class FVElementGeometry,
class SubControlVolume>
198 const FVElementGeometry& fvGeometry,
199 const SubControlVolume& scv,
203 return (isLowerLeftCell_(scv) && pvIdx == Indices::pressureIdx);
213 PrimaryVariables values;
215 values[Indices::pressureIdx] = 1.1e+5;
216 values[transportCompIdx] = 1e-3;
217 values[Indices::velocityXIdx] = 0.0;
218 values[Indices::velocityYIdx] = 0.0;
237 PrimaryVariables values;
238 values[Indices::pressureIdx] = 1.1e+5;
239 values[transportCompIdx] = 0.0;
240 values[Indices::velocityXIdx] = 0.0;
241 values[Indices::velocityYIdx] = 0.0;
254 template<
class Gr
idVariables,
class SolutionVector>
257 for (
const auto& element : elements(this->gridGeometry().gridView()))
259 auto fvGeometry =
localView(this->gridGeometry());
260 fvGeometry.bindElement(element);
261 for (
auto&& scv : scvs(fvGeometry))
263 auto ccDofIdx = scv.dofIndex();
265 auto elemVolVars =
localView(gridVariables.curGridVolVars());
266 elemVolVars.bind(element, fvGeometry, sol);
268 deltaRho_[ccDofIdx] = elemVolVars[scv].density() - 999.694;
274 {
return deltaRho_; }
282 template<
class SubControlVolume>
283 bool isLowerLeftCell_(
const SubControlVolume& scv)
const
284 {
return scv.dofIndex() == 0; }
287 bool useWholeLength_;
288 std::vector<Scalar> deltaRho_;
A single-phase, isothermal Navier-Stokes model.
A much simpler (and thus potentially less buggy) version of pure water.
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition localview.hh:38
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition parameters.hh:428
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
Definition common/properties.hh:47
Type tag for numeric models.
Definition grid.hh:35
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 of the fluid system to use.
Definition common/properties.hh:223
NavierStokesProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor.
Definition dumux/freeflow/navierstokes/problem.hh:99
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
Definition 1padapter.hh:46
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
Definition h2oair.hh:75
static constexpr int liquidPhaseIdx
Definition h2oair.hh:87
Test problem for the one-phase model.
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:96
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:211
Scalar temperature() const
Returns the temperature within the domain in [K].
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:141
NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
Returns the sources within the domain.
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:149
bool shouldWriteRestartFile() const
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:131
DensityDrivenFlowProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:118
bool isDirichletCell(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, int pvIdx) const
Returns whether a fixed Dirichlet value shall be used at a given cell.
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:197
void calculateDeltaRho(const GridVariables &gridVariables, const SolutionVector &sol)
Adds additional VTK output data to the VTKWriter.
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:255
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:235
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/navierstokesnc/densitydrivenflow/problem.hh:166
const std::vector< Scalar > & getDeltaRho() const
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:273
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:48
std::tuple< NavierStokesNC, StaggeredFreeFlowModel > InheritsFrom
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:48
static constexpr int phaseIdx
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:56
FluidSystems::OnePAdapter< H2OAir, phaseIdx > type
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:57
FluidSystems::H2OAir< GetPropType< TypeTag, Properties::Scalar > > H2OAir
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:55
static constexpr int value
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:61
Dune::YaspGrid< 2 > type
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:65
Dumux::DensityDrivenFlowProblem< TypeTag > type
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:69
static constexpr bool value
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:72
static constexpr bool value
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:75
static constexpr bool value
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:77
static constexpr bool value
Definition test/freeflow/navierstokesnc/densitydrivenflow/problem.hh:80
Defines a type tag and some properties for ree-flow models using the staggered scheme....
Navier-Stokes problem base class.