openmc-data 2.6.0__tar.gz → 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. {openmc_data-2.6.0 → openmc_data-3.0.0}/.github/workflows/test_package.yml +1 -0
  2. {openmc_data-2.6.0/src/openmc_data.egg-info → openmc_data-3.0.0}/PKG-INFO +43 -6
  3. openmc_data-2.6.0/PKG-INFO → openmc_data-3.0.0/README.md +38 -25
  4. {openmc_data-2.6.0 → openmc_data-3.0.0}/pyproject.toml +4 -0
  5. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/__init__.py +1 -0
  6. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/_version.py +3 -3
  7. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/generate_branching_ratios.py +110 -14
  8. openmc_data-3.0.0/src/openmc_data/depletion/generate_jeff_chain.py +126 -0
  9. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/generate_jendl_chain.py +4 -6
  10. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/download/download_chain.py +12 -9
  11. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/generate/generate_endf.py +4 -4
  12. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/generate/generate_jeff.py +26 -25
  13. openmc_data-3.0.0/src/openmc_data/generate/generate_jendl.py +256 -0
  14. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/urls.py +103 -5
  15. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/urls_chain.py +54 -14
  16. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/urls_jeff.py +4 -11
  17. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/urls_xml.py +57 -0
  18. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/utils.py +117 -19
  19. openmc_data-2.6.0/README.md → openmc_data-3.0.0/src/openmc_data.egg-info/PKG-INFO +62 -5
  20. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data.egg-info/SOURCES.txt +6 -0
  21. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data.egg-info/scm_file_list.json +15 -0
  22. openmc_data-3.0.0/src/openmc_data.egg-info/scm_version.json +8 -0
  23. openmc_data-3.0.0/tests/test_apply_updates.py +104 -0
  24. openmc_data-3.0.0/tests/test_download.py +107 -0
  25. openmc_data-3.0.0/tests/test_generate_branching_ratios.py +95 -0
  26. openmc_data-3.0.0/tests/test_generate_jeff_chain.py +105 -0
  27. openmc_data-3.0.0/tests/test_generate_jeff_download.py +39 -0
  28. openmc_data-3.0.0/tests/test_generate_jendl.py +139 -0
  29. {openmc_data-2.6.0 → openmc_data-3.0.0}/tests/test_urls.py +58 -9
  30. openmc_data-2.6.0/src/openmc_data/depletion/generate_jeff_chain.py +0 -92
  31. openmc_data-2.6.0/src/openmc_data/generate/generate_jendl.py +0 -137
  32. openmc_data-2.6.0/src/openmc_data.egg-info/scm_version.json +0 -8
  33. {openmc_data-2.6.0 → openmc_data-3.0.0}/.github/workflows/python-publish.yml +0 -0
  34. {openmc_data-2.6.0 → openmc_data-3.0.0}/.github/workflows/test_processing.yml +0 -0
  35. {openmc_data-2.6.0 → openmc_data-3.0.0}/.github/workflows/test_urls.yml +0 -0
  36. {openmc_data-2.6.0 → openmc_data-3.0.0}/.gitignore +0 -0
  37. {openmc_data-2.6.0 → openmc_data-3.0.0}/LICENSE +0 -0
  38. {openmc_data-2.6.0 → openmc_data-3.0.0}/MANIFEST.in +0 -0
  39. {openmc_data-2.6.0 → openmc_data-3.0.0}/setup.cfg +0 -0
  40. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/convert/__init__.py +0 -0
  41. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/convert/convert_endf.py +0 -0
  42. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/convert/convert_fendl.py +0 -0
  43. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/convert/convert_jeff.py +0 -0
  44. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/convert/convert_lib80x.py +0 -0
  45. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/convert/convert_mcnp70.py +0 -0
  46. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/convert/convert_mcnp71.py +0 -0
  47. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/convert/convert_tendl.py +0 -0
  48. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/__init__.py +0 -0
  49. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/add_branching_ratios.py +0 -0
  50. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/branching_ratios_pwr.json +0 -0
  51. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/branching_ratios_sfr.json +0 -0
  52. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/casl_chain.py +0 -0
  53. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/generate_endf71_chain_casl.py +0 -0
  54. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/generate_endf_chain.py +0 -0
  55. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/generate_serpent_fissq.py +0 -0
  56. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/generate_tendl_chain.py +0 -0
  57. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/reduce_chain.py +0 -0
  58. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/serpent_fissq.json +0 -0
  59. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/tendl2019_nuclides.json +0 -0
  60. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/depletion/tendl2021_nuclides.json +0 -0
  61. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/download/__init__.py +0 -0
  62. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/download/download_endf.py +0 -0
  63. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/download/download_jeff.py +0 -0
  64. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/download/download_tendl.py +0 -0
  65. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/generate/__init__.py +0 -0
  66. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/generate/generate_cendl.py +0 -0
  67. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/generate/generate_fendl.py +0 -0
  68. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/generate/generate_tendl.py +0 -0
  69. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/other/__init__.py +0 -0
  70. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/other/combine_libraries.py +0 -0
  71. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/other/convert_tendl_rand.py +0 -0
  72. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/other/make_compton.py +0 -0
  73. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/other/make_stopping_powers.py +0 -0
  74. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/other/remove_corrupt_h5.py +0 -0
  75. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/other/sample_sandy.py +0 -0
  76. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data/urls_h5.py +0 -0
  77. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data.egg-info/dependency_links.txt +0 -0
  78. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data.egg-info/entry_points.txt +0 -0
  79. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data.egg-info/requires.txt +0 -0
  80. {openmc_data-2.6.0 → openmc_data-3.0.0}/src/openmc_data.egg-info/top_level.txt +0 -0
  81. {openmc_data-2.6.0 → openmc_data-3.0.0}/tests/test_download_jeff.py +0 -0
  82. {openmc_data-2.6.0 → openmc_data-3.0.0}/tests/test_utils.py +0 -0
  83. {openmc_data-2.6.0 → openmc_data-3.0.0}/tests/test_version.py +0 -0
