From 81c6259289da9f661096e6b91a7bec9460a30a3b Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 19 Aug 2019 11:39:11 -0500 Subject: [PATCH] Write neutron fission-less heating coefficient to HDF5 Mark reaction 999 as one to be kept during the export process --- openmc/data/neutron.py | 2 +- tests/unit_tests/test_data_neutron.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index e903b6a92..a53194aa7 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -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 diff --git a/tests/unit_tests/test_data_neutron.py b/tests/unit_tests/test_data_neutron.py index 7fccb33d8..22aebe20a 100644 --- a/tests/unit_tests/test_data_neutron.py +++ b/tests/unit_tests/test_data_neutron.py @@ -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):