3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
dumux/porousmediumflow/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 *****************************************************************************/
24#ifndef DUMUX_POROUS_MEDIUM_FLOW_PROBLEM_HH
25#define DUMUX_POROUS_MEDIUM_FLOW_PROBLEM_HH
26
28
29namespace Dumux {
30
37template<class TypeTag>
38class PorousMediumFlowProblem : public FVProblem<TypeTag>
39{
43
44 enum {
45 dim = GridView::dimension,
46 dimWorld = GridView::dimensionworld
47 };
48
50 using Element = typename GridView::template Codim<0>::Entity;
51
52 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
53 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
54
55
56public:
59
67 PorousMediumFlowProblem(std::shared_ptr<const GridGeometry> gridGeometry,
68 std::shared_ptr<SpatialParams> spatialParams,
69 const std::string& paramGroup = "")
71 , gravity_(0.0)
73 {
74 const bool enableGravity = getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity");
75 if (enableGravity)
76 gravity_[dimWorld-1] = -9.81;
77 }
78
85 PorousMediumFlowProblem(std::shared_ptr<const GridGeometry> gridGeometry,
86 const std::string& paramGroup = "")
88 std::make_shared<SpatialParams>(gridGeometry),
90 {}
91
95 // \{
96
105 Scalar temperatureAtPos(const GlobalPosition &globalPos) const
106 { return this->asImp_().temperature(); }
107
115 Scalar temperature() const
116 {
117 DUNE_THROW(Dune::NotImplemented, "temperature() method not implemented by the user problem");
118 }
119
126 [[deprecated("Use the gravity function of the spatialParams (i.e. problem.spatialParams().gravity(pos)). Will be removed after 3.1!")]]
127 const GravityVector &gravityAtPos(const GlobalPosition &pos) const
128 { return this->asImp_().gravity(); }
129
139 [[deprecated("Use the gravity function of the spatialParams (i.e. problem.spatialParams().gravity(pos)). Will be removed after 3.1!")]]
140 const GravityVector &gravity() const
141 { return gravity_; }
142
147 { return *spatialParams_; }
148
153 { return *spatialParams_; }
154
155 // \}
156
157protected:
159 GravityVector gravity_;
160
161 // material properties of the porous medium
162 std::shared_ptr<SpatialParams> spatialParams_;
163};
164
165} // end namespace Dumux
166
167#endif
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 std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:592
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
Implementation & asImp_()
Returns the implementation of the problem (i.e. static polymorphism)
Definition: common/fvproblem.hh:597
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature at a given global position.
Definition: dumux/porousmediumflow/problem.hh:105
GravityVector gravity_
The gravity acceleration vector.
Definition: dumux/porousmediumflow/problem.hh:159
Scalar temperature() const
Returns the temperature for an isothermal problem.
Definition: dumux/porousmediumflow/problem.hh:115
std::shared_ptr< SpatialParams > spatialParams_
Definition: dumux/porousmediumflow/problem.hh:162
const GravityVector & gravity() const
Returns the acceleration due to gravity .
Definition: dumux/porousmediumflow/problem.hh:140
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition: dumux/porousmediumflow/problem.hh:146
PorousMediumFlowProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string &paramGroup="")
Constructor, constructing the spatial parameters.
Definition: dumux/porousmediumflow/problem.hh:85
const GravityVector & gravityAtPos(const GlobalPosition &pos) const
Returns the acceleration due to gravity .
Definition: dumux/porousmediumflow/problem.hh:127
GetPropType< TypeTag, Properties::SpatialParams > SpatialParams
Export spatial parameter type.
Definition: dumux/porousmediumflow/problem.hh:58
PorousMediumFlowProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< SpatialParams > spatialParams, const std::string &paramGroup="")
Constructor, passing the spatial parameters.
Definition: dumux/porousmediumflow/problem.hh:67
const SpatialParams & spatialParams() const
Returns the spatial parameters object.
Definition: dumux/porousmediumflow/problem.hh:152
Base class for all finite volume problems.