Skip to content

Commit a6e6f1d

Browse files
authored
Merge pull request #1369 from paulromano/data-fixes
Two data-related fixes
2 parents 87541e9 + 829f12b commit a6e6f1d

File tree

3 files changed

+59
-9
lines changed

3 files changed

+59
-9
lines changed

openmc/data/neutron.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ def get_file3_xs(ev, mt, E):
874874
fission = data.reactions[18].xs[temp]
875875
kerma_fission = get_file3_xs(ev, 318, E)
876876
kerma.y = kerma.y - kerma_fission + (
877-
f.fragments(E) + f.betas(E)) * fission.y
877+
f.fragments(E) + f.betas(E)) * fission(E)
878878

879879
# For local KERMA, we first need to get the values from the
880880
# HEATR run with photon energy deposited locally and put
@@ -887,7 +887,7 @@ def get_file3_xs(ev, mt, E):
887887
kerma_fission_local = get_file3_xs(ev_local, 318, E)
888888
kerma_local = kerma_local - kerma_fission_local + (
889889
f.fragments(E) + f.prompt_photons(E)
890-
+ f.delayed_photons(E) + f.betas(E))*fission.y
890+
+ f.delayed_photons(E) + f.betas(E))*fission(E)
891891

892892
heating_local.xs[temp] = Tabulated1D(E, kerma_local)
893893

openmc/data/njoy.py

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
# For a given MAT number, give a name for the ACE table and a list of ZAID
13-
# identifiers
13+
# identifiers. This is based on Appendix C in the ENDF manual.
1414
ThermalTuple = namedtuple('ThermalTuple', ['name', 'zaids', 'nmix'])
1515
_THERMAL_DATA = {
1616
1: ThermalTuple('hh2o', [1001], 1),
@@ -23,31 +23,77 @@
2323
11: ThermalTuple('dd2o', [1002], 1),
2424
12: ThermalTuple('parad', [1002], 1),
2525
13: ThermalTuple('orthod', [1002], 1),
26+
14: ThermalTuple('dice', [1002], 1),
2627
26: ThermalTuple('be', [4009], 1),
2728
27: ThermalTuple('bebeo', [4009], 1),
28-
31: ThermalTuple('graph', [6000, 6012, 6013], 1),
29+
28: ThermalTuple('bebe2c', [4009], 1),
30+
30: ThermalTuple('graph', [6000, 6012, 6013], 1),
31+
31: ThermalTuple('grph10', [6000, 6012, 6013], 1),
32+
32: ThermalTuple('grph30', [6000, 6012, 6013], 1),
2933
33: ThermalTuple('lch4', [1001], 1),
3034
34: ThermalTuple('sch4', [1001], 1),
35+
35: ThermalTuple('sch4p2', [1001], 1),
3136
37: ThermalTuple('hch2', [1001], 1),
37+
38: ThermalTuple('mesi00', [1001], 1),
3238
39: ThermalTuple('lucite', [1001], 1),
3339
40: ThermalTuple('benz', [1001, 6000, 6012], 2),
34-
41: ThermalTuple('od2o', [8016, 8017, 8018], 1),
40+
42: ThermalTuple('tol00', [1001], 1),
3541
43: ThermalTuple('sisic', [14028, 14029, 14030], 1),
3642
44: ThermalTuple('csic', [6000, 6012, 6013], 1),
43+
45: ThermalTuple('ouo2', [8016, 8017, 8018], 1),
3744
46: ThermalTuple('obeo', [8016, 8017, 8018], 1),
3845
47: ThermalTuple('sio2-a', [8016, 8017, 8018, 14028, 14029, 14030], 3),
39-
48: ThermalTuple('uuo2', [92238], 1),
46+
48: ThermalTuple('osap00', [92238], 1),
4047
49: ThermalTuple('sio2-b', [8016, 8017, 8018, 14028, 14029, 14030], 3),
4148
50: ThermalTuple('oice', [8016, 8017, 8018], 1),
49+
51: ThermalTuple('od2o', [8016, 8017, 8018], 1),
4250
52: ThermalTuple('mg24', [12024], 1),
4351
53: ThermalTuple('al27', [13027], 1),
4452
55: ThermalTuple('yyh2', [39089], 1),
4553
56: ThermalTuple('fe56', [26056], 1),
4654
58: ThermalTuple('zrzrh', [40000, 40090, 40091, 40092, 40094, 40096], 1),
47-
59: ThermalTuple('cacah2', [20040, 20042, 20043, 20044, 20046, 20048], 1),
48-
75: ThermalTuple('ouo2', [8016, 8017, 8018], 1),
55+
59: ThermalTuple('si00', [14028], 1),
56+
60: ThermalTuple('asap00', [13027], 1),
57+
71: ThermalTuple('n-un', [7014, 7015], 1),
58+
72: ThermalTuple('u-un', [92238], 1),
59+
75: ThermalTuple('uuo2', [8016, 8017, 8018], 1),
4960
}
5061

