-
Notifications
You must be signed in to change notification settings - Fork 7
/
boundary.h
163 lines (150 loc) · 5.93 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
///////////////////////////////////////////////////////////////////////////////
///
/// \file boundary.h
///
/// \brief Set the boundary conditions
///
/// \author Mingang Jin, Qingyan Chen
/// Purdue University
/// Wangda Zuo
/// University of Miami
///
/// \date 8/3/2013
///
/// This file provides functions that are used for setting the boundary
/// conditons.
/// It starts with \c set_bnd(). Then different subroutines are called
/// according to the properties of variables.
///
///////////////////////////////////////////////////////////////////////////////
#ifndef _BOUNDARY_H
#define _BOUNDARY_H
#endif
#ifndef _DATA_STRUCTURE_H
#define _DATA_STRUCTURE_H
#include "data_structure.h"
#endif
#ifndef _GEOMETRY_H
#define _GEOMETRY_H
#include "geometry.h"
#endif
#ifndef _UTILITY_H
#define _UTILITY_H
#include "utility.h"
#endif
#ifndef _CHEN_ZERO_EQU_MODEL_H
#define _CHEN_ZERO_EQU_MODEL_H
#include "chen_zero_equ_model.h"
#endif
///////////////////////////////////////////////////////////////////////////////
/// Entrance of setting boundary conditions
///
/// Specific boundary conditions will be selected according to the variable
/// type.
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param var_type The type of variable
///\param index Index of trace substances or species
///\param psi Pointer to the variable needing the boundary conditions
///\param BINDEX Pointer to boundary index
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int set_bnd(PARA_DATA *para, REAL **var, int var_type, int index, REAL *psi,
int **BINDEX) ;
///////////////////////////////////////////////////////////////////////////////
/// Set boundary conditions for velocity
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param var_type The type of variable
///\param psi Pointer to the variable needing the boundary conditions
///\param BINDEX Pointer to boundary index
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int set_bnd_vel(PARA_DATA *para, REAL **var, int var_type, REAL *vx,
int **BINDEX);
///////////////////////////////////////////////////////////////////////////////
/// Set the boundary condition for temperature
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param var_type The type of variable
///\param psi Pointer to the variable needing the boundary conditions
///\param BINDEX Pointer to boundary index
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int set_bnd_temp(PARA_DATA *para, REAL **var, int var_type, REAL *psi,
int **BINDEX);
///////////////////////////////////////////////////////////////////////////////
/// Set the boundary condition for trace substance
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param trace_index Index of the trace substance
///\param psi Pointer to the variable needing the boundary conditions
///\param BINDEX Pointer to boundary index
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int set_bnd_trace(PARA_DATA *para, REAL **var, int trace_index, REAL *psi,
int **BINDEX);
///////////////////////////////////////////////////////////////////////////////
/// Set the boundary condition for pressure
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param p Pointer to pressure variable
///\param BINDEX Pointer to boundary index
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int set_bnd_pressure(PARA_DATA *para, REAL **var, REAL *p,int **BINDEX);
///////////////////////////////////////////////////////////////////////////////
/// Enforce the mass conservation by adjusting the outlet flow rate
///
/// The detailes was published in the paper
/// "W. Zuo, J. Hu, Q. Chen 2010.
/// Improvements on FFD modeling by using different numerical schemes,
/// Numerical Heat Transfer, Part B Fundamentals, 58(1), 1-16."
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param BINDEX Pointer to boundary index
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int mass_conservation(PARA_DATA *para, REAL **var, int **BINDEX);
///////////////////////////////////////////////////////////////////////////////
/// Get the mass flow difference divided by outflow area
///
/// The detailes was published in the paper
/// "W. Zuo, J. Hu, Q. Chen 2010.
/// Improvements on FFD modeling by using different numerical schemes,
/// Numerical Heat Transfer, Part B Fundamentals, 58(1), 1-16."
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param BINDEX Pointer to boundary index
///
///\return Mass flow difference divided by the outflow area
///////////////////////////////////////////////////////////////////////////////
REAL adjust_velocity(PARA_DATA *para, REAL **var, int **BINDEX);
///////////////////////////////////////////////////////////////////////////////
/// Calculate convective hrat transfer coefficient
///
///\param para Pointer to FFD parameters
///\param var Pointer to FFD simulation variables
///\param i I-index of the cell
///\param j J-index of the cell
///\param k K-index of the cell
///\param D distance from the cell center to the wall
///
///\return Mass flow difference divided by the outflow area
///////////////////////////////////////////////////////////////////////////////
REAL h_coef(PARA_DATA *para, REAL **var, int i, int j, int k, REAL D);