File: /nfs/home/0/users/jenkins/mfix.git/model/geometry_mod.f

1     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
2     !                                                                      C
3     !  Module name: geometry.inc                                           C
4     !  Purpose: Common block containing geometry and discretization data   C
5     !                                                                      C
6     !  Author: M. Syamlal                                 Date: dd-mmm-yy  C
7     !  Reviewer:                                          Date: dd-mmm-yy  C
8     !                                                                      C
9     !  Revision Number: 1                                                  C
10     !  Purpose: Add variables DTODX_E, DToXDX_E, DToDY_N, DToDZ_T for      C
11     !           Variable Grid Size Capability                              C
12     !  Author: W. Rogers                                  Date: 16-APR-92  C
13     !  Reviewer:                                          Date: dd-mmm-yy  C
14     !                                                                      C
15     !  Literature/Document References: None                                C
16     !                                                                      C
17     !  Variables referenced: None                                          C
18     !  Variables modified: None                                            C
19     !                                                                      C
20     !  Local variables: None                                               C
21     !                                                                      C
22     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
23     
24     
25           MODULE geometry
26     
27     
28           Use param
29           Use param1
30     
31     
32     !
33     !                      Coordinates: CARTESIAN, CYLINDRICAL
34           CHARACTER(LEN=16)     COORDINATES
35     !
36     !                      Indicates whether x or r direction is not
37     !                      considered
38           LOGICAL          NO_I
39     !
40     !                      Indicates whether x or r direction is
41     !                      considered
42           LOGICAL          DO_I
43     !
44     !                      Starting index in the x or r direction
45           INTEGER          IMIN1
46     !
47     !                      Number of cells in the x or r direction
48           INTEGER          IMAX
49     !
50     !                      Number of cells in the x or r direction + 1
51           INTEGER          IMAX1
52     !
53     !                      Number of cells in the x or r direction + 2
54           INTEGER          IMAX2
55     !
56     !                      Cell sizes in the x or r direction
57           DOUBLE PRECISION DX (0:DIM_I)
58     !
59     !                      Starting value of X.  This quantity is useful for
60     !                      simulating an annular cylindrical region.
61           DOUBLE PRECISION XMIN
62     !
63     !                      Reactor length in the x or r direction
64           DOUBLE PRECISION XLENGTH
65     !
66     !                      Indicates whether y direction is not considered
67           LOGICAL          NO_J
68     !
69     !                      Indicates whether y direction is considered
70           LOGICAL          DO_J
71     !
72     !                      Starting index in the y direction
73           INTEGER          JMIN1
74     !
75     !                      Number of cells in the y direction
76           INTEGER          JMAX
77     !
78     !                      Number of cells in the y direction + 1
79           INTEGER          JMAX1
80     !
81     !                      Number of cells in the y direction + 2
82           INTEGER          JMAX2
83     !
84     !                      Cell sizes in the y direction
85           DOUBLE PRECISION DY (0:DIM_J)
86     !
87     !                      Reactor length in the y direction
88           DOUBLE PRECISION YLENGTH
89     !
90     !                      Indicates whether z or theta direction is not
91     !                      considered
92           LOGICAL          NO_K
93     !
94     !                      Indicates whether z or theta direction is
95     !                      considered
96           LOGICAL          DO_K
97     !
98     !                      Starting index in the z or theta direction
99           INTEGER          KMIN1
100     !
101     !                      Number of cells in the z or theta direction
102           INTEGER          KMAX
103     !
104     !                      Number of cells in the z or theta direction + 1
105           INTEGER          KMAX1
106     !
107     !                      Number of cells in the z or theta direction + 2
108           INTEGER          KMAX2
109     !
110     !                      Cell sizes in the z or theta direction
111           DOUBLE PRECISION DZ (0:DIM_K)
112     !
113     !                      Reactor length in the z or theta direction
114           DOUBLE PRECISION ZLENGTH
115     !
116     !                      IMAX2 * JMAX2
117           INTEGER          IJMAX2
118     !
119     !                      IMAX2 * JMAX2 * KMAX2
120           INTEGER          IJKMAX2
121     !
122     !                      IMAX2 * JMAX2 * KMAX2
123           INTEGER          IJKMAX3
124     !
125     !                      IJMAX2 + 1
126           INTEGER          IJKMIN1
127     !
128     !                      IJKMAX2 - IJMAX2
129           INTEGER          IJKMAX1
130     !
131     !                      Cell flags.
132           INTEGER, DIMENSION(:), ALLOCATABLE ::           FLAG
133     !
134     !                      Cell flags with 3rd layer.
135           INTEGER, DIMENSION(:), ALLOCATABLE ::           FLAG3
136     !
137     !                      Flag for the East surface
138           INTEGER, DIMENSION(:), ALLOCATABLE ::           FLAG_E
139     !
140     !                      Flag for North surface
141           INTEGER, DIMENSION(:), ALLOCATABLE ::           FLAG_N
142     !
143     !                      Flag for Top surface
144           INTEGER, DIMENSION(:), ALLOCATABLE ::           FLAG_T
145     !
146     !                      Cell flags (bc/ic conditions)
147     !//PG allocatable type causes PG internal error, Ed's soln: pointers
148     !      CHARACTER(LEN=3), DIMENSION(:), ALLOCATABLE :: ICBC_FLAG
149           character(LEN=3),  dimension(:), pointer :: icbc_flag
150     !
151     !                      1 / dx_i
152           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  oDX
153     !
154     !                      1 / dy_j
155           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  oDY
156     !
157     !                      1 / dz_k
158           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  oDZ
159     !
160     !                      1 / dx_i+1/2
161           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  oDX_E
162     !
163     !                      1 / dy_j+1/2
164           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  oDY_N
165     !
166     !                      1 / dz_k+1/2
167           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  oDZ_T
168     !
169     !                      Radial location at cell center (x_i).
170     !                      X = 1 in Cartesian coordinates.
171           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  X
172     
173     !                      For cylindrical_2d simulation
174           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  cyl_X
175     !
176     !                      Radial location at East face (x_i+1/2).
177     !                      X_E = 1 in Cartesian coordinates.
178           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  X_E
179     
180     !                      For cylindrical_2d simulation
181           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  cyl_X_E
182     !
183     !                      Reciprocal of radial location at cell center (1/x_i).
184     !                      oX = 1 in Cartesian coordinates.
185           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  oX
186     !
187     !                      Reciprocal of radial location at East face (1/x_i+1/2).
188     !                      oX_E = 1 in Cartesian coordinates.
189           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  oX_E
190     !
191     !                      Azimuthal location at cell center (z_k).
192           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  Z
193     !
194     !                      Azimuthal location at top face (z_k+1/2).
195           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  Z_T
196     !
197     !                      one or more periodic boundary condition is used
198           LOGICAL          CYCLIC
199     !
200     !                      Variable to flag periodic boundary condition in X
201           LOGICAL          CYCLIC_X
202     !
203     !                      Variable to flag periodic boundary condition in Y
204           LOGICAL          CYCLIC_Y
205     !
206     !                      Variable to flag periodic boundary condition in Z
207           LOGICAL          CYCLIC_Z
208     !
209     !                      Variable to flag periodic bc with pressure drop in X
210           LOGICAL          CYCLIC_X_PD
211     !
212     !                      Variable to flag periodic bc with pressure drop in Y
213           LOGICAL          CYCLIC_Y_PD
214     !
215     !                      Variable to flag periodic bc with pressure drop in Z
216           LOGICAL          CYCLIC_Z_PD
217     !
218     !                      Variable to flag periodic bc with mass flux in X
219           LOGICAL          CYCLIC_X_MF
220     !
221     !                      Variable to flag periodic bc with mass flux in Y
222           LOGICAL          CYCLIC_Y_MF
223     !
224     !                      Variable to flag periodic bc with mass flux in Z
225           LOGICAL          CYCLIC_Z_MF
226     !
227     !                      Variable to flag cylindrical coordinates
228           LOGICAL          CYLINDRICAL
229     
230     !                      Variables for cylindrical_2d simulation
231     !		       Turn on the cylindrical_2d simulation
232           logical          CYLINDRICAL_2D
233     !		       Variables for cylindrical_2d simulation
234     !		       Half width of the plate in term of cell count
235           integer          I_CYL_NUM
236     !		       Variables for cylindrical_2d simulation
237     !		       Cell number used to smooth the transition from plate to wedge
238           integer          I_CYL_TRANSITION
239     
240     !
241     !                      Factor for x direction averaging of U velocity: FX_i
242           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  FX
243     !
244     !                      1 - FX_i
245           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  FX_bar
246     !
247     !                      Factor for x direction averaging of scalars: FX_i+1/2
248           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  FX_E
249     !
250     !                      1 - FX_i+1/2
251           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  FX_E_bar
252     !
253     !                      Factor for y direction averaging of scalars: FY_j+1/2
254           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  FY_N
255     !
256     !                      1 - FY_j+1/2
257           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  FY_N_bar
258     !
259     !                      Factor for z direction averaging of scalars: FZ_k+1/2
260           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  FZ_T
261     !
262     !                      1 - FZ_k+1/2
263           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  FZ_T_bar
264     !
265     !                      East face area - scalar cell
266           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AYZ
267     !
268     !                      North face area - scalar cell
269           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AXZ
270     !
271     !                      Top face area - scalar cell
272           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AXY
273     !
274     !                      Cell volume - scalar cell
275           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  VOL
276     
277     !                      Total volume of cell's DES stencil neighbors
278           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  VOL_SURR
279     !
280     !                      East face area - U cell
281           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AYZ_U
282     !
283     !                      North face area - U cell
284           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AXZ_U
285     !
286     !                      Top face area - U cell
287           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AXY_U
288     !
289     !                      Cell volume - U cell
290           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  VOL_U
291     !
292     !                      East face area - V cell
293           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AYZ_V
294     !
295     !                      North face area - V cell
296           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AXZ_V
297     !
298     !                      Top face area - V cell
299           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AXY_V
300     !
301     !                      Cell volume - V cell
302           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  VOL_V
303     !
304     !                      East face area - W cell
305           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AYZ_W
306     !
307     !                      North face area - W cell
308           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AXZ_W
309     !
310     !                      Top face area - W cell
311           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  AXY_W
312     !
313     !                      Cell volume - W cell
314           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  VOL_W
315     !
316     !
317               common /geometry_i/imin1, imax1, jmin1, jmax1 !for Linux
318     
319     !     ADDED FOLLOWING VARIABLES TO TAKE CARE OF THE NEW CONVENTION - Pannala - 08/11/99
320     
321           INTEGER IMIN3,JMIN3,KMIN3,IMAX3,JMAX3,KMAX3, IMIN2, JMIN2, KMIN2
322     
323     !     ADDED FOLLOWING VARIABLES TO TAKE CARE OF 4th order discretization in parallel
324     
325           INTEGER IMIN4,JMIN4,KMIN4,IMAX4,JMAX4,KMAX4, IJKMAX4, IJKMIN4
326     
327     !!!HPF$ align FLAG(:) with TT(:)
328     !!!HPF$ align FLAG_E(:) with TT(:)
329     !!!HPF$ align FLAG_N(:) with TT(:)
330     !!!HPF$ align FLAG_T(:) with TT(:)
331     !!!!HPF$ align ICBC_FLAG(:) with TT(:)
332     !!!HPF$ align AYZ(:) with TT(:)
333     !!!HPF$ align AXZ(:) with TT(:)
334     !!!HPF$ align AXY(:) with TT(:)
335     !!!HPF$ align VOL(:) with TT(:)
336     !!!HPF$ align AYZ_U(:) with TT(:)
337     !!!HPF$ align AXZ_U(:) with TT(:)
338     !!!HPF$ align AXY_U(:) with TT(:)
339     !!!HPF$ align VOL_U(:) with TT(:)
340     !!!HPF$ align AYZ_V(:) with TT(:)
341     !!!HPF$ align AXZ_V(:) with TT(:)
342     !!!HPF$ align AXY_V(:) with TT(:)
343     !!!HPF$ align VOL_V(:) with TT(:)
344     !!!HPF$ align AYZ_W(:) with TT(:)
345     !!!HPF$ align AXZ_W(:) with TT(:)
346     !!!HPF$ align AXY_W(:) with TT(:)
347     !!!HPF$ align VOL_W(:) with TT(:)
348     
349           END MODULE geometry
350     
351     !// Comments on the modifications for DMP version implementation
352     !//PG allocatable type causes PG internal error, Ed's soln: pointers
353