version 3.8
manning.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_MATERIAL_FLUIDMATRIX_FRICTIONLAW_MANNING_HH
13#define DUMUX_MATERIAL_FLUIDMATRIX_FRICTIONLAW_MANNING_HH
14
15#include <algorithm>
16#include <cmath>
17#include <dune/common/math.hh>
18#include "frictionlaw.hh"
19
20namespace Dumux {
29template <typename VolumeVariables>
30class FrictionLawManning : public FrictionLaw<VolumeVariables>
31{
32 using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
33public:
41 FrictionLawManning(const Scalar gravity, const Scalar manningN, const Scalar roughnessHeight=0.0)
42 : gravity_(gravity), manningN_(manningN), roughnessHeight_(roughnessHeight) {}
43
55 Dune::FieldVector<Scalar, 2> bottomShearStress(const VolumeVariables& volVars) const final
56 {
57 using std::pow;
58 using Dune::power;
59 using std::hypot;
60
61 Dune::FieldVector<Scalar, 2> shearStress(0.0);
62
63 const Scalar artificialWaterDepth = this->limitRoughH(roughnessHeight_, volVars.waterDepth());
64 // c has units of m^(1/2)/s so c^2 has units of m/s^2
65 const Scalar c = pow(volVars.waterDepth() + artificialWaterDepth, 1.0/6.0) * 1.0/(manningN_);
66 const Scalar uv = hypot(volVars.velocity(0), volVars.velocity(1));
67 const Scalar dimensionlessFactor = gravity_/(c*c);
68
69 shearStress[0] = dimensionlessFactor * volVars.velocity(0) * uv * volVars.density();
70 shearStress[1] = dimensionlessFactor * volVars.velocity(1) * uv * volVars.density();
71
72 return shearStress;
73 }
74
75private:
76 Scalar gravity_;
77 Scalar manningN_;
78 Scalar roughnessHeight_;
79};
80
81} // end namespace Dumux
82
83#endif
Implementation of the abstract base class for friction laws.
Definition: frictionlaw.hh:31
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:84
Implementation of the friction law after Manning.
Definition: manning.hh:31
FrictionLawManning(const Scalar gravity, const Scalar manningN, const Scalar roughnessHeight=0.0)
Constructor.
Definition: manning.hh:41
Dune::FieldVector< Scalar, 2 > bottomShearStress(const VolumeVariables &volVars) const final
Compute the bottom shear stress.
Definition: manning.hh:55
Definition: adapt.hh:17