3.4
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
59 template<class Problem, class FVElementGeometry, class ElementVolumeVariables>
60 static NumEqVector flux(const Problem& problem,
61 const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
62 const FVElementGeometry& fvGeometry,
63 const ElementVolumeVariables& elemVolVars,
64 const typename FVElementGeometry::SubControlVolumeFace& scvf)
65 {
66
67 //Get the inside and outside volume variables
68 const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
69 const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
70 const auto& nxy = scvf.unitOuterNormal();
71 const auto gravity = problem.spatialParams().gravity(scvf.center());
72
73 auto riemannFlux = ShallowWater::riemannProblem(insideVolVars.waterDepth(),
74 outsideVolVars.waterDepth(),
75 insideVolVars.velocity(0),
76 outsideVolVars.velocity(0),
77 insideVolVars.velocity(1),
78 outsideVolVars.velocity(1),
79 insideVolVars.bedSurface(),
80 outsideVolVars.bedSurface(),
81 gravity,
82 nxy);
83
84 NumEqVector localFlux(0.0);
85 localFlux[0] = riemannFlux[0] * scvf.area();
86 localFlux[1] = riemannFlux[1] * scvf.area();
87 localFlux[2] = riemannFlux[2] * scvf.area();
88
89 return localFlux;
90 }
91};
92
93} // end namespace Dumux
94
95#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 2D shallow water model....
Definition: shallowwaterflux.hh:60
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 a Riemann problem and solve it.
Definition: riemannproblem.hh:71
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition: numeqvector.hh:46
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:66
Computes the shallow water flux by solving a riemann problem.
Definition: shallowwaterflux.hh:38