GCC Code Coverage Report


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