24#ifndef DUMUX_TEST_ADAPTIVE2D_2P2C_PROBLEM_HH
25#define DUMUX_TEST_ADAPTIVE2D_2P2C_PROBLEM_HH
28#include <dune/grid/uggrid.hh>
30#include <dune/grid/yaspgrid.hh>
48template<
class TypeTag>
66template<
class TypeTag>
105template<
class TypeTag = TTAG(Adaptive2p2c2d)>
111using TimeManager =
typename GET_PROP_TYPE(TypeTag, TimeManager);
113using Indices =
typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
114using FluidSystem =
typename GET_PROP_TYPE(TypeTag, FluidSystem);
116using BoundaryTypes =
typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
117using PrimaryVariables =
typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
121 dim = GridView::dimension, dimWorld = GridView::dimensionworld
126 wPhaseIdx = Indices::wPhaseIdx, nPhaseIdx = Indices::nPhaseIdx
131using Element =
typename GridView::Traits::template Codim<0>::Entity;
132using Intersection =
typename GridView::Intersection;
133using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
138, debugWriter_(
grid.leafGridView(),
"gridAfterAdapt")
140 this->
setName(getParam<std::string>(
"Problem.SimulationName"));
177 if (globalPos[0] > this->
bBoxMax()[0] - eps_|| globalPos[0] < eps_)
178 bcTypes.setAllDirichlet();
181 bcTypes.setAllNeumann();
187void boundaryFormulation(
typename Indices::BoundaryFormulation &bcFormulation,
const Intersection& intersection)
const
189 bcFormulation = Indices::concentration;
195void dirichletAtPos(PrimaryVariables &bcValues,
const GlobalPosition& globalPos)
const
201 bcValues[Indices::pressureEqIdx] = (globalPos[0] < eps_) ? (2.5e5 - FluidSystem::H2O::liquidDensity(temp, pRef) * this->
gravity()[dim-1])
202 : (2e5 - FluidSystem::H2O::liquidDensity(temp, pRef) * this->
gravity()[dim-1]);
205 bcValues[Indices::contiWEqIdx] = 1.;
206 bcValues[Indices::contiNEqIdx] = 1.- bcValues[Indices::contiWEqIdx];
213void neumannAtPos(PrimaryVariables &neumannValues,
const GlobalPosition& globalPos)
const
221void source(PrimaryVariables &values,
const Element &element)
224 auto father = element;
226 while (father.level() != this->gridAdapt().getMinLevel())
228 father = father.father();
230 GlobalPosition globalPos = father.geometry().center();
233 if (abs(globalPos[0] - 4.8) < 0.5 + eps_ && abs(globalPos[1] - 4.8) < 0.5 + eps_)
234 values[Indices::contiNEqIdx] = 0.0001;
256static constexpr Scalar eps_ = 1e-6;
#define TTAG(TypeTagName)
Makes a type out of a type tag name.
Definition: propertysystemmacros.hh:58
#define GET_PROP_TYPE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:283
#define NEW_TYPE_TAG(...)
Definition: propertysystemmacros.hh:130
Define some often used mathematical functions.
Linear capillary pressure and relative permeability <-> saturation relations.
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
Class defining a standard, saturation dependent indicator for grid adaption.
Defines the properties required for the adaptive sequential 2p2c models.
spatial parameters for the sequential 2p2c test
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag EnableCapillarity
Returns whether capillarity is regarded.
Definition: porousmediumflow/2p2c/sequential/properties.hh:60
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.
Property tag TransportModel
The type of the discretization of a transport model.
Definition: porousmediumflow/sequential/properties.hh:66
Type tag FVPressureOneP INHERITS_FROM(PressureOneP))
The type tag for the one-phase problems using a standard finite volume model.
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
SET_BOOL_PROP(FVPressureOneP, VisitFacesOnlyOnce, true)
Allow assembling algorithm for the pressure matrix to assemble only from one side of a cell-cell inte...
Property tag PressureModel
The type of the discretization of a pressure model.
Definition: porousmediumflow/sequential/properties.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
Definition: common/properties.hh:312
Simplifies writing multi-file VTK datasets.
Definition: vtkmultiwriter.hh:61
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
Definition: h2oair.hh:75
Class defining a standard, saturation dependent indicator for grid adaption.
Definition: gridadaptionindicator.hh:41
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: dumux/porousmediumflow/2p/sequential/impes/problem.hh:167
The finite volume model for the solution of the compositional pressure equation.
Definition: fv2dpressureadaptive.hh:78
Compositional Transport step in a Finite Volume discretization for a adaptive 2D-grid.
Definition: fv2dtransportadaptive.hh:57
Base class for all compositional 2-phase problems which use an impet algorithm.
Definition: dumux/porousmediumflow/2p2c/sequential/problem.hh:43
void setZero(typename GET_PROP_TYPE(TTAG(Adaptive2p2c2d), PrimaryVariables) &values, const int equation=-1) const
Sets entries of the primary variable vector to zero.
Definition: dumux/porousmediumflow/2p2c/sequential/problem.hh:199
TimeManager & timeManager()
Returns TimeManager object used by the simulation.
Definition: impetproblem.hh:663
void setName(std::string newName)
Set the problem name.
Definition: impetproblem.hh:565
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 the adaptive sequential 2p2c model in 2D.
Definition: test_adaptive2p2c2dproblem.hh:107
Scalar initConcentrationAtPos(const GlobalPosition &globalPos) const
Concentration initial condition (dimensionless)
Definition: test_adaptive2p2c2dproblem.hh:248
Adaptive2p2c2d(TimeManager &timeManager, Grid &grid)
Definition: test_adaptive2p2c2dproblem.hh:136
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature within the domain.
Definition: test_adaptive2p2c2dproblem.hh:159
void initialFormulation(typename Indices::BoundaryFormulation &initialFormulation, const Element &element) const
Flag for the type of initial conditions.
Definition: test_adaptive2p2c2dproblem.hh:240
void neumannAtPos(PrimaryVariables &neumannValues, const GlobalPosition &globalPos) const
Value for neumann boundary condition .
Definition: test_adaptive2p2c2dproblem.hh:213
bool shouldWriteRestartFile() const
Returns true if a restart file should be written.
Definition: test_adaptive2p2c2dproblem.hh:150
void source(PrimaryVariables &values, const Element &element)
Evaluate the source term.
Definition: test_adaptive2p2c2dproblem.hh:221
void boundaryFormulation(typename Indices::BoundaryFormulation &bcFormulation, const Intersection &intersection) const
Flag for the type of Dirichlet conditions.
Definition: test_adaptive2p2c2dproblem.hh:187
void dirichletAtPos(PrimaryVariables &bcValues, const GlobalPosition &globalPos) const
Values for dirichlet boundary condition for pressure and or for transport.
Definition: test_adaptive2p2c2dproblem.hh:195
void boundaryTypesAtPos(BoundaryTypes &bcTypes, const GlobalPosition &globalPos) const
Type of boundary condition.
Definition: test_adaptive2p2c2dproblem.hh:175
Scalar referencePressureAtPos(const GlobalPosition &globalPos) const
Returns the reference pressure.
Definition: test_adaptive2p2c2dproblem.hh:168
typename GET_PROP_TYPE(TypeTag, Scalar) Scalar
Definition: test_adaptive2p2c2dproblem.hh:69
spatial parameters for the sequential 2p2c test
Definition: test_dec2p2c_spatialparams.hh:64
Base class for sequential 2p2c compositional problems.