GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/freeflow/navierstokes/scalarvolumevariables.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 4 8 50.0%
Functions: 0 35 0.0%
Branches: 11 24 45.8%

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