Modification of Weighting scheme
The weighting scheme has been modified so that particles are splitted without modifying the weight. I have to look a bit more into this.
This commit is contained in:
parent
dd1fca3fee
commit
e9c86b4678
1 changed files with 8 additions and 14 deletions
|
|
@ -660,24 +660,18 @@ MODULE moduleSolver
|
|||
TYPE(particle), INTENT(inout):: part
|
||||
CLASS(meshVol), POINTER, INTENT(in):: volOld
|
||||
CLASS(meshVol), POINTER, INTENT(inout):: volNew
|
||||
REAL(8):: fractionVolume, fractionWeight
|
||||
INTEGER:: nSplit
|
||||
REAL(8):: fractionVolume, pSplit
|
||||
|
||||
!If particle has change cell, call Weighting scheme
|
||||
IF (volOld%n /= volNew%n) THEN
|
||||
!If particle changes volume to smaller cell
|
||||
IF (volOld%volume > volNew%volume) THEN
|
||||
fractionVolume = volOld%volume/volNew%volume
|
||||
|
||||
part%weight = part%weight * fractionVolume
|
||||
!Calculate probability of splitting particle
|
||||
pSplit = 1.D0 - DEXP(-fractionVolume)
|
||||
|
||||
fractionWeight = part%weight / part%species%weight
|
||||
|
||||
IF (fractionWeight >= 2.D0) THEN
|
||||
nSplit = FLOOR(fractionWeight)
|
||||
CALL splitParticle(part, nSplit, volNew)
|
||||
|
||||
ELSEIF (part%weight < 1.D0) THEN
|
||||
!Particle has lost statistical meaning and will be terminated
|
||||
part%n_in = .FALSE.
|
||||
IF (random() < pSplit THEN
|
||||
!Split particle in two
|
||||
CALL splitParticle(part, 2, volNew)
|
||||
|
||||
END IF
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue