3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
shallowwaterflux.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_FLUX_SHALLOW_WATER_FLUX_HH
25#define DUMUX_FLUX_SHALLOW_WATER_FLUX_HH
26
29
30namespace Dumux {
31
36template<class NumEqVector>
38{
39
40public:
41
44
54 template<class Problem, class FVElementGeometry, class ElementVolumeVariables>
55 static NumEqVector flux(const Problem& problem,
56 const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
57 const FVElementGeometry& fvGeometry,
58 const ElementVolumeVariables& elemVolVars,
59 const typename FVElementGeometry::SubControlVolumeFace& scvf)
60 {
61
62 //Get the inside and outside volume variables
63 const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
64 const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
65 const auto& nxy = scvf.unitOuterNormal();
66 const auto gravity = problem.spatialParams().gravity(scvf.center());
67
68 auto riemannFlux = ShallowWater::riemannProblem(insideVolVars.waterDepth(),
69 outsideVolVars.waterDepth(),
70 insideVolVars.velocity(0),
71 outsideVolVars.velocity(0),
72 insideVolVars.velocity(1),
73 outsideVolVars.velocity(1),
74 insideVolVars.bedSurface(),
75 outsideVolVars.bedSurface(),
76 gravity,
77 nxy);
78
79 NumEqVector localFlux(0.0);
80 localFlux[0] = riemannFlux[0] * scvf.area();
81 localFlux[1] = riemannFlux[1] * scvf.area();
82 localFlux[2] = riemannFlux[2] * scvf.area();
83
84 return localFlux;
85 }
86};
87
88} // end namespace Dumux
89
90#endif
This file includes a function to construct the Riemann problem.
Classes related to flux variables caching.
static NumEqVector flux(const Problem &problem, const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf)
Prepares the riemann problem for the advective flux for the shallow water model. The actual model use...
Definition: shallowwaterflux.hh:55
std::array< Scalar, 3 > riemannProblem(const Scalar waterDepthLeft, const Scalar waterDepthRight, Scalar velocityXLeft, Scalar velocityXRight, Scalar velocityYLeft, Scalar velocityYRight, const Scalar bedSurfaceLeft, const Scalar bedSurfaceRight, const Scalar gravity, const GlobalPosition &nxy)
Construct Riemann Problem and solve it.
Definition: riemannproblem.hh:66
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
The empty filler class corresponding to EmptyCache.
Definition: fluxvariablescaching.hh:32
Empty caches to use in a constitutive flux law/process, e.g. Darcy's law.
Definition: fluxvariablescaching.hh:63
Computes the shallow water flux by solving a riemann problem.
Definition: shallowwaterflux.hh:38