version 3.10-dev
nikuradse.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_NIKURADSE_HH
13#define DUMUX_MATERIAL_FLUIDMATRIX_FRICTIONLAW_NIKURADSE_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 FrictionLawNikuradse : public FrictionLaw<VolumeVariables>
31{
32 using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
33public:
40 FrictionLawNikuradse(const Scalar ks, const Scalar roughnessHeight=0.0)
41 : ks_(ks), roughnessHeight_(roughnessHeight) {}
42
54 Dune::FieldVector<Scalar, 2> bottomShearStress(const VolumeVariables& volVars) const final
55 {
56 using Dune::power;
57 using std::log;
58 using std::hypot;
59
60 Dune::FieldVector<Scalar, 2> shearStress(0.0);
61
62 const Scalar artificialWaterDepth = this->limitRoughH(roughnessHeight_, volVars.waterDepth());
63 const Scalar karmanConstant = 0.41; // Karman's constant is dimensionless
64 const Scalar dimensionlessFactor = power(karmanConstant, 2)/power(log((12*(volVars.waterDepth() + artificialWaterDepth))/ks_), 2);
65 const Scalar uv = hypot(volVars.velocity(0),volVars.velocity(1));
66
67 shearStress[0] = dimensionlessFactor * volVars.velocity(0) * uv * volVars.density();
68 shearStress[1] = dimensionlessFactor * volVars.velocity(1) * uv * volVars.density();
69
70 return shearStress;
71 }
72
73private:
74 Scalar ks_;
75 Scalar roughnessHeight_;
76};
77
78} // end namespace Dumux
79
80#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 Nikuradse.
Definition: nikuradse.hh:31
Dune::FieldVector< Scalar, 2 > bottomShearStress(const VolumeVariables &volVars) const final
Compute the bottom shear stress.
Definition: nikuradse.hh:54
FrictionLawNikuradse(const Scalar ks, const Scalar roughnessHeight=0.0)
Constructor.
Definition: nikuradse.hh:40
Definition: adapt.hh:17