3.3.0
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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
124 { return *spatialParams_; }
125
130 { return *spatialParams_; }
131
132 // \}
133
134protected:
136 GravityVector gravity_;
137
138 // material properties of the porous medium
139 std::shared_ptr<SpatialParams> spatialParams_;
140};
141
142} // end namespace Dumux
143
144#endif
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:54
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:578
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:574
Implementation & asImp_()
Returns the implementation of the problem (i.e. static polymorphism)
Definition: common/fvproblem.hh:583
Base class for all fully implicit porous media problems.
Definition: porousmediumflow/problem.hh:39
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature at a given global position.
Definition: porousmediumflow/problem.hh:105
GravityVector gravity_
The gravity acceleration vector.
Definition: porousmediumflow/problem.hh:136
Scalar temperature() const
Returns the temperature for an isothermal problem.
Definition: porousmediumflow/problem.hh:115
std::shared_ptr< SpatialParams > spatialParams_
Definition: porousmediumflow/problem.hh:139
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition: porousmediumflow/problem.hh:123
PorousMediumFlowProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string &paramGroup="")
Constructor, constructing the spatial parameters.
Definition: porousmediumflow/problem.hh:85
GetPropType< TypeTag, Properties::SpatialParams > SpatialParams
Export spatial parameter type.
Definition: 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: porousmediumflow/problem.hh:67
const SpatialParams & spatialParams() const
Returns the spatial parameters object.
Definition: porousmediumflow/problem.hh:129
Base class for all finite volume problems.