MFIX  2016-1
cfwallcontact.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2 !
3 ! Subroutine: CFWALLCONTACT(WALL, L, WALLCONTACT)
4 ! Purpose: Check if particle L is in contact with WALL. If so, set
5 ! WALLCONTACT to 1, else WALLCONTACT is 0
6 !
7 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 
9  SUBROUTINE cfwallcontact(WALL, L, WALLCONTACT)
10 
11 !-----------------------------------------------
12 ! Modules
13 !-----------------------------------------------
14  USE param1
15  USE constant
16  USE parallel
17  USE compar
18  Use discretelement
19  USE des_bc
20  use geometry, only: do_k
21  IMPLICIT NONE
22 !-----------------------------------------------
23 ! Dummy arguments
24 !-----------------------------------------------
25 ! Given wall ID number (1=west, 2=east, 3=south, 4=north, 5=bottom,
26 ! 6=top)
27  INTEGER, INTENT (IN) :: WALL
28 ! Given particle ID number
29  INTEGER, INTENT (IN) :: L
30 ! Flag to indicate whether given particle is in contact with given wall
31 ! (1=contact, 0 = no contact)
32  INTEGER, INTENT (INOUT) :: WALLCONTACT
33 !-----------------------------------------------
34 ! Local variables
35 !-----------------------------------------------
36 ! local variables for x, y, z position of the particle
37  DOUBLE PRECISION :: XPOS, YPOS, ZPOS
38 ! local variables to define system dimensions
39  DOUBLE PRECISION :: LXE, LXW, LYN, LYS, LZT, LZB
40 ! local variables: distance between particle surface and wall
41  DOUBLE PRECISION :: DistApart
42 !-----------------------------------------------
43 
44 ! assign temporary local variables for quick reference
45  lxe = ex2
46  lxw = wx1
47  lyn = ty2
48  lys = by1
49  lzt = nz2
50  lzb = sz1
51 
52 ! assign temporary local variables for manipulation/use
53  xpos = des_pos_new(l,1)
54  ypos = des_pos_new(l,2)
55  IF(do_k) zpos = des_pos_new(l,3)
56 
57 
58 ! initialize
59  wallcontact = 0
60 
61  IF (des_le_bc) THEN
62 ! Current implementation of Lees & Edwards boundaries implies all other
63 ! boundaries are periodic (i.e. no walls in system)
64  RETURN
65  ELSEIF (des_periodic_walls) THEN
66 ! Check if current wall corresponds to a periodic boundary (i.e. no wall)
67  IF( (des_periodic_walls_x .AND. (wall.EQ.1.OR.wall.EQ.2)).OR.&
68  (des_periodic_walls_y .AND. (wall.EQ.3.OR.wall.EQ.4)).OR.&
69  (do_k.AND.des_periodic_walls_z .AND. &
70  (wall.EQ.5.OR.wall.EQ.6)) ) THEN
71  RETURN
72  ENDIF
73  ENDIF
74 
75 ! Note that if no cohesion is used WALL_VDW_OUTER_CUTOFF = zero.
76 ! west wall (X)
77  IF(wall.EQ.1) THEN
78  distapart = xpos-lxw-des_radius(l)
79 ! consider wall contact calculations for particle wall distances less
80 ! than the cutoff
81  IF( distapart <= wall_vdw_outer_cutoff ) wallcontact = 1
82 
83 ! east wall (X)
84  ELSEIF(wall.EQ.2) THEN
85  distapart = lxe-xpos-des_radius(l)
86  IF( distapart <= wall_vdw_outer_cutoff ) wallcontact = 1
87 
88 ! south wall (Y)
89  ELSEIF(wall.EQ.3) THEN
90  distapart = ypos-(lys)-des_radius(l)
91  IF( distapart <= wall_vdw_outer_cutoff ) wallcontact = 1
92 
93 ! north wall (Y)
94  ELSEIF(wall.EQ.4) THEN
95  distapart = lyn-ypos-des_radius(l)
96  IF( distapart <= wall_vdw_outer_cutoff ) wallcontact = 1
97 
98 ! bottom wall (Z)
99  ELSEIF(wall.EQ.5) THEN
100  distapart = zpos-lzb-des_radius(l)
101  IF( distapart <= wall_vdw_outer_cutoff ) wallcontact = 1
102 
103 ! top wall (Z)
104  ELSEIF(wall.EQ.6) THEN
105  distapart = lzt-zpos-des_radius(l)
106  IF( distapart <= wall_vdw_outer_cutoff ) wallcontact = 1
107  ENDIF
108 
109  RETURN
110  END SUBROUTINE cfwallcontact
subroutine cfwallcontact(WALL, L, WALLCONTACT)
Definition: cfwallcontact.f:10
logical do_k
Definition: geometry_mod.f:30