Make sure no heating adjustments are made if HEATR is not run

This commit is contained in:
Paul Romano 2019-09-13 10:59:18 -05:00
parent fe731b7f19
commit dc3ab07ced

View file

@ -813,6 +813,15 @@ class IncidentNeutron(EqualityMixin):
for table in lib.tables[1:]:
data.add_temperature_from_ace(table)
# Add 0K elastic scattering cross section
if '0K' not in data.energy:
pendf = Evaluation(kwargs['pendf'])
file_obj = StringIO(pendf.section[3, 2])
get_head_record(file_obj)
params, xs = get_tab1_record(file_obj)
data.energy['0K'] = xs.x
data[2].xs['0K'] = xs
# Add fission energy release data
ev = evaluation if evaluation is not None else Evaluation(filename)
if (1, 458) in ev.section:
@ -833,8 +842,9 @@ class IncidentNeutron(EqualityMixin):
# The best way to handle this is to subtract off the fission
# KERMA that NJOY calculates and add back exactly what we want.
heating_local = Reaction(901)
heating_local.redundant = True
# If NJOY is not run with HEATR at all, skip everything below
if not kwargs["heatr"]:
return data
# Helper function to get a cross section from an ENDF file on a
# given energy grid
@ -844,6 +854,9 @@ class IncidentNeutron(EqualityMixin):
_, xs = get_tab1_record(file_obj)
return xs(E)
heating_local = Reaction(901)
heating_local.redundant = True
heatr_evals = get_evaluations(kwargs["heatr"])
heatr_local_evals = get_evaluations(kwargs["heatr"] + "_local")
for ev, ev_local in zip(heatr_evals, heatr_local_evals):
@ -877,15 +890,6 @@ class IncidentNeutron(EqualityMixin):
data.reactions[901] = heating_local
# Add 0K elastic scattering cross section
if '0K' not in data.energy:
pendf = Evaluation(kwargs['pendf'])
file_obj = StringIO(pendf.section[3, 2])
get_head_record(file_obj)
params, xs = get_tab1_record(file_obj)
data.energy['0K'] = xs.x
data[2].xs['0K'] = xs
return data
def _get_redundant_reaction(self, mt, mts):