MFIX  2016-1
geometry_mod.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
2 ! C
3 ! Module name: geometry C
4 ! Purpose: Common block containing geometry and discretization data C
5 ! C
6 ! Author: M. Syamlal Date: dd-mmm-yy C
7 ! C
8 ! C
9 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
10 
11  MODULE geometry
12 
13  Use param, only: dim_i, dim_j, dim_k
14 
15 
16 ! Coordinates: CARTESIAN, CYLINDRICAL
17  CHARACTER(LEN=16) coordinates
18 
19 ! Indicates whether x or r direction is not considered
20  LOGICAL :: no_i
21 ! Indicates whether x or r direction is considered
22  LOGICAL :: do_i
23 ! Indicates whether y direction is not considered
24  LOGICAL :: no_j
25 ! Indicates whether y direction is considered
26  LOGICAL :: do_j
27 ! Indicates whether z or theta direction is not considered
28  LOGICAL :: no_k
29 ! Indicates whether z or theta direction is considered
30  LOGICAL :: do_k
31 
32 ! Reactor length in the x or r direction
33  DOUBLE PRECISION :: xlength
34 ! Reactor length in the y direction
35  DOUBLE PRECISION :: ylength
36 ! Reactor length in the z or theta direction
37  DOUBLE PRECISION :: zlength
38 
39 ! Starting index in the x or r direction
40  INTEGER :: imin1
41 ! Starting index in the y direction
42  INTEGER :: jmin1
43 ! Starting index in the z or theta direction
44  INTEGER :: kmin1
45 
46 ! Number of cells in the x or r direction
47  INTEGER :: imax
48 ! Number of cells in the y direction
49  INTEGER :: jmax
50 ! Number of cells in the z or theta direction
51  INTEGER :: kmax
52 
53 ! Number of cells in the x or r direction + 1
54  INTEGER :: imax1
55 ! Number of cells in the y direction + 1
56  INTEGER :: jmax1
57 ! Number of cells in the z or theta direction + 1
58  INTEGER :: kmax1
59 
60 ! Number of cells in the x or r direction + 2
61  INTEGER :: imax2
62 ! Number of cells in the y direction + 2
63  INTEGER :: jmax2
64 ! Number of cells in the z or theta direction + 2
65  INTEGER :: kmax2
66 
67 ! Cell sizes in the x or r direction
68  DOUBLE PRECISION :: dx (0:dim_i)
69 ! Cell sizes in the y direction
70  DOUBLE PRECISION :: dy (0:dim_j)
71 ! Cell sizes in the z or theta direction
72  DOUBLE PRECISION :: dz (0:dim_k)
73 ! Starting value of X. This quantity is useful for
74 ! simulating an annular cylindrical region.
75  DOUBLE PRECISION :: xmin
76 
77 ! IMAX2 * JMAX2
78  INTEGER :: ijmax2
79 ! IMAX2 * JMAX2 * KMAX2
80  INTEGER :: ijkmax2
81 ! IMAX2 * JMAX2 * KMAX2
82  INTEGER :: ijkmax3
83 ! IJMAX2 + 1
84  INTEGER :: ijkmin1
85 ! IJKMAX2 - IJMAX2
86  INTEGER :: ijkmax1
87 
88 ! For discretization in parallel
89  INTEGER :: imin2, jmin2, kmin2
90  INTEGER :: imin3, jmin3, kmin3
91  INTEGER :: imax3, jmax3, kmax3
92 
93 ! For 4th order discretization in parallel
94  INTEGER :: imin4, jmin4, kmin4
95  INTEGER :: imax4, jmax4, kmax4
96  INTEGER :: ijkmax4, ijkmin4
97 
98 ! Cell flags.
99  INTEGER, DIMENSION(:), ALLOCATABLE :: flag
100 ! Cell flags with 3rd layer.
101  INTEGER, DIMENSION(:), ALLOCATABLE :: flag3
102 ! Flag for the East surface
103  INTEGER, DIMENSION(:), ALLOCATABLE :: flag_e
104 ! Flag for North surface
105  INTEGER, DIMENSION(:), ALLOCATABLE :: flag_n
106 ! Flag for Top surface
107  INTEGER, DIMENSION(:), ALLOCATABLE :: flag_t
108 ! Cell flags (bc/ic conditions)
109 ! Allocatable type causes PG internal error, Ed's soln: pointers
110 ! CHARACTER(LEN=3), DIMENSION(:), ALLOCATABLE :: ICBC_FLAG
111  character(LEN=3), dimension(:), pointer :: icbc_flag
112 
113 ! 1 / dx_i
114  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: odx
115 ! 1 / dy_j
116  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: ody
117 ! 1 / dz_k
118  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: odz
119 
120 ! 1 / dx_i+1/2
121  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: odx_e
122 ! 1 / dy_j+1/2
123  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: ody_n
124 ! 1 / dz_k+1/2
125  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: odz_t
126 
127 ! Radial location at cell center (x_i).
128 ! X = 1 in Cartesian coordinates.
129  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: x
130 ! Azimuthal location at cell center (z_k).
131  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: z
132 ! Radial location at East face (x_i+1/2).
133 ! X_E = 1 in Cartesian coordinates.
134  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: x_e
135 ! Azimuthal location at top face (z_k+1/2).
136  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: z_t
137 
138 ! Reciprocal of radial location at cell center (1/x_i).
139 ! oX = 1 in Cartesian coordinates.
140  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: ox
141 ! Reciprocal of radial location at East face (1/x_i+1/2).
142 ! oX_E = 1 in Cartesian coordinates.
143  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: ox_e
144 
145 
146 ! one or more periodic boundary condition is used
147  LOGICAL :: cyclic
148 ! Variable to flag periodic boundary condition in X
149  LOGICAL :: cyclic_x
150 ! Variable to flag periodic boundary condition in Y
151  LOGICAL :: cyclic_y
152 ! Variable to flag periodic boundary condition in Z
153  LOGICAL :: cyclic_z
154 ! Variable to flag periodic bc with pressure drop in X
155  LOGICAL :: cyclic_x_pd
156 ! Variable to flag periodic bc with pressure drop in Y
157  LOGICAL :: cyclic_y_pd
158 ! Variable to flag periodic bc with pressure drop in Z
159  LOGICAL :: cyclic_z_pd
160 ! Variable to flag periodic bc with mass flux in X
161  LOGICAL :: cyclic_x_mf
162 ! Variable to flag periodic bc with mass flux in Y
163  LOGICAL :: cyclic_y_mf
164 ! Variable to flag periodic bc with mass flux in Z
165  LOGICAL :: cyclic_z_mf
166 
167 ! Variable to flag cylindrical coordinates
168  LOGICAL :: cylindrical
169 
170 ! Variables for cylindrical_2d simulation
171 !------------------------------------------------------------>>>
172 ! Turn on the cylindrical_2d simulation
173  logical :: cylindrical_2d
174 ! Variables for cylindrical_2d simulation
175 ! Half width of the plate in term of cell count
176  integer :: i_cyl_num
177 ! Variables for cylindrical_2d simulation
178 ! Cell number used to smooth the transition from plate to wedge
179  integer :: i_cyl_transition
180 ! For cylindrical_2d simulation
181  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: cyl_x
182 ! For cylindrical_2d simulation
183  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: cyl_x_e
184 !------------------------------------------------------------<<<
185 
186 ! Factor for x direction averaging of U velocity: FX_i
187  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: fx
188 ! 1 - FX_i
189  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: fx_bar
190 ! Factor for x direction averaging of scalars: FX_i+1/2
191  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: fx_e
192 ! 1 - FX_i+1/2
193  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: fx_e_bar
194 
195 ! Factor for y direction averaging of scalars: FY_j+1/2
196  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: fy_n
197 ! 1 - FY_j+1/2
198  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: fy_n_bar
199 
200 ! Factor for z direction averaging of scalars: FZ_k+1/2
201  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: fz_t
202 ! 1 - FZ_k+1/2
203  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: fz_t_bar
204 
205 ! East face area - scalar cell
206  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: ayz
207 ! North face area - scalar cell
208  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: axz
209 ! Top face area - scalar cell
210  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: axy
211 ! Cell volume - scalar cell
212  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: vol
213 
214 ! Total volume of cell's DES stencil neighbors
215  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: vol_surr
216 
217 ! East face area - U cell
218  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: ayz_u
219 ! North face area - U cell
220  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: axz_u
221 ! Top face area - U cell
222  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: axy_u
223 ! Cell volume - U cell
224  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: vol_u
225 
226 ! East face area - V cell
227  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: ayz_v
228 ! North face area - V cell
229  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: axz_v
230 ! Top face area - V cell
231  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: axy_v
232 ! Cell volume - V cell
233  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: vol_v
234 
235 ! East face area - W cell
236  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: ayz_w
237 ! North face area - W cell
238  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: axz_w
239 ! Top face area - W cell
240  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: axy_w
241 ! Cell volume - W cell
242  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: vol_w
243 
244 ! Indicates whether to use loop over "core" cells (with same
245 ! CELL_CLASS) in LEQSOL_MOD for vectorization/performance
246  LOGICAL :: use_corecell_loop
247 
248  INTEGER :: core_istart, core_iend
249  INTEGER :: core_jstart, core_jend
250  INTEGER :: core_kstart, core_kend
251 
252  END MODULE geometry
character(len=16) coordinates
Definition: geometry_mod.f:17
double precision, dimension(:), allocatable fx
Definition: geometry_mod.f:187
double precision, dimension(:), allocatable vol_w
Definition: geometry_mod.f:242
integer imax2
Definition: geometry_mod.f:61
double precision, dimension(:), allocatable vol_surr
Definition: geometry_mod.f:215
integer, parameter dim_i
Definition: param_mod.f:77
integer ijkmin4
Definition: geometry_mod.f:96
double precision, dimension(:), allocatable ox_e
Definition: geometry_mod.f:143
logical no_i
Definition: geometry_mod.f:20
double precision, dimension(:), allocatable ody
Definition: geometry_mod.f:116
double precision, dimension(:), allocatable odx
Definition: geometry_mod.f:114
integer imax3
Definition: geometry_mod.f:91
double precision, dimension(:), allocatable cyl_x
Definition: geometry_mod.f:181
integer, dimension(:), allocatable flag3
Definition: geometry_mod.f:101
integer ijkmax2
Definition: geometry_mod.f:80
integer core_jend
Definition: geometry_mod.f:249
double precision, dimension(:), allocatable axy
Definition: geometry_mod.f:210
double precision, dimension(:), allocatable cyl_x_e
Definition: geometry_mod.f:183
double precision, dimension(:), allocatable x_e
Definition: geometry_mod.f:134
integer core_jstart
Definition: geometry_mod.f:249
logical cyclic_z_mf
Definition: geometry_mod.f:165
integer kmin4
Definition: geometry_mod.f:94
integer ijkmax1
Definition: geometry_mod.f:86
double precision, dimension(0:dim_j) dy
Definition: geometry_mod.f:70
double precision, dimension(:), allocatable z_t
Definition: geometry_mod.f:136
integer imax4
Definition: geometry_mod.f:95
logical cyclic_z
Definition: geometry_mod.f:153
integer core_kend
Definition: geometry_mod.f:250
double precision, dimension(:), allocatable ayz_u
Definition: geometry_mod.f:218
double precision, dimension(0:dim_k) dz
Definition: geometry_mod.f:72
double precision, dimension(:), allocatable ayz
Definition: geometry_mod.f:206
character(len=3), dimension(:), pointer icbc_flag
Definition: geometry_mod.f:111
integer jmin2
Definition: geometry_mod.f:89
integer imin3
Definition: geometry_mod.f:90
logical cyclic_z_pd
Definition: geometry_mod.f:159
integer ijkmin1
Definition: geometry_mod.f:84
double precision, dimension(:), allocatable ayz_v
Definition: geometry_mod.f:227
integer imax
Definition: geometry_mod.f:47
double precision, dimension(:), allocatable axz_u
Definition: geometry_mod.f:220
integer ijkmax3
Definition: geometry_mod.f:82
integer core_kstart
Definition: geometry_mod.f:250
double precision, dimension(:), allocatable ody_n
Definition: geometry_mod.f:123
double precision, dimension(:), allocatable fz_t
Definition: geometry_mod.f:201
integer kmax4
Definition: geometry_mod.f:95
integer i_cyl_num
Definition: geometry_mod.f:176
double precision, dimension(:), allocatable fx_e_bar
Definition: geometry_mod.f:193
integer kmax1
Definition: geometry_mod.f:58
integer imin4
Definition: geometry_mod.f:94
double precision, dimension(:), allocatable fx_e
Definition: geometry_mod.f:191
integer ijkmax4
Definition: geometry_mod.f:96
double precision, dimension(:), allocatable odx_e
Definition: geometry_mod.f:121
logical cyclic_y_pd
Definition: geometry_mod.f:157
integer, parameter dim_j
Definition: param_mod.f:79
integer imax1
Definition: geometry_mod.f:54
double precision, dimension(:), allocatable axy_v
Definition: geometry_mod.f:231
integer jmax2
Definition: geometry_mod.f:63
integer core_iend
Definition: geometry_mod.f:248
double precision, dimension(:), allocatable ox
Definition: geometry_mod.f:140
logical cyclic_y
Definition: geometry_mod.f:151
integer jmax3
Definition: geometry_mod.f:91
double precision, dimension(0:dim_i) dx
Definition: geometry_mod.f:68
logical do_j
Definition: geometry_mod.f:26
integer kmax2
Definition: geometry_mod.f:65
logical cyclic_y_mf
Definition: geometry_mod.f:163
double precision xlength
Definition: geometry_mod.f:33
integer jmax1
Definition: geometry_mod.f:56
double precision, dimension(:), allocatable axz
Definition: geometry_mod.f:208
double precision, dimension(:), allocatable ayz_w
Definition: geometry_mod.f:236
logical cyclic_x
Definition: geometry_mod.f:149
Definition: param_mod.f:2
logical cyclic_x_mf
Definition: geometry_mod.f:161
integer jmin3
Definition: geometry_mod.f:90
integer kmax
Definition: geometry_mod.f:51
logical no_k
Definition: geometry_mod.f:28
integer jmin4
Definition: geometry_mod.f:94
integer ijmax2
Definition: geometry_mod.f:78
logical use_corecell_loop
Definition: geometry_mod.f:246
integer jmin1
Definition: geometry_mod.f:42
integer, dimension(:), allocatable flag_e
Definition: geometry_mod.f:103
integer kmax3
Definition: geometry_mod.f:91
logical do_k
Definition: geometry_mod.f:30
logical cyclic_x_pd
Definition: geometry_mod.f:155
double precision, dimension(:), allocatable axz_w
Definition: geometry_mod.f:238
double precision, dimension(:), allocatable odz
Definition: geometry_mod.f:118
logical no_j
Definition: geometry_mod.f:24
logical cylindrical
Definition: geometry_mod.f:168
double precision, dimension(:), allocatable fy_n
Definition: geometry_mod.f:196
double precision, dimension(:), allocatable axy_w
Definition: geometry_mod.f:240
integer kmin3
Definition: geometry_mod.f:90
double precision xmin
Definition: geometry_mod.f:75
logical cyclic
Definition: geometry_mod.f:147
double precision, dimension(:), allocatable vol_u
Definition: geometry_mod.f:224
integer jmax
Definition: geometry_mod.f:49
integer imin2
Definition: geometry_mod.f:89
logical do_i
Definition: geometry_mod.f:22
double precision ylength
Definition: geometry_mod.f:35
integer, dimension(:), allocatable flag
Definition: geometry_mod.f:99
double precision, dimension(:), allocatable z
Definition: geometry_mod.f:131
integer imin1
Definition: geometry_mod.f:40
integer, parameter dim_k
Definition: param_mod.f:81
integer i_cyl_transition
Definition: geometry_mod.f:179
double precision, dimension(:), allocatable fx_bar
Definition: geometry_mod.f:189
double precision, dimension(:), allocatable vol
Definition: geometry_mod.f:212
double precision, dimension(:), allocatable axy_u
Definition: geometry_mod.f:222
integer, dimension(:), allocatable flag_n
Definition: geometry_mod.f:105
double precision, dimension(:), allocatable odz_t
Definition: geometry_mod.f:125
logical cylindrical_2d
Definition: geometry_mod.f:173
integer kmin1
Definition: geometry_mod.f:44
double precision, dimension(:), allocatable fz_t_bar
Definition: geometry_mod.f:203
integer jmax4
Definition: geometry_mod.f:95
double precision, dimension(:), allocatable axz_v
Definition: geometry_mod.f:229
integer core_istart
Definition: geometry_mod.f:248
double precision, dimension(:), allocatable x
Definition: geometry_mod.f:129
double precision zlength
Definition: geometry_mod.f:37
double precision, dimension(:), allocatable fy_n_bar
Definition: geometry_mod.f:198
integer, dimension(:), allocatable flag_t
Definition: geometry_mod.f:107
integer kmin2
Definition: geometry_mod.f:89
double precision, dimension(:), allocatable vol_v
Definition: geometry_mod.f:233