version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_FLUX_SHALLOW_WATER_FLUX_HH
13#define DUMUX_FLUX_SHALLOW_WATER_FLUX_HH
14
17
18namespace Dumux {
19
35template<class NumEqVector>
37{
38
39public:
40
43
49 template<class Problem, class FVElementGeometry, class ElementVolumeVariables>
50 static NumEqVector flux(const Problem& problem,
51 const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
52 const FVElementGeometry& fvGeometry,
53 const ElementVolumeVariables& elemVolVars,
54 const typename FVElementGeometry::SubControlVolumeFace& scvf)
55 {
56
57 //Get the inside and outside volume variables
58 const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
59 const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
60 const auto& nxy = scvf.unitOuterNormal();
61 const auto gravity = problem.spatialParams().gravity(scvf.center());
62
63 auto riemannFlux = ShallowWater::riemannProblem(insideVolVars.waterDepth(),
64 outsideVolVars.waterDepth(),
65 insideVolVars.velocity(0),
66 outsideVolVars.velocity(0),
67 insideVolVars.velocity(1),
68 outsideVolVars.velocity(1),
69 insideVolVars.bedSurface(),
70 outsideVolVars.bedSurface(),
71 gravity,
72 nxy);
73
74 NumEqVector localFlux(0.0);
75 localFlux[0] = riemannFlux[0] * scvf.area();
76 localFlux[1] = riemannFlux[1] * scvf.area();
77 localFlux[2] = riemannFlux[2] * scvf.area();
78
79 return localFlux;
80 }
81};
82
83} // end namespace Dumux
84
85#endif
Prepare and compute the shallow water advective flux.
Definition: shallowwaterflux.hh:37
Classes related to flux variables caching.
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:34
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:50
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:59
Definition: adapt.hh:17
This file includes a function to construct the Riemann problem.
Empty caches to use in a constitutive flux law/process, e.g. Darcy's law.
Definition: fluxvariablescaching.hh:54
The empty filler class corresponding to EmptyCache.
Definition: fluxvariablescaching.hh:20