24#ifndef DUMUX_TEST_MPFA2P_PROBLEM_HH
25#define DUMUX_TEST_MPFA2P_PROBLEM_HH
28#include <dune/grid/uggrid.hh>
30#include <dune/grid/yaspgrid.hh>
56template<
class TypeTag>
57class MPFATwoPTestProblem;
78template<
class TypeTag>
129template<
class TypeTag>
134using Grid =
typename GridView::Grid;
136using Indices =
typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
138using WettingPhase =
typename GET_PROP(TypeTag, FluidSystem)::WettingPhase;
140using TimeManager =
typename GET_PROP_TYPE(TypeTag, TimeManager);
142using BoundaryTypes =
typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
143using SolutionTypes =
typename GET_PROP(TypeTag, SolutionTypes);
144using PrimaryVariables =
typename SolutionTypes::PrimaryVariables;
148 dim = GridView::dimension, dimWorld = GridView::dimensionworld
153 nPhaseIdx = Indices::nPhaseIdx,
155 pnIdx = Indices::pnIdx,
157 pwIdx = Indices::pwIdx,
159 swIdx = Indices::swIdx,
160 eqIdxPress = Indices::pressureEqIdx,
161 eqIdxSat = Indices::satEqIdx
166using Element =
typename GridView::Traits::template Codim<0>::Entity;
167using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
173, analyticSolution_(*this)
176 int refinementFactor = getParam<Scalar>(
"Grid.RefinementFactor", 0);
177 this->
grid().globalRefine(refinementFactor);
179 Scalar inletWidth = getParam<Scalar>(
"Problem.InletWidth", 1.0);
180 GlobalPosition inletCenter = this->
bBoxMax();
181 inletCenter[0] *= 0.5;
183 inletLeftCoord_ = inletCenter;
184 inletLeftCoord_[0] -=0.5*inletWidth;
185 inletRightCoord_ = inletCenter;
186 inletRightCoord_[0] +=0.5*inletWidth;
188 inFlux_ = getParam<Scalar>(
"Problem.InjectionFlux", 1e-4);
190 int outputInterval = getParam<int>(
"Problem.OutputInterval", 0);
193 Scalar outputTimeInterval = getParam<Scalar>(
"Problem.OutputTimeInterval", 1e6);
204 analyticSolution_.initialize(vTot);
207 analyticSolution_.initialize();
213 analyticSolution_.calculateAnalyticSolution();
216 analyticSolution_.addOutputVtkFields(this->
resultWriter());
232 return getParam<std::string>(
"Problem.Name");
259void source(PrimaryVariables &values,
const Element& element)
const
274 if (isInlet(globalPos))
276 bcTypes.setNeumann(eqIdxPress);
277 bcTypes.setDirichlet(swIdx);
279 else if (isBottom(globalPos) || isTop(globalPos))
281 bcTypes.setAllNeumann();
285 bcTypes.setDirichlet(pwIdx);
286 bcTypes.setOutflow(eqIdxSat);
289 if (globalPos[0] < eps_)
291 bcTypes.setAllDirichlet();
293 else if (globalPos[0] > this->
bBoxMax()[0] - eps_)
295 bcTypes.setNeumann(eqIdxPress);
296 bcTypes.setOutflow(eqIdxSat);
300 bcTypes.setAllNeumann();
303 if (globalPos[0] < eps_)
305 bcTypes.setAllDirichlet();
309 bcTypes.setAllNeumann();
315void dirichletAtPos(PrimaryVariables &values,
const GlobalPosition& globalPos)
const
325 if (isInlet(globalPos))
330 if (globalPos[0] < eps_)
336 if (globalPos[0] < eps_)
345void neumannAtPos(PrimaryVariables &values,
const GlobalPosition& globalPos)
const
349 if (isInlet(globalPos))
351 values[nPhaseIdx] = -inFlux_;
354 if (globalPos[0] > this->
bBoxMax()[0] - eps_)
356 values[nPhaseIdx] = 3e-3;
363 const GlobalPosition& globalPos)
const
379bool isInlet(
const GlobalPosition& globalPos)
const
381 if (!isTop(globalPos))
384 for (
int i = 0; i < dim; i++)
386 if (globalPos[i] < inletLeftCoord_[i] - eps_)
388 if (globalPos[i] > inletRightCoord_[i] + eps_)
394bool isTop(
const GlobalPosition& globalPos)
const
398 if (globalPos[1] > this->
bBoxMax()[1] - eps_)
403 if (globalPos[2] > this->
bBoxMax()[2] - eps_)
409bool isBottom(
const GlobalPosition& globalPos)
const
413 if (globalPos[1] < eps_)
418 if (globalPos[2] < eps_)
425GlobalPosition inletLeftCoord_;
426GlobalPosition inletRightCoord_;
427static constexpr Scalar eps_ = 1e-6;
429BuckleyLeverettAnalytic<TypeTag> analyticSolution_;
432McWhorterAnalytic<TypeTag> analyticSolution_;
#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 simple implementation of Trichloroethene (TCE), a DNAPL.
A liquid phase consisting of a single component.
A fluid system for two-phase models assuming immiscibility and thermodynamic equilibrium.
Properties for the adaptive MPFA-L method.
Class defining a standard, saturation dependent indicator for grid adaption.
Cfl-flux-function to evaluate a Cfl-Condition after Coats 2003.
Analytical solution of the buckley-leverett problem.
Analytic solution of the McWhorter problem.
#define PROBLEM
Definition: test_3d2p.cc:22
Test problem for the sequential 2p models.
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 EvalCflFluxFunction
Type of the evaluation of the CFL-condition.
Definition: transportproperties.hh:50
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
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
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: dumux/porousmediumflow/2p/sequential/impes/problem.hh:167
static const int pnsw
pn and sw as primary variables
Definition: porousmediumflow/2p/sequential/indices.hh:36
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
void init()
Called by the TimeManager in order to initialize the problem.
Definition: impetproblem.hh:324
void addOutputVtkFields()
Definition: impetproblem.hh:785
void setOutputInterval(const int interval)
Sets the interval for Output.
Definition: impetproblem.hh:492
VtkMultiWriter & resultWriter()
Returns the applied VTK-writer for the output.
Definition: impetproblem.hh:818
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
Definition: test_mpfa2pproblem.hh:131
void dirichletAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const
set dirichlet condition (pressure [Pa], saturation [-])
Definition: test_mpfa2pproblem.hh:315
Scalar referencePressureAtPos(const GlobalPosition &globalPos) const
Returns the reference pressure for evaluation of constitutive relations.
Definition: test_mpfa2pproblem.hh:254
std::string name() const
The problem name.
Definition: test_mpfa2pproblem.hh:230
void initialAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const
return initial solution -> only saturation values have to be given!
Definition: test_mpfa2pproblem.hh:362
void source(PrimaryVariables &values, const Element &element) const
Definition: test_mpfa2pproblem.hh:259
void init()
Definition: test_mpfa2pproblem.hh:198
void addOutputVtkFields()
Definition: test_mpfa2pproblem.hh:211
bool shouldWriteRestartFile() const
Definition: test_mpfa2pproblem.hh:235
void boundaryTypesAtPos(BoundaryTypes &bcTypes, const GlobalPosition &globalPos) const
Returns the type of boundary condition.
Definition: test_mpfa2pproblem.hh:271
MPFATwoPTestProblem(TimeManager &timeManager, Grid &grid)
Definition: test_mpfa2pproblem.hh:170
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature within the domain.
Definition: test_mpfa2pproblem.hh:246
void neumannAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const
set neumann condition for phases (flux, [kg/(m^2 s)])
Definition: test_mpfa2pproblem.hh:345
typename GET_PROP_TYPE(TypeTag, Scalar) Scalar
Definition: test_mpfa2pproblem.hh:81
Test problem for the sequential 2p models.
Definition: test_mpfa2pspatialparams.hh:63
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 finite volume pressure models in a two-phase sequential model.
Properties for the MPFA-L method.
Properties for the MPFA-O method.