GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/freeflow/rans/twoeq/komega/iofields.hh
Date: 2025-04-19 19:19:10
Exec Total Coverage
Lines: 11 11 100.0%
Functions: 9 10 90.0%
Branches: 6 8 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 KOmegaModel
10 * \copydoc Dumux::KOmegaIOFields
11 */
12 #ifndef DUMUX_KOMEGA_IO_FIELDS_HH
13 #define DUMUX_KOMEGA_IO_FIELDS_HH
14
15 #include <dumux/freeflow/rans/iofields.hh>
16
17 namespace Dumux {
18
19 /*!
20 * \ingroup KOmegaModel
21 * \brief Adds I/O fields for the Reynolds-Averaged Navier-Stokes model
22 */
23 struct KOmegaIOFields
24 {
25 //! Initialize the KOmegaModel specific output fields.
26 template <class OutputModule>
27 14 static void initOutputModule(OutputModule& out)
28 {
29 14 RANSIOFields::initOutputModule(out);
30
31
1/2
✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
128 out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k");
32
1/2
✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
128 out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega");
33 14 }
34
35 //! return the names of the primary variables
36 template <class ModelTraits, class FluidSystem>
37 40 static std::string primaryVariableName(int pvIdx = 0, int state = 0)
38 {
39
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 4 times.
40 if (pvIdx < ModelTraits::dim() + ModelTraits::numFluidComponents())
40 20 return RANSIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state);
41
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
20 else if (pvIdx == ModelTraits::dim() + ModelTraits::numFluidComponents())
42 10 return "k";
43 else
44 10 return "omega";
45 }
46 };
47
48 } // end namespace Dumux
49
50 #endif
51