3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/navierstokes/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_NAVIERSTOKES_BOUNDARY_TYPES_HH
25#define FREEFLOW_NAVIERSTOKES_BOUNDARY_TYPES_HH
26
29
30namespace Dumux {
31
36template <int numEq>
38{
40
41public:
43 {
44 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
45 resetEq(eqIdx);
46 }
47
51 void resetEq(const int eqIdx)
52 {
54
55 boundaryInfo_[eqIdx].isSymmetry = false;
56 boundaryInfo_[eqIdx].isBeaversJoseph = false;
57 boundaryInfo_[eqIdx].isOutflow = false;
58 }
59
64 {
65 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
66 {
67 resetEq(eqIdx);
68 boundaryInfo_[eqIdx].isSymmetry = true;
69 }
70 }
71
75 bool isSymmetry() const
76 { return boundaryInfo_[0].isSymmetry; }
77
81 template<class T = void>
83 {
84 static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Dirichlet not permitted!");
85 }
86
90 template<class T = void>
92 {
93 static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Neumann not permitted!");
94 }
95
100 void setBeaversJoseph(const int eqIdx)
101 {
102 resetEq(eqIdx);
103 boundaryInfo_[eqIdx].isBeaversJoseph = true;
104 }
105
112 bool isBeaversJoseph(const int eqIdx) const
113 { return boundaryInfo_[eqIdx].isBeaversJoseph; }
114
119 bool hasBeaversJoseph() const
120 {
121 for (int i = 0; i < numEq; ++i)
123 return true;
124 return false;
125 }
126
130 void setOutflow(const int eqIdx)
131 {
132 resetEq(eqIdx);
133 boundaryInfo_[eqIdx].isOutflow = true;
134 }
135
140 bool isOutflow(const int eqIdx) const
141 { return boundaryInfo_[eqIdx].isOutflow; }
142
146 bool hasOutflow() const
147 {
148 for (int i = 0; i < numEq; ++i)
150 return true;
151 return false;
152 }
153
154protected:
157 {
158 bool isSymmetry : 1;
159 bool isOutflow : 1;
161 };
162
163 std::array<NavierStokesBoundaryInfo, numEq> boundaryInfo_;
164};
165
166} // end namespace Dumux
167
168#endif
Type traits.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
void resetEq(int eqIdx)
Reset the boundary types for one equation.
Definition: common/boundarytypes.hh:63
Template which always yields a false value.
Definition: typetraits.hh:35
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/boundarytypes.hh:38
void setAllSymmetry()
Sets a symmetry boundary condition for all equations.
Definition: freeflow/navierstokes/boundarytypes.hh:63
void resetEq(const int eqIdx)
Reset the boundary types for one equation.
Definition: freeflow/navierstokes/boundarytypes.hh:51
bool hasBeaversJoseph() const
Returns true if some equation is used to specify a Beavers-Joseph(-Saffman) boundary condition.
Definition: freeflow/navierstokes/boundarytypes.hh:119
void setAllNeumann()
Prevent setting all boundary conditions to Neumann.
Definition: freeflow/navierstokes/boundarytypes.hh:91
std::array< NavierStokesBoundaryInfo, numEq > boundaryInfo_
Definition: freeflow/navierstokes/boundarytypes.hh:163
bool isOutflow(const int eqIdx) const
Returns true if an outflow boundary condition was set.
Definition: freeflow/navierstokes/boundarytypes.hh:140
NavierStokesBoundaryTypes()
Definition: freeflow/navierstokes/boundarytypes.hh:42
void setOutflow(const int eqIdx)
Set an outflow boundary condition.
Definition: freeflow/navierstokes/boundarytypes.hh:130
void setBeaversJoseph(const int eqIdx)
Set a boundary condition for a single equation to Beavers-Joseph(-Saffmann) (special case of Dirichle...
Definition: freeflow/navierstokes/boundarytypes.hh:100
void setAllDirichlet()
Prevent setting all boundary conditions to Dirichlet.
Definition: freeflow/navierstokes/boundarytypes.hh:82
bool isSymmetry() const
Returns true if the there is a symmetry boundary condition.
Definition: freeflow/navierstokes/boundarytypes.hh:75
bool isBeaversJoseph(const int eqIdx) const
Returns true if an equation is used to specify a Beavers-Joseph(-Saffman) boundary condition.
Definition: freeflow/navierstokes/boundarytypes.hh:112
bool hasOutflow() const
Returns true if some equation has an outflow boundary condition.
Definition: freeflow/navierstokes/boundarytypes.hh:146
use bitfields to minimize the size
Definition: freeflow/navierstokes/boundarytypes.hh:157
bool isBeaversJoseph
Definition: freeflow/navierstokes/boundarytypes.hh:160
bool isSymmetry
Definition: freeflow/navierstokes/boundarytypes.hh:158
bool isOutflow
Definition: freeflow/navierstokes/boundarytypes.hh:159
Class to specify the type of a boundary.