3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
test_dec2p2cproblem.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_TEST_2P2C_PROBLEM_HH
25#define DUMUX_TEST_2P2C_PROBLEM_HH
26
27#include <dune/grid/yaspgrid.hh>
28
32
33// fluid properties
35
37
38namespace Dumux
39{
44template<class TypeTag>
45class TestDecTwoPTwoCProblem;
46
47// Specify the properties
48namespace Properties
49{
50NEW_TYPE_TAG(TestDecTwoPTwoC, INHERITS_FROM(SequentialTwoPTwoC, Test2P2CSpatialParams));
51
52// Set the grid type
53SET_TYPE_PROP(TestDecTwoPTwoC, Grid, Dune::YaspGrid<3>);
54
55// Set the problem property
57
58// Set the model properties
60
62
63
64SET_INT_PROP(TestDecTwoPTwoC, PressureFormulation, GET_PROP_TYPE(TypeTag, Indices)::pressureN);
65
66// Select fluid system
67template<class TypeTag>
68struct FluidSystem<TypeTag, TTag::TestDecTwoPTwoC>
69{
70 using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
72};
73
74SET_BOOL_PROP(TestDecTwoPTwoC, EnableCapillarity, true);
75SET_INT_PROP(TestDecTwoPTwoC, BoundaryMobility, GET_PROP_TYPE(TypeTag, Indices)::satDependent);
76}
77
90template<class TypeTag>
92{
94using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
95using Grid = typename GridView::Grid;
96using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
97using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
98
99using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
100
101using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
102using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
103
104enum
105{
106 dim = GridView::dimension, dimWorld = GridView::dimensionworld
107};
108
109using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
110
111using Element = typename GridView::Traits::template Codim<0>::Entity;
112using Intersection = typename GridView::Intersection;
113using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
114
115public:
117ParentType(timeManager, grid), depthBOR_(1000.0)
118{}
119
123// \{
124
126
128std::string name() const
129{
130 return "test_dec2p2c";
131}
133/* The default behaviour is to write no restart file.
134 */
136{
137 return false;
138}
139
141
144Scalar temperatureAtPos(const GlobalPosition& globalPos) const
145{
146 return 273.15 + 10; // -> 10°C
147}
148
149// \}
151 /*This pressure is used in order to calculate the material properties
152 * at the beginning of the initialization routine. It should lie within
153 * a reasonable pressure range for the current problem.
154 * \param globalPos The global Position
155 */
156Scalar referencePressureAtPos(const GlobalPosition& globalPos) const
157{
158 return 1e6;
159}
161
169void boundaryTypesAtPos(BoundaryTypes &bcTypes, const GlobalPosition& globalPos) const
170{
171 if (globalPos[0] > this->bBoxMax()[0] - eps_ || globalPos[0] < eps_)
172 bcTypes.setAllDirichlet();
173 else
174 // all other boundaries
175 bcTypes.setAllNeumann();
176}
177
179
186void boundaryFormulation(typename Indices::BoundaryFormulation &bcFormulation, const Intersection& intersection) const
187{
188 bcFormulation = Indices::concentration;
189}
191
199void dirichletAtPos(PrimaryVariables &bcValues ,const GlobalPosition& globalPos) const
200{
201 Scalar pRef = referencePressureAtPos(globalPos);
202 Scalar temp = temperatureAtPos(globalPos);
203
204 // Dirichlet for pressure equation
205 bcValues[Indices::pressureEqIdx] = (globalPos[0] < eps_) ? (2.5e5 - FluidSystem::H2O::liquidDensity(temp, pRef) * this->gravity()[dim-1])
206 : (2e5 - FluidSystem::H2O::liquidDensity(temp, pRef) * this->gravity()[dim-1]);
207
208 // Dirichlet values for transport equations
209 bcValues[Indices::contiWEqIdx] = 1.;
210 bcValues[Indices::contiNEqIdx] = 1.- bcValues[Indices::contiWEqIdx];
211
212}
213
215
224void neumannAtPos(PrimaryVariables &neumannValues, const GlobalPosition& globalPos) const
225{
226 this->setZero(neumannValues);
227}
229
239void sourceAtPos(PrimaryVariables &sourceValues, const GlobalPosition& globalPos) const
240{
241 this->setZero(sourceValues);
242 using std::abs;
243 if (abs(globalPos[0] - 4.8) < 0.5 + eps_ && abs(globalPos[1] - 4.8) < 0.5 + eps_)
244 sourceValues[Indices::contiNEqIdx] = 0.0001;
245}
247
251void initialFormulation(typename Indices::BoundaryFormulation &initialFormulation, const Element& element) const
252{
253 initialFormulation = Indices::concentration;
254}
256
258Scalar initConcentrationAtPos(const GlobalPosition& globalPos) const
259{
260 return 1;
261}
262private:
263GlobalPosition lowerLeft_;
264GlobalPosition upperRight_;
265
266static constexpr Scalar eps_ = 1e-6;
267const Scalar depthBOR_;
268};
269} //end namespace
270
271#endif
#define GET_PROP_TYPE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:283
#define NEW_TYPE_TAG(...)
Definition: propertysystemmacros.hh:130
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
Finite volume 2p2c pressure model.
Finite volume discretization of the component transport equation.
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
Property tag BoundaryMobility
Definition: porousmediumflow/2p2c/sequential/properties.hh:61
SET_INT_PROP(SequentialOneP, NumEq, 1)
Set number of equations to 1 for isothermal one-phase models.
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
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
Definition: h2oair.hh:75
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: fvpressure.hh:73
Compositional transport step in a Finite Volume discretization.
Definition: fvtransport.hh:60
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(TypeTag, PrimaryVariables) &values, const int equation=-1) const
Sets entries of the primary variable vector to zero.
Definition: dumux/porousmediumflow/2p2c/sequential/problem.hh:199
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
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
spatial parameters for the sequential 2p2c test
Definition: test_dec2p2c_spatialparams.hh:64
test problem for the sequential 2p2c model
Definition: test_dec2p2cproblem.hh:92
void boundaryFormulation(typename Indices::BoundaryFormulation &bcFormulation, const Intersection &intersection) const
Flag for the type of Dirichlet conditions.
Definition: test_dec2p2cproblem.hh:186
Scalar referencePressureAtPos(const GlobalPosition &globalPos) const
Returns the reference pressure.
Definition: test_dec2p2cproblem.hh:156
void neumannAtPos(PrimaryVariables &neumannValues, const GlobalPosition &globalPos) const
Value for neumann boundary condition .
Definition: test_dec2p2cproblem.hh:224
bool shouldWriteRestartFile() const
Returns true if a restart file should be written.
Definition: test_dec2p2cproblem.hh:135
Scalar initConcentrationAtPos(const GlobalPosition &globalPos) const
Concentration initial condition (dimensionless)
Definition: test_dec2p2cproblem.hh:258
TestDecTwoPTwoCProblem(TimeManager &timeManager, Grid &grid)
Definition: test_dec2p2cproblem.hh:116
std::string name() const
The problem name.
Definition: test_dec2p2cproblem.hh:128
void dirichletAtPos(PrimaryVariables &bcValues, const GlobalPosition &globalPos) const
Values for dirichlet boundary condition for pressure and or for transport.
Definition: test_dec2p2cproblem.hh:199
void initialFormulation(typename Indices::BoundaryFormulation &initialFormulation, const Element &element) const
Flag for the type of initial conditions.
Definition: test_dec2p2cproblem.hh:251
void sourceAtPos(PrimaryVariables &sourceValues, const GlobalPosition &globalPos) const
Source of mass .
Definition: test_dec2p2cproblem.hh:239
void boundaryTypesAtPos(BoundaryTypes &bcTypes, const GlobalPosition &globalPos) const
Type of boundary condition.
Definition: test_dec2p2cproblem.hh:169
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature within the domain.
Definition: test_dec2p2cproblem.hh:144
typename GET_PROP_TYPE(TypeTag, Scalar) Scalar
Definition: test_dec2p2cproblem.hh:70
Base class for sequential 2p2c compositional problems.