MFIX  2016-1
integrate_time_pic.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2 ! !
3 ! Module name: CFNEWVALUES !
4 ! !
5 ! Purpose: DES - Calculate the new values of particle velocity, !
6 ! position, angular velocity etc !
7 ! !
8 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
9  SUBROUTINE integrate_time_pic
10 
11  USE discretelement
12  USE mfix_pic
13 
14  IMPLICIT NONE
15 
16 ! call the coloring function like approach
19  ELSE
21  ENDIF
22 
23  RETURN
24  END SUBROUTINE integrate_time_pic
25 
26 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
27 ! !
28 ! Module name: INTEGRATE_TIME_PIC_SNIDER !
29 ! !
30 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
31  SUBROUTINE integrate_time_pic_snider
32 
33  USE param
34  USE param1
35  USE parallel
36  USE physprop
37  USE constant
38  USE fldvar
39  USE discretelement
40  USE des_bc
41  USE mpi_utility
42  USE fldvar
43  USE cutcell
44  USE mfix_pic
45  USE randomno
46  USE geometry, only: do_k, no_k
47  USE fun_avg
48  USE functions
49 
50  IMPLICIT NONE
51 
52 ! Local Variables
53 !---------------------------------------------------------------------//
54 ! Loop counters
55  INTEGER :: NP, LC, PC
56 ! Drag coefficient divided by parcel mass
57  DOUBLE PRECISION :: DP_BAR
58 ! Restitution coefficient plus one
59  DOUBLE PRECISION :: ENp1
60 ! Integrated particle velocity without particle normal stress
61  DOUBLE PRECISION :: VEL(3)
62 ! Estimated parcel velocity from normal particle stress
63  DOUBLE PRECISION :: DELUP(3)
64 ! Actual parcel velocity from particle normal stress.
65  DOUBLE PRECISION :: UPRIMETAU(3)
66 ! Slip velocity between parcel and bulk solids
67  DOUBLE PRECISION :: SLIPVEL(3)
68 ! Distance traveled by the parcel (and magnitude)
69  DOUBLE PRECISION :: DIST(3), DIST_MAG
70 ! Max velocity magnitude of all parcels
71  DOUBLE PRECISION :: MAX_VEL
72 ! Mininum fluid cell dimenstion
73  DOUBLE PRECISION :: DXYZ_MIN
74 ! Three times the square root of two.
75  DOUBLE PRECISION :: l3SQT2
76 ! Volume fraction used to limit parcel movement in close pack regions.
77  DOUBLE PRECISION :: EPg_MFP
78 ! Mean free path of parcels based on volume fraction.
79  DOUBLE PRECISION :: MFP
80 ! Solids volume fraction at the parcel
81  DOUBLE PRECISION :: EPs
82 ! Loop bound
83  INTEGER :: LC_BND
84 ! Gravity normal and magnitude
85  DOUBLE PRECISION :: GRAV_NORM(3)
86 !......................................................................!
87 
88 ! Volume fraction used to limit parcel movement in close pack regions.
89  epg_mfp = 0.95d0*ep_star
90 ! Initialize max parcel velocity
91  max_vel = -undefined
92 ! Restitution coefficient plus one.
93  enp1 = mppic_coeff_en1 + 1.0d0
94 ! Three times the square root of two.
95  l3sqt2 = merge(3.0d0, 2.0d0, do_k)*sqrt(2.0d0)
96 ! Dimenion loop bound
97  lc_bnd = merge(2,3,no_k)
98 
99 ! Calculate the normal of gravity
100  IF(grav_mag > small_number) grav_norm = grav/grav_mag
101 
102  pc = 1
103  DO np = 1, max_pip
104 
105  IF(pc.GT.pip) EXIT
106  IF(is_nonexistent(np)) cycle
107 
108  pc = pc+1
109 
110 ! If a particle is classified as new, then forces are ignored.
111 ! Classification from new to existing is performed in routine
112 ! des_check_new_particle.f
113  IF(is_entering(np))THEN
114  fc(np,:) = zero
115  ELSE
116  fc(np,:) = fc(np,:)/pmass(np) + grav(:)
117  ENDIF
118 
119 ! DP_BAR is the D_p in the Snider paper (JCP, vol 170, 523-549, 2001)
120 ! By comparing MFIX equations and equations in those papers,
121 ! D_p = Beta/(EP_S*RHOP)
122 ! F_gp in drag_fgs.f = Beta*PVOL/EP_S
123 ! Therefore, D_p = F_gp/(PVOL*RHOP) = F_gp/PMASS
124  IF(des_continuum_coupled .AND. mppic_pdrag_implicit)&
125  dp_bar = f_gp(np)/pmass(np)
126 
127 ! Solids volume fraction
128 ! EPs = max(ONE-EP_G(PIJK(NP,4)), 1.0d-4)
129  eps = max(one-epg_p(np), 1.0d-4)
130 
131 ! Numerically integrated particle velocity without particle normal
132 ! stress force :: Snider (Eq 38)
133  vel(:) = (des_vel_new(np,:) + &
134  fc(np,:)*dtsolid)/(1.d0+dp_bar*dtsolid)
135 
136 ! Estimated discrete particle velocity from continuum particle
137 ! normal stress graident :: Snider (Eq 39)
138  delup(:) = -(dtsolid*ps_grad(:,np)) / &
139  (eps*ro_s0(1)*(1.d0+dp_bar*dtsolid))
140 
141 ! Slip velocity between parcel and average solids velocity adjusted
142 ! for gravity driven flows.
143  slipvel = avg_vel_wgrav(np,vel) - vel
144 
145 ! Calculate particle velocity from particle normal stress.
146  DO lc = 1, lc_bnd
147 ! Snider (40)
148  IF(ps_grad(lc,np) <= zero) THEN
149  uprimetau(lc) = min(delup(lc), enp1*slipvel(lc))
150  uprimetau(lc) = max(uprimetau(lc), zero)
151 ! Snider (41)
152  ELSE
153  uprimetau(lc) = max(delup(lc), enp1*slipvel(lc))
154  uprimetau(lc) = min(uprimetau(lc), zero)
155  ENDIF
156  ENDDO
157 
158 ! Total particle velocity is the sum of the particle velocity from
159 ! normal stress and velocity from all other foces :: Sinder (Eq 37)
160  des_vel_new(np,:) = vel + uprimetau
161 ! Total distance traveled over the current time step
162  dist(:) = des_vel_new(np,:)*dtsolid
163 
164 ! Limit parcel movement in close pack regions to the mean free path.
165  IF(epg_p(np) < epg_mfp) THEN
166  IF(dot_product(des_vel_new(np,:),ps_grad(:,np)) > zero) THEN
167 ! Total distance traveled given current velocity.
168  dist_mag = dot_product(dist, dist)
169 ! Mean free path based on volume fraction :: Snider (43)
170  mfp = 3.7d0*des_radius(np)/(l3sqt2*eps)
171 ! Impose the distance limit and calculate the corresponding velocity.
172  IF(mfp**2 < dist_mag) THEN
173  dist = mfp*dist/sqrt(dist_mag)
174  des_vel_new(np,:) = dist/dtsolid
175  ENDIF
176  ENDIF
177  ENDIF
178 
179 
180 ! Update the parcel position.
181  des_pos_new(np,:) = des_pos_new(np,:) + dist
182 ! Clear out the force array.
183  fc(np,:) = zero
184 
185 ! Determine the maximum distance traveled by any single parcel.
186  dist_mag = dot_product(des_vel_new(np,:),des_vel_new(np,:))
187  max_vel = max(max_vel, dist_mag)
188 
189  ENDDO
190 
191 ! Get the minimum fluid cell dimension
192  dxyz_min = min(minval(dx(imin1:imax1)),minval(dy(jmin1:jmax1)))
193  IF(do_k) dxyz_min = min(dxyz_min,minval(dz(kmin1:kmax1)))
194 
195 ! Calculate the maximum time step to prevent a parcel from moving more
196 ! than a fluid cell in one time step. The global_all_max could get
197 ! expensive in large MPI applications.
198  dtpic_cfl = cfl_pic*dxyz_min/(max_vel+small_number)
200 
201  RETURN
202  contains
203 
204 
205 !......................................................................!
206 ! !
207 ! Function: AVG_SOLIDS_vGRAV !
208 ! Author: J.Musser !
209 ! !
210 ! Purpose: Return the average solids velocity around the parcel with !
211 ! a correction for gravity dominated flows. !
212 ! !
213 ! Notes: The average solids velocity is reduced by 1/2 when it is !
214 ! moving within 5 degrees of parall of the direction of gravity. This !
215 ! is helps prevent overpacking while solids are settling. The value is !
216 ! blended from AVG to 0.5AVG from 0.1 to 0.0 radians. !
217 ! !
218 !''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''!
219  FUNCTION avg_vel_wgrav(lNP,lVEL) RESULT(aVEL)
221  IMPLICIT NONE
222 
223 ! Particle index
224  INTEGER, INTENT(IN) :: lNP
225 ! Intermediate parcel velocity
226  DOUBLE PRECISION, INTENT(IN) :: lVEL(3)
227 ! Average solids velocity modified for gravity
228  DOUBLE PRECISION :: aVEL(3)
229 ! Temp double precision variables.
230  DOUBLE PRECISION :: tDP1, tDP2
231 
232  avel = avgsolvel_p(:,lnp)
233 
234 ! Reduce the avreage solids velocity for gravity driven flows.
235  IF(grav_mag > small_number) THEN
236  tdp1 = dot_product(grav_norm,avel)
237  IF(tdp1 > zero) THEN
238  IF(dot_product(avel,lvel) > zero) THEN
239  tdp2 = dot_product(avel, avel)
240  IF(tdp1**2 > 0.99*tdp2) avel = &
241  (50.75d0- 50.0d0*tdp1/sqrt(tdp2))*avel ! 3/4
242 
243 ! IF(tDP1**2 > 0.99*tDP2) aVEL = aVEL * &
244 ! (100.50d0-100.0d0*tDP1/sqrt(tDP2))*aVEL ! 1/2
245 
246 ! IF(tDP1**2 > 0.99*tDP2) aVEL = 0.75d0* aVEL
247  ENDIF
248  ENDIF
249  ENDIF
250 
251  RETURN
252  END FUNCTION avg_vel_wgrav
253 
254  END SUBROUTINE integrate_time_pic_snider
255 
256 
257 
258 
259 
260 
261 
262 
263 
264 
265 
266 
267 
268 
269 
270 
271 
272 
273 
274 
275 
276 
277 
278 
279 
280 
281 
282 
283 
284 
285  SUBROUTINE integrate_time_pic_garg
287  USE param
288  USE param1
289  USE parallel
290  USE physprop
291  USE constant
292  USE fldvar
293  USE discretelement
294  USE des_bc
295  USE mpi_utility
296  USE mfix_pic
297  USE randomno
298  USE cutcell
299  USE fun_avg
300  USE functions
301  IMPLICIT NONE
302 !-----------------------------------------------
303 ! Local Variables
304 !-----------------------------------------------
305  INTEGER NP, M, LC
306  INTEGER I, J, K, IJK, IJK_OLD
307 
308  DOUBLE PRECISION DD(3), DIST, &
309  DP_BAR, MEANVEL(3), D_GRIDUNITS(3)
310 
311  DOUBLE PRECISION MEAN_FREE_PATH
312 ! index to track accounted for particles
313  INTEGER PC
314 
315 ! Logical for local debug warnings
316  LOGICAL DES_LOC_DEBUG
317 
318 ! maximum distance particles can move in MPPIC
319  DOUBLE PRECISION UPRIMEMOD
320 
321 ! dt's in each direction based on cfl_pic for the mppic case
322 
323  DOUBLE PRECISION :: DTPIC_TMPX, DTPIC_TMPY , DTPIC_TMPZ
324  DOUBLE PRECISION :: THREEINTOSQRT2, RAD_EFF, POS_Z
325  DOUBLE PRECISION :: VELP_INT(3)
326 
327  LOGICAL :: DELETE_PART, INSIDE_DOMAIN
328  INTEGER :: PIP_DEL_COUNT
329 
330  INTEGER :: LPIP_DEL_COUNT_ALL(0:numpes-1), PIJK_OLD(5)
331 
332  double precision sig_u, mean_u
333  DOUBLE PRECISION :: DTPIC_MIN_X, DTPIC_MIN_Y, DTPIC_MIN_Z
334  double precision, allocatable, dimension(:,:) :: rand_vel
335 
336  double precision :: norm1, norm2, norm3
337  Logical :: OUTER_STABILITY_COND, DES_FIXED_BED
338 !-----------------------------------------------
339 
340  outer_stability_cond = .false.
341  des_fixed_bed = .false.
342  pc = 1
344  dtpic_min_x = large_number
345  dtpic_min_y = large_number
346  dtpic_min_z = large_number
347 
348  if(no_k) threeintosqrt2 = 2.d0*sqrt(2.d0)
349  if(do_k) threeintosqrt2 = 3.d0*sqrt(2.d0)
350  threeintosqrt2 = 3.d0*sqrt(2.d0)
351  pip_del_count = 0
352 
353  !EPG_MIN2 = MINVAL(EP_G(:))
354  !epg_min_loc = MINLOC(EP_G)
355  !IJK = epg_min_loc(1)
356  allocate(rand_vel(3, max_pip))
357  do lc = 1, merge(2,3,no_k)
358  mean_u = zero
359  sig_u = 1.d0
360  CALL nor_rno(rand_vel(lc, 1:max_pip), mean_u, sig_u)
361  enddo
362  !WRITE(*, '(A,2x,3(g17.8))') 'FC MIN AND MAX IN Z = ', MINVAL(FC(3,:)), MAXVAL(FC(3,:))
363  !WRITE(UNIT_LOG, '(A,2x,3(g17.8))') 'FC MIN AND MAX IN Z = ', MINVAL(FC(3,:)), MAXVAL(FC(3,:))
364 
365  DO np = 1, max_pip
366  delete_part = .false.
367 ! pradeep skip ghost particles
368  if(pc.gt.pip) exit
369  if(is_nonexistent(np)) cycle
370  pc = pc+1
371  if(is_ghost(np) .or. is_entering_ghost(np) .or. is_exiting_ghost(np)) cycle
372 
373  des_loc_debug = .false.
374 
375  IF(.NOT.is_entering(np))THEN
376  fc(np,:) = fc(np,:)/pmass(np) + grav(:)
377  ELSE
378  fc(np,:) = zero
379  ENDIF
380 
381  IF(des_fixed_bed) fc(np,:) = zero
382 
383  !DP_BAR is the D_p in the Snider paper (JCP, vol 170, 523-549, 2001)
384  !By comparing the MFIX and equations in those papers,
385  !D_p = Beta/(EP_S*RHOP)
386  !F_gp in drag_fgs.f = Beta*PVOL/EP_S
387  !Therefore, D_p = F_gp/(PVOL*RHOP) = F_gp/PMASS
388  dp_bar = f_gp(np)/(pmass(np))
389  IF(.NOT.des_continuum_coupled) dp_bar = zero
390 
391  if(.not.mppic_pdrag_implicit) dp_bar = zero
392  m = pijk(np,5)
393  ijk = pijk(np,4)
394  ijk_old = ijk
395  pijk_old(:) = pijk(np,:)
396 
397  i = i_of(ijk)
398  j = j_of(ijk)
399  k = k_of(ijk)
400 
401  des_vel_new(np,:) = (des_vel_new(np,:) + &
402  & fc(np,:)*dtsolid)/(1.d0+dp_bar*dtsolid)
403 
404  IF(des_fixed_bed) des_vel_new(np,:) = zero
405 
406  !MPPIC_VPTAU(NP,:) = DES_VEL_NEW(NP,:)
407 
408  velp_int(:) = des_vel_new(np,:)
409 
410  meanvel(1) = u_s(ijk_old,m)
411  meanvel(2) = v_s(ijk_old,m)
412  IF(do_k) meanvel(3) = w_s(ijk_old,m)
413 
414  rad_eff = des_radius(np)
415  !RAD_EFF = (DES_STAT_WT(NP)**(1.d0/3.d0))*DES_RADIUS(NP)
416  IF(.not.des_oneway_coupled) then
417  mean_free_path = max(1.d0/(1.d0-ep_star), 1.d0/(1.d0-ep_g(ijk_old)))
418  mean_free_path = mean_free_path*rad_eff/threeintosqrt2
419  endif
420 
421  DO lc = 1, merge(2,3,no_k)
422  !SIG_U = 0.05D0*MEANVEL(LC)
423  !DES_VEL_NEW(NP,LC) = DES_VEL_NEW(NP,LC) + SIG_U*RAND_VEL(LC, L )
424  !PART_TAUP = RO_Sol(NP)*((2.d0*DES_RADIUS(NP))**2.d0)/(18.d0* MU_G(IJK))
425  sig_u = 0.005d0 !*MEANVEL(LC)
426  rand_vel(lc, np) = sig_u*rand_vel(lc, np)*des_vel_new(np,lc)
427  IF(des_fixed_bed) rand_vel(lc,np) = zero
428  !rand_vel(LC, NP) = sig_u*rand_vel(LC, NP)/part_taup
429  !rand_vel(LC, NP) = sig_u* mean_free_path*rand_vel(LC, NP)/part_taup
430  des_vel_new(np,lc) = des_vel_new(np,lc) + rand_vel(lc, np)
431  enddo
432 
433  IF(.not.des_oneway_coupled.and.(.not.des_fixed_bed)) CALL mppic_apply_ps_grad_part(np)
434 
435  uprimemod = sqrt(dot_product(des_vel_new(np,1:), des_vel_new(np,1:)))
436 
437  !IF(UPRIMEMOD*DTSOLID.GT.MEAN_FREE_PATH) then
438  ! DES_VEL_NEW(NP,:) = (DES_VEL_NEW(NP,:)/UPRIMEMOD)*MEAN_FREE_PATH/DTSOLID
439  !ENDIF
440 
441  IF(des_fixed_bed) THEN
442  dd(:) = zero
443  ELSE
444  dd(:) = des_vel_new(np,:)*dtsolid !+ rand_vel(:, NP)*dtsolid
445  ENDIF
446 
447  CALL pic_find_new_cell(np)
448 
449  ijk = pijk(np,4)
450 
451  !IF((EP_G(IJK).LT.0.35.and.fluid_at(ijk)).or.(ep_g(ijk_old).lt.0.35)) then !.and.(ijk.ne.ijk_old)) then
452  !IF((EP_G(IJK).LT.EP_STAR.and.fluid_at(ijk)).and.(ijk.ne.ijk_old)) then
453  inside_domain = .true.
454  inside_domain = fluid_at(ijk)
455 
456  IF(cut_cell_at(ijk)) THEN
457  pos_z = zero
458  IF(do_k) pos_z = des_pos_new(np,3)
459  CALL get_del_h_des(ijk,'SCALAR', &
460  & des_pos_new(np,1), des_pos_new(np,2), &
461  & pos_z, &
462  & dist, norm1, norm2, norm3, .true.)
463 
464  IF(dist.LE.zero) inside_domain = .false.
465  ENDIF
466 
467  !IF((EP_G(IJK).LT.EP_STAR.and.INSIDE_DOMAIN)) then
468  !IF(EP_G(IJK).LT.EP_STAR.and.INSIDE_DOMAIN) then
469  IF(1.d0 - ep_g(ijk).GT. 1.3d0*(1.d0 - ep_star).and.inside_domain.and.ijk.NE.ijk_old.and.outer_stability_cond) then
470  dd(:) = zero
471  des_vel_new(np,:) = 0.8d0*des_vel_new(np,:)
472  ENDIF
473 
474  pijk(np,:) = pijk_old(:)
475 
476  des_pos_new(np,:) = des_pos_new(np,:) + dd(:)
477 
478  dist = sqrt(dot_product(dd,dd))
479 
480  d_gridunits(1) = abs(dd(1))/dx(pijk(np,1))
481  d_gridunits(2) = abs(dd(2))/dy(pijk(np,2))
482  d_gridunits(3) = 1.d0
483  IF(do_k) d_gridunits(3) = abs(dd(3))/dz(pijk(np,3))
484 
485  dist = sqrt(dot_product(dd,dd))
486  dtpic_tmpx = (cfl_pic*dx(pijk(np,1)))/(abs(des_vel_new(np,1))+small_number)
487  dtpic_tmpy = (cfl_pic*dy(pijk(np,2)))/(abs(des_vel_new(np,2))+small_number)
488  dtpic_tmpz = large_number
489  IF(do_k) dtpic_tmpz = (cfl_pic*dz(pijk(np,3)))/(abs(des_vel_new(np,3))+small_number)
490 
491 
492 ! Check if the particle has moved a distance greater than or equal to grid spacing
493 ! if so, then exit
494 
495  DO lc = 1, merge(2,3,no_k)
496  IF(d_gridunits(lc).GT.one) THEN
497  IF(dmp_log.OR.mype.eq.pe_io) THEN
498 
499  WRITE(unit_log, 2001) np, d_gridunits(:), des_vel_new(np,:)
500  WRITE(unit_log, '(A,2x,3(g17.8))') 'rand_vel = ', rand_vel(:,np)
501  IF (do_old) WRITE(unit_log, '(A,2x,3(g17.8))') 'des_pos_old = ', des_pos_old(np,:)
502  WRITE(unit_log, '(A,2x,3(g17.8))') 'des_pos_new = ', des_pos_new(np,:)
503  WRITE(unit_log, '(A,2x,3(g17.8))') 'FC = ', fc(np,:)
504 
505  WRITE(*, 2001) np, d_gridunits(:), des_vel_new(np,:)
506 
507  WRITE(*, '(A,2x,3(g17.8))') 'rand_vel = ', rand_vel(:,np)
508  IF (do_old) WRITE(*, '(A,2x,3(g17.8))') 'des_pos_old = ', des_pos_old(np,:)
509  WRITE(*, '(A,2x,3(g17.8))') 'des_pos_new = ', des_pos_new(np,:)
510  WRITE(*, '(A,2x,3(g17.8))') 'FC = ', fc(np,:)
511 ! read(*,*)
512  delete_part = .true.
513 
514  ENDIF
515  !CALL mfix_exit(myPE)
516  END IF
517 
518  END DO
519 
520  IF(.not.delete_part) then
521  dtpic_cfl = min(dtpic_cfl, dtpic_tmpx, dtpic_tmpy, dtpic_tmpz)
522  dtpic_min_x = min(dtpic_min_x, dtpic_tmpx)
523  dtpic_min_y = min(dtpic_min_y, dtpic_tmpy)
524  dtpic_min_z = min(dtpic_min_z, dtpic_tmpz)
525  ENDIF
526  fc(np,:) = zero
527 
528  IF(delete_part) THEN
529  CALL set_nonexistent(np)
530  pip_del_count = pip_del_count + 1
531  ENDIF
532  IF (des_loc_debug) WRITE(*,1001)
533  ENDDO
534 
535 
536  DEALLOCATE(rand_vel)
537 
539  pip = pip - pip_del_count
540 
541  lpip_del_count_all(:) = 0
542  lpip_del_count_all(mype) = pip_del_count
543  CALL global_all_sum(lpip_del_count_all)
544  IF((dmp_log).AND.sum(lpip_del_count_all(:)).GT.0) THEN
545  IF(print_des_screen) THEN
546  WRITE(*,'(/,2x,A,2x,i10,/,A)') &
547  'TOTAL NUMBER OF PARTS STEPPING MORE THAN ONE GRID SPACE = ',&
548  sum(lpip_del_count_all(:)), &
549  'THIS SHOULD NOT HAPPEN FREQUENTLY: MONITOR THIS MESSAGE'
550  ENDIF
551 
552  WRITE(unit_log,'(/,2x,A,2x,i10,/,A)') &
553  'TOTAL NUMBER OF PARTS STEPPING MORE THAN ONE GRID SPACEC=',&
554  sum(lpip_del_count_all(:)), &
555  'THIS SHOULD NOT HAPPEN FREQUENTLY: MONITOR THIS MESSAGE'
556  !DO IPROC = 0, NUMPES-1
557  ! WRITE(UNIT_LOG, '(/,A,i4,2x,A,2x,i5)') &
558  ! 'PARTICLES OUTSIDE DOMAIN (PIC) ON PROC:', IPROC,' EQUAL TO', LPIP_DEL_COUNT_ALL(IPROC)
559  !ENDDO
560 
561  ENDIF
562 
564 
565  RETURN
566  IF(dtsolid.GT.dtpic_max) THEN
567  !IF(DMP_LOG) WRITE(UNIT_LOG, 2001) DTSOLID
568  IF(mype.eq.pe_io) WRITE(*, 2004) dtsolid
569  ELSEIF(dtsolid.LT.dtpic_max) THEN
570 
571  !IF(DMP_LOG) WRITE(UNIT_LOG, 2002) DTSOLID
572  IF(mype.eq.pe_io) WRITE(*, 2002) dtpic_max
573  ELSE
574  !WRITE(*,'(A40,2x,g17.8)') 'DT
575  !IF(mype.eq.pe_IO) WRITE(*,2003) DTSOLID
576  END IF
577 
578  WRITE(unit_log, '(10x,A,2x,3(g17.8))')&
579  'DTPIC MINS IN EACH DIRECTION = ', dtpic_min_x, &
580  dtpic_min_y, dtpic_min_z
581  WRITE(*, '(10x,A,2x,3(g17.8))')'DTPIC MINS IN EACH DIRECTION = ',&
582  dtpic_min_x, dtpic_min_y, dtpic_min_z
583 
584  1001 FORMAT(3x,'<---------- END INTEGRATE_TIME_PIC ----------')
585 
586 2001 FORMAT(/1x,70('*'),//,10x, &
587  & 'MOVEMENT UNDESIRED IN INTEGRATE_TIME_PIC: PARTICLE', i5, /,10x, &
588  & ' MOVED MORE THAN A GRID SPACING IN ONE TIME STEP', /,10x, &
589  & 'MOVEMENT IN GRID UNITS = ', 3(2x, g17.8),/,10x, &
590  & 'TERMINAL ERROR: NOT STOPPING, BUT DELETING THE PARTICLE', &
591  & /1x,70('*'), /10x, &
592  & 'DES_VEL_NEW = ', 3(2x, g17.8))
593 
594  2004 FORMAT(/10x, &
595  & 'DTSOLID SHUD BE REDUCED TO', g17.8)
596 
597  2002 FORMAT(/10x, &
598  & 'DTSOLID CAN BE INCREASED TO', g17.8)
599 
600  RETURN
601  END SUBROUTINE integrate_time_pic_garg
602 
603 
604 !------------------------------------------------------------------------
605 ! subroutine : des_dbgpic
606 ! Author : Pradeep G.
607 ! Purpose : For debugging the pic values
608 ! Parameters : pstart - start indices of the particle
609 ! pend - end indices of the particle
610 ! pfreq - optional frequency (when the local count matches the
611 ! frequency the filw will be written)
612 ! if not send then it prints the file
613 !------------------------------------------------------------------------
614 
615  subroutine des_dbgpic (pstart,pend,pfreq)
617 !-----------------------------------------------
618 ! Modules
619 !-----------------------------------------------
620  use discretelement
621  USE fldvar
622  use physprop, only: mmax
623  use functions
624  implicit none
625 !-----------------------------------------------
626 ! Dummy arguments
627 !-----------------------------------------------
628  INTEGER, INTENT(IN) :: pstart,pend
629  INTEGER, INTENT(IN), OPTIONAL :: pfreq
630 !-----------------------------------------------
631 ! Local variables
632 !-----------------------------------------------
633  integer lp,lijk
634  integer, save :: lfcount = 0 ,lfreq =0
635  character(255) :: filename
636 !-----------------------------------------------
637  if (present(pfreq)) then
638  lfreq = lfreq+1
639  if (lfreq .ne. pfreq) return
640  lfreq =0
641  end if
642  lfcount = lfcount + 1
643  write(filename,'("debug",I3.3)') lfcount
644  open (unit=100,file=filename)
645  do lp = pstart,pend
646  if (is_normal(lp) .or. is_entering(lp) .or. is_exiting(lp)) then
647  lijk = pijk(lp,4)
648  write(100,*)"positon =",lijk,pijk(lp,1),pijk(lp,2), &
649  pijk(lp,3),ep_g(lijk),u_s(lijk,mmax+1)
650  write(100,*)"forces =", fc(lp,2),tow(lp,1)
651  end if
652  end do
653  close (100)
654 
655  RETURN
656  END SUBROUTINE des_dbgpic
657 
658 
659 !------------------------------------------------------------------------
660 ! subroutine : des_dbgtecplot
661 ! Author : Pradeep G.
662 ! Purpose : prints the tecplot file for particle location
663 ! Parameters : pstart - start indices of the particle
664 ! pend - end indices of the particle
665 ! pfreq - optional frequency (when the local count matches the
666 ! frequency the filw will be written)
667 ! if not send then it prints the file
668 !------------------------------------------------------------------------
669 
670  subroutine des_dbgtecplot (pstart,pend,pfreq)
672 !-----------------------------------------------
673 ! Modules
674 !-----------------------------------------------
675  use discretelement
676  USE fldvar
677  use functions
678  implicit none
679 !-----------------------------------------------
680 ! Dummy arguments
681 !-----------------------------------------------
682  INTEGER, INTENT(IN) :: pstart,pend
683  INTEGER, INTENT(IN), OPTIONAL :: pfreq
684 !-----------------------------------------------
685 ! Local variables
686 !-----------------------------------------------
687  integer lp,lijk
688  integer, save :: lfcount = 0 ,lfreq =0
689  character(255) :: filename
690 !-----------------------------------------------
691 
692  if (present(pfreq)) then
693  lfreq = lfreq+1
694  if (lfreq .ne. pfreq) return
695  lfreq =0
696  end if
697  lfcount = lfcount + 1
698  write(filename,'("new_tec",I3.3,".dat")') lfcount
699  open (unit=100,file=filename)
700  write(100,'(9(A,3X),A)') &
701  'VARIABLES = ', '"ijk"', '"x"', '"y"', '"vx"', '"vy"', &
702  '"ep_g"', '"FCX"' ,'"FCY"', '"TOW"'
703  write(100,'(A,F14.7,A)') 'zone T = "' , s_time , '"'
704  do lp = pstart,pend
705  if (.not.is_nonexistent(lp)) then
706  lijk = pijk(lp,4)
707  write(100,*)lijk,des_pos_new(lp,1),des_pos_new(lp,2), &
708  des_vel_new(lp,1),des_vel_new(lp,2),ep_g(lijk),&
709  fc(lp,1),fc(lp,2),tow(1,lp)
710  endif
711  enddo
712  close (100)
713  RETURN
714  END SUBROUTINE des_dbgtecplot
double precision dtpic_cfl
Definition: mfix_pic_mod.f:70
double precision, dimension(:,:), allocatable v_s
Definition: fldvar_mod.f:105
double precision, dimension(:), allocatable ep_g
Definition: fldvar_mod.f:15
double precision, dimension(:,:), allocatable avgsolvel_p
Definition: mfix_pic_mod.f:28
double precision, dimension(:,:), allocatable ps_grad
Definition: mfix_pic_mod.f:74
double precision, parameter one
Definition: param1_mod.f:29
logical mppic_solid_stress_snider
Definition: mfix_pic_mod.f:20
logical mppic_pdrag_implicit
Definition: mfix_pic_mod.f:78
subroutine, public nor_rno(Y, mean, sigma)
Definition: randomno_mod.f:66
double precision function, dimension(3) avg_vel_wgrav(lNP, lVEL)
double precision, dimension(:,:), allocatable w_s
Definition: fldvar_mod.f:117
double precision cfl_pic
Definition: mfix_pic_mod.f:70
double precision, parameter undefined
Definition: param1_mod.f:18
double precision, dimension(:,:), allocatable u_s
Definition: fldvar_mod.f:93
subroutine pic_find_new_cell(LL)
integer mmax
Definition: physprop_mod.f:19
double precision, parameter small_number
Definition: param1_mod.f:24
subroutine integrate_time_pic_snider
double precision, parameter large_number
Definition: param1_mod.f:23
Definition: param_mod.f:2
double precision dtpic_taup
Definition: mfix_pic_mod.f:70
double precision ep_star
Definition: constant_mod.f:29
logical no_k
Definition: geometry_mod.f:28
logical do_k
Definition: geometry_mod.f:30
logical, dimension(:), allocatable cut_cell_at
Definition: cutcell_mod.f:355
double precision, dimension(:), allocatable epg_p
Definition: mfix_pic_mod.f:31
subroutine integrate_time_pic_garg
subroutine get_del_h_des(IJK, TYPE_OF_CELL, X0, Y0, Z0, Del_H, Nx, Ny, Nz, allow_neg_dist)
Definition: get_delh.f:177
double precision dtpic_max
Definition: mfix_pic_mod.f:65
double precision mppic_coeff_en1
Definition: mfix_pic_mod.f:42
subroutine mppic_apply_ps_grad_part(L)
Definition: pic_routines.f:192
double precision, dimension(dim_m) ro_s0
Definition: physprop_mod.f:28
subroutine des_dbgpic(pstart, pend, pfreq)
subroutine integrate_time_pic
double precision, parameter zero
Definition: param1_mod.f:27
subroutine des_dbgtecplot(pstart, pend, pfreq)