mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Merge pull request #2295 from colinelarmier/fix_yield
Fix the case where the yield is zero.
This commit is contained in:
commit
765df9115f
1 changed files with 1 additions and 1 deletions
|
|
@ -1127,7 +1127,7 @@ void inelastic_scatter(const Nuclide& nuc, const Reaction& rx, Particle& p)
|
|||
|
||||
// evaluate yield
|
||||
double yield = (*rx.products_[0].yield_)(E_in);
|
||||
if (std::floor(yield) == yield) {
|
||||
if (std::floor(yield) == yield && yield > 0) {
|
||||
// If yield is integral, create exactly that many secondary particles
|
||||
for (int i = 0; i < static_cast<int>(std::round(yield)) - 1; ++i) {
|
||||
p.create_secondary(p.wgt(), p.u(), p.E(), ParticleType::neutron);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue