GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/freeflow/navierstokes/mass/1p/advectiveflux.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 0 34 0.0%
Branches: 1 8 12.5%

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 * \brief Helper struct defining the advective fluxes of the single-phase flow
11 * Navier-Stokes mass model
12 */
13 #ifndef DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_ADVECTIVE_FLUX_HH
14 #define DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_ADVECTIVE_FLUX_HH
15
16 namespace Dumux {
17
18 #ifndef DOXYGEN
19 // forward declare
20 struct NavierStokesMassOnePModelTraits;
21
22 template<class IsothermalTraits>
23 struct NavierStokesEnergyModelTraits;
24
25 template<class ModelTraits, class T = ModelTraits>
26 struct AdvectiveFlux;
27 #endif
28
29 /*!
30 * \ingroup NavierStokesModel
31 * \brief Helper struct defining the advective fluxes of the single-phase flow
32 * Navier-Stokes mass model
33 */
34 template<class T>
35 struct AdvectiveFlux<NavierStokesMassOnePModelTraits, T>
36 {
37 template<class NumEqVector, class UpwindFunction>
38 static void addAdvectiveFlux(NumEqVector& flux,
39 const UpwindFunction& upwind)
40 {
41 using ModelTraits = T;
42
43 // get equation index
44 100676297 const auto eqIdx = ModelTraits::Indices::conti0EqIdx;
45
1/8
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 7 taken 249600 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
526897742 flux[eqIdx] += upwind([](const auto& volVars) { return volVars.density(); });
46 }
47 };
48
49 // use the same mass flux for the non-isothermal model (heat fluxes are added separately)
50 template<>
51 struct AdvectiveFlux<NavierStokesEnergyModelTraits<NavierStokesMassOnePModelTraits>>
52 : public AdvectiveFlux<NavierStokesMassOnePModelTraits>
53 {};
54
55 } // end namespace Dumux
56
57 #endif
58