From ae785fda5f821e9144b1c93e5344d788c7382ce7 Mon Sep 17 00:00:00 2001 From: Coline Larmier Date: Thu, 10 Nov 2022 15:14:09 +0100 Subject: [PATCH] Fix the case where the yield is zero. Problem detected in the context of a code-to-code comparison between OpenMC and TRIPOLI-4: - configuration: sphere of radius R = 30 cm containing the isotope ZR93 at 293K - sphere irradiated at the center by an isotropic, mono-energy, point source (E_0 = 14.1 MeV) - data from JEFF-3.3 For some isotopes, namely ZR93 at 293K, the sampled yield can be equal to 0 (namely for MT=5: interaction "n-other"). In such a case, it is necessary to deactivate the particle. --- src/physics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics.cpp b/src/physics.cpp index bcdcf7ecf..ae59b49cb 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -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(std::round(yield)) - 1; ++i) { p.create_secondary(p.wgt(), p.u(), p.E(), ParticleType::neutron);