version 3.10-dev
freeflow/rans/iofields.hh
Go to the documentation of this file.
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//
12#ifndef DUMUX_RANS_IO_FIELDS_HH
13#define DUMUX_RANS_IO_FIELDS_HH
14
16
17namespace Dumux {
18
24{
26 template <class OutputModule>
27 static void initOutputModule(OutputModule& out)
28 {
30
31 static const bool isFlatWallBounded = getParamFromGroup<bool>(out.paramGroup(), "RANS.IsFlatWallBounded", false);
32 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 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 out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[0]; }, "dv_x/ds_");
40 if (dim > 1)
41 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 out.addVolumeVariable([](const auto& v){ return v.pressure() - 1e5; }, "p_rel");
45 out.addVolumeVariable([](const auto& v){ return v.viscosity() / v.density(); }, "nu");
46 out.addVolumeVariable([](const auto& v){ return v.kinematicEddyViscosity(); }, "nu_t");
47 out.addVolumeVariable([](const auto& v){ return v.wallDistance(); }, "l_w");
48 if (writeFlatWallBoundedFields)
49 {
50 out.addVolumeVariable([](const auto& v){ return v.yPlus(); }, "y^+");
51 out.addVolumeVariable([](const auto& v){ return v.uPlus(); }, "u^+");
52 }
53 }
54
56 template <class ModelTraits, class FluidSystem>
57 static std::string primaryVariableName(int pvIdx = 0, int state = 0)
58 {
59 return NavierStokesIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state);
60 }
61};
62
63} // end namespace Dumux
64
65#endif
static void initOutputModule(OutputModule &out)
Initialize the Navier-Stokes specific output fields.
Definition: freeflow/navierstokes/iofields.hh:79
Definition: adapt.hh:17
Adds I/O fields for the Reynolds-Averaged Navier-Stokes model.
Definition: freeflow/rans/iofields.hh:24
static std::string primaryVariableName(int pvIdx=0, int state=0)
return the names of the primary variables
Definition: freeflow/rans/iofields.hh:57
static void initOutputModule(OutputModule &out)
Initialize the RANS specific output fields.
Definition: freeflow/rans/iofields.hh:27