62+
63+
def _get_thermal_data(ev, mat):
64+
"""Return appropriate ThermalTuple, accounting for bugs."""
65+
66+
# JEFF assigns MAT=59 to Ca in CaH2 (which is supposed to be silicon).
67+
if ev.info['library'][0] == 'JEFF':
68+
if ev.material == 59:
69+
if 'CaH2' in ''.join(ev.info['description']):
70+
zaids = [20040, 20042, 20043, 20044, 20046, 20048]
71+
return ThermalTuple('cacah2', zaids, 1)
72+
73+
# Before ENDF/B-VIII.0, crystalline graphite was MAT=31
74+
if ev.info['library'] != ('ENDF/B', 8, 0):
75+
if ev.material == 31:
76+
return _THERMAL_DATA[30]
77+
78+
# ENDF/B incorrectly assigns MAT numbers for UO2
79+
#
80+
# Material | ENDF Manual | VII.0 | VII.1 | VIII.0
81+
# ---------|-------------|-------|-------|-------
82+
# O in UO2 | 45 | 75 | 75 | 75
83+
# U in UO2 | 75 | 76 | 48 | 48
84+
if ev.info['library'][0] == 'ENDF/B':
85+
if ev.material == 75:
86+
return _THERMAL_DATA[45]
87+
version = ev.info['library'][1:]
88+
if version in ((7, 1), (8, 0)) and ev.material == 48:
89+
return _THERMAL_DATA[75]
90+
if version == (7, 0) and ev.material == 76:
91+
return _THERMAL_DATA[75]
92+
93+
# If not a problematic material, use the dictionary as is
94+
return _THERMAL_DATA[mat]
95+
96+
5197
_TEMPLATE_RECONR = """
5298
reconr / %%%%%%%%%%%%%%%%%%% Reconstruct XS for neutrons %%%%%%%%%%%%%%%%%%%%%%%
5399
{nendf} {npendf}
@@ -444,7 +490,8 @@ def make_ace_thermal(filename, filename_thermal, temperatures=None,
444490
mat_thermal = ev_thermal.material
445491
zsymam_thermal = ev_thermal.target['zsymam']
446492

447-
data = _THERMAL_DATA[mat_thermal]
493+
# Determine name, isotopes based on MAT number
494+
data = _get_thermal_data(ev_thermal, mat_thermal)
448495
zaids = ' '.join(str(zaid) for zaid in data.zaids[:3])
449496

450497
# Determine name of library

openmc/data/thermal.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@
3333
'c_Be': ('be', 'be-metal', 'be-met', 'be00'),
3434
'c_BeO': ('beo',),
3535
'c_Be_in_BeO': ('bebeo', 'be-beo', 'be-o', 'be/o', 'bbeo00'),
36+
'c_Be_in_Be2C': ('bebe2c',),
3637
'c_C6H6': ('benz', 'c6h6'),
3738
'c_C_in_SiC': ('csic', 'c-sic'),
3839
'c_Ca_in_CaH2': ('cah', 'cah00'),
3940
'c_D_in_D2O': ('dd2o', 'd-d2o', 'hwtr', 'hw', 'dhw00'),
41+
'c_D_in_D2O_ice': ('dice',),
4042
'c_Fe56': ('fe', 'fe56', 'fe-56'),
4143
'c_Graphite': ('graph', 'grph', 'gr', 'gr00'),
4244
'c_Graphite_10p': ('grph10',),
@@ -45,6 +47,7 @@
4547
'c_H_in_CH2': ('hch2', 'poly', 'pol', 'h-poly', 'pol00'),
4648
'c_H_in_CH4_liquid': ('lch4', 'lmeth'),
4749
'c_H_in_CH4_solid': ('sch4', 'smeth'),
50+
'c_H_in_CH4_solid_phase_II': ('sch4p2',),
4851
'c_H_in_H2O': ('hh2o', 'h-h2o', 'lwtr', 'lw', 'lw00'),
4952
'c_H_in_H2O_solid': ('hice', 'h-ice', 'ice00'),
5053
'c_H_in_C5O2H8': ('lucite', 'c5o2h8', 'h-luci'),

0 commit comments

Comments
 (0)