Merge pull request #2320 from paulromano/from-njoy-high-t-fix

Fix `IncidentNeutron.from_njoy` for high temperatures
This commit is contained in:
Paul Romano 2022-12-15 16:22:43 -06:00 committed by GitHub
commit 4e49f69f02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -868,9 +868,8 @@ class IncidentNeutron(EqualityMixin):
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):
temp = "{}K".format(round(ev.target["temperature"]))
for ev, ev_local, temp in zip(heatr_evals, heatr_local_evals, data.temperatures):
# Get total KERMA (originally from ACE file) and energy grid
kerma = data.reactions[301].xs[temp]
E = kerma.x

View file

@ -531,3 +531,12 @@ def test_ace_table_types():
assert TT.from_suffix('20t') == TT.THERMAL_SCATTERING
with pytest.raises(ValueError):
TT.from_suffix('z')
@needs_njoy
def test_high_temperature():
endf_data = os.environ['OPENMC_ENDF_DATA']
endf_file = os.path.join(endf_data, 'neutrons', 'n-001_H_001.endf')
# Ensure that from_njoy works when given a high temperature
openmc.data.IncidentNeutron.from_njoy(endf_file, temperatures=[123_456.0])