Fixed segmentation fault in Coulomb collisions

When the relative velocity between a charged particle and the background
for Coulomb collisions (W in the code) was low, there was a
segmentation fault. This is fixed now as if the norm of the relative
velocity (normW) in the code is too low, no collision is applied.
This commit is contained in:
Jorge Gonzalez 2023-03-12 17:02:12 +01:00
commit f4448d9e7a
2 changed files with 16 additions and 1 deletions

View file

@ -1016,6 +1016,14 @@ MODULE moduleMesh
W = partTemp%part%v - velocity
normW = NORM2(W)
IF (normW > 1.D-10) THEN
!If relative velocity is too low, skip collision and move to next particle
partTemp => partTemp%next
CYCLE
END IF
lW = l * normW
AW = coulombMatrix(k)%A_i/normW
@ -1082,6 +1090,14 @@ MODULE moduleMesh
W = partTemp%part%v - velocity
normW = NORM2(W)
IF (normW > 1.D-10) THEN
!If relative velocity is too low, skip collision and move to next particle
partTemp => partTemp%next
CYCLE
END IF
lW = l * normW
AW = coulombMatrix(k)%A_j/normW