version 3.11-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-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_MATERIAL_FLUIDMATRIX_FRICTIONLAW_NIKURADSE_HH
14#define DUMUX_MATERIAL_FLUIDMATRIX_FRICTIONLAW_NIKURADSE_HH
15
21#include <algorithm>
22#include <cmath>
23#include <dune/common/math.hh>
24#include "frictionlaw.hh"
25
26namespace Dumux {
57template <typename VolumeVariables>
58class FrictionLawNikuradse : public FrictionLaw<VolumeVariables>
59{
60 using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
61public:
68 FrictionLawNikuradse(const Scalar ks, const Scalar roughnessHeight=0.0)
69 : ks_(ks), roughnessHeight_(roughnessHeight) {}
70
82 Dune::FieldVector<Scalar, 2> bottomShearStress(const VolumeVariables& volVars) const final
83 {
84 using Dune::power;
85 using std::log;
86 using std::hypot;
87
88 Dune::FieldVector<Scalar, 2> shearStress(0.0);
89
90 const Scalar artificialWaterDepth = this->limitRoughH(roughnessHeight_, volVars.waterDepth());
91 const Scalar karmanConstant = 0.41; // Karman's constant is dimensionless
92 const Scalar dimensionlessFactor = power(karmanConstant, 2)/power(log((12*(volVars.waterDepth() + artificialWaterDepth))/ks_), 2);
93 const Scalar uv = hypot(volVars.velocity(0),volVars.velocity(1));
94
95 shearStress[0] = dimensionlessFactor * volVars.velocity(0) * uv * volVars.density();
96 shearStress[1] = dimensionlessFactor * volVars.velocity(1) * uv * volVars.density();
97
98 return shearStress;
99 }
100
101private:
102 Scalar ks_;
103 Scalar roughnessHeight_;
104};
105
106} // end namespace Dumux
107
108#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
Implementation of the friction law after Nikuradse.
Definition: nikuradse.hh:59
Dune::FieldVector< Scalar, 2 > bottomShearStress(const VolumeVariables &volVars) const final
Compute the bottom shear stress.
Definition: nikuradse.hh:82
FrictionLawNikuradse(const Scalar ks, const Scalar roughnessHeight=0.0)
Constructor.
Definition: nikuradse.hh:68
Implementation of the abstract base class for friction laws.
Definition: adapt.hh:17