diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index f478aafc7..581adc417 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -511,6 +511,9 @@ class IncidentNeutron(EqualityMixin): rxs = [data[mt] for mt in SUM_RULES[mt_sum] if mt in data] if len(rxs) > 0: data.summed_reactions[mt_sum] = rx = Reaction(mt_sum) + if rx.mt == 18 and 'total_nu' in group: + tgroup = group['total_nu'] + rx.derived_products.append(Product.from_hdf5(tgroup)) for T in data.temperatures: rx.xs[T] = Sum([rx_i.xs[T] for rx_i in rxs]) diff --git a/openmc/plotter.py b/openmc/plotter.py index f93c716ed..23143d6b7 100644 --- a/openmc/plotter.py +++ b/openmc/plotter.py @@ -1,5 +1,6 @@ from numbers import Integral, Real from six import string_types +from itertools import chain import numpy as np @@ -427,38 +428,42 @@ def _calculate_cexs_nuclide(this, types, temperature=294., sab_name=None, funcs.append(pw_funcs) else: funcs.append(nuc[mt].xs[nucT]) - elif mt == 5 and mt in nuc: - # Only consider the (n,misc) products if neutrons are - # included in the outgoing channel since (n,misc) is only - # explicitly needed for scatter cross sections. - for prod in nuc[mt].products: - if prod.particle == 'neutron' and \ - prod.emission_mode in ('total', 'prompt'): - if yields[i]: - func = openmc.data.Combination( - [nuc[mt].xs[nucT], prod.yield_], - [np.multiply]) - else: - func = nuc[mt].xs[nucT] - - funcs.append(func) - break - else: - funcs.append(lambda x: 0.) - elif mt in nuc: if yields[i]: - for prod in nuc[mt].products: + # Get the total yield first if available. This will be + # used primarily for fission. + for prod in chain(nuc[mt].products, + nuc[mt].derived_products): if prod.particle == 'neutron' and \ - prod.emission_mode in ('total', 'prompt'): + prod.emission_mode == 'total': func = openmc.data.Combination( [nuc[mt].xs[nucT], prod.yield_], [np.multiply]) funcs.append(func) break else: - # Assume the yield is 1 - funcs.append(nuc[mt].xs[nucT]) + # Total doesn't exist so we have to create from + # prompt and delayed. This is used for scatter + # multiplication. + func = None + for prod in chain(nuc[mt].products, + nuc[mt].derived_products): + if prod.particle == 'neutron' and \ + prod.emission_mode != 'total': + if func: + func = openmc.data.Combination( + [prod.yield_, func], [np.add]) + else: + func = prod.yield_ + if func: + funcs.append(openmc.data.Combination( + [func, nuc[mt].xs[nucT]], [np.multiply])) + else: + # If func is still None, then there were no + # products. In that case, assume the yield is + # one as its not provided for some summed + # reactions like MT=4 + funcs.append(nuc[mt].xs[nucT]) else: funcs.append(nuc[mt].xs[nucT]) elif mt == UNITY_MT: