version 3.10.0
Loading...
Searching...
No Matches
frictionlaw.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-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12
13#ifndef DUMUX_MATERIAL_FLUIDMATRIX_FRICTIONLAW_HH
14#define DUMUX_MATERIAL_FLUIDMATRIX_FRICTIONLAW_HH
15
16#include <algorithm>
17#include <cmath>
18
19#include <dune/common/fvector.hh>
20
21namespace Dumux {
22
34
35template <typename VolumeVariables >
37{
38 using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
39public:
51 virtual Dune::FieldVector<Scalar, 2> bottomShearStress(const VolumeVariables& volVars) const = 0;
52
90 Scalar limitRoughH(const Scalar roughnessHeight, const Scalar waterDepth, const Scalar eps=1.0e-12) const
91 {
92 using std::clamp;
93
94 // return zero if the roughness depth is near zero
95 if (roughnessHeight < eps) return 0.0;
96
97 // calculate the artificial water depth
98 const Scalar mobilityMax = 1.0;
99
100 const Scalar minUpperH = roughnessHeight * 2.0;
101 const Scalar sw = clamp(waterDepth * (1.0/minUpperH), 0.0, 1.0);
102 const Scalar mobility = mobilityMax /(1.0 + (1.0-sw)*(1.0-sw));
103 return roughnessHeight * (1.0 - mobility);
104 }
105
106 // virtual base class needs a virtual destructor
107 virtual ~FrictionLaw() = default;
108};
109
110} // end namespace Dumux
111
112#endif
Implementation of the abstract base class for friction laws.
Definition frictionlaw.hh:37
virtual ~FrictionLaw()=default
Scalar limitRoughH(const Scalar roughnessHeight, const Scalar waterDepth, const Scalar eps=1.0e-12) const
Limit the friction for small water depth.
Definition frictionlaw.hh:90
virtual Dune::FieldVector< Scalar, 2 > bottomShearStress(const VolumeVariables &volVars) const =0
Compute the bottom shear stress.
Definition adapt.hh:17