-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboundary.h
executable file
·126 lines (116 loc) · 4.99 KB
/
boundary.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/**
* Copyright 2019 United Kingdom Research and Innovation
*
* Authors: See AUTHORS
*
* Contact: [[email protected] and/or [email protected]]
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice
* this list of conditions and the following disclaimer in the documentation
* and or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*! @brief Head files for boundary conditions
* @author Jianping Meng
* @details Declaring functions related to boundary conditions.
*/
#ifndef BOUNDARY_H
#define BOUNDARY_H
#include "type.h"
#include <vector>
#include "block.h"
#include "flowfield_host_device.h"
#include "boundary_host_device.h"
#include "model.h"
#include "model_host_device.h"
const std::vector<BoundarySurface> AllBoundarySurface{BoundarySurface::Left,
BoundarySurface::Right,
BoundarySurface::Top,
BoundarySurface::Bottom,
#ifdef OPS_3D
BoundarySurface::Front,
BoundarySurface::Back,
BoundarySurface::LeftBack,
BoundarySurface::LeftFront,
BoundarySurface::RightBack,
BoundarySurface::RightFront,
BoundarySurface::TopBack,
BoundarySurface::TopFront,
BoundarySurface::BottomBack,
BoundarySurface::BottomFront,
#endif
BoundarySurface::LeftTop,
BoundarySurface::LeftBottom,
BoundarySurface::RightTop,
BoundarySurface::RightBottom
};
enum class BoundaryScheme {
KineticDiffuseWall = 11,
KineticSpelluarWall = 12,
ExtrapolPressure1ST = 16,
ExtrapolPressure2ND = 17,
MDPeriodic = 18,
FDPeriodic = 19,
BounceBack = 20,
FreeFlux = 21,
ZouHeVelocity = 22,
EQNNoSlip = 23,
EQMDiffuseRefl = 24,
None = -1
};
struct BlockBoundary {
int blockIndex;
int componentID;
std::vector<Real> givenVars;
BoundarySurface boundarySurface;
BoundaryScheme boundaryScheme;
std::vector<VariableTypes> macroVarTypesatBoundary;
VertexType boundaryType;
};
int BoundaryHaloNum();
void SetBoundaryHaloNum(const int boundaryhaloNum);
void BoundaryNormal3D(const VertexGeometryType vg, int* unitNormal);
void DefineBlockBoundary(int blockIndex, int componentID,
BoundarySurface boundarySurface,
BoundaryScheme boundaryScheme,
const std::vector<VariableTypes>& macroVarTypes,
const std::vector<Real>& macroVarValues,
const VertexType boundaryType = VertexType::Wall);
void DefineBlockBoundary(
int blockIndex, int componentID, BoundarySurface boundarySurface,
const VertexType boundaryType = VertexType::VirtualBoundary);
const std::vector<BlockBoundary>& BlockBoundaries();
#ifdef OPS_3D
void TreatBlockBoundary3D(const Block& block, const int componentID,
const Real* givenVars,
const BoundaryScheme boundaryScheme,
const BoundarySurface boundarySurface);
void ImplementBoundary3D();
#endif
#ifdef OPS_2D
void TreatBlockBoundary(const Block& block, const int componentID,
const Real* givenVars,
const BoundaryScheme boundaryScheme,
const BoundarySurface boundarySurface);
void ImplementBoundary();
#endif
#endif // BOUNDARY_H