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
|
TYPE(particle), INTENT(inout):: part
|
||||||
CLASS(meshVol), POINTER, INTENT(in):: volOld
|
CLASS(meshVol), POINTER, INTENT(in):: volOld
|
||||||
CLASS(meshVol), POINTER, INTENT(inout):: volNew
|
CLASS(meshVol), POINTER, INTENT(inout):: volNew
|
||||||
REAL(8):: fractionVolume, fractionWeight
|
REAL(8):: fractionVolume, pSplit
|
||||||
INTEGER:: nSplit
|
|
||||||
|
|
||||||
!If particle has change cell, call Weighting scheme
|
!If particle changes volume to smaller cell
|
||||||
IF (volOld%n /= volNew%n) THEN
|
IF (volOld%volume > volNew%volume) THEN
|
||||||
fractionVolume = volOld%volume/volNew%volume
|
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 (random() < pSplit THEN
|
||||||
|
!Split particle in two
|
||||||
IF (fractionWeight >= 2.D0) THEN
|
CALL splitParticle(part, 2, volNew)
|
||||||
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.
|
|
||||||
|
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue