version 3.8
freeflow/rans/boundarytypes.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 FREEFLOW_RANS_BOUNDARY_TYPES_HH
13#define FREEFLOW_RANS_BOUNDARY_TYPES_HH
14
15#include <dune/common/exceptions.hh>
16
19
20namespace Dumux {
21
26template <class ModelTraits, int numEq>
28{
30 static constexpr auto dimWorld = ModelTraits::dim();
31 using Indices = typename ModelTraits::Indices;
32 static_assert(dimWorld > 1, "Wall conditions cannot be set for 1D domains.");
33public:
35 {
36 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
37 resetEq(eqIdx);
38 }
39
40 void setWall()
41 {
42 isWall_ = true;
43 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
44 {
45 if constexpr (dimWorld == 3)
46 {
47 if ((eqIdx == Indices::velocityXIdx)
48 || (eqIdx == Indices::velocityYIdx)
49 || (eqIdx == Indices::velocityZIdx))
51 }
52 else if constexpr (dimWorld == 2)
53 {
54 if ((eqIdx == Indices::velocityXIdx)
55 || (eqIdx == Indices::velocityYIdx))
57 }
58 else
59 DUNE_THROW(Dune::NotImplemented, "1D Turbulence models are not supported");
60
61 if constexpr (numTurbulenceEq(ModelTraits::turbulenceModel()) == 1)
62 {
63 if (eqIdx == Indices::viscosityTildeIdx)
65 }
66 else if constexpr (numTurbulenceEq(ModelTraits::turbulenceModel()) == 2)
67 {
68 if (eqIdx == Indices::turbulentKineticEnergyEqIdx || eqIdx == Indices::dissipationEqIdx)
70 }
71 }
72 }
73
78 bool hasWall() const
79 { return isWall_; }
80
84 void resetEq(const int eqIdx)
85 {
87 isWall_ = false;
88 }
89
90protected:
91 bool isWall_;
92};
93
94} // end namespace Dumux
95
96#endif
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:26
bool isDirichlet(unsigned eqIdx) const
Returns true if an equation is used to specify a Dirichlet condition.
Definition: common/boundarytypes.hh:200
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/boundarytypes.hh:26
void resetEq(const int eqIdx)
Reset the boundary types for one equation.
Definition: freeflow/navierstokes/boundarytypes.hh:39
Class to specify the type of a boundary condition for the RANS extension to the Navier-Stokes model.
Definition: freeflow/rans/boundarytypes.hh:28
bool hasWall() const
Returns true if some equation is used to specify a Wall boundary condition.
Definition: freeflow/rans/boundarytypes.hh:78
bool isWall_
Definition: freeflow/rans/boundarytypes.hh:91
void setWall()
Definition: freeflow/rans/boundarytypes.hh:40
RANSBoundaryTypes()
Definition: freeflow/rans/boundarytypes.hh:34
void resetEq(const int eqIdx)
Reset the boundary types for one equation.
Definition: freeflow/rans/boundarytypes.hh:84
Type traits.
Definition: adapt.hh:17
constexpr unsigned int numTurbulenceEq(TurbulenceModel model)
Definition: turbulencemodel.hh:30