3.6-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
47template<class NumEqVector>
49{
50
51public:
52
55
61 template<class Problem, class FVElementGeometry, class ElementVolumeVariables>
62 static NumEqVector flux(const Problem& problem,
63 const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
64 const FVElementGeometry& fvGeometry,
65 const ElementVolumeVariables& elemVolVars,
66 const typename FVElementGeometry::SubControlVolumeFace& scvf)
67 {
68
69 //Get the inside and outside volume variables
70 const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
71 const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
72 const auto& nxy = scvf.unitOuterNormal();
73 const auto gravity = problem.spatialParams().gravity(scvf.center());
74
75 auto riemannFlux = ShallowWater::riemannProblem(insideVolVars.waterDepth(),
76 outsideVolVars.waterDepth(),
77 insideVolVars.velocity(0),
78 outsideVolVars.velocity(0),
79 insideVolVars.velocity(1),
80 outsideVolVars.velocity(1),
81 insideVolVars.bedSurface(),
82 outsideVolVars.bedSurface(),
83 gravity,
84 nxy);
85
86 NumEqVector localFlux(0.0);
87 localFlux[0] = riemannFlux[0] * scvf.area();
88 localFlux[1] = riemannFlux[1] * scvf.area();
89 localFlux[2] = riemannFlux[2] * scvf.area();
90
91 return localFlux;
92 }
93};
94
95} // end namespace Dumux
96
97#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 and compute the shallow water advective flux.
Definition: shallowwaterflux.hh:62
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
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
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
Prepare and compute the shallow water advective flux.
Definition: shallowwaterflux.hh:49