MFIX  2016-1
des_bc_mod.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2 ! !
3 ! Module name: DES_INLET !
4 ! !
5 ! Purpose: Common elements needed for the des mass inflow boundary !
6 ! condition. !
7 ! !
8 ! Author: J.Musser Date: 13-Jul-09 !
9 ! !
10 ! Comments: !
11 ! !
12 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
13 
14  MODULE des_bc
15 
16  USE param, only: dimension_bc, dim_m
17 
18  INTEGER :: dem_bcmi
19  INTEGER :: dem_bcmo
20 
21  LOGICAL dem_mio ! either inlet or outlet exists
22 
23 ! Map between DEM MI/MO IDs and the user input BC index.
26 
27 ! This array contains integers representing the mass/solid phase indices
28 ! present at a specific boundary condtion in proportion to their
29 ! respective number fraction at the inlet (i.e., it represents the
30 ! particle number distribution of incoming solids at the inlet). The
31 ! array is scaled in size according to the parameter NUMFRAC_LIMIT.
32  INTEGER, DIMENSION(:,:), ALLOCATABLE :: dem_bc_poly_layout
33 
34 ! Particle injection time scale; used when pi_factor > 1 to keep track
35 ! of time needed for next injection
36  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: dem_mi_time
37 
38 ! Logical that can be flagged in the mfix.dat file to force the inlet
39 ! to operate with an ordered boundary condition. This may be useful
40 ! during long simulations or if the inlet appears to be taking a long
41 ! time to randomly place particles.
42  LOGICAL :: force_ord_bc
43 
44 ! Particle injection factor; how many solid time steps (dtsolid) pass
45 ! before the next injection of a particle. if pi_count is greater than
46 ! 1, then pi_factor is set to 1 (i.e. multiple particles enter every
47 ! solids time step).
48  INTEGER, DIMENSION(:), ALLOCATABLE :: pi_factor !(DES_BCMI)
49 
50 ! Particle injection count (injection number); how many particles are
51 ! injected in one solids time step. pi_count is set to one if
52 ! less than 1 particle enters per solids time step.
53  INTEGER, DIMENSION(:), ALLOCATABLE :: pi_count !(DES_BCMI)
54 
55 
56 ! Limit on the total number of divisions (fineness) used to represent
57 ! the particle number distribution at an inlet.
58  INTEGER, PARAMETER :: numfrac_limit = 10000
59 
60 
61 ! the dimension of this variable is equal to the number of grid
62 ! cells in the inlet edge/face
63  TYPE dem_mi_
64 ! Array position of next seed location.
65  INTEGER :: vacancy
66 ! Number of positions in the layout grid.
67  INTEGER :: occupants
68 ! Flag for polydisperse inlets.
69  LOGICAL :: polydisperse
70 ! Uniform grid dimension (width and height).
71  DOUBLE PRECISION :: window
72 ! Offset for placing particles in ghost cell.
73  DOUBLE PRECISION :: offset
74 ! Fluid cell index associated with each grid. (I/J/K like)
75  INTEGER :: l
76  INTEGER, ALLOCATABLE :: w(:)
77  INTEGER, ALLOCATABLE :: h(:)
78 ! Spatial location of each grid cell's lower, bottom corder.
79  DOUBLE PRECISION, ALLOCATABLE :: p(:)
80  DOUBLE PRECISION, ALLOCATABLE :: q(:)
81 ! The rank of the owning process owning the indexed grid cell.
82  INTEGER, ALLOCATABLE :: owner(:)
83  END TYPE dem_mi_
84 
85 ! Construct an array of integers in values from 1 to a calculated factor
86 ! in a random order, which is used when placing new particles.
87 ! TYPE(DEM_MI_DATA), DIMENSION(:), ALLOCATABLE :: MI_ORDER
88 
89 ! Array linking all of the reaction data.
90  TYPE(dem_mi_), DIMENSION(:), TARGET, ALLOCATABLE :: dem_mi
91 
92  INTEGER, ALLOCATABLE :: dem_bcmo_ijkstart(:)
93  INTEGER, ALLOCATABLE :: dem_bcmo_ijkend(:)
94 
95  INTEGER, ALLOCATABLE :: dem_bcmo_ijk(:)
96 
97 
98  INTEGER, ALLOCATABLE :: dem_bcmi_ijkstart(:)
99  INTEGER, ALLOCATABLE :: dem_bcmi_ijkend(:)
100 
101  INTEGER, ALLOCATABLE :: dem_bcmi_ijk(:)
102 
103 
104 !----------------------------------------------------------------------!
105 
106 
107 ! DES specification for solids phase velocity for WALL boundary
108 ! conditions. The current setup is fairly limited. The specified
109 ! boundary velocities are assigned to the indicated wall where a wall
110 ! corresponds to one of the six planes in a cubic domain. Each wall
111 ! corresponds to a number as follows west=1, east=2, bottom=3, top=4,
112 ! south=5, north=6. See cfwallposvel for details. To specify a y or z
113 ! velocity to the west wall set des_bc_vw_s(1,M) or des_bc_ww_s(1,M),
114 ! respectively (note an x velocity is not valid for a west or east wall).
115 ! Since these are user input, they are allocated here with a constant
116 ! preset size, but their actual size is represented by &
117 ! (nwalls, des_mmax)
118  DOUBLE PRECISION des_bc_uw_s(dimension_bc, dim_m)
119  DOUBLE PRECISION des_bc_vw_s(dimension_bc, dim_m)
120  DOUBLE PRECISION des_bc_ww_s(dimension_bc, dim_m)
121 
122  CONTAINS
123 !----------------------------------------------------------------------!
124 ! Function to exclude cells from DEM mass inlet. !
125 !----------------------------------------------------------------------!
126  LOGICAL FUNCTION exclude_dem_mi_cell(lI, lJ, lK)
128  use functions, only: funijk
129  use functions, only: fluid_at
130  use functions, only: is_on_mype_plus2layers
131 
132  use compar, only: dead_cell_at
133 
134 ! Indicies of cell to check
135  INTEGER, INTENT(IN) :: lI, lJ, lK
136 ! Local value for IJK
137  INTEGER :: IJK
138 
139  exclude_dem_mi_cell = .true.
140 
141  IF(.NOT.is_on_mype_plus2layers(li,lj,lk)) RETURN
142  IF(dead_cell_at(li,lj,lk)) RETURN
143  ijk = funijk(li,lj,lk)
144  IF(.NOT.fluid_at(ijk)) RETURN
145 
146  exclude_dem_mi_cell = .false.
147  RETURN
148  END FUNCTION exclude_dem_mi_cell
149 
150  END MODULE des_bc
151 
logical function exclude_dem_mi_cell(lI, lJ, lK)
Definition: des_bc_mod.f:127
integer, dimension(:), allocatable dem_bcmi_ijk
Definition: des_bc_mod.f:101
integer, dimension(:), allocatable dem_bcmo_ijkstart
Definition: des_bc_mod.f:92
integer, dimension(:), allocatable dem_bcmo_ijk
Definition: des_bc_mod.f:95
integer, dimension(:), allocatable dem_bcmo_ijkend
Definition: des_bc_mod.f:93
double precision, dimension(dimension_bc, dim_m) des_bc_vw_s
Definition: des_bc_mod.f:119
double precision, dimension(dimension_bc, dim_m) des_bc_uw_s
Definition: des_bc_mod.f:118
integer, parameter dim_m
Definition: param_mod.f:67
integer dem_bcmo
Definition: des_bc_mod.f:19
integer, parameter dimension_bc
Definition: param_mod.f:61
double precision, dimension(:), allocatable dem_mi_time
Definition: des_bc_mod.f:36
logical, dimension(:,:,:), allocatable dead_cell_at
Definition: compar_mod.f:127
integer dem_bcmi
Definition: des_bc_mod.f:18
integer, parameter numfrac_limit
Definition: des_bc_mod.f:58
Definition: param_mod.f:2
integer, dimension(:), allocatable dem_bcmi_ijkstart
Definition: des_bc_mod.f:98
integer, dimension(:), allocatable pi_factor
Definition: des_bc_mod.f:48
integer, dimension(:), allocatable dem_bcmi_ijkend
Definition: des_bc_mod.f:99
integer, dimension(:), allocatable pi_count
Definition: des_bc_mod.f:53
logical force_ord_bc
Definition: des_bc_mod.f:42
type(dem_mi_), dimension(:), allocatable, target dem_mi
Definition: des_bc_mod.f:90
integer, dimension(dimension_bc) dem_bcmo_map
Definition: des_bc_mod.f:25
double precision, dimension(dimension_bc, dim_m) des_bc_ww_s
Definition: des_bc_mod.f:120
integer, dimension(dimension_bc) dem_bcmi_map
Definition: des_bc_mod.f:24
integer, dimension(:,:), allocatable dem_bc_poly_layout
Definition: des_bc_mod.f:32
logical dem_mio
Definition: des_bc_mod.f:21