version 3.10.0
Loading...
Searching...
No Matches
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-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_MANNING_HH
14#define DUMUX_MATERIAL_FLUIDMATRIX_FRICTIONLAW_MANNING_HH
15
16#include <algorithm>
17#include <cmath>
18#include <dune/common/math.hh>
19#include "frictionlaw.hh"
20
21namespace Dumux {
26
49
50template <typename VolumeVariables>
51class FrictionLawManning : public FrictionLaw<VolumeVariables>
52{
53 using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
54public:
62 FrictionLawManning(const Scalar gravity, const Scalar manningN, const Scalar roughnessHeight=0.0)
63 : gravity_(gravity), manningN_(manningN), roughnessHeight_(roughnessHeight) {}
64
76 Dune::FieldVector<Scalar, 2> bottomShearStress(const VolumeVariables& volVars) const final
77 {
78 using std::pow;
79 using Dune::power;
80 using std::hypot;
81
82 Dune::FieldVector<Scalar, 2> shearStress(0.0);
83
84 const Scalar artificialWaterDepth = this->limitRoughH(roughnessHeight_, volVars.waterDepth());
85 // c has units of m^(1/2)/s so c^2 has units of m/s^2
86 const Scalar c = pow(volVars.waterDepth() + artificialWaterDepth, 1.0/6.0) * 1.0/(manningN_);
87 const Scalar uv = hypot(volVars.velocity(0), volVars.velocity(1));
88 const Scalar dimensionlessFactor = gravity_/(c*c);
89
90 shearStress[0] = dimensionlessFactor * volVars.velocity(0) * uv * volVars.density();
91 shearStress[1] = dimensionlessFactor * volVars.velocity(1) * uv * volVars.density();
92
93 return shearStress;
94 }
95
96private:
97 Scalar gravity_;
98 Scalar manningN_;
99 Scalar roughnessHeight_;
100};
101
102} // end namespace Dumux
103
104#endif
Implementation of the abstract base class for friction laws.
Definition frictionlaw.hh:37
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
FrictionLawManning(const Scalar gravity, const Scalar manningN, const Scalar roughnessHeight=0.0)
Constructor.
Definition manning.hh:62
Dune::FieldVector< Scalar, 2 > bottomShearStress(const VolumeVariables &volVars) const final
Compute the bottom shear stress.
Definition manning.hh:76
Implementation of the abstract base class for friction laws.
Definition adapt.hh:17