3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
test/porousmediumflow/1p/implicit/compressible/instationary/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 *****************************************************************************/
25#ifndef DUMUX_COMPRESSIBLE_ONEP_TEST_PROBLEM_HH
26#define DUMUX_COMPRESSIBLE_ONEP_TEST_PROBLEM_HH
27
28#include <dune/grid/yaspgrid.hh>
29
33
37
40
41#include "spatialparams.hh"
42
43namespace Dumux {
44// forward declarations
45template<class TypeTag> class OnePTestProblem;
46
47namespace Properties {
48// create the type tag nodes
49// Create new type tags
50namespace TTag {
51struct OnePCompressible { using InheritsFrom = std::tuple<OneP>; };
52struct OnePCompressibleTpfa { using InheritsFrom = std::tuple<OnePCompressible, CCTpfaModel>; };
53struct OnePCompressibleMpfa { using InheritsFrom = std::tuple<OnePCompressible, CCMpfaModel>; };
54struct OnePCompressibleBox { using InheritsFrom = std::tuple<OnePCompressible, BoxModel>; };
55} // end namespace TTag
56
57// Set the grid type
58template<class TypeTag>
59struct Grid<TypeTag, TTag::OnePCompressible> { using type = Dune::YaspGrid<2>; };
60
61// Set the problem type
62template<class TypeTag>
63struct Problem<TypeTag, TTag::OnePCompressible> { using type = OnePTestProblem<TypeTag>; };
64
65// set the spatial params
66template<class TypeTag>
67struct SpatialParams<TypeTag, TTag::OnePCompressible>
68{
72};
73
74// the fluid system
75template<class TypeTag>
76struct FluidSystem<TypeTag, TTag::OnePCompressible>
77{
78private:
80public:
82};
83
84// Disable caching (for testing purposes)
85template<class TypeTag>
86struct EnableGridVolumeVariablesCache<TypeTag, TTag::OnePCompressible> { static constexpr bool value = false; };
87template<class TypeTag>
88struct EnableGridFluxVariablesCache<TypeTag, TTag::OnePCompressible> { static constexpr bool value = false; };
89template<class TypeTag>
90struct EnableGridGeometryCache<TypeTag, TTag::OnePCompressible> { static constexpr bool value = false; };
91} // end namespace Properties
92
100template<class TypeTag>
101class OnePTestProblem : public PorousMediumFlowProblem<TypeTag>
102{
103 using ParentType = PorousMediumFlowProblem<TypeTag>;
105 using Element = typename GridView::template Codim<0>::Entity;
110 static constexpr int dimWorld = GridView::dimensionworld;
111 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
112
113public:
114 OnePTestProblem(std::shared_ptr<const GridGeometry> gridGeometry)
116 {
118 1.0e4, 1.0e6, 200);
119 }
120
127 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
128 {
129 BoundaryTypes values;
130
131 Scalar eps = 1.0e-6;
132 if (globalPos[dimWorld-1] < eps || globalPos[dimWorld-1] > this->gridGeometry().bBoxMax()[dimWorld-1] - eps)
133 values.setAllDirichlet();
134 else
135 values.setAllNeumann();
136
137 return values;
138 }
139
147 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
148 {
149 PrimaryVariables values(0);
150 values[0] = 1.0e+5*(2.0 - globalPos[dimWorld-1]);
151 return values;
152 }
153
159 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
160 {
161 return PrimaryVariables(1.0e5);
162 }
163
171 Scalar temperature() const
172 {
173 return 283.15; // 10°C
174 }
175};
176
177} // end namespace Dumux
178
179#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.
Material properties of pure water .
Tabulates all thermodynamic properties of a given untabulated chemical species.
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: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
Tabulates all thermodynamic properties of a given untabulated chemical species.
Definition: tabulatedcomponent.hh:82
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:147
OnePTestProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:114
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial conditions.
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:159
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/compressible/instationary/problem.hh:127
Scalar temperature() const
Returns the temperature for an isothermal problem.
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:171
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/compressible/instationary/problem.hh:51
std::tuple< OneP > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:51
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:52
std::tuple< OnePCompressible, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:52
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:53
std::tuple< OnePCompressible, CCMpfaModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:53
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:54
std::tuple< OnePCompressible, BoxModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:54
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:59
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:69
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh:70
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.