GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/material/fluidmatrixinteractions/frictionlaws/viscousnoslip.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 6 6 100.0%
Functions: 1 1 100.0%
Branches: 1 2 50.0%

Line Branch Exec Source
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 //
7 /*!
8 * \file
9 * \ingroup FrictionLaws
10 * \brief Implementation of a viscous no-slip bottom friction law
11 */
12
13 #ifndef DUMUX_MATERIAL_FLUIDMATRIX_FRICTIONLAW_VISCOUS_NOSLIP_HH
14 #define DUMUX_MATERIAL_FLUIDMATRIX_FRICTIONLAW_VISCOUS_NOSLIP_HH
15
16 #include <algorithm>
17 #include <cmath>
18 #include <dune/common/math.hh>
19
20 #include <dumux/material/fluidmatrixinteractions/frictionlaws/frictionlaw.hh>
21
22 namespace Dumux {
23 /*!
24 * \addtogroup FrictionLaws
25 * \copydetails Dumux::FrictionLawViscousNoSlip
26 */
27
28 /*!
29 * \ingroup FrictionLaws
30 * \brief Implementation of a viscous no-slip bottom friction law
31 *
32 * ### Viscous No-Slip
33 *
34 * This friction law assumes thin film flow with a parabolic velocity profile in depth
35 * (for the depth-averaged shallow water equations). The velocity profile
36 * and associated bottom shear stress can be derived from plane Poiseuille flow
37 * with a free surface boundary condition on top and a no-slip boundary condition
38 * on the bottom.
39 */
40
41 template <typename VolumeVariables>
42
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 class FrictionLawViscousNoSlip : public FrictionLaw<VolumeVariables>
43 {
44 using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
45 public:
46 /*!
47 * \brief Compute the bottom shear stress.
48 *
49 * Compute the bottom shear stress due to bottom friction.
50 * The bottom shear stress is a projection of the shear stress tensor onto the bottom plane.
51 * It can therefore be represented by a (tangent) vector with two entries.
52 *
53 * \return shear stress in N/m^2. First entry is the x-component, the second the y-component.
54 */
55 320 Dune::FieldVector<Scalar, 2> bottomShearStress(const VolumeVariables& volVars) const final
56 {
57 // assume a parabolic velocity profile with no-slip BC on the bottom
58 // and zero stress condition on the free surface
59 // note that the velocity corresponds to the height-averaged velocity
60 320 Dune::FieldVector<Scalar, 2> shearStress(0.0);
61 320 shearStress[0] = volVars.viscosity()*volVars.velocity(0) * 3.0 / volVars.waterDepth();
62 320 shearStress[1] = volVars.viscosity()*volVars.velocity(1) * 3.0 / volVars.waterDepth();
63 320 return shearStress;
64 }
65 };
66
67 } // end namespace Dumux
68
69 #endif
70