16 use discretelement
, only: max_pip
18 use discretelement
, only: pijk
20 use discretelement
, only: pinc
35 INTEGER :: L, I, J, K, IJK
39 LOGICAL,
PARAMETER :: REMOVE_ROGUE_PARTICLES = .false.
56 IF((i > iend1 .OR. i < istart1) .OR. &
57 (j > jend1 .OR. j < jstart1) .OR. &
58 (k > kend1 .OR. k < kstart1))
THEN 61 pinc(ijk) = pinc(ijk) - 1
66 ELSEIF(remove_rogue_particles)
THEN 78 IF(remove_rogue_particles)
RETURN 102 use discretelement
, only: iglobal_id
104 use discretelement
, only: max_pip
106 use discretelement
, only: pijk
108 use discretelement
, only: des_pos_new, des_vel_new
119 INTEGER :: L, I, J, K
130 1100
FORMAT(
'Error 1100: Particles detected in a ghost cell:',/
' ')
134 IF(.NOT.is_normal(l)) cycle
141 IF (i.GT.iend1 .OR. i.LT.istart1)
THEN 142 WRITE(
err_msg, 1101) trim(
ival(iglobal_id(l))),
'I', &
143 trim(
ival(i)),
'X',des_pos_new(l,1),
'X',des_vel_new(l,1)
147 IF(j.GT.jend1 .OR. j.LT.jstart1)
THEN 148 WRITE(
err_msg, 1101) trim(
ival(iglobal_id(l))),
'J', &
149 trim(
ival(j)),
'Y',des_pos_new(l,2),
'Y',des_vel_new(l,2)
153 IF (do_k .AND. (k.GT.kend1 .OR. k.LT.kstart1))
THEN 154 WRITE(
err_msg, 1101) trim(
ival(iglobal_id(l))),
'K', &
155 trim(
ival(k)),
'Z',des_pos_new(l,3),
'Z',des_vel_new(l,3)
160 1101
FORMAT(
'Particle ',a,
' moved into cell with ',a,
' index ',a,/ &
161 3x,a,
'-Position: ',g11.4,6x,a,
'-Velocity:',g11.4,/
' ')
165 1102
FORMAT(
'This is a fatal error. A particle output file (vtp) ', &
166 'will be written',/
'to aid debugging.')
194 use discretelement
, only: pip, max_pip
196 use discretelement
, only: pijk
198 use discretelement
, only: pinc
200 use discretelement
, only: des_pos_new, des_vel_new
202 use discretelement
, only: xe, yn, zt
204 use discretelement
, only: dtsolid
210 use discretelement
, only: xe, yn, zt
219 use discretelement
, only: iglobal_id
227 INTEGER,
INTENT(IN) :: NP
233 INTEGER :: I, J, K, IJK
237 LOGICAL,
PARAMETER :: lDEBUG = .false.
239 DOUBLE PRECISION :: oPOS(3)
245 opos = des_pos_new(np,:)
248 des_vel_new(np,:) = -des_vel_new(np,:)
251 des_pos_new(np,:) = des_pos_new(np,:) + &
252 des_vel_new(np,:) * dtsolid
261 IF(fluid_at(ijk))
THEN 269 pinc(ijk) = pinc(ijk) + 1
272 write(*,*)
'Still not cool -->', iglobal_id(np)
282 1100
FORMAT(
'Warninge 1100: Particle ',a,
' was recovered from a ', &
283 'ghost cell.',2/2x,
'Moved into cell with ',a1,
' index: ',a, &
284 /2x,a1,
'-Position OLD:',g11.4,/2x,a1,
'-Position NEW:',g11.4, &
285 /2x,a1,
'-Velocity:',g11.4)
287 1110
FORMAT(
'Warninge 1110: Particle ',a,
' was deleted from a ', &
288 'ghost cell.',2/2x,
'Moved into cell with ',a1,
' index: ',a, &
289 /2x,a1,
'-Position OLD:',g11.4,/2x,a1,
'-Position NEW:',g11.4, &
290 /2x,a1,
'-Velocity:',g11.4,/2x,
'Fluid Cell: ',a,/2x, &
291 'Cut cell? ',l1,/2x,
'Fluid at? ',l1)
327 use discretelement
, only: pip, max_pip
329 use discretelement
, only: pijk
331 use discretelement
, only: pinc
333 use discretelement
, only: des_pos_new, des_pos_old
335 use discretelement
, only: xe, yn, zt
337 use discretelement
, only: des_vel_new
350 INTEGER :: L, I, J, K, IJK
354 DOUBLE PRECISION :: lPOS
356 INTEGER :: lDELETED, gDELETED
358 INTEGER :: lRECOVERED, gRECOVERED
360 LOGICAL,
PARAMETER :: lDEBUG = .false.
375 IF(.NOT.is_normal(l)) cycle
387 IF (i > iend1 .OR. i < istart1)
THEN 389 lpos = des_pos_new(l,1)
390 IF(i.EQ.iend1+1 .AND. &
391 (lpos >= xe(iend1-1) .AND. lpos <= xe(iend1)) )
THEN 393 lrecovered = lrecovered + 1
398 'X',des_pos_old(l,1),
'X',lpos,
'X',des_vel_new(l,1)
403 ldeleted = ldeleted + 1
404 CALL set_nonexistent(l)
405 pinc(ijk) = pinc(ijk) - 1
409 'X',des_pos_old(l,1),
'X',lpos,
'X',des_vel_new(l,1), &
417 IF(j.GT.jend1 .OR. j.LT.jstart1)
THEN 418 lpos = des_pos_new(l,2)
419 IF(j.EQ.jend1+1.AND.&
420 (lpos >= yn(jend1-1) .AND. lpos <= yn(jend1)) )
THEN 422 lrecovered = lrecovered + 1
427 'Y',des_pos_old(l,2),
'Y',lpos,
'Y',des_vel_new(l,2)
433 ldeleted = ldeleted + 1
434 CALL set_nonexistent(l)
435 pinc(ijk) = pinc(ijk) - 1
439 'Y',des_pos_old(l,2),
'Y',lpos,
'Y',des_vel_new(l,2), &
447 IF(do_k .AND. (k > kend1 .OR. k < kstart1))
THEN 448 lpos = des_pos_new(l,3)
449 IF(k == kend1+1 .AND. &
450 (lpos >= zt(kend1-1) .AND. lpos <= zt(kend1)) )
THEN 452 lrecovered = lrecovered + 1
457 'Z',des_pos_old(l,3),
'Z',lpos,
'Z',des_vel_new(l,3)
462 ldeleted = ldeleted + 1
463 CALL set_nonexistent(l)
464 pinc(ijk) = pinc(ijk) - 1
468 'Z',des_pos_old(l,3),
'Z',lpos,
'Z',des_vel_new(l,3), &
477 1100
FORMAT(
'Warninge 1100: Particle ',a,
' was recovered from a ', &
478 'ghost cell.',2/2x,
'Moved into cell with ',a1,
' index: ',a, &
479 /2x,a1,
'-Position OLD:',g11.4,/2x,a1,
'-Position NEW:',g11.4, &
480 /2x,a1,
'-Velocity:',g11.4)
482 1110
FORMAT(
'Warninge 1110: Particle ',a,
' was deleted from a ', &
483 'ghost cell.',2/2x,
'Moved into cell with ',a1,
' index: ',a, &
484 /2x,a1,
'-Position OLD:',g11.4,/2x,a1,
'-Position NEW:',g11.4, &
485 /2x,a1,
'-Velocity:',g11.4,/2x,
'Fluid Cell: ',a,/2x, &
486 'Cut cell? ',l1,/2x,
'Fluid at? ',l1)
492 CALL global_sum(lrecovered, grecovered, pe_io)
495 IF(grecovered + gdeleted > 0)
THEN 496 WRITE(
err_msg,1115) trim(
ival(gdeleted + grecovered)), &
497 trim(
ival(gdeleted)), trim(
ival(grecovered))
501 1115
FORMAT(
'Warning 1115: ',a,
' particles detected outside the ', &
502 'domain.',/2x,a,
' particles were deleted.',/2x,a,
' particles',&
subroutine recover_parcel(NP)
subroutine write_des_data
subroutine init_err_msg(CALLER)
subroutine check_cell_movement
subroutine check_cell_movement_dem
logical, dimension(:), allocatable cut_cell_at
subroutine pic_search(IDX, lPOS, ENT_POS, lDIMN, lSTART, lEND)
character(len=line_length), dimension(line_count) err_msg
subroutine check_cell_movement_pic
subroutine delete_particle(NP)
subroutine open_pe_log(IER)
subroutine flush_err_msg(DEBUG, HEADER, FOOTER, ABORT, LOG, CALL_TREE)