From 1b2b5e169c7dcf9d504ed505edc76f96ee25e87d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 23 May 2022 14:44:08 -0500 Subject: [PATCH] Map radiation type to particle type properly in Decay.get_sources --- openmc/data/decay.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/openmc/data/decay.py b/openmc/data/decay.py index 5de07f465e..142be35e43 100644 --- a/openmc/data/decay.py +++ b/openmc/data/decay.py @@ -511,11 +511,21 @@ class Decay(EqualityMixin): sources = {} name = self.nuclide['name'] for particle, spectra in self.spectra.items(): - # Only handle gammas for now - if particle not in ('gamma', 'xray'): - continue - # TODO: Set particle type based on 'particle' above - particle_type = 'photon' + # Set particle type based on 'particle' above + particle_type = { + 'gamma': 'photon', + 'beta-': 'electron', + 'ec/beta+': 'positron', + 'alpha': 'alpha', + 'n': 'neutron', + 'sf': 'fragment', + 'p': 'proton', + 'e-': 'electron', + 'xray': 'photon', + 'anti-neutrino': 'anti-neutrino', + 'neutrino': 'neutrino', + }[particle] + if particle_type not in sources: sources[particle_type] = []