3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_RANS_IO_FIELDS_HH
25#define DUMUX_RANS_IO_FIELDS_HH
26
28
29namespace Dumux {
30
36{
38 template <class OutputModule>
39 static void initOutputModule(OutputModule& out)
40 {
42
43 static const bool isFlatWallBounded = getParamFromGroup<bool>(out.paramGroup(), "RANS.IsFlatWallBounded", false);
44 static const bool writeFlatWallBoundedFields = getParamFromGroup<bool>(out.paramGroup(), "RANS.WriteFlatWallBoundedFields", isFlatWallBounded);
45
46 static constexpr auto dim = decltype(std::declval<typename OutputModule::VolumeVariables>().ccVelocityVector())::dimension;
47
48 out.addVolumeVariable([](const auto& v){ return v.ccVelocityVector()[0] / v.velocityMaximum()[0]; }, "v_x/v_x,max");
49
50 // velocityGradients is a tensor, gradient of each velocity component is added here.
51 out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[0]; }, "dv_x/ds_");
52 if (dim > 1)
53 out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[1]; }, "dv_y/ds_");
54 if (dim > 2)
55 out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[2]; }, "dv_z/ds_");
56 out.addVolumeVariable([](const auto& v){ return v.pressure() - 1e5; }, "p_rel");
57 out.addVolumeVariable([](const auto& v){ return v.viscosity() / v.density(); }, "nu");
58 out.addVolumeVariable([](const auto& v){ return v.kinematicEddyViscosity(); }, "nu_t");
59 out.addVolumeVariable([](const auto& v){ return v.wallDistance(); }, "l_w");
60 if (writeFlatWallBoundedFields)
61 {
62 out.addVolumeVariable([](const auto& v){ return v.yPlus(); }, "y^+");
63 out.addVolumeVariable([](const auto& v){ return v.uPlus(); }, "u^+");
64 }
65 }
66
68 template <class ModelTraits, class FluidSystem>
69 static std::string primaryVariableName(int pvIdx = 0, int state = 0)
70 {
71 return NavierStokesIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state);
72 }
73};
74
75} // end namespace Dumux
76
77#endif
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
static void initOutputModule(OutputModule &out)
Initialize the Navier-Stokes specific output fields.
Definition: freeflow/navierstokes/iofields.hh:91
Adds I/O fields for the Reynolds-Averaged Navier-Stokes model.
Definition: freeflow/rans/iofields.hh:36
static std::string primaryVariableName(int pvIdx=0, int state=0)
return the names of the primary variables
Definition: freeflow/rans/iofields.hh:69
static void initOutputModule(OutputModule &out)
Initialize the RANS specific output fields.
Definition: freeflow/rans/iofields.hh:39