OpenMC/scripts/openmc-make-depletion-chain

33 lines
898 B
Python
Executable file

#!/usr/bin/env python3
import glob
import os
from zipfile import ZipFile
from openmc._utils import download
import openmc.deplete
URLS = [
'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-neutrons.zip',
'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-decay.zip',
'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-nfy.zip'
]
def main():
for url in URLS:
basename = download(url)
with ZipFile(basename, 'r') as zf:
print('Extracting {}...'.format(basename))
zf.extractall()
decay_files = glob.glob(os.path.join('decay', '*.endf'))
nfy_files = glob.glob(os.path.join('nfy', '*.endf'))
neutron_files = glob.glob(os.path.join('neutrons', '*.endf'))
chain = openmc.deplete.Chain.from_endf(decay_files, nfy_files, neutron_files)
chain.export_to_xml('chain_endfb71.xml')
if __name__ == '__main__':
main()