3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
test/porousmediumflow/1p/implicit/pointsources/timeindependent/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_1P_SINGULARITY_PROBLEM_HH
26#define DUMUX_1P_SINGULARITY_PROBLEM_HH
27
28#if HAVE_UG
29#include <dune/grid/uggrid.hh>
30#endif
31#include <dune/grid/yaspgrid.hh>
32
39
40#include "../spatialparams.hh"
41
42#ifndef GRIDTYPE // default to yasp grid if not provided by CMake
43#define GRIDTYPE Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >
44#endif
45
46namespace Dumux {
47template <class TypeTag>
48class OnePSingularityProblem;
49
50namespace Properties {
51// Create new type tags
52namespace TTag {
53struct OnePSingularity { using InheritsFrom = std::tuple<OneP>; };
54struct OnePSingularityBox { using InheritsFrom = std::tuple<OnePSingularity, BoxModel>; };
55struct OnePSingularityCCTpfa { using InheritsFrom = std::tuple<OnePSingularity, CCTpfaModel>; };
56} // end namespace TTag
57
58// the fluid system
59template<class TypeTag>
60struct FluidSystem<TypeTag, TTag::OnePSingularity>
61{
64};
65
66// Set the grid type
67template<class TypeTag>
68struct Grid<TypeTag, TTag::OnePSingularity> { using type = GRIDTYPE; };
69
70// Set the problem property
71template<class TypeTag>
72struct Problem<TypeTag, TTag::OnePSingularity> { using type = OnePSingularityProblem<TypeTag> ; };
73
74// Set the spatial parameters
75template<class TypeTag>
76struct SpatialParams<TypeTag, TTag::OnePSingularity>
77{
81};
82}
83
97template <class TypeTag>
99{
103
104 // copy some indices for convenience
106 enum { dimWorld = GridView::dimensionworld };
107 enum {
108 // index of the primary variable
109 pressureIdx = Indices::pressureIdx
110 };
111
116 using Element = typename GridGeometry::GridView::template Codim<0>::Entity;
117 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
118
119public:
120 OnePSingularityProblem(std::shared_ptr<const GridGeometry> gridGeometry)
122 {
123 name_ = getParam<std::string>("Problem.Name");
124 }
125
129 // \{
130
136 const std::string& name() const
137 {
138 return name_;
139 }
140
146 Scalar temperature() const
147 { return 273.15 + 10; } // 10C
148
149 // \}
153 // \{
154
161 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
162 {
163 BoundaryTypes bcTypes;
164 bcTypes.setAllDirichlet();
165 return bcTypes;
166 }
167
175 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
176 {
177 return initialAtPos(globalPos);
178 }
179
180 // \}
181
185 // \{
186
199 void addPointSources(std::vector<PointSource>& pointSources) const
200 {
201 // inject 10 kg/s water at origin;
202 pointSources.push_back(PointSource(GlobalPosition(0.0), {10}));
203 }
204
211 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
212 {
213 PrimaryVariables priVars(0.0);
214 priVars[pressureIdx] = 1.0e5;
215 return priVars;
216 }
217
218 // \}
219
220private:
221 std::string name_;
222};
223
224} // end namespace Dumux
225
226#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 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
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 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
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
The spatial parameters class for the test problem using the 1p model with point sources.
Definition: porousmediumflow/1p/implicit/pointsources/spatialparams.hh:43
Test problem for the one-phase model: Water is injected in a single point in the middle of the domain...
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:99
void addPointSources(std::vector< PointSource > &pointSources) const
Applies a vector of point sources which are possibly solution dependent.
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:199
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:211
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/pointsources/timeindependent/problem.hh:161
const std::string & name() const
The problem name.
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:136
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:175
OnePSingularityProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:120
Scalar temperature() const
Returns the temperature within the domain in [K].
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:146
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:53
std::tuple< OneP > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:53
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:54
std::tuple< OnePSingularity, BoxModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:54
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:55
std::tuple< OnePSingularity, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:55
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:62
GRIDTYPE type
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:68
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:78
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:79
A single-phase, isothermal flow model using the fully implicit scheme.
Base class for all porous media problems.
#define GRIDTYPE
Definition: test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh:43