mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Merge pull request #2320 from paulromano/from-njoy-high-t-fix
Fix `IncidentNeutron.from_njoy` for high temperatures
This commit is contained in:
commit
4e49f69f02
2 changed files with 10 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue