GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/freeflow/navierstokes/channel/3d/spatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 7 11 63.6%
Functions: 4 15 26.7%
Branches: 5 22 22.7%

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-FileCopyrightInfo: 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 FreeflowTests
10 * \brief Definition of the spatial parameters for the 3D Channel Problems.
11 */
12
13 #ifndef DUMUX_CHANNEL3D_SPATIAL_PARAMS_HH
14 #define DUMUX_CHANNEL3D_SPATIAL_PARAMS_HH
15
16 #include <dumux/freeflow/spatialparams.hh>
17
18 namespace Dumux {
19
20 /*!
21 * \ingroup FreeflowModels
22 * \brief Definition of the spatial parameters for the freeflow problems.
23 */
24 template<class GridGeometry, class Scalar>
25
2/12
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
8 class Channel3DSpatialParams
26 : public FreeFlowSpatialParams<GridGeometry, Scalar, Channel3DSpatialParams<GridGeometry, Scalar>>
27 {
28 using ParentType = FreeFlowSpatialParams<GridGeometry, Scalar, Channel3DSpatialParams<GridGeometry, Scalar>>;
29 using GridView = typename GridGeometry::GridView;
30 using FVElementGeometry = typename GridGeometry::LocalView;
31 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
32 using GlobalPosition = typename SubControlVolume::Traits::GlobalPosition;
33 using Element = typename GridView::template Codim<0>::Entity;
34
35 static constexpr int dim = GridGeometry::GridView::dimension;
36 static constexpr bool enablePseudoThreeDWallFriction = dim != 3;
37
38 public:
39 16 Channel3DSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
40
2/8
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
16 : ParentType(gridGeometry)
41 {
42
43
1/2
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
16 height_ = getParam<Scalar>("Problem.Height");
44
45 if constexpr (enablePseudoThreeDWallFriction)
46 4 extrusionFactor_ = 2.0/3.0 * height_;
47 else
48 12 extrusionFactor_ = 1.0;
49
50 16 }
51
52 /*!
53 * \brief Return the temperature in the domain at the given position
54 * \param globalPos The position in global coordinates where the temperature should be specified.
55 */
56 Scalar temperatureAtPos(const GlobalPosition& globalPos) const
57 { return 283.15; }
58
59 /*!
60 * \brief Return how much the domain is extruded at a given sub-control volume.
61 */
62 template<class ElementSolution>
63 Scalar extrusionFactor(const Element& element,
64 const SubControlVolume& scv,
65 const ElementSolution& elemSol) const
66 { return extrusionFactor_; }
67
68 /*!
69 * \brief Return how much the domain is extruded at a given position.
70 */
71 Scalar extrusionFactorAtPos(const GlobalPosition& globalPos) const
72 { return extrusionFactor_; }
73
74 private:
75 Scalar extrusionFactor_;
76 Scalar height_;
77 };
78
79 } // end namespace Dumux
80
81 #endif
82