@@ -88,6 +88,7 @@ jobs:
88
88
  add_branching_ratios --help
89
89
  generate_endf71_chain_casl --help
90
90
  generate_endf_chain --help
91
+ generate_jeff_chain --help
91
92
  generate_serpent_fissq --help
92
93
  generate_tendl_chain --help
93
94
  reduce_chain --help
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openmc_data
3
- Version: 2.6.0
3
+ Version: 3.0.0
4
4
  Summary: A Python package containing a collection of scripts for producing and downloading data for OpenMC
5
5
  Author-email: Jonathan Shimwell <mail@jshimwell.com>
6
6
  License-Expression: MIT
@@ -8,6 +8,10 @@ Project-URL: Homepage, https://github.com/fusion-energy/openmc_data
8
8
  Project-URL: Bug Tracker, https://github.com/fusion-energy/openmc_data/issues
9
9
  Keywords: openmc,nuclear,data,download,process,cross,section
10
10
  Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
11
15
  Classifier: Operating System :: OS Independent
12
16
  Requires-Python: >=3.8
13
17
  Description-Content-Type: text/markdown
@@ -146,8 +150,8 @@ See `convert_jeff --help` for all options.
146
150
  | generate_cendl | CENDL | 3.1<br>3.2 | |
147
151
  | generate_endf | ENDF/B | VII.1<br>VIII.0<br>VIII.1 | NNDC |
148
152
  | generate_fendl | FENDL | 3.2c<br>3.2b<br>3.2a<br>3.2<br>3.1d<br>3.1a<br>3.0 | |
149
- | generate_jendl | JENDL | 4.0<br>5.0 | |
150
- | generate_jeff | JEFF | 3.3<br>4.0 | NJOY |
153
+ | generate_jendl | JENDL | 4.0<br>5.0 (neutron, thermal scattering and photon) | NJOY |
154
+ | generate_jeff | JEFF | 3.3<br>4.0 (neutron and thermal scattering) | NJOY |
151
155
  | generate_tendl | TENDL | 2023<br>2025 | |
152
156
 
153
157
 
@@ -179,7 +183,7 @@ See `convert_jeff --help` for all options.
179
183
  | Script name | Library | Release |
180
184
  |-|-|-|
181
185
  |generate_endf_chain | ENDF/B | VII.1<br>VIII.0<br>VIII.1 |
182
- |generate_jeff_chain | JEFF | 3.3 |
186
+ |generate_jeff_chain | JEFF | 3.3<br>4.0 (default) |
183
187
  |generate_jendl_chain | JENDL | 5.0 |
184
188
  |generate_tendl_chain | TENDL | 2015<br>2017<br>2019<br>2021<br>2023<br>2025 |
185
189
  |generate_serpent_fissq | | |
@@ -210,6 +214,7 @@ generate_branching_ratios \
210
214
  --neutron-dir tendl-2017-endf/neutron \
211
215
  --fispact-fluxes fns/Ag/2000exp_5min_fluxes \
212
216
  --chain chain_tendl_2017_endf80.xml \
217
+ --decay endf-b8.0-endf/decay --decay-pattern '*.endf' \
213
218
  --jobs 20 \
214
219
  -o branching_ratios_tendl_2017_fns.json
215
220
 
@@ -220,6 +225,18 @@ add_branching_ratios \
220
225
  -o chain_tendl_2017_endf80_fns.xml
