GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/freeflow/rans/iofields.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 17 17 100.0%
Functions: 44 44 100.0%
Branches: 17 32 53.1%

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 RANSModel
10 * \copydoc Dumux::RANSIOFields
11 */
12 #ifndef DUMUX_RANS_IO_FIELDS_HH
13 #define DUMUX_RANS_IO_FIELDS_HH
14
15 #include <dumux/freeflow/navierstokes/iofields.hh>
16
17 namespace Dumux {
18
19 /*!
20 * \ingroup RANSModel
21 * \brief Adds I/O fields for the Reynolds-Averaged Navier-Stokes model
22 */
23 struct RANSIOFields
24 {
25 //! Initialize the RANS specific output fields.
26 template <class OutputModule>
27 70 static void initOutputModule(OutputModule& out)
28 {
29 70 NavierStokesIOFields::initOutputModule(out);
30
31
3/6
✓ Branch 0 taken 50 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 50 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 50 times.
✗ Branch 7 not taken.
70 static const bool isFlatWallBounded = getParamFromGroup<bool>(out.paramGroup(), "RANS.IsFlatWallBounded", false);
32
3/6
✓ Branch 0 taken 50 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 50 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 50 times.
✗ Branch 7 not taken.
70 static const bool writeFlatWallBoundedFields = getParamFromGroup<bool>(out.paramGroup(), "RANS.WriteFlatWallBoundedFields", isFlatWallBounded);
33
34 static constexpr auto dim = decltype(std::declval<typename OutputModule::VolumeVariables>().ccVelocityVector())::dimension;
35
36
1/2
✓ Branch 2 taken 50 times.
✗ Branch 3 not taken.
640 out.addVolumeVariable([](const auto& v){ return v.ccVelocityVector()[0] / v.velocityMaximum()[0]; }, "v_x/v_x,max");
37
38 // velocityGradients is a tensor, gradient of each velocity component is added here.
39
1/2
✓ Branch 2 taken 50 times.
✗ Branch 3 not taken.
640 out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[0]; }, "dv_x/ds_");
40 if (dim > 1)
41
1/2
✓ Branch 2 taken 50 times.
✗ Branch 3 not taken.
640 out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[1]; }, "dv_y/ds_");
42 if (dim > 2)
43 out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[2]; }, "dv_z/ds_");
44
1/2
✓ Branch 2 taken 50 times.
✗ Branch 3 not taken.
640 out.addVolumeVariable([](const auto& v){ return v.pressure() - 1e5; }, "p_rel");
45
1/2
✓ Branch 2 taken 50 times.
✗ Branch 3 not taken.
640 out.addVolumeVariable([](const auto& v){ return v.viscosity() / v.density(); }, "nu");
46
1/2
✓ Branch 2 taken 50 times.
✗ Branch 3 not taken.
640 out.addVolumeVariable([](const auto& v){ return v.kinematicEddyViscosity(); }, "nu_t");
47
1/2
✓ Branch 2 taken 50 times.
✗ Branch 3 not taken.
640 out.addVolumeVariable([](const auto& v){ return v.wallDistance(); }, "l_w");
48
2/2
✓ Branch 0 taken 46 times.
✓ Branch 1 taken 4 times.
70 if (writeFlatWallBoundedFields)
49 {
50
1/2
✓ Branch 2 taken 46 times.
✗ Branch 3 not taken.
632 out.addVolumeVariable([](const auto& v){ return v.yPlus(); }, "y^+");
51
1/2
✓ Branch 2 taken 46 times.
✗ Branch 3 not taken.
632 out.addVolumeVariable([](const auto& v){ return v.uPlus(); }, "u^+");
52 }
53 70 }
54
55 //! return the names of the primary variables
56 template <class ModelTraits, class FluidSystem>
57 84 static std::string primaryVariableName(int pvIdx = 0, int state = 0)
58 {
59 84 return NavierStokesIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state);
60 }
61 };
62
63 } // end namespace Dumux
64
65 #endif
66