File: N:\mfix\model\bc_mod.f

1     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
2     !                                                                      C
3     !  Module name: bc.inc                                                 C
4     !  Purpose: Common block containing boundary conditions 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:                                                    C
10     !  Purpose:                                                            C
11     !  Author:                                            Date: dd-mmm-yy  C
12     !  Reviewer:                                          Date: dd-mmm-yy  C
13     !                                                                      C
14     !  Literature/Document References: None                                C
15     !                                                                      C
16     !  Variables referenced: None                                          C
17     !  Variables modified: None                                            C
18     !                                                                      C
19     !  Local variables: None                                               C
20     !                                                                      C
21     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
22     
23           MODULE bc
24     
25           Use param, only: dimension_bc, dim_scalar, dim_m, dim_n_g, dim_n_s
26     
27     !
28     !                      x coordinate of the west face of a region where
29     !                      boundary conditions are specified
30           DOUBLE PRECISION BC_X_w (DIMENSION_BC)
31     !
32     !                      x coordinate of the east face of a region where
33     !                      boundary conditions are specified
34           DOUBLE PRECISION BC_X_e (DIMENSION_BC)
35     !
36     !                      y coordinate of the south face of a region where
37     !                      boundary conditions are specified
38           DOUBLE PRECISION BC_Y_s (DIMENSION_BC)
39     !
40     !                      y coordinate of the north face of a region where
41     !                      boundary conditions are specified
42           DOUBLE PRECISION BC_Y_n (DIMENSION_BC)
43     !
44     !                      z coordinate of the bottom face of a region where
45     !                      boundary conditions are specified
46           DOUBLE PRECISION BC_Z_b (DIMENSION_BC)
47     !
48     !                      z coordinate of the top face of a region where
49     !                      boundary conditions are specified
50           DOUBLE PRECISION BC_Z_t (DIMENSION_BC)
51     !
52     !                      i index of the west face of a region where
53     !                      boundary conditions are specified
54           INTEGER          BC_I_w (DIMENSION_BC)
55     !
56     !                      i index of the east face of a region where
57     !                      boundary conditions are specified
58           INTEGER          BC_I_e (DIMENSION_BC)
59     !
60     !                      j index of the south face of a region where
61     !                      boundary conditions are specified
62           INTEGER          BC_J_s (DIMENSION_BC)
63     !
64     !                      j index of the north face of a region where
65     !                      boundary conditions are specified
66           INTEGER          BC_J_n (DIMENSION_BC)
67     !
68     !                      k index of the bottom face of a region where
69     !                      boundary conditions are specified
70           INTEGER          BC_K_b (DIMENSION_BC)
71     !
72     !                      k index of the top face of a region where
73     !                      boundary conditions are specified
74           INTEGER          BC_K_t (DIMENSION_BC)
75     !
76     !                      Void fraction in a specified boundary region
77           DOUBLE PRECISION BC_EP_g (DIMENSION_BC)
78     !
79     !                      Gas pressure in a specified boundary region
80           DOUBLE PRECISION BC_P_g (DIMENSION_BC)
81     !
82     !                      Microscopic density of gas in a specified
83     !                      boundary region
84           DOUBLE PRECISION BC_RO_g (DIMENSION_BC)
85     !
86     !                      Macroscopic density of gas in a specified
87     !                      boundary region
88           DOUBLE PRECISION BC_ROP_g (DIMENSION_BC)
89     !
90     !                      Macroscopic density of solids phases in a
91     !                      specified boundary region
92           DOUBLE PRECISION BC_ROP_s (DIMENSION_BC, DIM_M)
93           DOUBLE PRECISION BC_EP_s (DIMENSION_BC, DIM_M)
94     !
95     !                      Gas phase temperature in a specified boundary
96     !                      region
97           DOUBLE PRECISION BC_T_g (DIMENSION_BC)
98     !
99     !                      Solids phase temperature in a specified
100     !                      boundary region
101           DOUBLE PRECISION BC_T_s (DIMENSION_BC, DIM_M)
102     !
103     !                      Solids phase granular temperature in a specified
104     !                      boundary region
105           DOUBLE PRECISION BC_Theta_m (DIMENSION_BC, DIM_M)
106     !
107     !                      x-component of gas velocity in a specified
108     !                      boundary region
109           DOUBLE PRECISION BC_U_g (DIMENSION_BC)
110     !
111     !                      x-component of solids phase velocity in a
112     !                      specified boundary region
113           DOUBLE PRECISION BC_U_s (DIMENSION_BC, DIM_M)
114     !
115     !                      y-component of gas velocity in a specified
116     !                      boundary region
117           DOUBLE PRECISION BC_V_g (DIMENSION_BC)
118     !
119     !                      y-component of solids phase velocity in a
120     !                      specified boundary region
121           DOUBLE PRECISION BC_V_s (DIMENSION_BC, DIM_M)
122     !
123     !                      z-component of gas velocity in a specified
124     !                      boundary region
125           DOUBLE PRECISION BC_W_g (DIMENSION_BC)
126     !
127     !                      z-component of solids phase velocity in a
128     !                      specified boundary region
129           DOUBLE PRECISION BC_W_s (DIMENSION_BC, DIM_M)
130     !
131     ! JFD: For cut cells, define the magnitude of velocity that will be enforced
132     !      perpendicular to the cut face, for CG_MI boundary condition
133     !
134     !                      magnitude of gas velocity in a specified
135     !                      boundary region
136           DOUBLE PRECISION BC_VELMAG_g (DIMENSION_BC)
137     !
138     !                      magnitude of solids phase velocity in a
139     !                      specified boundary region
140           DOUBLE PRECISION BC_VELMAG_s (DIMENSION_BC, DIM_M)
141     
142     !
143     !                      Type of boundary: MASS_INFLOW, MASS_OUTFLOW,
144     !                      P_INFLOW, P_OUTFLOW, FREE_SLIP_WALL, NO_SLIP_WALL
145           CHARACTER(LEN=16)  ::   BC_TYPE (DIMENSION_BC)
146           INTEGER ::     BC_TYPE_ENUM (DIMENSION_BC)
147     
148           ENUM, BIND(C)
149              ENUMERATOR :: CG_NSW, CG_FSW, CG_PSW, CG_MI, NONE
150              ENUMERATOR :: NO_SLIP_WALL, FREE_SLIP_WALL, PAR_SLIP_WALL, NSW, FSW, PSW
151              ENUMERATOR :: P_OUTFLOW, MASS_OUTFLOW, OUTFLOW
152              ENUMERATOR :: P_INFLOW, MASS_INFLOW
153              ENUMERATOR :: CG_PO, CG_MO
154              ENUMERATOR :: BLANK
155              ENUMERATOR :: DUMMY
156           END ENUM
157     
158           ! Total number of valid BC types
159           INTEGER, PARAMETER :: DIM_BCTYPE = 21
160           ! Valid boundary condition types
161           CHARACTER(LEN=16), DIMENSION(1:DIM_BCTYPE) ::VALID_BC_TYPE = (/&
162                'MASS_INFLOW     ', 'MI              ',&
163                'MASS_OUTFLOW    ', 'MO              ',&
164                'P_INFLOW        ', 'PI              ',&
165                'P_OUTFLOW       ', 'PO              ',&
166                'FREE_SLIP_WALL  ', 'FSW             ',&
167                'NO_SLIP_WALL    ', 'NSW             ',&
168                'PAR_SLIP_WALL   ', 'PSW             ',&
169                'OUTFLOW         ', 'OF              ',&
170                'CG_NSW          ', 'CG_FSW          ',&
171                'CG_PSW          ', 'CG_MI           ',&
172                'CG_PO           '/)
173     
174           INTEGER, DIMENSION(1:DIM_BCTYPE) ::VALID_BC_TYPE_ENUM = (/&
175                MASS_INFLOW     , MASS_INFLOW      ,&
176                MASS_OUTFLOW    , MASS_OUTFLOW      ,&
177                P_INFLOW        , P_INFLOW      ,&
178                P_OUTFLOW       , P_OUTFLOW      ,&
179                FREE_SLIP_WALL  , FSW     ,&
180                NO_SLIP_WALL    , NSW     ,&
181                PAR_SLIP_WALL   , PSW     ,&
182                OUTFLOW         , OUTFLOW      ,&
183                CG_NSW          , CG_FSW  ,&
184                CG_PSW          , CG_MI   ,&
185                CG_PO           /)
186     
187     
188     !                      FLAG to specify if this PO BC applies to solid phase
189     !                      in discrete implementation or not. For example, setting
190     !                      Pressure outflow only for gas-phase.
191     
192           LOGICAL          BC_PO_APPLY_TO_DES (DIMENSION_BC)
193     
194     !                      Gas volumetric flow rate through the boundary
195           DOUBLE PRECISION BC_VOLFLOW_g (DIMENSION_BC)
196     !
197     !                      Solids volumetric flow rate through the boundary
198           DOUBLE PRECISION BC_VOLFLOW_s (DIMENSION_BC, DIM_M)
199     !
200     !                      Gas mass flow rate through the boundary
201           DOUBLE PRECISION BC_MASSFLOW_g (DIMENSION_BC)
202     !
203     !                      Solids mass flow rate through the boundary
204           DOUBLE PRECISION BC_MASSFLOW_s (DIMENSION_BC, DIM_M)
205     !
206     !                      Logical variable to determine whether a bc is defined
207            LOGICAL         BC_DEFINED (DIMENSION_BC)
208     !start kapil&anuj 01/19/98
209     !
210     !                      Logical variable to determine whether the partial
211     !                      slip bc of Johnson and Jackson is used
212            INTEGER         BC_JJ_PS (DIMENSION_BC)
213     !end   kapil&anuj 01/19/98
214     !
215     !                      Character variable with values W, E, S, N, B, and T
216     !                      to determine the flow plane of a flow cell
217            CHARACTER       BC_PLANE (DIMENSION_BC)
218     !
219     !                      The interval at the beginning when normal vel. is equal to
220     !                      BC_Jet_g0
221           DOUBLE PRECISION BC_DT_0 (DIMENSION_BC)
222     !
223     !                      Stored value of normal velocity
224           DOUBLE PRECISION BC_Jet_g (DIMENSION_BC)
225     !
226     !                      Value of normal vel. during the initial interval BC_DT_0
227           DOUBLE PRECISION BC_Jet_g0 (DIMENSION_BC)
228     !
229     !                      The interval when normal vel. is equal to BC_Jet_gh
230           DOUBLE PRECISION BC_DT_h (DIMENSION_BC)
231     !
232     !                      Value of normal vel. during the initial interval BC_DT_h
233           DOUBLE PRECISION BC_Jet_gh (DIMENSION_BC)
234     !
235     !                      The interval when normal vel. is equal to BC_Jet_gl
236           DOUBLE PRECISION BC_DT_l (DIMENSION_BC)
237     !
238     !                      Value of normal vel. during the initial interval BC_DT_l
239           DOUBLE PRECISION BC_Jet_gl (DIMENSION_BC)
240     !
241     !                      Time to update a transient boundary condition
242           DOUBLE PRECISION BC_TIME (DIMENSION_BC)
243     !
244     !                      Area of boundary surfaces
245           DOUBLE PRECISION BC_AREA (DIMENSION_BC)
246     !
247     !                      Volume of boundary cells
248           DOUBLE PRECISION BC_VOL (DIMENSION_BC)
249     !
250     !                      Gas species mass fractions in a boundary region
251           DOUBLE PRECISION BC_X_g (DIMENSION_BC, DIM_N_g)
252     !
253     !                      Solids species mass fractions in a boundary region
254           DOUBLE PRECISION BC_X_s (DIMENSION_BC, DIM_M, DIM_N_s)
255     !
256     !                      Accumulated or average mass outflow rate of gas
257           DOUBLE PRECISION BC_MOUT_g(DIMENSION_BC)
258     !
259     !                      Accumulated or average mass outflow rate of solids
260           DOUBLE PRECISION BC_MOUT_s(DIMENSION_BC, DIM_M)
261     !
262     !                      Accumulated or average volumetric outflow rate of gas
263           DOUBLE PRECISION BC_VOUT_g(DIMENSION_BC)
264     !
265     !                      Accumulated or average volumetric outflow rate of solids
266           DOUBLE PRECISION BC_VOUT_s(DIMENSION_BC, DIM_M)
267     !
268     !                      Number of outflow rate values accumulated
269           INTEGER          BC_OUT_N (DIMENSION_BC)
270     !
271     !                      Pressure drop specified for cyclic b.c. in X
272           DOUBLE PRECISION DELP_X
273     !
274     !                      Pressure drop specified for cyclic b.c. in Y
275           DOUBLE PRECISION DELP_Y
276     !
277     !                      Pressure drop specified for cyclic b.c. in Z
278           DOUBLE PRECISION DELP_Z
279     !
280     !                      Specified mass flux (e.g., g/cm^2.s) in the cyclic
281     !                      direction with specified pressure drop (only one
282     !                      direction is allowed).
283           DOUBLE PRECISION Flux_g
284     !
285     !                      Average gas velocity in X direction (for cyclic bc)
286           DOUBLE PRECISION U_g0
287     !
288     !                      Average gas velocity in Y direction (for cyclic bc)
289           DOUBLE PRECISION V_g0
290     !
291     !                      Average gas velocity in Z direction (for cyclic bc)
292           DOUBLE PRECISION W_g0
293     !
294     !                      Average solids velocity in X direction (for cyclic bc)
295           DOUBLE PRECISION U_s0 (DIM_M)
296     !
297     !                      Average solids velocity in Y direction (for cyclic bc)
298           DOUBLE PRECISION V_s0 (DIM_M)
299     !
300     !                      Average solids velocity in Z direction (for cyclic bc)
301           DOUBLE PRECISION W_s0 (DIM_M)
302     !
303     !                      IJK location where P_g is fixed for cyclic b.c's
304           INTEGER          IJK_P_g
305     !
306     !                      Coefficient in partial slip condition -- gas
307           DOUBLE PRECISION BC_hw_g (DIMENSION_BC)
308     !
309     !                      Coefficient in partial slip condition -- solids
310           DOUBLE PRECISION BC_hw_s (DIMENSION_BC, DIM_M)
311     !
312     !                      Wall velocity for partial slip condition -- gas
313           DOUBLE PRECISION BC_Uw_g (DIMENSION_BC)
314     !
315     !                      Wall velocity for partial slip condition -- gas
316           DOUBLE PRECISION BC_Vw_g (DIMENSION_BC)
317     !
318     !                      Wall velocity for partial slip condition -- gas
319           DOUBLE PRECISION BC_Ww_g (DIMENSION_BC)
320     !
321     !                      Wall velocity for partial slip condition -- solids
322           DOUBLE PRECISION BC_Uw_s (DIMENSION_BC, DIM_M)
323     !
324     !                      Wall velocity for partial slip condition -- solids
325           DOUBLE PRECISION BC_Vw_s (DIMENSION_BC, DIM_M)
326     !
327     !                      Wall velocity for partial slip condition -- solids
328           DOUBLE PRECISION BC_Ww_s (DIMENSION_BC, DIM_M)
329     
330     !
331     !                      Coefficient in heat transfer boundary condition -- gas
332           DOUBLE PRECISION BC_hw_T_g (DIMENSION_BC)
333     !
334     !                      Coefficient in heat transfer boundary condition -- solids
335           DOUBLE PRECISION BC_hw_T_s (DIMENSION_BC, DIM_M)
336     !
337     !                      Wall temperature in heat transfer boundary  condition -- gas
338           DOUBLE PRECISION BC_Tw_g (DIMENSION_BC)
339     !
340     !                      Wall temperature in heat transfer boundary condition -- solids
341           DOUBLE PRECISION BC_Tw_s (DIMENSION_BC, DIM_M)
342     !
343     !                      Coefficient in heat transfer boundary condition -- gas
344           DOUBLE PRECISION BC_C_T_g (DIMENSION_BC)
345     !
346     !                      Coefficient in heat transfer boundary condition -- solids
347           DOUBLE PRECISION BC_C_T_s (DIMENSION_BC, DIM_M)
348     
349     
350     !
351     !                      Coefficient in granular temp boundary condition -- solids
352           DOUBLE PRECISION BC_hw_Theta_m (DIMENSION_BC, DIM_M)
353     !
354     !                      Wall granular temperature -- solids
355           DOUBLE PRECISION BC_Thetaw_m (DIMENSION_BC, DIM_M)
356     !
357     !                      Coefficient in granualr tempearure boundary condition -- solids
358           DOUBLE PRECISION BC_C_Theta_m (DIMENSION_BC, DIM_M)
359     
360     !
361     !                      Coefficient in mass transfer boundary condition -- gas
362           DOUBLE PRECISION BC_hw_X_g (DIMENSION_BC, DIM_N_g)
363     !
364     !                      Coefficient in mass transfer boundary condition -- solids
365           DOUBLE PRECISION BC_hw_X_s (DIMENSION_BC, DIM_M, DIM_N_s)
366     !
367     !                      Wall value in mass  transfer boundary  condition -- gas
368           DOUBLE PRECISION BC_Xw_g (DIMENSION_BC, DIM_N_g)
369     !
370     !                      Wall value in mass transfer boundary condition -- solids
371           DOUBLE PRECISION BC_Xw_s (DIMENSION_BC, DIM_M, DIM_N_s)
372     !
373     !                      Coefficient in mass transfer boundary condition -- gas
374           DOUBLE PRECISION BC_C_X_g (DIMENSION_BC, DIM_N_g)
375     !
376     !                      Coefficient in mass transfer boundary condition -- solids
377           DOUBLE PRECISION BC_C_X_s (DIMENSION_BC, DIM_M, DIM_N_s)
378     !
379     !
380     !   User-defined Scalars
381     !
382     !
383     !                      scalar value in a boundary region
384           DOUBLE PRECISION BC_Scalar (DIMENSION_BC, DIM_scalar)
385     
386     !
387     !                      Coefficient in boundary condition
388           DOUBLE PRECISION BC_hw_Scalar (DIMENSION_BC, DIM_scalar)
389     
390     !
391     !                      Coefficient in boundary condition
392           DOUBLE PRECISION BC_C_Scalar (DIMENSION_BC, DIM_scalar)
393     
394     !
395     !                      Wall value in boundary  condition
396           DOUBLE PRECISION BC_ScalarW (DIMENSION_BC, DIM_scalar)
397     !
398     !
399     !   K and Epsilon for Gas turbulence
400     !
401     !
402     !                      K & Epsilon values in a boundary region
403           DOUBLE PRECISION BC_K_Turb_G (DIMENSION_BC)
404           DOUBLE PRECISION BC_E_Turb_G (DIMENSION_BC)
405     
406           LOGICAL:: CG_MI_CONVERTED_TO_PS(DIMENSION_BC)
407     
408     
409     ! Flag to specify the constant number of particles per cell
410     ! for the PIC solids
411     ! Statistical weight of parcels will be calculated by the code
412           INTEGER :: BC_PIC_MI_CONST_NPC(DIMENSION_BC, DIM_M)
413     
414     ! Flag to specify the constant statistical weight.
415     ! for the PIC solids
416     ! Number of computational particles/parcels will be calculated by the code
417           DOUBLE PRECISION :: BC_PIC_MI_CONST_STATWT(DIMENSION_BC, DIM_M)
418     
419         CONTAINS
420     
421           LOGICAL FUNCTION IS_CG(boundary_condition)
422             implicit none
423             INTEGER, intent(in) :: boundary_condition
424             IS_CG = ((boundary_condition .eq. CG_PO) &
425                  .or. (boundary_condition .eq. CG_MO) &
426                  .or. (boundary_condition .eq. CG_NSW) &
427                  .or. (boundary_condition .eq. CG_FSW) &
428                  .or. (boundary_condition .eq. CG_PSW) &
429                  .or. (boundary_condition .eq. CG_MI) &
430                  )
431           END FUNCTION IS_CG
432     
433           LOGICAL FUNCTION IS_NSW(boundary_condition)
434             implicit none
435             INTEGER, intent(in) :: boundary_condition
436             IS_NSW = ((boundary_condition .eq. CG_NSW) &
437                  )
438           END FUNCTION IS_NSW
439     
440           LOGICAL FUNCTION IS_FSW(boundary_condition)
441             implicit none
442             INTEGER, intent(in) :: boundary_condition
443             IS_FSW = ((boundary_condition .eq. CG_FSW) &
444                  )
445           END FUNCTION IS_FSW
446     
447           LOGICAL FUNCTION IS_PSW(boundary_condition)
448             implicit none
449             INTEGER, intent(in) :: boundary_condition
450             IS_PSW = ((boundary_condition .eq. CG_PSW) &
451                  )
452           END FUNCTION IS_PSW
453     
454           END MODULE bc
455