GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/freeflow/navierstokes/mass/1p/advectiveflux.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 3 3 100.0%
Functions: 0 0 -%
Branches: 3 4 75.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 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 112445281 static void addAdvectiveFlux(NumEqVector& flux,
39 const UpwindFunction& upwind)
40 {
41 using ModelTraits = T;
42
43 // get equation index
44
1/2
✓ Branch 2 taken 18080 times.
✗ Branch 3 not taken.
112039496 const auto eqIdx = ModelTraits::Indices::conti0EqIdx;
45
2/2
✓ Branch 0 taken 249600 times.
✓ Branch 1 taken 327168 times.
224067442 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