From e0d4a80f9ac36d92c694d7f4ee54cafb24b80343 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 10 Sep 2019 12:00:11 -0500 Subject: [PATCH] Use same energy grid for fission heating as total heating The fission heating data generated with IncidentNeutron.from_njoy does not have the same energy grid as other reactions. Previously, the energy grid was maintained and the non-fission heating was generated by evaluating total heating at each point in the fission heating grid and taking total_xs(fission_h.x) - fission_h.y This led to the crash in #1340 where openmc expected cross sections to use the same grid, or at least same number of grid points when computing the total cross section. While fission heating is not included in the total cross section [since 71825fb35], a consistent energy grid is helpful. Both fission heating and non-fission heating now use the energy grid from the total heating. --- openmc/data/neutron.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index 32de3385f4..dfd44a4d07 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -842,15 +842,17 @@ class IncidentNeutron(EqualityMixin): f318 = StringIO(heatr.section[3, 318]) get_head_record(f318) _params, fission_kerma = get_tab1_record(f318) - fission_heating.xs[temp] = fission_kerma total_heating_xs = data.reactions[301].xs.get(temp) if total_heating_xs is None: + fission_heating.xs[temp] = fission_kerma continue + # Cast fission heating to same grid as total heating + new_fission_heat_xs = fission_kerma(total_heating_xs.x) + fission_heating.xs[temp] = Tabulated1D( + total_heating_xs.x, new_fission_heat_xs) non_fission_heating.xs[temp] = Tabulated1D( - fission_kerma.x, - total_heating_xs(fission_kerma.x) - fission_kerma.y, - breakpoints=fission_kerma.breakpoints, - interpolation=fission_kerma.interpolation) + total_heating_xs.x, + total_heating_xs.y - new_fission_heat_xs) data.reactions[318] = fission_heating data.reactions[999] = non_fission_heating