221
226
  ```
222
227
 
228
+ The MF=8 section lists the excited states of each product by excitation energy
229
+ but not by isomer number. Pass the decay sublibrary used for the chain with
230
+ `--decay` so that each state is matched to the isomer with the closest
231
+ excitation energy. Without it the states are numbered in order of energy, which
232
+ mislabels an isomer whenever an evaluation lists a higher isomer without the
233
+ lower one. JEFF-4.0 Ta181 capture, for example, only lists the 519.6 keV
234
+ Ta182_m2 state, which ranking calls Ta182_m1. When an evaluation lists a
235
+ metastable state that the decay data has no isomer for, such as the 200.1 keV
236
+ Tb156 state in TENDL next to the 88.4 keV Tb156_m2, the isomer goes to the
237
+ nearest state and the other is counted as the ground state, as the chain has no
238
+ nuclide for it.
239
+
223
240
  Most reactions store their isomeric production as cross sections in MF=10 and
224
241
  need no other data. The remainder store multiplicities in MF=9 which have to be
225
242
  weighted by the reaction cross section, and as the MF=3 cross section is only
@@ -241,10 +258,30 @@ in series.
241
258
 
242
259
  | Script name | Library | Release | Branching options|
243
260
  |-|-|-|-|
244
- |download_chain | ENDF/B | VII.1<br>VIII.0<br>VIII.1 | None<br>SFR<br>PWR |
261
+ |download_chain | ENDF/B | VII.1<br>VIII.0 | None<br>SFR<br>PWR |
262
+ |download_chain | ENDF/B | VIII.1 | None<br>SFR<br>PWR<br>FNS |
263
+ |download_chain | JEFF | 4.0 | None<br>SFR<br>PWR<br>FNS |
264
+ |download_chain | JENDL | 5.0 | None<br>SFR<br>PWR<br>FNS |
245
265
  |download_chain | TENDL | 2017<br>2019 | None<br>SFR<br>PWR<br>FNS<br>FNS-ORIGEN |
246
266
  |download_chain | TENDL | 2025 | None<br>SFR<br>PWR<br>FNS |
247
267
 
268
+ The JEFF-4.0 and JENDL-5.0 chains are made with `generate_jeff_chain` and
269
+ `generate_jendl_chain` and take their neutron, decay and fission yield data from
270
+ their own library only, as do the ENDF/B chains. Their FNS branching ratios come
271
+ from the isomeric production data of the same library, with the decay data of
272
+ the same library passed to `generate_branching_ratios --decay`.
273
+
274
+ | Chain | Nuclides | FNS reaction types | FNS branched channels | Size |
275
+ |-|-|-|-|-|
276
+ | ENDF/B-VIII.1 | 3820 | 30 | 236 | 28 MB |
277
+ | JEFF-4.0 | 3851 | 29 | 2742 | 9 MB |
278
+ | JENDL-5.0 | 4070 | 28 | 2328 | 66 MB |
279
+
280
+ ENDF/B-VIII.1 has isomeric production data for far fewer reactions than JEFF-4.0,
281
+ JENDL-5.0 or TENDL, so its FNS chain splits fewer channels. The JENDL-5.0 chains
282
+ are larger because its decay sublibrary holds more, and more detailed, decay
283
+ radiation spectra.
284
+
248
285
  All the TENDL chains are made with `generate_tendl_chain` using decay data and
249
286
  neutron induced fission yields from ENDF/B-VIII.0, so the releases can be
250
287
  compared against one another.
@@ -263,7 +300,7 @@ values. Counts below are for TENDL 2017.
263
300
  | None | none | 0 | |
264
301
  | SFR<br>PWR | `(n,gamma)` only | 101 | [Serpent default isomeric branching ratios](https://serpent.vtt.fi/mediawiki/index.php?title=Default_isomeric_branching_ratios) |
265
302
  | FNS-ORIGEN | 15 reaction types | 2355 | ORIGEN |
266
- | FNS | 35 reaction types | 15616 | the TENDL files themselves |
303
+ | FNS | 35 reaction types | 14692 | the TENDL files themselves |
267
304
 
268
305
  The reactor options only ever split capture. For a fusion spectrum the threshold
269
306
  reactions matter most, and in the FNS chains `(n,gamma)` is only the fourth
@@ -1,23 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: openmc_data
3
- Version: 2.6.0
4
- Summary: A Python package containing a collection of scripts for producing and downloading data for OpenMC
5
- Author-email: Jonathan Shimwell <mail@jshimwell.com>
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/fusion-energy/openmc_data
8
- Project-URL: Bug Tracker, https://github.com/fusion-energy/openmc_data/issues
9
- Keywords: openmc,nuclear,data,download,process,cross,section
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.8
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: numpy>=1.21.1
16
- Provides-Extra: tests
17
- Requires-Dist: pytest; extra == "tests"
18
- Requires-Dist: requests; extra == "tests"
19
- Dynamic: license-file
20
-
21
1
  [![test_urls](https://github.com/shimwell/data/actions/workflows/test_urls.yml/badge.svg)](https://github.com/shimwell/data/actions/workflows/test_urls.yml)
22
2
  [![test_package](https://github.com/openmc-data-storage/openmc_data/actions/workflows/test_package.yml/badge.svg)](https://github.com/openmc-data-storage/openmc_data/actions/workflows/test_package.yml)
23
3
  [![test_convert_scripts](https://github.com/openmc-data-storage/openmc_data/actions/workflows/test_processing.yml/badge.svg)](https://github.com/openmc-data-storage/openmc_data/actions/workflows/test_processing.yml)
@@ -146,8 +126,8 @@ See `convert_jeff --help` for all options.
146
126
  | generate_cendl | CENDL | 3.1<br>3.2 | |
147
127
  | generate_endf | ENDF/B | VII.1<br>VIII.0<br>VIII.1 | NNDC |
148
128
  | generate_fendl | FENDL | 3.2c<br>3.2b<br>3.2a<br>3.2<br>3.1d<br>3.1a<br>3.0 | |
149
- | generate_jendl | JENDL | 4.0<br>5.0 | |
150
- | generate_jeff | JEFF | 3.3<br>4.0 | NJOY |
129
+ | generate_jendl | JENDL | 4.0<br>5.0 (neutron, thermal scattering and photon) | NJOY |
130
+ | generate_jeff | JEFF | 3.3<br>4.0 (neutron and thermal scattering) | NJOY |
151
131
  | generate_tendl | TENDL | 2023<br>2025 | |
152
132
 
153
133
 
@@ -179,7 +159,7 @@ See `convert_jeff --help` for all options.
179
159
  | Script name | Library | Release |
180
160
  |-|-|-|
181
161
  |generate_endf_chain | ENDF/B | VII.1<br>VIII.0<br>VIII.1 |
182
- |generate_jeff_chain | JEFF | 3.3 |
162
+ |generate_jeff_chain | JEFF | 3.3<br>4.0 (default) |
183
163
  |generate_jendl_chain | JENDL | 5.0 |
184
164
  |generate_tendl_chain | TENDL | 2015<br>2017<br>2019<br>2021<br>2023<br>2025 |
185
165
  |generate_serpent_fissq | | |
@@ -210,6 +190,7 @@ generate_branching_ratios \
210
190
  --neutron-dir tendl-2017-endf/neutron \
211
191
  --fispact-fluxes fns/Ag/2000exp_5min_fluxes \
212
192
  --chain chain_tendl_2017_endf80.xml \
193
+ --decay endf-b8.0-endf/decay --decay-pattern '*.endf' \
213
194
  --jobs 20 \
214
195
  -o branching_ratios_tendl_2017_fns.json
215
196
 
@@ -220,6 +201,18 @@ add_branching_ratios \
220
201
  -o chain_tendl_2017_endf80_fns.xml
221
202
  ```
