3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/tracer/1ptracer/problem_1p.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 *****************************************************************************/
25#ifndef DUMUX_ONEP_TRACER_TEST_PROBLEM_HH
26#define DUMUX_ONEP_TRACER_TEST_PROBLEM_HH
27
28#include <dune/grid/yaspgrid.hh>
29
36
37#include "spatialparams_1p.hh"
38
39namespace Dumux {
40
45// forward declarations
46template<class TypeTag>
47class OnePTestProblem;
48
49namespace Properties {
50// Create new type tags
51namespace TTag {
52struct IncompressibleTest { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; };
53} // end namespace TTag
54
55// Set the grid type
56template<class TypeTag>
57struct Grid<TypeTag, TTag::IncompressibleTest> { using type = Dune::YaspGrid<2>; };
58
59// Set the problem type
60template<class TypeTag>
61struct Problem<TypeTag, TTag::IncompressibleTest> { using type = OnePTestProblem<TypeTag>; };
62
63template<class TypeTag>
64struct SpatialParams<TypeTag, TTag::IncompressibleTest>
65{
69};
70
71template<class TypeTag>
72struct LocalResidual<TypeTag, TTag::IncompressibleTest> { using type = OnePIncompressibleLocalResidual<TypeTag>; };
73
74// the fluid system
75template<class TypeTag>
76struct FluidSystem<TypeTag, TTag::IncompressibleTest>
77{
80};
81
82// Enable caching
83template<class TypeTag>
84struct EnableGridVolumeVariablesCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; };
85template<class TypeTag>
86struct EnableGridFluxVariablesCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; };
87template<class TypeTag>
88struct EnableGridGeometryCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; };
89} // end namespace Properties
90
91template<class TypeTag>
92class OnePTestProblem : public PorousMediumFlowProblem<TypeTag>
93{
94 using ParentType = PorousMediumFlowProblem<TypeTag>;
96 using Element = typename GridView::template Codim<0>::Entity;
99 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
100 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
103
104 static constexpr int dimWorld = GridView::dimensionworld;
105
106public:
107 OnePTestProblem(std::shared_ptr<const GridGeometry> gridGeometry)
109
117 BoundaryTypes boundaryTypes(const Element &element,
118 const SubControlVolumeFace &scvf) const
119 {
120 BoundaryTypes values;
121 const auto globalPos = scvf.ipGlobal();
122
123 Scalar eps = 1.0e-6;
124 if (globalPos[dimWorld-1] < eps || globalPos[dimWorld-1] > this->gridGeometry().bBoxMax()[dimWorld-1] - eps)
125 values.setAllDirichlet();
126 else
127 values.setAllNeumann();
128
129 return values;
130 }
131
140 PrimaryVariables dirichlet(const Element &element,
141 const SubControlVolumeFace &scvf) const
142 {
143 const auto& pos = scvf.ipGlobal();
144 PrimaryVariables values(0);
145 values[0] = 1.0e+5*(1.1 - pos[dimWorld-1]*0.1);
146 return values;
147 }
148
156 Scalar temperature() const
157 {
158 return 283.15; // 10°C
159 }
160
161};
162
163} // end namespace Dumux
164
165#endif
Properties for all models using cell-centered finite volume scheme with TPFA.
A much simpler (and thus potentially less buggy) version of pure water.
A liquid phase consisting of a single component.
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
constexpr double eps
epsilon for checking direction of scvf normals
Definition: test_tpfafvgeometry_nonconforming.cc:44
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:50
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
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
Definition: common/properties.hh:91
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 spatial parameters object.
Definition: common/properties.hh:221
The type of the fluid system to use.
Definition: common/properties.hh:223
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
Element-wise calculation of the residual and its derivatives for a single-phase, incompressible,...
Definition: 1p/incompressiblelocalresidual.hh:41
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary cont...
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:117
OnePTestProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:107
Scalar temperature() const
Returns the temperature for an isothermal problem.
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:156
PrimaryVariables dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:140
The spatial parameters class for the test problem using the incompressible 1p model.
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:62
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:52
std::tuple< OneP, CCTpfaModel > InheritsFrom
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:52
Dune::YaspGrid< 2 > type
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:57
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:66
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:67
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: porousmediumflow/tracer/1ptracer/problem_1p.hh:78
A single-phase, isothermal flow model using the fully implicit scheme.
Base class for all porous media problems.
Element-wise calculation of the residual and its derivatives for a single-phase, incompressible,...
The spatial parameters for the incompressible test.