3.4
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
62 { return priVars_; }
63
68 Scalar waterDepth() const
69 {
70 return priVars_[Indices::waterdepthIdx];
71 }
72
78 Scalar velocity(int directionIndex) const
79 {
80
81 return priVars_[Indices::velocityOffset + directionIndex];
82 }
83
88 Scalar bedSurface() const
89 {
90 return bedSurface_;
91 }
92
93private:
94 PrimaryVariables priVars_;
95 Scalar bedSurface_;
96};
97
98} // end namespace Dumux
99
100#endif
static unsigned int directionIndex(Vector &&vector)
Returns the dirction index of the facet (0 = x, 1 = y, 2 = z)
Definition: staggeredgeometryhelper.hh:133
Definition: adapt.hh:29
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:68
const PrimaryVariables & priVars() const
Return the vector of primary variables.
Definition: freeflow/shallowwater/volumevariables.hh:61
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:78
Scalar bedSurface() const
Return the bed surface inside the sub-control volume.
Definition: freeflow/shallowwater/volumevariables.hh:88