First attempt at Coulomb collisions #46

Merged
JorgeGonz merged 21 commits from feature/CoulombLinear into development 2023-07-16 14:47:59 +02:00
2 changed files with 16 additions and 1 deletions
Showing only changes of commit f4448d9e7a - Show all commits

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.
Jorge Gonzalez 2023-03-12 17:02:12 +01:00

View file

@ -1016,6 +1016,14 @@ MODULE moduleMesh
W = partTemp%part%v - velocity W = partTemp%part%v - velocity
normW = NORM2(W) 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 lW = l * normW
AW = coulombMatrix(k)%A_i/normW AW = coulombMatrix(k)%A_i/normW
@ -1082,6 +1090,14 @@ MODULE moduleMesh
W = partTemp%part%v - velocity W = partTemp%part%v - velocity
normW = NORM2(W) 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 lW = l * normW
AW = coulombMatrix(k)%A_j/normW AW = coulombMatrix(k)%A_j/normW

View file

@ -70,7 +70,6 @@ MODULE moduleSolver
CHARACTER(:), ALLOCATABLE:: pusherType CHARACTER(:), ALLOCATABLE:: pusherType
REAL(8):: tau, tauSp REAL(8):: tau, tauSp
!TODO: Reorganize if Cart pushers are combined
SELECT CASE(mesh%dimen) SELECT CASE(mesh%dimen)
CASE(0) CASE(0)
self%pushParticle => push0D self%pushParticle => push0D