222
203
 
204
+ The MF=8 section lists the excited states of each product by excitation energy
205
+ but not by isomer number. Pass the decay sublibrary used for the chain with
206
+ `--decay` so that each state is matched to the isomer with the closest
207
+ excitation energy. Without it the states are numbered in order of energy, which
208
+ mislabels an isomer whenever an evaluation lists a higher isomer without the
209
+ lower one. JEFF-4.0 Ta181 capture, for example, only lists the 519.6 keV
210
+ Ta182_m2 state, which ranking calls Ta182_m1. When an evaluation lists a
211
+ metastable state that the decay data has no isomer for, such as the 200.1 keV
212
+ Tb156 state in TENDL next to the 88.4 keV Tb156_m2, the isomer goes to the
213
+ nearest state and the other is counted as the ground state, as the chain has no
214
+ nuclide for it.
215
+
223
216
  Most reactions store their isomeric production as cross sections in MF=10 and
224
217
  need no other data. The remainder store multiplicities in MF=9 which have to be
225
218
  weighted by the reaction cross section, and as the MF=3 cross section is only
@@ -241,10 +234,30 @@ in series.
241
234
 
242
235
  | Script name | Library | Release | Branching options|
243
236
  |-|-|-|-|
244
- |download_chain | ENDF/B | VII.1<br>VIII.0<br>VIII.1 | None<br>SFR<br>PWR |
237
+ |download_chain | ENDF/B | VII.1<br>VIII.0 | None<br>SFR<br>PWR |
238
+ |download_chain | ENDF/B | VIII.1 | None<br>SFR<br>PWR<br>FNS |
239
+ |download_chain | JEFF | 4.0 | None<br>SFR<br>PWR<br>FNS |
240
+ |download_chain | JENDL | 5.0 | None<br>SFR<br>PWR<br>FNS |
245
241
  |download_chain | TENDL | 2017<br>2019 | None<br>SFR<br>PWR<br>FNS<br>FNS-ORIGEN |
246
242
  |download_chain | TENDL | 2025 | None<br>SFR<br>PWR<br>FNS |
247
243
 
