Write neutron fission-less heating coefficient to HDF5

Mark reaction 999 as one to be kept during the export process
This commit is contained in:
Andrew Johnson 2019-08-19 11:39:11 -05:00
parent d81aaeca98
commit 81c6259289
No known key found for this signature in database
GPG key ID: 253418E91B7F6FEB
2 changed files with 8 additions and 2 deletions

View file

@ -453,7 +453,7 @@ class IncidentNeutron(EqualityMixin):
if rx.redundant:
photon_rx = any(p.particle == 'photon' for p in rx.products)
keep_mts = (4, 16, 103, 104, 105, 106, 107,
203, 204, 205, 206, 207, 301, 444)
203, 204, 205, 206, 207, 301, 444, 999)
if not (photon_rx or rx.mt in keep_mts):
continue

View file

@ -206,7 +206,7 @@ def test_derived_products(am244):
def test_heating(run_in_tmpdir, am244):
assert 999 in am244.reactions # TBD
assert 999 in am244.reactions
strT = min(am244.reactions[1].xs.keys())
total_xs = am244.reactions[1].xs[strT].y
fission_xs = am244.reactions[18].xs[strT].y
@ -215,6 +215,12 @@ def test_heating(run_in_tmpdir, am244):
heating_number = total_heating / total_xs
assert no_fission_heating == pytest.approx(
heating_number * (total_xs - fission_xs))
# Re-read to ensure data is written
am244.export_to_hdf5("Am244.h5")
new = openmc.data.IncidentNeutron.from_hdf5("Am244.h5")
assert 999 in new.reactions
new_rxn = new.reactions[999].xs[strT].y
assert (new_rxn == no_fission_heating).all()
def test_urr(pu239):