3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
test/porousmediumflow/1p/implicit/isothermal/problem.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 *****************************************************************************/
26#ifndef DUMUX_1PTEST_PROBLEM_HH
27#define DUMUX_1PTEST_PROBLEM_HH
28
29#include <dune/grid/yaspgrid.hh>
30
38
39#include "spatialparams.hh"
40
41#if FORCHHEIMER
43#endif
44
45namespace Dumux {
46
47template <class TypeTag>
48class OnePTestProblem;
49
50namespace Properties {
51
52// Create new type tags
53namespace TTag {
54struct OnePTest { using InheritsFrom = std::tuple<OneP>; };
55struct OnePTestBox { using InheritsFrom = std::tuple<BoxModel, OnePTest>; };
56struct OnePTestCCTpfa { using InheritsFrom = std::tuple<CCTpfaModel, OnePTest>; };
57struct OnePTestCCMpfa { using InheritsFrom = std::tuple<CCMpfaModel, OnePTest>; };
58} // end namespace TTag
59
60// Specialize the fluid system type for this type tag
61template<class TypeTag>
62struct FluidSystem<TypeTag, TTag::OnePTest>
63{
66};
67
68// Specialize the grid type for this type tag
69template<class TypeTag>
70struct Grid<TypeTag, TTag::OnePTest>
71{ using type = Dune::YaspGrid<2>; };
72
73// Specialize the problem type for this type tag
74template<class TypeTag>
75struct Problem<TypeTag, TTag::OnePTest>
77
78// Specialize the spatial params type for this type tag
79template<class TypeTag>
80struct SpatialParams<TypeTag, TTag::OnePTest>
81{
85};
86
87#ifdef FORCHHEIMER
88// Specialize the advection type for this type tag
89template<class TypeTag>
90struct AdvectionType<TypeTag, TTag::OnePTest>
92#endif
93
94} // end namespace Properties
95
117template <class TypeTag>
118class OnePTestProblem : public PorousMediumFlowProblem<TypeTag>
119{
120 using ParentType = PorousMediumFlowProblem<TypeTag>;
121 using GridView = GetPropType<TypeTag, Properties::GridView>;
122 using Element = typename GridView::template Codim<0>::Entity;
123 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
124
125 // copy some indices for convenience
127
128 enum {
129 // index of the primary variable
130 pressureIdx = Indices::pressureIdx
131 };
132
133 using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
134 using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>;
135 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
136
137 static constexpr int dimWorld = GridView::dimensionworld;
138
139 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
140
141public:
142 OnePTestProblem(std::shared_ptr<const GridGeometry> gridGeometry)
144 {
145 name_ = getParam<std::string>("Problem.Name");
146 }
147
151 // \{
152
158 std::string name() const
159 {
160 return name_;
161 }
162
168 Scalar temperature() const
169 { return 273.15 + 10; } // 10C
170
171 // \}
175 // \{
176
183 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
184 {
185 BoundaryTypes values;
186
187 if (globalPos[dimWorld-1] < eps_ || globalPos[dimWorld-1] > this->gridGeometry().bBoxMax()[dimWorld-1] - eps_)
188 values.setAllDirichlet();
189 else
190 values.setAllNeumann();
191
192 return values;
193 }
194
202 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
203 {
204 PrimaryVariables values(0);
205 values[pressureIdx] = 1.0e+5*(2.0 - globalPos[dimWorld-1]);
206 return values;
207 }
208
209 // \}
210
214 // \{
215
222 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
223 {
224 PrimaryVariables priVars(0.0);
225 priVars[pressureIdx] = 1.0e+5;
226 return priVars;
227 }
228
229 // \}
230
231private:
232 std::string name_;
233 static constexpr Scalar eps_ = 1.0e-6;
234};
235
236} // end namespace Dumux
237
238#endif
Defines a type tag and some properties for models using the box scheme.
Properties for all models using cell-centered finite volume scheme with mpfa.
Properties for all models using cell-centered finite volume scheme with TPFA.
Forchheimer's law specialized for different discretization schemes This file contains the data which ...
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
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
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
The type for the calculation the advective fluxes.
Definition: common/properties.hh:208
UndefinedProperty type
Definition: common/properties.hh:208
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
forward declare
Definition: forchheimerslaw.hh:38
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
Definition: test_propertysystem.cc:60
std::tuple< OnePModel, BoxDisc > InheritsFrom
Definition: test_propertysystem.cc:60
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:202
OnePTestProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:142
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:222
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary cont...
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:183
Scalar temperature() const
Returns the temperature within the domain in [K].
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:168
std::string name() const
The problem name.
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:158
The spatial parameters class for the test problem using the incompressible 1p model.
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:62
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:55
std::tuple< BoxModel, OnePTest > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:55
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:56
std::tuple< CCTpfaModel, OnePTest > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:56
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:57
std::tuple< CCMpfaModel, OnePTest > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:57
GetPropType< TypeTag, Scalar > Scalar
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:64
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:71
GetPropType< TypeTag, Scalar > Scalar
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:83
GetPropType< TypeTag, GridGeometry > GridGeometry
Definition: test/porousmediumflow/1p/implicit/isothermal/problem.hh:82
A single-phase, isothermal flow model using the fully implicit scheme.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.