MFIX  2016-1
cal_d.f
Go to the documentation of this file.
1 
2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 !SUBROUTINE CAL_D calculates shear velocity
4 !
5 
6  SUBROUTINE cal_d(V_sh)
7 
8  USE param
9  USE param1
10  USE parallel
11  USE scales
12  USE constant
13  USE physprop
14  USE fldvar
15  USE visc_s
16  USE rxns
17  USE toleranc
18  USE geometry
19  USE indices
20  USE is
21  USE tau_s
22  USE bc
23  USE vshear
24  USE compar
25  USE fun_avg
26  USE functions
27 
28  DOUBLE PRECISION V_sh,dis
29 ! DOUBLE PRECISION xdist(IMAX2,JMAX2)
30 ! DOUBLE PRECISION xdist3(IMAX2,JMAX2,KMAX2),cnter3(IMAX2,JMAX2,KMAX2)
31 
32 !//SP Note the rational behind using global direction in I direction. This is to ensure
33 ! correctness in the way distances are calculated in the serial version and also
34 ! to give the capability to perform calculations over additional ghost layers in
35 ! to avoid if checks and communication
36  DOUBLE PRECISION xdist(imin3:imax3,jstart3:jend3)
37  DOUBLE PRECISION xdist3(imin3:imax3,jstart3:jend3,kstart3:kend3)
38 
39  INTEGER IJK,I1,J1,K1,I,J,K
40 
41  IF (no_k) THEN
42 
43 !calculate distances
44  DO j1= jstart3, jend3
45  xdist(1,j1)=1d0/(odx(1))
46  if(imin3.ne.imin2) xdist(imin3,j1)=-1d0/(odx(imin3))
47  DO i1 = 2, imax3
48  xdist(i1,j1)=1d0/(odx(i1))+xdist((i1-1),j1)
49  END DO
50  END DO
51 
52  DO ijk= ijkstart3, ijkend3
53  i = i_of(ijk)
54  j = j_of(ijk)
55 
56  dis=xdist(i,j)
57 
58 !shear velocity alligned u momentum cells
59 
60  vshe(ijk)=v_sh-2d0*(1d0-(dis-(1d0/odx(i))/xlength))*v_sh
61 
62 !shear velocity alligned with scalar, v, w momentum cells
63 
64  vsh(ijk)=v_sh-2d0*(1d0-(dis-(1d0/odx(i))/xlength))*v_sh&
65  -2d0*(1d0/(2d0*odx(i)*xlength))*v_sh
66 
67  END DO
68 
69 
70  ELSE
71 
72 !calculate distances
73  DO k1=kstart3,kend3
74  DO j1= jstart3, jend3
75  IF (dead_cell_at(1,j1,k1)) cycle ! skip dead cells
76  xdist3(1,j1,k1)=1d0/(odx(1))
77  if(imin3.ne.imin2) xdist(imin3,j1)=-1d0/(odx(imin3))
78  DO i1 = 2, imax3
79  IF (dead_cell_at(i1,j1,k1)) cycle ! skip dead cells
80  xdist3(i1,j1,k1)=1d0/(odx(i1))+xdist3((i1-1),j1,k1)
81  END DO
82  END DO
83  END DO
84 
85 
86  DO ijk= ijkstart3, ijkend3
87  i = i_of(ijk)
88  j = j_of(ijk)
89  k = k_of(ijk)
90 
91  dis=xdist3(i,j,k)
92 
93 !shear velocity alligned u momentum cells
94 
95  vshe(ijk)=v_sh-2d0*(1d0-(dis-(1d0/odx(i))/xlength))*v_sh
96 
97 !shear velocity alligned with scalar, v, w momentum cells
98 
99  vsh(ijk)=v_sh-2d0*(1d0-(dis-(1d0/odx(i))/xlength))*v_sh&
100  -2d0*(1d0/(2d0*odx(i)*xlength))*v_sh
101 
102  END DO
103 
104  END IF
105  RETURN
106  END SUBROUTINE cal_d
107 
108 !// Comments on the modifications for DMP version implementation
109 !// 001 Include header file and common declarations for parallelization
110 !// 350 Changed do loop limits: 1,ijkmax2-> ijkstart3, ijkend3
111 !// 350 1206 change do loop limits: 1,kmax2->kstart3,kend3
112 
integer, dimension(:), allocatable i_of
Definition: indices_mod.f:45
integer jstart3
Definition: compar_mod.f:80
integer ijkend3
Definition: compar_mod.f:80
double precision, dimension(:), allocatable odx
Definition: geometry_mod.f:114
integer imax3
Definition: geometry_mod.f:91
Definition: rxns_mod.f:1
Definition: tau_s_mod.f:1
integer kstart3
Definition: compar_mod.f:80
integer imin3
Definition: geometry_mod.f:90
Definition: is_mod.f:11
integer kend3
Definition: compar_mod.f:80
double precision, dimension(:), allocatable vsh
Definition: vshear_mod.f:3
integer, dimension(:), allocatable k_of
Definition: indices_mod.f:47
logical, dimension(:,:,:), allocatable dead_cell_at
Definition: compar_mod.f:127
integer, dimension(:), allocatable j_of
Definition: indices_mod.f:46
integer jend3
Definition: compar_mod.f:80
double precision xlength
Definition: geometry_mod.f:33
double precision, dimension(:), allocatable vshe
Definition: vshear_mod.f:4
Definition: param_mod.f:2
logical no_k
Definition: geometry_mod.f:28
integer ijkstart3
Definition: compar_mod.f:80
subroutine cal_d(V_sh)
Definition: cal_d.f:7
integer imin2
Definition: geometry_mod.f:89
Definition: bc_mod.f:23