Make sure subcrit multiplication problems abort gracefully when k > 1

This commit is contained in:
Paul Romano 2019-03-20 22:33:54 -05:00
parent 4971779f39
commit 2e94189b1b

View file

@ -95,6 +95,14 @@ void sample_neutron_reaction(Particle* p)
} else if (settings::run_mode == RUN_MODE_FIXEDSOURCE &&
settings::create_fission_neutrons) {
create_fission_sites(p, i_nuclide, rx, simulation::secondary_bank);
// Make sure particle population doesn't grow out of control for
// subcritical multiplication problems.
if (simulation::secondary_bank.size() >= 10000) {
fatal_error("The secondary particle bank appears to be growing without "
"bound. You are likely running a subcritical multiplication problem "
"with k-effective close to or greater than one.");
}
}
}