3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * 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 FREEFLOW_RANS_BOUNDARY_TYPES_HH
25#define FREEFLOW_RANS_BOUNDARY_TYPES_HH
26
27#include <dune/common/exceptions.hh>
28
31
32namespace Dumux {
33
38template <class ModelTraits, int numEq>
40{
42 static constexpr auto dimWorld = ModelTraits::dim();
43 using Indices = typename ModelTraits::Indices;
44 static_assert(dimWorld > 1, "Wall conditions cannot be set for 1D domains.");
45public:
47 {
48 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
49 resetEq(eqIdx);
50 }
51
52 void setWall()
53 {
54 isWall_ = true;
55 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
56 {
57 if constexpr (dimWorld == 3)
58 {
59 if ((eqIdx == Indices::velocityXIdx)
60 || (eqIdx == Indices::velocityYIdx)
61 || (eqIdx == Indices::velocityZIdx))
63 }
64 else if constexpr (dimWorld == 2)
65 {
66 if ((eqIdx == Indices::velocityXIdx)
67 || (eqIdx == Indices::velocityYIdx))
69 }
70 else
71 DUNE_THROW(Dune::NotImplemented, "1D Turbulence models are not supported");
72
73 if constexpr (numTurbulenceEq(ModelTraits::turbulenceModel()) == 1)
74 {
75 if (eqIdx == Indices::viscosityTildeIdx)
77 }
78 else if constexpr (numTurbulenceEq(ModelTraits::turbulenceModel()) == 2)
79 {
80 if (eqIdx == Indices::turbulentKineticEnergyEqIdx || eqIdx == Indices::dissipationEqIdx)
82 }
83 }
84 }
85
90 bool hasWall() const
91 { return isWall_; }
92
96 void resetEq(const int eqIdx)
97 {
99 isWall_ = false;
100 }
101
102protected:
104};
105
106} // end namespace Dumux
107
108#endif
Type traits.
Definition: adapt.hh:29
constexpr unsigned int numTurbulenceEq(TurbulenceModel model)
Definition: turbulencemodel.hh:42
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
bool isDirichlet(unsigned eqIdx) const
Returns true if an equation is used to specify a Dirichlet condition.
Definition: common/boundarytypes.hh:212
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/boundarytypes.hh:38
void resetEq(const int eqIdx)
Reset the boundary types for one equation.
Definition: freeflow/navierstokes/boundarytypes.hh:51
Class to specify the type of a boundary condition for the RANS extension to the Navier-Stokes model.
Definition: freeflow/rans/boundarytypes.hh:40
bool hasWall() const
Returns true if some equation is used to specify a Wall boundary condition.
Definition: freeflow/rans/boundarytypes.hh:90
bool isWall_
Definition: freeflow/rans/boundarytypes.hh:103
void setWall()
Definition: freeflow/rans/boundarytypes.hh:52
RANSBoundaryTypes()
Definition: freeflow/rans/boundarytypes.hh:46
void resetEq(const int eqIdx)
Reset the boundary types for one equation.
Definition: freeflow/rans/boundarytypes.hh:96