mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Don't modify wgt_last in russian_roulette
This commit is contained in:
parent
36d5c94f9e
commit
03fe9d3200
1 changed files with 1 additions and 3 deletions
|
|
@ -12,12 +12,10 @@ namespace openmc {
|
|||
void russian_roulette(Particle& p)
|
||||
{
|
||||
if (p.wgt() < settings::weight_cutoff) {
|
||||
if (prn(p.current_seed()) < p.wgt() / settings::weight_survive) {
|
||||
if (settings::weight_survive * prn(p.current_seed()) < p.wgt()) {
|
||||
p.wgt() = settings::weight_survive;
|
||||
p.wgt_last() = p.wgt();
|
||||
} else {
|
||||
p.wgt() = 0.;
|
||||
p.wgt_last() = 0.;
|
||||
p.alive() = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue