3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
test/porousmediumflow/1p/implicit/pointsources/timedependent/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_1P_SINGULARITY_TIME_DEP_PROBLEM_HH
27#define DUMUX_1P_SINGULARITY_TIME_DEP_PROBLEM_HH
28
29#include "../timeindependent/problem.hh"
30
31namespace Dumux {
32template <class TypeTag>
33class OnePSingularityProblemTimeDependent;
34
35namespace Properties {
36// Create new type tags
37namespace TTag {
38struct OnePSingularityTimeDependentCCTpfa { using InheritsFrom = std::tuple<OnePSingularityCCTpfa>; };
39} // end namespace TTag
40
41// Set the problem property
42template<class TypeTag>
43struct Problem<TypeTag, TTag::OnePSingularityTimeDependentCCTpfa> { using type = OnePSingularityProblemTimeDependent<TypeTag>; };
44
45// point source
46template<class TypeTag>
47struct PointSource<TypeTag, TTag::OnePSingularityTimeDependentCCTpfa> { using type = SolDependentPointSource<TypeTag>; };
48}
49
64template <class TypeTag>
66{
72
74 using Element = typename GridView::template Codim<0>::Entity;
75 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
76 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
77 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
79
80public:
81 OnePSingularityProblemTimeDependent(std::shared_ptr<const GridGeometry> gridGeometry)
83 {}
84
88 // \{
89
102 void addPointSources(std::vector<PointSource>& pointSources) const
103 {
104 // inject <time> kg/s water at position (0, 0), where <time> is the current simulation time
105 auto function = [](const Problem& problem,
106 const Element& element,
107 const FVElementGeometry& fvGeometry,
108 const ElementVolumeVariables& elemVolVars,
109 const SubControlVolume& scv)
110 { return PrimaryVariables(problem.getTime()); };
111
112 pointSources.push_back(PointSource({0.0, 0.0}, function));
113 }
114
116 void setTime(Scalar time)
117 { time_ = time; }
118
120 Scalar getTime() const
121 { return time_; }
122
123private:
124 Scalar time_ = 0.0;
125};
126
127} // end namespace Dumux
128
129#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 GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
A point source class for time dependent point sources.
Definition: pointsource.hh:213
Property to specify the type of a problem which has to be solved.
Definition: common/properties.hh:69
Property defining the type of point source used.
Definition: common/properties.hh:71
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/timedependent/problem.hh:66
void setTime(Scalar time)
Set the current time at which we evaluate the source.
Definition: test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh:116
void addPointSources(std::vector< PointSource > &pointSources) const
Applies a vector of point sources which are possibly solution dependent.
Definition: test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh:102
Scalar getTime() const
Set the current time at which we evaluate the source.
Definition: test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh:120
OnePSingularityProblemTimeDependent(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh:81
Definition: test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh:38
std::tuple< OnePSingularityCCTpfa > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh:38
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