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.
This commit is contained in:
Andrew Johnson 2019-09-10 12:00:11 -05:00
parent 71825fb35a
commit e0d4a80f9a
No known key found for this signature in database
GPG key ID: 253418E91B7F6FEB

View file

@ -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