24#ifndef DUMUX_TEST_3D2P_PROBLEM_HH
25#define DUMUX_TEST_3D2P_PROBLEM_HH
28#include <dune/alugrid/grid.hh>
56template<
class TypeTag>
68SET_TYPE_PROP(ThreeDTwoPTest,
Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>);
75template<
class TypeTag>
94NEW_TYPE_TAG(MPFALAdaptiveTwoPTest,
INHERITS_FROM(FvMpfaL3dPressureTwoPAdaptive, FVTransportTwoP, IMPESTwoPAdaptive, ThreeDTwoPTest));
96NEW_TYPE_TAG(MimeticAdaptiveTwoPTest,
INHERITS_FROM(MimeticPressureTwoPAdaptive, FVTransportTwoP, IMPESTwoPAdaptive, ThreeDTwoPTest));
110template<
class TypeTag>
116using Grid =
typename GridView::Grid;
118using Indices =
typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
120using FluidSystem =
typename GET_PROP_TYPE(TypeTag, FluidSystem);
121using FluidState =
typename GET_PROP_TYPE(TypeTag, FluidState);
123using TimeManager =
typename GET_PROP_TYPE(TypeTag, TimeManager);
125using BoundaryTypes =
typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
126using PrimaryVariables =
typename GET_PROP(TypeTag, SolutionTypes)::PrimaryVariables;
130 dim = GridView::dimension, dimWorld = GridView::dimensionworld
135 wPhaseIdx = Indices::wPhaseIdx,
136 nPhaseIdx = Indices::nPhaseIdx,
138 pNIdx = Indices::pnIdx,
140 pWIdx = Indices::pwIdx,
142 swIdx = Indices::swIdx,
143 pressureEqIdx = Indices::pressureEqIdx,
144 satEqIdx = Indices::satEqIdx
149using Element =
typename GridView::Traits::template Codim<0>::Entity;
150using Intersection =
typename GridView::Intersection;
151using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
152using LocalPosition = Dune::FieldVector<Scalar, dim>;
159 int refinementFactor = 0;
162 refinementFactor = getParam<Scalar>(
"Grid.RefinementFactor");
163 grid.globalRefine(refinementFactor);
166 Scalar minDist = this->
bBoxMax().two_norm();
167 Scalar maxDist = this->
bBoxMin().two_norm();
170 for (
const auto& vertex : vertices(
grid.leafGridView())) {
171 GlobalPosition vertexCoord(vertex.geometry().center());
173 Scalar dist = vertexCoord.two_norm();
177 outflowEdge_ = vertex.geometry().center();
182 inflowEdge_ = vertex.geometry().center();
186 int outputInterval = 0;
187 if (
hasParam(
"Problem.OutputInterval"))
189 outputInterval = getParam<int>(
"Problem.OutputInterval");
193 Scalar outputTimeInterval = 1e6;
194 if (
hasParam(
"Problem.OutputTimeInterval"))
196 outputTimeInterval = getParam<Scalar>(
"Problem.OutputTimeInterval");
213 return getParam<std::string>(
"Problem.OutputName",
"test_3d2p");
238void sourceAtPos(PrimaryVariables &values,
const GlobalPosition& globalPos)
const
243 if (globalPos[0] < 0.1 * outflowEdge_[0] + eps_ && globalPos[1] < 0.1 * outflowEdge_[1] && globalPos[2] < 0.1 * outflowEdge_[2])
245 values[wPhaseIdx] = 1;
250void source(PrimaryVariables &values,
const Element& element)
const
255 int numVertices = element.geometry().corners();
256 for(
int i = 0; i < numVertices; i++)
258 GlobalPosition globalPos(element.template subEntity<dim>(i).geometry().center());
260 if (globalPos[0] < inflowEdge_[0] + eps_ && globalPos[1] < inflowEdge_[1] + eps_ && globalPos[2] < inflowEdge_[2] + eps_)
262 values[wPhaseIdx] = 1;
272 if (globalPos[0] > 0.9 * outflowEdge_[0] && globalPos[1] > 0.9 * outflowEdge_[1] && globalPos[2] > 0.9 * outflowEdge_[2])
274 bcTypes.setAllDirichlet();
278 bcTypes.setAllNeumann();
281 if (globalPos[0] < eps_)
283 bcTypes.setAllDirichlet();
285 else if (globalPos[0] > this->
bBoxMax()[0] - eps_)
287 bcTypes.setNeumann(pressureEqIdx);
288 bcTypes.setOutflow(satEqIdx);
293 bcTypes.setAllNeumann();
298void boundaryTypes(BoundaryTypes &bcTypes,
const Intersection& intersection)
const
301 auto element = intersection.inside();
302 int numVertices = element.geometry().corners();
303 for(
int i = 0; i < numVertices; i++)
305 GlobalPosition globalPos(element.template subEntity<dim>(i).geometry().center());
307 if (globalPos[0] > outflowEdge_[0] - eps_ && globalPos[1] > outflowEdge_[1] - eps_ && globalPos[2] > outflowEdge_[2] - eps_)
309 bcTypes.setAllDirichlet();
314 bcTypes.setAllNeumann();
318 GlobalPosition globalPos(intersection.geometry().center());
324void dirichletAtPos(PrimaryVariables &values,
const GlobalPosition& globalPos)
const
332 if (globalPos[0] < eps_)
338 if (globalPos[0] < eps_)
346void neumannAtPos(PrimaryVariables &values,
const GlobalPosition& globalPos)
const
351 if (globalPos[0] > this->
bBoxMax()[0] - eps_)
353 values[nPhaseIdx] = 3e-3;
359 const GlobalPosition& globalPos)
const
371static constexpr Scalar eps_ = 1e-6;
372GlobalPosition inflowEdge_;
373GlobalPosition outflowEdge_;
#define GET_PROP_VALUE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:282
#define GET_PROP(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:281
#define GET_PROP_TYPE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:283
#define NEW_TYPE_TAG(...)
Definition: propertysystemmacros.hh:130
A much simpler (and thus potentially less buggy) version of pure water.
A gaseous phase consisting of a single component.
A liquid phase consisting of a single component.
Properties for the MPFA-O method.
Properties for the MPFA-O method.
Class defining a standard, saturation dependent indicator for grid adaption.
Cfl-flux-function to evaluate a Cfl-Condition after Coats 2003.
spatial parameters for the 2p 3d test
bool hasParam(const std::string ¶m)
Check whether a key exists in the parameter tree.
Definition: parameters.hh:446
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
SET_INT_PROP(SequentialOneP, NumEq, 1)
Set number of equations to 1 for isothermal one-phase models.
Property tag AdaptionIndicator
Class defining the refinement/coarsening indicator.
Definition: gridadaptproperties.hh:55
SET_TYPE_PROP(FVPressureOneP, Velocity, FVVelocity1P< TypeTag >)
Set velocity reconstruction implementation standard cell centered finite volume schemes as default.
Type tag FVPressureOneP INHERITS_FROM(PressureOneP))
The type tag for the one-phase problems using a standard finite volume model.
Property tag AdaptiveGrid
Defines if the grid is h-adaptive.
Definition: gridadaptproperties.hh:49
Property tag EvalCflFluxFunction
Type of the evaluation of the CFL-condition.
Definition: transportproperties.hh:50
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
The type of the fluid system to use.
Definition: common/properties.hh:223
The formulation of the model.
Definition: common/properties.hh:237
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
A fluid system for two-phase models assuming immiscibility and thermodynamic equilibrium.
Definition: 2pimmiscible.hh:59
Class defining a standard, saturation dependent indicator for grid adaption.
Definition: gridadaptionindicatorlocal.hh:40
Base class for all 2-phase problems which use an IMPES algorithm.
Definition: dumux/porousmediumflow/2p/sequential/impes/problem.hh:41
Cfl-flux-function to evaluate a Cfl-Condition after Coats 2003.
Definition: evalcflfluxcoats.hh:40
base class for problems using a sequential implicit-explicit strategy
Definition: impetproblem.hh:46
TimeManager & timeManager()
Returns TimeManager object used by the simulation.
Definition: impetproblem.hh:663
void setOutputTimeInterval(const Scalar timeInterval)
Sets a time interval for Output.
Definition: impetproblem.hh:481
const GlobalPosition & bBoxMin() const
The coordinate of the corner of the GridView's bounding box with the smallest values.
Definition: impetproblem.hh:648
void setOutputInterval(const int interval)
Sets the interval for Output.
Definition: impetproblem.hh:492
const GlobalPosition & bBoxMax() const
The coordinate of the corner of the GridView's bounding box with the largest values.
Definition: impetproblem.hh:655
Grid & grid()
Returns the current grid which used by the problem.
Definition: impetproblem.hh:581
test problem for sequential 2p models in 3d
Definition: test_3d2pproblem.hh:112
void boundaryTypesAtPos(BoundaryTypes &bcTypes, const GlobalPosition &globalPos) const
Definition: test_3d2pproblem.hh:269
void source(PrimaryVariables &values, const Element &element) const
Definition: test_3d2pproblem.hh:250
Test3D2PProblem(TimeManager &timeManager, Grid &grid)
Definition: test_3d2pproblem.hh:156
bool shouldWriteRestartFile() const
Definition: test_3d2pproblem.hh:216
void sourceAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const
Definition: test_3d2pproblem.hh:238
Scalar referencePressureAtPos(const GlobalPosition &globalPos) const
Definition: test_3d2pproblem.hh:233
void dirichletAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const
Definition: test_3d2pproblem.hh:324
void boundaryTypes(BoundaryTypes &bcTypes, const Intersection &intersection) const
Definition: test_3d2pproblem.hh:298
void initialAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const
Definition: test_3d2pproblem.hh:358
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature within the domain.
Definition: test_3d2pproblem.hh:226
std::string name() const
The problem name.
Definition: test_3d2pproblem.hh:211
void neumannAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const
Definition: test_3d2pproblem.hh:346
typename GET_PROP_TYPE(TypeTag, Scalar) Scalar
Definition: test_3d2pproblem.hh:78
spatial parameters for the 2p 3d test
Definition: test_3d2pspatialparams.hh:69
Specifies the properties for immiscible 2p transport.
Base class for all 2-phase problems which use an IMPES algorithm.
Defines the properties required for finite volume pressure models in a two-phase sequential model.
Defines the properties required for (immiscible) twophase sequential models.
Defines the properties required for finite volume pressure models in a two-phase sequential model.
Defines the properties required for (immiscible) twophase sequential models.