OpenMC/src/physics_common.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
506 B
C++
Raw Permalink Normal View History

2018-10-07 07:18:29 -04:00
#include "openmc/physics_common.h"
#include "openmc/random_lcg.h"
#include "openmc/settings.h"
namespace openmc {
//==============================================================================
// RUSSIAN_ROULETTE
//==============================================================================
2022-01-19 09:14:41 -06:00
void russian_roulette(Particle& p, double weight_survive)
2018-10-07 07:18:29 -04:00
{
2022-01-19 09:14:41 -06:00
if (weight_survive * prn(p.current_seed()) < p.wgt()) {
p.wgt() = weight_survive;
} else {
p.wgt() = 0.;
2018-10-07 07:18:29 -04:00
}
}
} // namespace openmc