244
+ The JEFF-4.0 and JENDL-5.0 chains are made with `generate_jeff_chain` and
245
+ `generate_jendl_chain` and take their neutron, decay and fission yield data from
246
+ their own library only, as do the ENDF/B chains. Their FNS branching ratios come
247
+ from the isomeric production data of the same library, with the decay data of
248
+ the same library passed to `generate_branching_ratios --decay`.
249
+
250
+ | Chain | Nuclides | FNS reaction types | FNS branched channels | Size |
251
+ |-|-|-|-|-|
252
+ | ENDF/B-VIII.1 | 3820 | 30 | 236 | 28 MB |
253
+ | JEFF-4.0 | 3851 | 29 | 2742 | 9 MB |
254
+ | JENDL-5.0 | 4070 | 28 | 2328 | 66 MB |
255
+
256
+ ENDF/B-VIII.1 has isomeric production data for far fewer reactions than JEFF-4.0,
257
+ JENDL-5.0 or TENDL, so its FNS chain splits fewer channels. The JENDL-5.0 chains
258
+ are larger because its decay sublibrary holds more, and more detailed, decay
259
+ radiation spectra.
260
+
248
261
  All the TENDL chains are made with `generate_tendl_chain` using decay data and
249
262
  neutron induced fission yields from ENDF/B-VIII.0, so the releases can be
250
263
  compared against one another.
@@ -263,7 +276,7 @@ values. Counts below are for TENDL 2017.
263
276
  | None | none | 0 | |
