From e510064b9cbf58bbf4e630d9a61f151a67043d62 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 2 Oct 2019 21:09:18 -0500 Subject: [PATCH 1/3] Make sure heating is calculated correctly with threshold fission When trying to process Pa233 from ENDF/B-VIII.0, which has a threshold fission reaction, I discovered that calculating heating numbers crashed because we were trying to do arithmetic on arrays of different sizes. Re-evaluting the fission cross section on the proper energy grid does the trick here. --- openmc/data/neutron.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index 8a6c889817..ea14be7844 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -874,7 +874,7 @@ class IncidentNeutron(EqualityMixin): fission = data.reactions[18].xs[temp] kerma_fission = get_file3_xs(ev, 318, E) kerma.y = kerma.y - kerma_fission + ( - f.fragments(E) + f.betas(E)) * fission.y + f.fragments(E) + f.betas(E)) * fission(E) # For local KERMA, we first need to get the values from the # HEATR run with photon energy deposited locally and put @@ -887,7 +887,7 @@ class IncidentNeutron(EqualityMixin): kerma_fission_local = get_file3_xs(ev_local, 318, E) kerma_local = kerma_local - kerma_fission_local + ( f.fragments(E) + f.prompt_photons(E) - + f.delayed_photons(E) + f.betas(E))*fission.y + + f.delayed_photons(E) + f.betas(E))*fission(E) heating_local.xs[temp] = Tabulated1D(E, kerma_local) From 92d410ed776df1f3758c17a8bc6663fd42ae0958 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 2 Oct 2019 21:29:42 -0500 Subject: [PATCH 2/3] Ensure all thermal scattering evals from ENDF/B-VIII.0 and JEFF 3.3 work --- openmc/data/njoy.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/openmc/data/njoy.py b/openmc/data/njoy.py index 4983098f73..83fe991c76 100644 --- a/openmc/data/njoy.py +++ b/openmc/data/njoy.py @@ -25,13 +25,16 @@ _THERMAL_DATA = { 13: ThermalTuple('orthod', [1002], 1), 26: ThermalTuple('be', [4009], 1), 27: ThermalTuple('bebeo', [4009], 1), - 31: ThermalTuple('graph', [6000, 6012, 6013], 1), + 30: ThermalTuple('graph', [6000, 6012, 6013], 1), + 31: ThermalTuple('grph10', [6000, 6012, 6013], 1), + 32: ThermalTuple('grph30', [6000, 6012, 6013], 1), 33: ThermalTuple('lch4', [1001], 1), 34: ThermalTuple('sch4', [1001], 1), 37: ThermalTuple('hch2', [1001], 1), + 38: ThermalTuple('mesi00', [1001], 1), 39: ThermalTuple('lucite', [1001], 1), 40: ThermalTuple('benz', [1001, 6000, 6012], 2), - 41: ThermalTuple('od2o', [8016, 8017, 8018], 1), + 42: ThermalTuple('tol00', [1001], 1), 43: ThermalTuple('sisic', [14028, 14029, 14030], 1), 44: ThermalTuple('csic', [6000, 6012, 6013], 1), 46: ThermalTuple('obeo', [8016, 8017, 8018], 1), @@ -39,12 +42,16 @@ _THERMAL_DATA = { 48: ThermalTuple('uuo2', [92238], 1), 49: ThermalTuple('sio2-b', [8016, 8017, 8018, 14028, 14029, 14030], 3), 50: ThermalTuple('oice', [8016, 8017, 8018], 1), + 51: ThermalTuple('od2o', [8016, 8017, 8018], 1), 52: ThermalTuple('mg24', [12024], 1), 53: ThermalTuple('al27', [13027], 1), 55: ThermalTuple('yyh2', [39089], 1), 56: ThermalTuple('fe56', [26056], 1), 58: ThermalTuple('zrzrh', [40000, 40090, 40091, 40092, 40094, 40096], 1), 59: ThermalTuple('cacah2', [20040, 20042, 20043, 20044, 20046, 20048], 1), + 60: ThermalTuple('asap00', [13027], 1), + 71: ThermalTuple('n-un', [7014, 7015], 1), + 72: ThermalTuple('u-un', [92238], 1), 75: ThermalTuple('ouo2', [8016, 8017, 8018], 1), } @@ -444,7 +451,21 @@ def make_ace_thermal(filename, filename_thermal, temperatures=None, mat_thermal = ev_thermal.material zsymam_thermal = ev_thermal.target['zsymam'] + # Determine name, isotopes based on MAT number data = _THERMAL_DATA[mat_thermal] + if ev_thermal.info['library'][0] == 'JEFF': + # JEFF uses MAT=48 for O in Sapphire even though ENDF already uses + # that MAT number for U in UO2. It also assigns MAT=49 (which is + # supposed to be Ca in CaH2) to silicon. + if ev_thermal.material == 48: + data = ThermalTuple('osap00', [8016, 8017, 8018], 1) + elif ev_thermal.gnd_name == 'Si28': + data = ThermalTuple('si00', [14028], 1) + elif ev_thermal.info['library'] != ('ENDF/B', 8, 0): + # Before ENDF/B-VIII.0, crystalline graphite was MAT=31 + if ev_thermal.material == 31: + data = ThermalTuple('graph', [6000, 6012, 6013], 1) + zaids = ' '.join(str(zaid) for zaid in data.zaids[:3]) # Determine name of library From 829f12b1b52daf0218b9b929710301a0b9b89dee Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 3 Oct 2019 11:49:56 -0500 Subject: [PATCH 3/3] Move thermal scattering MAT number bug fixes into a dedicated function --- openmc/data/njoy.py | 62 ++++++++++++++++++++++++++++++------------ openmc/data/thermal.py | 3 ++ 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/openmc/data/njoy.py b/openmc/data/njoy.py index 83fe991c76..0c853102f3 100644 --- a/openmc/data/njoy.py +++ b/openmc/data/njoy.py @@ -10,7 +10,7 @@ from . import endf # For a given MAT number, give a name for the ACE table and a list of ZAID -# identifiers +# identifiers. This is based on Appendix C in the ENDF manual. ThermalTuple = namedtuple('ThermalTuple', ['name', 'zaids', 'nmix']) _THERMAL_DATA = { 1: ThermalTuple('hh2o', [1001], 1), @@ -23,13 +23,16 @@ _THERMAL_DATA = { 11: ThermalTuple('dd2o', [1002], 1), 12: ThermalTuple('parad', [1002], 1), 13: ThermalTuple('orthod', [1002], 1), + 14: ThermalTuple('dice', [1002], 1), 26: ThermalTuple('be', [4009], 1), 27: ThermalTuple('bebeo', [4009], 1), + 28: ThermalTuple('bebe2c', [4009], 1), 30: ThermalTuple('graph', [6000, 6012, 6013], 1), 31: ThermalTuple('grph10', [6000, 6012, 6013], 1), 32: ThermalTuple('grph30', [6000, 6012, 6013], 1), 33: ThermalTuple('lch4', [1001], 1), 34: ThermalTuple('sch4', [1001], 1), + 35: ThermalTuple('sch4p2', [1001], 1), 37: ThermalTuple('hch2', [1001], 1), 38: ThermalTuple('mesi00', [1001], 1), 39: ThermalTuple('lucite', [1001], 1), @@ -37,9 +40,10 @@ _THERMAL_DATA = { 42: ThermalTuple('tol00', [1001], 1), 43: ThermalTuple('sisic', [14028, 14029, 14030], 1), 44: ThermalTuple('csic', [6000, 6012, 6013], 1), + 45: ThermalTuple('ouo2', [8016, 8017, 8018], 1), 46: ThermalTuple('obeo', [8016, 8017, 8018], 1), 47: ThermalTuple('sio2-a', [8016, 8017, 8018, 14028, 14029, 14030], 3), - 48: ThermalTuple('uuo2', [92238], 1), + 48: ThermalTuple('osap00', [92238], 1), 49: ThermalTuple('sio2-b', [8016, 8017, 8018, 14028, 14029, 14030], 3), 50: ThermalTuple('oice', [8016, 8017, 8018], 1), 51: ThermalTuple('od2o', [8016, 8017, 8018], 1), @@ -48,13 +52,48 @@ _THERMAL_DATA = { 55: ThermalTuple('yyh2', [39089], 1), 56: ThermalTuple('fe56', [26056], 1), 58: ThermalTuple('zrzrh', [40000, 40090, 40091, 40092, 40094, 40096], 1), - 59: ThermalTuple('cacah2', [20040, 20042, 20043, 20044, 20046, 20048], 1), + 59: ThermalTuple('si00', [14028], 1), 60: ThermalTuple('asap00', [13027], 1), 71: ThermalTuple('n-un', [7014, 7015], 1), 72: ThermalTuple('u-un', [92238], 1), - 75: ThermalTuple('ouo2', [8016, 8017, 8018], 1), + 75: ThermalTuple('uuo2', [8016, 8017, 8018], 1), } + +def _get_thermal_data(ev, mat): + """Return appropriate ThermalTuple, accounting for bugs.""" + + # JEFF assigns MAT=59 to Ca in CaH2 (which is supposed to be silicon). + if ev.info['library'][0] == 'JEFF': + if ev.material == 59: + if 'CaH2' in ''.join(ev.info['description']): + zaids = [20040, 20042, 20043, 20044, 20046, 20048] + return ThermalTuple('cacah2', zaids, 1) + + # Before ENDF/B-VIII.0, crystalline graphite was MAT=31 + if ev.info['library'] != ('ENDF/B', 8, 0): + if ev.material == 31: + return _THERMAL_DATA[30] + + # ENDF/B incorrectly assigns MAT numbers for UO2 + # + # Material | ENDF Manual | VII.0 | VII.1 | VIII.0 + # ---------|-------------|-------|-------|------- + # O in UO2 | 45 | 75 | 75 | 75 + # U in UO2 | 75 | 76 | 48 | 48 + if ev.info['library'][0] == 'ENDF/B': + if ev.material == 75: + return _THERMAL_DATA[45] + version = ev.info['library'][1:] + if version in ((7, 1), (8, 0)) and ev.material == 48: + return _THERMAL_DATA[75] + if version == (7, 0) and ev.material == 76: + return _THERMAL_DATA[75] + + # If not a problematic material, use the dictionary as is + return _THERMAL_DATA[mat] + + _TEMPLATE_RECONR = """ reconr / %%%%%%%%%%%%%%%%%%% Reconstruct XS for neutrons %%%%%%%%%%%%%%%%%%%%%%% {nendf} {npendf} @@ -452,20 +491,7 @@ def make_ace_thermal(filename, filename_thermal, temperatures=None, zsymam_thermal = ev_thermal.target['zsymam'] # Determine name, isotopes based on MAT number - data = _THERMAL_DATA[mat_thermal] - if ev_thermal.info['library'][0] == 'JEFF': - # JEFF uses MAT=48 for O in Sapphire even though ENDF already uses - # that MAT number for U in UO2. It also assigns MAT=49 (which is - # supposed to be Ca in CaH2) to silicon. - if ev_thermal.material == 48: - data = ThermalTuple('osap00', [8016, 8017, 8018], 1) - elif ev_thermal.gnd_name == 'Si28': - data = ThermalTuple('si00', [14028], 1) - elif ev_thermal.info['library'] != ('ENDF/B', 8, 0): - # Before ENDF/B-VIII.0, crystalline graphite was MAT=31 - if ev_thermal.material == 31: - data = ThermalTuple('graph', [6000, 6012, 6013], 1) - + data = _get_thermal_data(ev_thermal, mat_thermal) zaids = ' '.join(str(zaid) for zaid in data.zaids[:3]) # Determine name of library diff --git a/openmc/data/thermal.py b/openmc/data/thermal.py index 4fbe963631..067c0a7034 100644 --- a/openmc/data/thermal.py +++ b/openmc/data/thermal.py @@ -33,10 +33,12 @@ _THERMAL_NAMES = { 'c_Be': ('be', 'be-metal', 'be-met', 'be00'), 'c_BeO': ('beo',), 'c_Be_in_BeO': ('bebeo', 'be-beo', 'be-o', 'be/o', 'bbeo00'), + 'c_Be_in_Be2C': ('bebe2c',), 'c_C6H6': ('benz', 'c6h6'), 'c_C_in_SiC': ('csic', 'c-sic'), 'c_Ca_in_CaH2': ('cah', 'cah00'), 'c_D_in_D2O': ('dd2o', 'd-d2o', 'hwtr', 'hw', 'dhw00'), + 'c_D_in_D2O_ice': ('dice',), 'c_Fe56': ('fe', 'fe56', 'fe-56'), 'c_Graphite': ('graph', 'grph', 'gr', 'gr00'), 'c_Graphite_10p': ('grph10',), @@ -45,6 +47,7 @@ _THERMAL_NAMES = { 'c_H_in_CH2': ('hch2', 'poly', 'pol', 'h-poly', 'pol00'), 'c_H_in_CH4_liquid': ('lch4', 'lmeth'), 'c_H_in_CH4_solid': ('sch4', 'smeth'), + 'c_H_in_CH4_solid_phase_II': ('sch4p2',), 'c_H_in_H2O': ('hh2o', 'h-h2o', 'lwtr', 'lw', 'lw00'), 'c_H_in_H2O_solid': ('hice', 'h-ice', 'ice00'), 'c_H_in_C5O2H8': ('lucite', 'c5o2h8', 'h-luci'),