MFIX  2016-1
drag_ss_dem_noninterp.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2 ! !
3 ! Subroutine: DRAG_SS_DEM_NONINTERP !
4 ! !
5 ! Purpose: This routine is called from the DISCRETE side to calculate !
6 ! the solids-solids drag force acting on each particle using cell- !
7 ! center continuum solids velocity. The total contact force is also !
8 ! updated to include P* for over-packing. !
9 ! !
10 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
11  SUBROUTINE drag_ss_dem_noninterp
12 
13 ! Modules
14 !---------------------------------------------------------------------//
15 ! Fluid grid loop bounds.
16  use compar, only: ijkstart3, ijkend3
17 ! Fudge factor for SS drag (c.f. Gera, 2004)
19 ! The count and a list of particles in IJK
20  use discretelement, only: pinc, pijk
21  use derived_types, only: pic
22 ! Particle velocity and density
23  use discretelement, only: des_vel_new, ro_sol
24 ! Particle radius and volume.
25  use discretelement, only: des_radius, pvol
26 ! Total forces acting on particle
27  use discretelement, only: fc
28 ! Gas phase volume fraction
29  use fldvar, only: ep_g
30 ! Solids pressure
31  use fldvar, only: p_star
32 ! Diameter of continuum solids phases
33  use fldvar, only: d_p
34 ! Material (ROs) and bulk density (ROPs) of continuum solids
35  use fldvar, only: rop_s, ro_s
36  use functions, only: is_nonexistent, is_ghost, is_entering_ghost, is_exiting_ghost
37 ! Function to deterine if a cell contains fluid.
38  use functions, only: fluid_at
39 ! Double precision values.
40  use param1, only: zero, one
41 ! Array sizes for solids
42  use param, only: dimension_m
43 ! Number of continuum solids phases
44  use physprop, only: smax
45 ! Flag that a continuum solids can pack
46  use physprop, only: close_packed
47 ! radial distribution function
48  use rdf, only: g_0
49  IMPLICIT NONE
50 
51 ! Local variables
52 !---------------------------------------------------------------------//
53 ! Loop indices:
54  INTEGER :: IJK, M, NINDX, NP, L
55 ! average solids velocity at scalar cell center in array form
56  DOUBLE PRECISION :: VELCS(3, dimension_m)
57 ! relative velocity between solids phase m and l
58  DOUBLE PRECISION :: VSLP(3), VREL
59 ! radial distribution function between phase M and L
60  DOUBLE PRECISION :: G0_ML
61 ! Sum over all phases of ratio volume fraction over particle diameter
62  DOUBLE PRECISION :: EPSoDP
63 ! DEM particle diameter calculated from radius.
64  DOUBLE PRECISION :: lDP
65 ! solid-solid drag coefficient
66  DOUBLE PRECISION :: lDss
67 ! Intermediate calculations for volume fraction.
68  DOUBLE PRECISION :: OoEPg, EPg_2
69 ! Drag force acting on each phase.
70  DOUBLE PRECISION :: D_FORCE(3)
71 
72 !......................................................................!
73 
74 ! Calculate the solid-solid drag for each particle.
75 !---------------------------------------------------------------------//
76 !!$omp parallel do schedule(guided, 50) default(none) &
77 !!$omp shared(IJKSTART3, IJKEND3, PINC, PIC, DES_VEL_NEW, &
78 !!$omp D_P, RO_s, ROP_s, EP_G, DES_RADIUS, RO_SOL, FC, &
79 !!$omp PVOL, SEGREGATION_SLOPE_COEFFICIENT, CLOSE_PACKED, P_STAR)&
80 !!$omp private(IJK, OoEPg, EPg_2, EPSoDP, NP, lDP, D_FORCE, G0_ML, &
81 !!$omp VELCS, VSLP, VREL, lDss, L)
82  DO ijk = ijkstart3, ijkend3
83 
84  IF(.NOT.fluid_at(ijk)) cycle
85  IF(pinc(ijk) == 0) cycle
86 
87  ooepg = one/ep_g(ijk)
88  epg_2 = ep_g(ijk)*ep_g(ijk)
89 
90 ! Calculate solids volume fraction over particle diameter.
91  CALL calc_epsodp(ijk, epsodp)
92 
93 ! Calculate the continuum solids velocity at scalar cell center.
94  CALL calc_cell_center_csolids_vel(ijk, velcs)
95 
96 ! Calculate the solids drag for each particle in the current cell.
97  DO nindx = 1,pinc(ijk)
98  np = pic(ijk)%P(nindx)
99 ! skipping indices that do not represent particles and ghost particles
100  IF(is_nonexistent(np)) cycle
101  IF(is_ghost(np) .OR. is_entering_ghost(np) .OR. is_exiting_ghost(np)) cycle
102 
103 ! Diameter of particle (not a phase diameter).
104  ldp = 2.0d0*des_radius(np)
105 
106  d_force = zero
107  DO m = 1, smax
108 
109 ! evaluating g0 - taken from G_0.f subroutine (lebowitz form)
110 ! this section is needed to account for all solids phases until g0 for
111 ! multiple solids types (i.e. discrete & continuum) can be addressed
112 ! more effectively.
113 ! G0_ML = OoEPg + 3.0d0*EPSoDP*D_P(IJK,M)*lDP / &
114 ! (EPg_2 *(D_P(IJK,M) + lDP))
115 ! the calculation below allows for a more generic g0 form, however,
116 ! the calculation above is truer to the discrete nature of the info
117  l = pijk(np,5)
118  g0_ml = g_0(ijk,l,m)
119 
120 ! Relative (slip) velocity.
121  vslp = des_vel_new(np,:) - velcs(:,m)
122 ! Relative velocity magnitude.
123  vrel = sqrt(dot_product(vslp,vslp))
124 
125  CALL drag_ss_syam0(ldss, d_p(ijk,m), ldp, ro_s(ijk,m), &
126  ro_sol(np), g0_ml, vrel)
127 
128  ldss = ldss*rop_s(ijk,m)*ro_sol(np)
129 
130 ! accounting for particle-particle drag due to enduring contact in a
131 ! close-packed system
132  IF(close_packed(m)) ldss = ldss + &
134 
135 ! Calculating the accumulated solids-solids drag force.
136  d_force(:) = d_force(:) - ldss*vslp(:)
137 
138  ENDDO ! end do loop (M=1,SMAX)
139 
140  fc(np,:) = fc(np,:) + d_force(:)*pvol(np)
141 
142  ENDDO ! END DO LOOP (NP=1,MAX_PIP)
143  ENDDO ! END DO LOOP (IJK=IJKSTART3, IJKEND3)
144 !!$omp end parallel do
145 
146  RETURN
147  END SUBROUTINE drag_ss_dem_noninterp
148 
149 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
150 ! !
151 ! Subroutine: DES_DRAG_SS !
152 ! !
153 ! Purpose: This subroutine is called from the CONTINUUM side. It !
154 ! calculate the solids-solids drag force coefficient between !
155 ! continuum and discrete solids. !
156 ! !
157 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
158  SUBROUTINE drag_ss_tfm_noninterp
160 ! Modules
161 !---------------------------------------------------------------------//
162 ! Fluid grid loop bounds.
163  use compar, only: ijkstart3, ijkend3
164 ! Fudge factor for SS drag (c.f. Gera, 2004)
166 ! The count and a list of particles in IJK
167  use derived_types, only: pic
168  use discretelement, only: pinc, pijk, des_vol_node
169 ! Particle velocity and density
170  use discretelement, only: des_vel_new, ro_sol
171 ! Particle radius and volume.
172  use discretelement, only: des_radius
173 ! Total forces acting on particle
174  use discretelement, only: sdrag_am, sdrag_bm, f_sds
175 ! Gas phase volume fraction
176  use fldvar, only: ep_g
177 ! Diameter of continuum solids phases
178  use fldvar, only: d_p
179 ! Material (ROs) and bulk density (ROPs) of continuum solids
180  use fldvar, only: rop_s, ro_s
181 ! Solids pressure
182  use fldvar, only: p_star
183 ! Function to deterine if a cell contains fluid.
184  use functions, only: fluid_at
185  use functions, only: is_nonexistent, is_ghost
186  use functions, only: is_entering_ghost, is_exiting_ghost
187  use geometry, only: vol
188 ! Double precision values.
189  use param1, only: zero, one
190 ! Array sizes for solids
191  use param, only: dimension_m
192 ! Flag that a continuum solids can pack
193  use physprop, only: close_packed
194 ! Number of continuum solids phases
195  use physprop, only: smax
196 ! radial distribution function
197  use rdf, only: g_0
198  IMPLICIT NONE
199 
200 ! Local variables
201 !---------------------------------------------------------------------//
202 ! Loop indices:
203  INTEGER :: IJK, M, NINDX, NP, L
204 ! average solids velocity at scalar cell center in array form
205  DOUBLE PRECISION :: VELCS(3, dimension_m)
206 ! relative velocity between solids phase m and l
207  DOUBLE PRECISION :: VSLP(3), VREL
208 ! radial distribution function between phase M and L
209  DOUBLE PRECISION :: G0_ML
210 ! Sum over all phases of ratio volume fraction over particle diameter
211  DOUBLE PRECISION :: EPSoDP
212 ! DEM particle diameter calculated from radius.
213  DOUBLE PRECISION :: lDP
214 ! solid-solid drag coefficient
215  DOUBLE PRECISION :: lDss
216 ! Intermediate calculations for volume fraction.
217  DOUBLE PRECISION :: OoEPg, EPg_2
218 ! Drag force acting on each phase.
219  DOUBLE PRECISION :: lFORCE
220 !......................................................................!
221 
222  DO ijk = ijkstart3, ijkend3
223 
224  f_sds(ijk,:) = zero
225  sdrag_am(ijk,:) = zero
226  sdrag_bm(ijk,:,:) = zero
227 
228  IF(.NOT.fluid_at(ijk)) cycle
229  IF(pinc(ijk) == 0) cycle
230 
231  ooepg = one/ep_g(ijk)
232  epg_2 = ep_g(ijk)*ep_g(ijk)
233 
234 ! Calculate solids volume fraction over particle diameter.
235  CALL calc_epsodp(ijk, epsodp)
236 
237 ! Calculate the continuum solids velocity at scalar cell center.
238  CALL calc_cell_center_csolids_vel(ijk, velcs)
239 
240 ! Calculate the solids drag for each particle in the current cell.
241  DO nindx = 1,pinc(ijk)
242  np = pic(ijk)%P(nindx)
243 ! skipping indices that do not represent particles and ghost particles
244  IF(is_nonexistent(np)) cycle
245  IF(is_ghost(np) .OR. is_entering_ghost(np) .OR. is_exiting_ghost(np)) cycle
246 
247 ! Diameter of particle (not a phase diameter).
248  ldp = 2.0d0*des_radius(np)
249 
250  DO m = 1, smax
251 
252 ! Relative (slip) velocity.
253  vslp = des_vel_new(np,:) - velcs(:,m)
254 ! Relative velocity magnitude.
255  vrel = sqrt(dot_product(vslp,vslp))
256 
257 ! evaluating g0 - taken from G_0.f subroutine (lebowitz form)
258 ! this section is needed to account for all solids phases until g0 for
259 ! multiple solids types (i.e. discrete & continuum) can be addressed
260 ! more effectively.
261 ! G0_ML = OoEPg + 3.0d0*EPSoDP*D_P(IJK,M)*lDP / &
262 ! (EPg_2 *(D_P(IJK,M) + lDP))
263 ! the calculation below allows for a more generic g0 form, however,
264 ! the calculation above is truer to the discrete nature of the info
265  l = pijk(np,5)
266  g0_ml = g_0(ijk,l,m)
267 
268  CALL drag_ss_syam0(ldss, d_p(ijk,m), ldp, ro_s(ijk,m), &
269  ro_sol(np), g0_ml, vrel)
270 
271  ldss = ldss*rop_s(ijk,m)*ro_sol(np)
272 
273 ! accounting for particle-particle drag due to enduring contact in a
274 ! close-packed system
275  IF(close_packed(m)) ldss = ldss + &
277 
278 ! Calculating the accumulated solids-solids drag force.
279  lforce = ldss/vol(l)
280 
281  sdrag_am(ijk,m) = sdrag_am(ijk,m) + lforce
282  sdrag_bm(ijk,:,m) = sdrag_bm(ijk,:,m) + &
283  lforce*des_vel_new(np,:)
284 
285  ENDDO ! end do loop (M=1,SMAX)
286 
287  ENDDO ! END DO LOOP (NP=1,MAX_PIP)
288 
289  f_sds(ijk,:) = sdrag_am(ijk,:)
290 
291  ENDDO ! END DO LOOP (IJK=IJKSTART3, IJKEND3)
292 
293  RETURN
294  END SUBROUTINE drag_ss_tfm_noninterp
295 
296 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
297 ! !
298 ! Subroutine: CALC_CELL_CENTER_CSOLIDS_VEL !
299 ! Author: J.Musser Date: 07-NOV-14 !
300 ! !
301 ! Purpose: Calculate the scalar cell center continuum solids !
302 ! velocity. This code is common to the DEM and GAS calls for non- !
303 ! interpolated drag routines. !
304 ! !
305 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
306  SUBROUTINE calc_cell_center_csolids_vel(IJK, lVELFP)
308 ! Modules
309 !---------------------------------------------------------------------//
310 ! Flags and correction factors for cut momentum cells.
314 ! Solids velocities.
315  use fldvar, only: u_s, v_s, w_s
316 ! Functions to average momentum to scalar cell center.
317  use fun_avg, only: avg_x_e, avg_y_n, avg_z_t
318 ! Functions to lookup adjacent cells by index.
319  use functions, only: im_of, jm_of, km_of
320 ! Flag for 3D simulatoins.
321  use geometry, only: do_k
322  use indices, only: i_of
323 ! Double precision parameters.
324  use param1, only: zero
325 ! Array sizes for solids
326  use param, only: dimension_m
327 ! Number of solid phases.
328  use physprop, only: smax
329  IMPLICIT NONE
330 
331 ! Dummy arguments
332 !---------------------------------------------------------------------//
333 ! Fluid cell and solids phase indices
334  INTEGER, INTENT(IN) :: IJK
335 ! Fluid velocity vector at IJK cell center.
336  DOUBLE PRECISION, INTENT(OUT) :: lVELFP(3, dimension_m)
337 
338 ! Local variables
339 !---------------------------------------------------------------------//
340 ! Phase loop counter
341  INTEGER :: M
342 ! Indices of adjacent cells
343  INTEGER :: IMJK, IJMK, IJKM
344 !......................................................................!
345 
346 ! Calculate the average fluid velocity at scalar cell center.
347  DO m=1,smax
348 
349  imjk = im_of(ijk)
350  IF(cut_u_treatment_at(imjk)) THEN
351  lvelfp(1,m) = (theta_ue_bar(imjk)*u_s(imjk,m) + &
352  theta_ue(imjk)*u_s(ijk,m))
353  ELSE
354  lvelfp(1,m) = avg_x_e(u_s(imjk,m),u_s(ijk,m),i_of(ijk))
355  ENDIF
356 
357  ijmk = jm_of(ijk)
358  IF(cut_v_treatment_at(ijmk)) THEN
359  lvelfp(2,m) = (theta_vn_bar(ijmk)*v_s(ijmk,m) + &
360  theta_vn(ijmk)*v_s(ijk,m))
361  ELSE
362  lvelfp(2,m) = avg_y_n(v_s(ijmk,m),v_s(ijk,m))
363  ENDIF
364 
365  IF(do_k) THEN
366  ijkm = km_of(ijk)
367  IF(cut_w_treatment_at(ijkm)) THEN
368  lvelfp(3,m) = (theta_wt_bar(ijkm)*w_s(ijkm,m) + &
369  theta_wt(ijkm)* w_s(ijk,m))
370  ELSE
371  lvelfp(3,m) = avg_z_t(w_s(ijkm,m),w_s(ijk,m))
372  ENDIF
373  ELSE
374  lvelfp(3,m) = zero
375  ENDIF
376  ENDDO
377 
378  RETURN
379  END SUBROUTINE calc_cell_center_csolids_vel
380 
381 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
382 ! !
383 ! Subroutine: CALC_EPSoDP !
384 ! Author: J.Musser Date: 07-NOV-14 !
385 ! !
386 ! !
387 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
388  SUBROUTINE calc_epsodp(IJK, lEPSoDP)
390 ! Global Variables:
391 !---------------------------------------------------------------------//
392 ! The count and a list of particles in IJK
393  use derived_types, only: pic
394  use discretelement, only: pinc
395 ! Particle volume and radius
396  use discretelement, only: pvol, des_radius
397 ! Volume of scalar cell
398  use geometry, only: vol
399 ! Continuum solids diamter
400  use fldvar, only: d_p
401 ! Function to calculate continuum solids volume fraction
402  use fldvar, only: ep_s
403 ! Number of continuum solids phases
404  use physprop, only: smax
405 
406  use functions
407 
408 ! Global Parameters:
409 !---------------------------------------------------------------------//
410 ! Double precision parameters.
411  use param1, only: zero
412 
413  IMPLICIT NONE
414 
415 ! Dummy arguments
416 !---------------------------------------------------------------------//
417 ! Fluid cell and solids phase indices
418  INTEGER, INTENT(IN) :: IJK
419 ! Fluid velocity vector at IJK cell center.
420  DOUBLE PRECISION, INTENT(OUT) :: lEPSoDP
421 
422 ! Local variables:
423 !---------------------------------------------------------------------//
424 ! Loop counters
425  INTEGER :: NP, NINDX, M
426 
427 ! Calculate the sum of the particle volumes divided by radius.
428  lepsodp = zero
429  DO nindx = 1,pinc(ijk)
430  np = pic(ijk)%P(nindx)
431  IF(is_nonexistent(np)) cycle
432  IF(is_ghost(np) .OR. is_entering_ghost(np) .OR.&
433  is_exiting_ghost(np)) cycle
434  lepsodp = lepsodp + pvol(np)/des_radius(np)
435  ENDDO
436 ! Convert radius to diameter and divide by cell volume.
437  lepsodp = lepsodp/(2.0d0*vol(ijk))
438 
439 ! Add contributions from continuum solids.
440  DO m = 1, smax
441  lepsodp = lepsodp + ep_s(ijk,m)/d_p(ijk,m)
442  ENDDO
443 
444  RETURN
445  END SUBROUTINE calc_epsodp
subroutine drag_ss_dem_noninterp
double precision, dimension(:,:), allocatable v_s
Definition: fldvar_mod.f:105
integer, dimension(:), allocatable i_of
Definition: indices_mod.f:45
integer ijkend3
Definition: compar_mod.f:80
double precision, dimension(:), allocatable ep_g
Definition: fldvar_mod.f:15
double precision, parameter one
Definition: param1_mod.f:29
double precision, dimension(:,:), allocatable w_s
Definition: fldvar_mod.f:117
double precision segregation_slope_coefficient
Definition: constant_mod.f:67
double precision, dimension(:), allocatable theta_wt
Definition: cutcell_mod.f:293
double precision function g_0(IJK, M1, M2)
Definition: rdf_mod.f:240
logical, dimension(dim_m) close_packed
Definition: physprop_mod.f:56
logical, dimension(:), allocatable cut_u_treatment_at
Definition: cutcell_mod.f:350
double precision, dimension(:,:), allocatable u_s
Definition: fldvar_mod.f:93
double precision, dimension(:), allocatable theta_wt_bar
Definition: cutcell_mod.f:294
double precision, dimension(:), allocatable theta_vn_bar
Definition: cutcell_mod.f:252
double precision, dimension(:,:), allocatable d_p
Definition: fldvar_mod.f:57
double precision, dimension(:), allocatable theta_vn
Definition: cutcell_mod.f:251
double precision, dimension(:), allocatable theta_ue
Definition: cutcell_mod.f:210
subroutine calc_cell_center_csolids_vel(IJK, lVELFP)
subroutine calc_epsodp(IJK, lEPSoDP)
Definition: param_mod.f:2
subroutine drag_ss_tfm_noninterp
double precision, dimension(:,:), allocatable ro_s
Definition: fldvar_mod.f:45
logical, dimension(:), allocatable cut_w_treatment_at
Definition: cutcell_mod.f:352
logical do_k
Definition: geometry_mod.f:30
double precision, dimension(:), allocatable p_star
Definition: fldvar_mod.f:142
double precision, dimension(:), allocatable theta_ue_bar
Definition: cutcell_mod.f:211
logical, dimension(:), allocatable cut_v_treatment_at
Definition: cutcell_mod.f:351
integer ijkstart3
Definition: compar_mod.f:80
double precision function ep_s(IJK, xxM)
Definition: fldvar_mod.f:178
Definition: rdf_mod.f:11
double precision, dimension(:,:), allocatable rop_s
Definition: fldvar_mod.f:51
integer smax
Definition: physprop_mod.f:22
type(iap1), dimension(:), allocatable pic
double precision, dimension(:), allocatable vol
Definition: geometry_mod.f:212
integer dimension_m
Definition: param_mod.f:18
double precision, parameter zero
Definition: param1_mod.f:27
subroutine drag_ss_syam0(ldss, d_pm, d_pl, ro_m, ro_l, g0_ml, vrel
Definition: drag_ss.f:186