3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/shallowwater/volumevariables.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 2 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_FREEFLOW_SHALLOW_WATER_VOLUME_VARIABLES_HH
25#define DUMUX_FREEFLOW_SHALLOW_WATER_VOLUME_VARIABLES_HH
26
27namespace Dumux {
28
33template <class Traits>
35{
36 using Indices = typename Traits::ModelTraits::Indices;
37 using Scalar = typename Traits::PrimaryVariables::value_type;
38
39public:
40 using PrimaryVariables = typename Traits::PrimaryVariables;
41
42 template<class ElemSol, class Problem, class Element, class Scv>
43 void update(const ElemSol &elemSol,
44 const Problem &problem,
45 const Element &element,
46 const Scv &scv)
47 {
48
49 priVars_ = elemSol[scv.localDofIndex()];
50 bedSurface_ = problem.spatialParams().bedSurface(element,scv);
51 }
52
57 Scalar extrusionFactor() const
58 { return 1.0; }
59
64 Scalar waterDepth() const
65 {
66 return priVars_[Indices::waterdepthIdx];
67 }
68
74 Scalar velocity(int directionIndex) const
75 {
76
77 return priVars_[Indices::velocityOffset + directionIndex];
78 }
79
84 Scalar bedSurface() const
85 {
86 return bedSurface_;
87 }
88
89private:
90 PrimaryVariables priVars_;
91 Scalar bedSurface_;
92};
93
94} // end namespace Dumux
95
96#endif
static unsigned int directionIndex(Vector &&vector)
Returns the dirction index of the facet (0 = x, 1 = y, 2 = z)
Definition: staggeredgeometryhelper.hh:114
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
Volume variables for the shallow water equations model.
Definition: freeflow/shallowwater/volumevariables.hh:35
Scalar extrusionFactor() const
Return the extrusion factor (dummy variable).
Definition: freeflow/shallowwater/volumevariables.hh:57
Scalar waterDepth() const
Return water detph h inside the sub-control volume.
Definition: freeflow/shallowwater/volumevariables.hh:64
typename Traits::PrimaryVariables PrimaryVariables
Definition: freeflow/shallowwater/volumevariables.hh:40
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Definition: freeflow/shallowwater/volumevariables.hh:43
Scalar velocity(int directionIndex) const
Return water velocity component inside the sub-control volume.
Definition: freeflow/shallowwater/volumevariables.hh:74
Scalar bedSurface() const
Return the bed surface inside the sub-control volume.
Definition: freeflow/shallowwater/volumevariables.hh:84