264
277
  | SFR<br>PWR | `(n,gamma)` only | 101 | [Serpent default isomeric branching ratios](https://serpent.vtt.fi/mediawiki/index.php?title=Default_isomeric_branching_ratios) |
265
278
  | FNS-ORIGEN | 15 reaction types | 2355 | ORIGEN |
266
- | FNS | 35 reaction types | 15616 | the TENDL files themselves |
279
+ | FNS | 35 reaction types | 14692 | the TENDL files themselves |
267
280
 
268
281
  The reactor options only ever split capture. For a fusion spectrum the threshold
269
282
  reactions matter most, and in the FNS chains `(n,gamma)` is only the fourth
@@ -19,6 +19,10 @@ requires-python = ">=3.8"
19
19
  keywords = ["openmc", "nuclear", "data", "download", "process", "cross", "section"]
20
20
  classifiers = [
21
21
  "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
22
26
  "Operating System :: OS Independent",
23
27
  ]
24
28
  dependencies = [
@@ -18,6 +18,7 @@ __all__ = ["__version__"]
18
18
 
19
19
  from .utils import (
20
20
  ProgressTracker,
21
+ apply_updates,
21
22
  calculate_download_size,
22
23
  download,
23
24
  extract,
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '2.6.0'
22
- __version_tuple__ = version_tuple = (2, 6, 0)
21
+ __version__ = version = '3.0.0'
22
+ __version_tuple__ = version_tuple = (3, 0, 0)
23
23
 
24
- __commit_id__ = commit_id = 'g06d8c2c1f'
24
+ __commit_id__ = commit_id = 'ga06d1e87b'
@@ -116,6 +116,23 @@ parser.add_argument(
116
116
  "exist in the chain. Branching ratios for nuclides that are not in the "
117
117
  "chain are dropped and reported",
118
118
  )
119
+ parser.add_argument(
120
+ "--decay",
121
+ type=Path,
122
+ nargs="+",
123
+ default=None,
124
+ help="ENDF decay sublibrary of the same library as the neutron files, as "
125
+ "files, multi-material tapes or directories. The MF=8 states of each "
126
+ "product are matched to the isomer of the decay data with the closest "
127
+ "excitation energy. Without it the states are numbered by ranking their "
128
+ "excitation energies, which mislabels an isomer when an evaluation lists a "
129
+ "higher isomer but not a lower one, for example Ta182_m2 from Ta181 capture",
130
+ )
131
+ parser.add_argument(
132
+ "--decay-pattern",
133
+ default="*",
134
+ help="Glob pattern used to find the decay files in --decay directories",
135
+ )
119
136
  parser.add_argument(
120
137
  "-j",
121
138
  "--jobs",
@@ -170,7 +187,35 @@ def read_flux():
170
187
  return boundaries, values
171
188
 
172
189
 
173
- def isomer_targets(evaluation, mt):
190
+ def decay_isomers():
191
+ """Return {(Z, A): {metastable state: excitation energy in eV}} from the
192
+ --decay files, or None when they were not given."""
193
+ if args.decay is None:
194
+ return None
195
+ import openmc.data
196
+
197
+ paths = []
198
+ for path in args.decay:
199
+ if path.is_dir():
200
+ paths.extend(p for p in sorted(path.rglob(args.decay_pattern)) if p.is_file())
201
+ else:
202
+ paths.append(path)
203
+
204
+ isomers = defaultdict(dict)
205
+ for path in paths:
206
+ for material in openmc.data.endf.get_evaluations(path):
207
+ target = openmc.data.endf.as_evaluation(material).target
208
+ if target["isomeric_state"] > 0:
209
+ key = (target["atomic_number"], target["mass_number"])
210
+ isomers[key][target["isomeric_state"]] = target["excitation_energy"]
211
+ if not isomers:
212
+ raise ValueError(f"No isomers found in the decay data {args.decay}")
213
+ print(f"Read excitation energies of {sum(map(len, isomers.values()))} "
214
+ f"isomers from the decay data")
215
+ return dict(isomers)
216
+
217
+
218
+ def isomer_targets(evaluation, mt, isomers=None):
174
219
  """Map the ENDF final state number to a nuclide name for one MF=8 section.
175
220
 
176
221
  The final state number (LFS) counts excited states of the product while
@@ -179,8 +224,17 @@ def isomer_targets(evaluation, mt):
179
224
  the metastable index is found by ranking the states of each product by their
180
225
  excitation energy (ELFS).
181
226
 
227
+ When ``isomers`` from the decay data are given, each excited state is
228
+ instead matched to the isomer of that product with the closest excitation
229
+ energy, as other libraries can list a higher isomer without the lower one.
230
+ When several states are closest to the same isomer, the nearest of them
231
+ takes it and the others, which the decay data has no isomer for and so the
232
+ chain cannot hold, are counted as the ground state. Products whose decay
233
+ data gives an isomer an unknown (zero) excitation energy fall back to the
234
+ ranking.
235
+
182
236
  Returns {LFS: (nuclide name, LMF)} where LMF is the file, 9 or 10, that
183
- holds the production data.
237
+ holds the production data. Several states can map to the same nuclide.
184
238
  """
185
239
  from openmc.data import gnds_name
186
240
  from openmc.data.endf import get_cont_record, get_head_record, get_list_record
@@ -208,15 +262,43 @@ def isomer_targets(evaluation, mt):
208
262
  product_states = sorted(
209
263
  (state for state in states if state[0] == za_product), key=lambda s: s[1]
210
264
  )
265
+ z, a = divmod(za_product, 1000)
266
+ known = (isomers or {}).get((z, a))
267
+ if known and any(energy <= 0.0 for energy in known.values()):
268
+ # decay files give an excitation energy of zero when it is not
269
+ # known, which cannot be matched against
270
+ known = None
211
271
  metastable = 0
272
+ claims = {}
212
273
  for _za, excitation, lmf, lfs in product_states:
213
- if excitation > 0.0:
274
+ if excitation <= 0.0:
275
+ state = 0
276
+ elif known:
277
+ state = min(known, key=lambda m: abs(known[m] - excitation))
278
+ claims.setdefault(state, []).append((abs(known[state] - excitation), lfs))
279
+ else:
214
280
  metastable += 1
215
- z, a = divmod(za_product, 1000)
216
- targets[lfs] = (gnds_name(z, a, metastable), lmf)
281
+ state = metastable
282
+ targets[lfs] = (gnds_name(z, a, state), lmf)
283
+ # TENDL can list a metastable state that the decay data does not have,
284
+ # such as Tb156 at 200.1 keV next to the 88.4 keV Tb156_m2, and both
285
+ # are closest to the same isomer
286
+ for claimants in claims.values():
287
+ for _distance, lfs in sorted(claimants)[1:]:
288
+ targets[lfs] = (gnds_name(z, a, 0), targets[lfs][1])
217
289
  return targets
218
290
 
219
291
 
292
+ def ratios_by_target(targets, rates):
293
+ """Sum the reaction rates into each final state to branching ratios."""
294
+ total = sum(rates.values())
295
+ ratios = {}
296
+ for lfs, rate in rates.items():
297
+ name = targets[lfs][0]
298
+ ratios[name] = ratios.get(name, 0.0) + rate / total
299
+ return ratios
300
+
301
+
220
302
  def production_data(evaluation, mf, mt):
221
303
  """Return {LFS: Tabulated1D} from an MF=9 or MF=10 section."""
222
304
  from openmc.data.endf import get_head_record, get_tab1_record
@@ -298,21 +380,26 @@ class CrossSections:
298
380
 
299
381
 
300
382
  def chain_nuclides():
301
- """Return the set of nuclide names in the chain file, or None."""
383
+ """Return {nuclide name: set of its reaction types} for the chain file, or
384
+ None when no chain was given."""
302
385
  if args.chain is None:
303
386
  return None
304
387
  import openmc.deplete
305
388
 
306
- return {nuclide.name for nuclide in openmc.deplete.Chain.from_xml(args.chain).nuclides}
389
+ return {
390
+ nuclide.name: {reaction.type for reaction in nuclide.reactions}
391
+ for nuclide in openmc.deplete.Chain.from_xml(args.chain).nuclides
392
+ }
307
393
 
308
394
 
309
395
  # state shared with the worker processes, set by init_worker
310
396
  _state = {}
311
397
 
312
398
 
313
- def init_worker(midpoints, flux, in_chain):
399
+ def init_worker(midpoints, flux, in_chain, isomers=None):
314
400
  import openmc.deplete.chain
315
401
 
402
+ _state["isomers"] = isomers
316
403
  _state["midpoints"] = midpoints
317
404
  _state["flux"] = flux
318
405
  _state["in_chain"] = in_chain
@@ -350,7 +437,7 @@ def process_file(path):
350
437
  if mf != 8 or mt not in mt_to_reaction:
351
438
  continue
352
439
  reaction = mt_to_reaction[mt]
353
- targets = isomer_targets(evaluation, mt)
440
+ targets = isomer_targets(evaluation, mt, _state["isomers"])
354
441
 
355
442
  # only reactions that make more than one state of a product branch
356
443
  if len({name for name, _lmf in targets.values()}) < 2:
@@ -388,10 +475,10 @@ def process_file(path):
388
475
  skipped.append(("zero reaction rate for this flux", f"{parent} {reaction}"))
389
476
  continue
390
477
 
391
- ratios = {targets[lfs][0]: rate / total for lfs, rate in rates.items()}
478
+ ratios = ratios_by_target(targets, rates)
392
479
 
393
480
  if in_chain is not None:
394
- missing = ({parent} | set(ratios)) - in_chain
481
+ missing = ({parent} | set(ratios)) - in_chain.keys()
395
482
  if missing:
396
483
  skipped.append(
397
484
  (
@@ -400,6 +487,14 @@ def process_file(path):
400
487
  )
401
488
  )
402
489
  continue
490
+ # Chain files only hold reactions with an MF=3 cross section, but
491
+ # an evaluation can give isomeric production in MF=10 for one that
492
+ # has none, such as Tm170 (n,3np) in ENDF/B-VIII.1. A ratio for a
493
+ # reaction the chain lacks cannot be applied, and when no parent
494
+ # has the reaction add_branching_ratios fails
495
+ if reaction not in in_chain[parent]:
496
+ skipped.append(("reaction not in chain file", f"{parent} {reaction}"))
497
+ continue
403
498
 
404
499
  ratios_by_reaction[reaction] = ratios
405
500
 
@@ -423,6 +518,7 @@ def main():
423
518
  print(f"Found {len(paths)} ENDF neutron files in {args.neutron_dir}")
424
519
 
425
520
  in_chain = chain_nuclides()
521
+ isomers = decay_isomers()
426
522
 
427
523
  branching_ratios = defaultdict(dict)
428
524
  skipped = Counter()
@@ -452,14 +548,14 @@ def main():
452
548
  context = None
453
549
 
454
550
  if context is None:
455
- init_worker(midpoints, flux, in_chain)
551
+ init_worker(midpoints, flux, in_chain, isomers)
456
552
  executor = ThreadPoolExecutor(max_workers=args.jobs)
457
553
  else:
458
554
  executor = ProcessPoolExecutor(
459
555
  max_workers=args.jobs,
460
556
  mp_context=context,
461
557
  initializer=init_worker,
462
- initargs=(midpoints, flux, in_chain),
558
+ initargs=(midpoints, flux, in_chain, isomers),
463
559
  )
464
560
  print(f"Processing with {args.jobs} jobs", flush=True)
465
561
  # as_completed rather than map so that the progress reflects the files
@@ -474,7 +570,7 @@ def main():
474
570
  if done % 25 == 0 or done == len(paths):
475
571
  print(f" {done} of {len(paths)} files", flush=True)
476
572
  else:
477
- init_worker(midpoints, flux, in_chain)
573
+ init_worker(midpoints, flux, in_chain, isomers)
478
574
  for done, path in enumerate(paths, 1):
479
575
  collect(process_file(path))
480
576
  if done % 25 == 0 or done == len(paths):
@@ -0,0 +1,126 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """Generate an OpenMC depletion chain from JEFF ENDF evaluations.
4
+
5
+ JEFF distributes its radioactive decay and fission product yield
6
+ sub-libraries as single ENDF tapes holding every material. The tapes are
7
+ split into their individual materials before the chain is built, as OpenMC
8
+ only reads the first material of a file.
9
+ """
10
+
11
+ import argparse
12
+ from pathlib import Path
13
+ import shutil
14
+
15
+ import openmc.data
16
+ import openmc.deplete
17
+
18
+ from openmc_data.utils import download, extract
19
+ from openmc_data import all_decay_release_details
20
+
21
+
22
+ LIBRARY_NAME = 'jeff'
23
+ RELEASES = tuple(all_decay_release_details[LIBRARY_NAME])
24
+ ARCHIVE_SUFFIXES = ('.zip', '.tar.gz', '.tgz', '.tar.bz2', '.tar.xz', '.xz')
25
+
26
+
27
+ def parse_args(argv=None):
28
+ parser = argparse.ArgumentParser(
29
+ prog="generate_jeff_chain",
30
+ description="Generates a OpenMC chain file from JEFF nuclear data files",
31
+ )
32
+ parser.add_argument('-r', '--release', choices=RELEASES, default='4.0',
33
+ help="The nuclear data library release version. The "
34
+ f"currently supported options are {', '.join(RELEASES)}")
35
+ parser.add_argument(
36
+ "-d",
37
+ "--destination",
38
+ type=Path,
39
+ default=None,
40
+ help="filename of the chain file xml file produced. If left as None then "
41
+ "the filename will follow this format 'chain_jeff_{release}.xml'",
42
+ )
43
+ return parser.parse_args(argv)
44
+
45
+
46
+ def fetch(details, download_path, extract_dir):
47
+ """Download one sub-library and return the paths of its ENDF files."""
48
+ paths = []
49
+ for base_url, name, checksum in zip(details['base_url'],
50
+ details['compressed_files'],
51
+ details['checksums']):
52
+ downloaded_file = download(
53
+ url=base_url + name + details.get('url_suffix', ''),
54
+ checksum=checksum,
55
+ as_browser=details.get('as_browser', False),
56
+ output_path=download_path,
57
+ output_filename=name,
58
+ )
59
+ if name.endswith(ARCHIVE_SUFFIXES):
60
+ extract(downloaded_file, extract_dir)
61
+ else:
62
+ paths.append(downloaded_file)
63
+ if 'endf_files' in details:
64
+ paths.extend(sorted(extract_dir.rglob(details['endf_files'])))
65
+ return paths
66
+
67
+
68
+ def with_tape_id(path):
69
+ """Return a copy of an ENDF tape with a TPID record added if it lacks one.
70
+
71
+ The JEFF fission product yield tapes start directly with the first
72
+ material, which ENDF readers misread as the tape identifier.
73
+ """
74
+ with open(path) as fh:
75
+ first_line = fh.readline()
76
+ if first_line[70:75] == ' 0 0':
77
+ return path
78
+ fixed = path.with_name(f'{path.stem}-fixed{path.suffix}')
79
+ with open(path) as original, open(fixed, 'w') as out:
80
+ out.write(" " * 66 + " 1 0 0 0\n")
81
+ shutil.copyfileobj(original, out)
82
+ return fixed
83
+
84
+
85
+ def materials(paths):
86
+ """Split ENDF tapes into a list of their individual materials."""
87
+ return [material for path in paths
88
+ for material in openmc.data.endf.get_evaluations(with_tape_id(path))]
89
+
90
+
91
+ def main(argv=None):
92
+ args = parse_args(argv)
93
+
94
+ cwd = Path.cwd()
95
+ endf_files_dir = cwd / f'{LIBRARY_NAME}-{args.release}-endf'
96
+ download_path = cwd / f'{LIBRARY_NAME}-{args.release}-download'
97
+ release_details = all_decay_release_details[LIBRARY_NAME][args.release]
98
+
99
+ files = {}
100
+ for file_type, extract_dir in [('neutron', 'neutrons'), ('decay', 'decay'),
101
+ ('nfy', 'nfy')]:
102
+ files[file_type] = fetch(release_details[file_type], download_path,
103
+ endf_files_dir / extract_dir)
104
+
105
+ # check files exist
106
+ for file_type, description in [('decay', 'decay'), ('neutron', 'neutron'),
107
+ ('nfy', 'neutron fission product yield')]:
108
+ if not files[file_type]:
109
+ raise IOError(f"No {description} endf files found in {endf_files_dir}")
110
+
111
+ chain = openmc.deplete.Chain.from_endf(
112
+ decay_files=materials(files['decay']),
113
+ fpy_files=materials(files['nfy']),
114
+ neutron_files=files['neutron'],
115
+ reactions=list(openmc.deplete.chain.REACTIONS.keys())
116
+ )
117
+
118
+ if args.destination is None:
119
+ args.destination = f'chain_{LIBRARY_NAME}_{args.release}.xml'
120
+
121
+ chain.export_to_xml(args.destination)
122
+ print(f'Chain file written to {args.destination}')
123
+
124
+
125
+ if __name__ == '__main__':
126
+ main()
@@ -7,7 +7,7 @@ from urllib.parse import urljoin
7
7
 
8
8
  import openmc.deplete
9
9
 
10
- from openmc_data.utils import download, extract
10
+ from openmc_data.utils import apply_updates, download, extract
11
11
  from openmc_data import all_decay_release_details
12
12
 
13
13
 
@@ -62,7 +62,7 @@ def main():
62
62
  if not neutron_files:
63
63
  details = all_decay_release_details[library_name][args.release]['neutron']
64
64
 
65
- for f in details['compressed_files']:
65
+ for f in details['compressed_files'] + details.get('updates', []):
66
66
  # Establish connection to URL
67
67
  download(
68
68
  urljoin(details['base_url'], f),
@@ -74,10 +74,8 @@ def main():
74
74
  extraction_dir=endf_files_dir,
75
75
  del_compressed_file=False
76
76
  )
77
- for erratum in details["errata"]:
78
- files = Path('.').rglob(erratum)
79
- for p in files:
80
- p.rename((endf_files_dir / details["endf_files"]).parent / p.name)
77
+ apply_updates([download_path / f for f in details.get('updates', [])],
78
+ (endf_files_dir / details['endf_files']).parent)
81
79
  neutron_files = endf_files_dir.glob(details['endf_files'])
82
80
 
83
81
  decay_files = args.decay