version 3.8
fluxlimiterlet.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//
13#ifndef DUMUX_FLUX_SHALLOW_WATER_FLUX_LIMITER_LET_HH
14#define DUMUX_FLUX_SHALLOW_WATER_FLUX_LIMITER_LET_HH
15
16#include <algorithm>
17#include <cmath>
18
19namespace Dumux {
20namespace ShallowWater {
21
39template<class Scalar>
40static Scalar fluxLimiterLET(const Scalar valueLeft,
41 const Scalar valueRight,
42 const Scalar upperH,
43 const Scalar lowerH)
44{
45 using std::pow;
46 using std::min;
47 using std::max;
48
49 const auto h = (valueLeft + valueRight)*0.5;
50
51 Scalar mobility = 1.0;
52 if (h < upperH)
53 {
54 const auto sw = max(min(h*(1.0/upperH) - lowerH, 1.0), 0.0);
55
56 // LET-model for mobility
57 // constexpr Scalar krw = 1.0;
58 // constexpr Scalar letL = 2.0;
59 // constexpr Scalar letT = 2.0;
60 // constexpr Scalar letE = 1.0;
61 // mobility = (krw * pow(sw, letL))/(pow(sw, letL) + letE * pow(1.0 - sw, letT));
62
63 mobility = (sw*sw)/(sw*sw + (1-sw)*(1-sw));
64 }
65
66 return mobility;
67}
68
69} // end namespace ShallowWater
70} // end namespace Dumux
71
72#endif
static Scalar fluxLimiterLET(const Scalar valueLeft, const Scalar valueRight, const Scalar upperH, const Scalar lowerH)
Flux limiter function to scale fluxes for small water depths.
Definition: fluxlimiterlet.hh:40
std::string mobility(int phaseIdx) noexcept
I/O name of mobility for multiphase systems.
Definition: name.hh:89
Definition: adapt.hh:17