I'm a fucking idiot
The limit I set to avoid divisions by zero was wront and collisions were being skipped. It is corrected now.
This commit is contained in:
parent
f4448d9e7a
commit
ed6c2c46e4
2 changed files with 6 additions and 4 deletions
|
|
@ -1016,7 +1016,7 @@ MODULE moduleMesh
|
|||
|
||||
W = partTemp%part%v - velocity
|
||||
normW = NORM2(W)
|
||||
IF (normW > 1.D-10) THEN
|
||||
IF (normW < 1.D-12) THEN
|
||||
!If relative velocity is too low, skip collision and move to next particle
|
||||
partTemp => partTemp%next
|
||||
|
||||
|
|
@ -1055,6 +1055,7 @@ MODULE moduleMesh
|
|||
deltaV = dW(1)*e1 + dW(2)*(COS(rnd)*e2 + SIN(rnd)*e3)
|
||||
|
||||
totalDeltaV_ij = totalDeltaV_ij + NORM2(deltaV)
|
||||
|
||||
!Change particle velocity
|
||||
partTemp%part%v = partTemp%part%v + deltaV
|
||||
|
||||
|
|
@ -1078,6 +1079,7 @@ MODULE moduleMesh
|
|||
normDeltaV = totalDeltaV_ij / REAL(cell%listPart_in(j)%amount) * &
|
||||
(coulombMatrix(k)%sp_i%weight*coulombMatrix(k)%sp_i%m) / &
|
||||
(coulombMatrix(k)%sp_j%weight*coulombMatrix(k)%sp_j%m)
|
||||
|
||||
!Loop over particles of species_j
|
||||
partTemp => cell%listPart_in(j)%head
|
||||
DO WHILE(ASSOCIATED(partTemp))
|
||||
|
|
@ -1090,7 +1092,7 @@ MODULE moduleMesh
|
|||
|
||||
W = partTemp%part%v - velocity
|
||||
normW = NORM2(W)
|
||||
IF (normW > 1.D-10) THEN
|
||||
IF (normW < 1.D-12) THEN
|
||||
!If relative velocity is too low, skip collision and move to next particle
|
||||
partTemp => partTemp%next
|
||||
|
||||
|
|
@ -1111,7 +1113,7 @@ MODULE moduleMesh
|
|||
dW(2) = ABS(randomMaxwellian()*SQRT(delta_per_square*tauMin))
|
||||
|
||||
!Normalize with average exchange per particle
|
||||
!TODO: This is a dirty trick, it should not be neccessary but I don't lnow why it is.
|
||||
!TODO: This is a dirty trick to ensure conservation between species
|
||||
dW = normDeltaV*dW/NORM2(dW)
|
||||
|
||||
!System of reference for the velocity change
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue