GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/freeflow/navierstokes/momentum/volumevariables.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 5 9 55.6%
Functions: 0 28 0.0%
Branches: 13 18 72.2%

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 NavierStokesModel
10 *
11 * \copydoc Dumux::NavierStokesVolumeVariables
12 */
13 #ifndef DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH
14 #define DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH
15
16
17 namespace Dumux {
18
19 /*!
20 * \ingroup NavierStokesModel
21 * \brief Volume variables for the single-phase Navier-Stokes model.
22 */
23 template <class Traits>
24 4196652 class NavierStokesMomentumVolumeVariables
25 {
26 using Scalar = typename Traits::PrimaryVariables::value_type;
27
28 static_assert(Traits::PrimaryVariables::dimension == 1);
29
30 public:
31 //! export the type used for the primary variables
32 using PrimaryVariables = typename Traits::PrimaryVariables;
33
34 //! export the indices type
35 using Indices = typename Traits::ModelTraits::Indices; // TODO
36
37
38 /*!
39 * \brief Update all quantities for a given control volume
40 *
41 * \param elemSol A vector containing all primary variables connected to the element
42 * \param problem The object specifying the problem which ought to
43 * be simulated
44 * \param element An element which contains part of the control volume
45 * \param scv The sub-control volume
46 */
47 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
48 void update(const ElementSolution& elemSol,
49 const Problem& problem,
50 const Element& element,
51 const SubControlVolume& scv)
52 {
53 72935086 priVars_ = elemSol[scv.indexInElement()];
54 218396172 extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol);
55 }
56
57 /*!
58 * \brief Return how much the sub-control volume is extruded.
59 *
60 * This means the factor by which a lower-dimensional (1D or 2D)
61 * entity needs to be expanded to get a full dimensional cell. The
62 * default is 1.0 which means that 1D problems are actually
63 * thought as pipes with a cross section of 1 m^2 and 2D problems
64 * are assumed to extend 1 m to the back.
65 */
66 Scalar extrusionFactor() const
67 { return extrusionFactor_; }
68
69 Scalar velocity() const
70
13/18
✗ Branch 1 not taken.
✓ Branch 2 taken 22284989 times.
✓ Branch 3 taken 16255742 times.
✓ Branch 4 taken 1551 times.
✓ Branch 5 taken 3775032 times.
✓ Branch 6 taken 74876374 times.
✓ Branch 7 taken 14594347 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 9 times.
✓ Branch 10 taken 90062135 times.
✓ Branch 11 taken 1 times.
✓ Branch 12 taken 32039 times.
✓ Branch 13 taken 457505 times.
✓ Branch 14 taken 4415 times.
✓ Branch 16 taken 33240 times.
✗ Branch 17 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
794949913 { return priVars_[0]; }
71
72 /*!
73 * \brief Return a component of primary variable vector
74 *
75 * \param pvIdx The index of the primary variable of interest
76 */
77 Scalar priVar(const int pvIdx) const
78 { return priVars_[pvIdx]; }
79
80 /*!
81 * \brief Return the primary variable vector
82 */
83 const PrimaryVariables& priVars() const
84 133918 { return priVars_; }
85
86 protected:
87 PrimaryVariables priVars_;
88 Scalar extrusionFactor_;
89 };
90
91 } // end namespace Dumux
92
93 #endif // DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH
94