Fix an issue in assigning cells in ionization Boundary

This assigns the correct random cell when a particle is created from the
ionization boundary.

Also, the number of possible ionizations is reduced by one if there is a
suscesful ionization. This has no impact on the results.
This commit is contained in:
Jorge Gonzalez 2023-02-03 10:52:49 +01:00
commit a0dfc55a69

View file

@ -156,8 +156,14 @@ MODULE moduleMeshBoundary
newElectron%r = edge%randPos() newElectron%r = edge%randPos()
newIon%r = newElectron%r newIon%r = newElectron%r
newElectron%cell = part%cell IF (ASSOCIATED(edge%e1)) THEN
newIon%cell = part%cell newElectron%cell = edge%e1%n
ELSEIF (ASSOCIATED(edge%e2)) THEN
newElectron%cell = edge%e2%n
END IF
newIon%cell = newElectron%cell
newElectron%Xi = mesh%cells(part%cell)%obj%phy2log(newElectron%r) newElectron%Xi = mesh%cells(part%cell)%obj%phy2log(newElectron%r)
newIon%Xi = newElectron%Xi newIon%Xi = newElectron%Xi
@ -178,6 +184,9 @@ MODULE moduleMeshBoundary
eRel = eRel - bound%eThreshold eRel = eRel - bound%eThreshold
vRel = 2.D0*DSQRT(eRel)/mRel vRel = 2.D0*DSQRT(eRel)/mRel
!Reduce number of possible ionizations
nIonizations = nIonizations - 1
END IF END IF
END DO END DO