Add TENDL 2017, 2019 and 2025 chains with TENDL derived FNS branching ratios - #36
Merged
Conversation
The TENDL 2017 chains are useful for comparing against the IAEA CoNDERC FNS decay heat benchmark as the reference FISPACT-II simulations were run with TENDL 2017. - chain_tendl_2017_endf80.xml is TENDL 2017 with decay data and neutron induced fission yields from ENDF/B-VIII.0, made with generate_tendl_chain - the SFR and PWR variants are made from it with add_branching_ratios - the FNS variant is downloaded from the openmc_activator repository as the flux collapsed branching ratios can not currently be reproduced by this package download_chain gains the 2017 release and now raises a ValueError naming the available options when a library, release and branching ratio combination does not exist, rather than a KeyError. The branching ratios are also included in the default filename so that chain files with different branching ratios no longer overwrite each other.
…hing Reactions can produce either the ground state or a metastable state of a nuclide and the split between them depends on the neutron spectrum. This adds a script that finds the split from the isomeric production data in the ENDF neutron files and collapses it with a multigroup flux, writing a JSON file in the same format as branching_ratios_pwr.json so that add_branching_ratios can apply it to a chain file without any changes. The MF=8 section of each evaluation gives the excitation energy of every state of every reaction product and says whether the production data is stored as multiplicities in MF=9 or as cross sections in MF=10. The metastable index is found by ranking the states of a product by excitation energy rather than by using the ENDF final state number, as the two are not the same. For example TENDL 2017 gives Ag107 (n,gamma) Ag108 at final states 0 and 2, where state 2 at 109.47 keV is the first metastable state Ag108_m1. The branching ratio is reaction rate weighted, sum(Y * xs * flux) divided by sum(xs * flux), which is the weighting that preserves the production rate of each isomer when the chain only has a single energy group. Reactions with MF=10 data need no cross sections. Those with MF=9 data are weighted by the reaction cross section, which is reconstructed with NJOY because the MF=3 cross section is only the background in the resolved resonance range, where the majority of the capture rate can sit even for a fusion spectrum. Passing --cross-sections reads them from an existing HDF5 library instead. Channels that are skipped, for example those below threshold for the given flux, are counted and reported by reason rather than being dropped silently.
Reconstructing the cross sections for the MF=9 reactions with NJOY takes tens of seconds per nuclide, so a whole library takes many hours in series. Each ENDF file is independent so they are now processed in a pool of workers. The workers are forked rather than spawned because the command line is parsed when the module is imported, so a spawned worker would reparse a command line that is not its own. Systems without fork fall back to threads, which still overlap the NJOY subprocesses. Verified on 21 TENDL 2017 evaluations that --jobs 20 gives byte for byte the same JSON as a series run, in 1m27s instead of 3m57s.
Results from executor.map arrive in the order the files were submitted, so a single slow file hides all the progress behind it. Running over a whole TENDL library this reported nothing at all for hours, because the files are processed alphabetically and the actinides at the start are the slowest to reconstruct. Uses as_completed instead, and reports every 25 files rather than every 100, so the count reflects real progress. Output is unchanged, verified identical on the 21 evaluation test set.
Reconstructing a whole TENDL library was not viable. The unresolved resonance probability tables produced by purr take over two hours for a single actinide, and as the files are processed alphabetically every worker started on Ac, Am, Bk, Cf and Cm at once, so a run over 2813 evaluations completed nothing in 3 hours. Only the shape of the cross section is used, as a weight for the MF=9 multiplicities, so purr, heatr and gaspr are turned off and the reconstruction tolerance is loosened to 0.01. An actinide then takes about 8 seconds instead of over 2 hours. Measured on the 21 evaluation test set: the same 118 channels with the same parents and targets, and no branching ratio moves by more than 0.2 percent. Threshold reactions are unchanged to every digit, as they have no resonance region contribution, and only capture moves at all.
The FNS chains available until now came from the openmc_activator repository and their branching ratios are derived from ORIGEN data. These are generated from the isomeric production data in the TENDL files themselves with generate_branching_ratios, so a comparison against FISPACT-II, which also takes its isomeric production from TENDL, is not mixing in a second library. Every release now offers the same four options, and 2025 is added: 2017, 2019 None, SFR, PWR, FNS and FNS-ORIGEN 2025 None, SFR, PWR and FNS FNS now means the TENDL derived chain, which changes what the default download_chain invocation returns. The ORIGEN based chains are still available as FNS-ORIGEN and are still fetched from openmc_activator. The two differ substantially, for example Ag107 capture to Ag108_m1 under a fusion spectrum is 0.056 from TENDL against 0.348 from ORIGEN, because the TENDL value is reaction rate weighted and most of the capture rate sits in the resolved resonance range where the isomeric ratio is small. The TENDL derived chains also cover far more of the library. The 2017 FNS chain has branching ratios on 15616 channels against 2355 in the ORIGEN based one, and the 2019 base chain covers 2670 nuclides with reactions against 629 in the openmc_activator chain, which was restricted to the TENDL-2019 ACE nuclide list. All three releases were built the same way, with generate_tendl_chain for the base chain and ENDF/B-VIII.0 decay data and neutron induced fission yields. The branching ratios were collapsed with the fusion neutron source spectrum shared by 91 of the 132 experiment files in the IAEA CoNDERC FNS benchmark.
Three gaps in the README: - the generate_branching_ratios example did not use --jobs, so anyone copying it for a whole library would get a series run taking hours instead of about half an hour - nothing said that the NJOY modules which do not affect the cross section shape are skipped, which is what makes the actinides tractable - add_branching_ratios was described as handling n,gamma reactions, which has not been true since it started looping over whatever reactions are in the JSON file, and generate_branching_ratios produces 35 of them
The branching options differ in which reactions they cover, not only in the values they give, and nothing said so. Measured on TENDL 2017: SFR, PWR (n,gamma) only, 101 channels, from the Serpent defaults FNS-ORIGEN 15 reaction types, 2355 channels FNS 35 reaction types, 15616 channels This matters for fusion because the threshold reactions dominate at 14 MeV. In the FNS chains (n,gamma) is only the fourth largest group of branched channels, behind (n,na), (n,3He) and (n,2n), so the reactor options leave out most of what an activation calculation needs. Added as a table in the download chain files section, where the option is chosen, and noted in the generate_branching_ratios docstring. Also corrects add_branching_ratios, whose description said it adds branching ratios to n,gamma reactions. It has always looped over whatever reactions are in the file it is given, so the limitation was in the bundled data rather than in the tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds TENDL chains for 2017, 2019 and 2025, and a script that derives the branching ratios for metastable production from the TENDL files themselves.
Why
The FNS chains available until now came from the openmc_activator repository and their branching ratios are derived from ORIGEN. The IAEA CoNDERC FNS decay heat benchmark's reference results were produced by FISPACT-II, which takes its isomeric production straight from TENDL, so comparing against it with an ORIGEN derived chain mixes in a second library's physics. TENDL 2017 matters specifically, because that is what the reference FISPACT-II runs used.
What you get
-b FNSnow means the TENDL derived chain, so what the defaultdownload_chaininvocation returns changes. The ORIGEN based chains stay available asFNS-ORIGEN.generate_branching_ratios
Reads the isomeric production data in the ENDF neutron files and collapses it with a multigroup flux, writing JSON in the same format as
branching_ratios_pwr.jsonsoadd_branching_ratiosapplies it with no changes.generate_tendl_chain -r 2017 --lib endf80 generate_branching_ratios --neutron-dir tendl-2017-endf/neutron \ --fispact-fluxes fns/Ag/2000exp_5min_fluxes \ --chain chain_tendl_2017_endf80.xml --jobs 20 \ -o branching_ratios_tendl_2017_fns.json add_branching_ratios -i chain_tendl_2017_endf80.xml \ -b branching_ratios_tendl_2017_fns.json -o chain_tendl_2017_endf80_fns.xmlThree things that turned out to matter:
MF=8 drives it. It gives the excitation energy of every state of every reaction product and says whether the production data sits in MF=9 or MF=10, so nothing has to be guessed.
The ENDF final state number is not the metastable index. TENDL 2017 gives Ag107 (n,gamma) Ag108 at final states 0 and 2, where state 2 at 109.47 keV is the first metastable state
Ag108_m1. Using the final state number directly would produceAg108_m2, which is not in the chain. The index is taken by ranking each product's states by excitation energy instead, checked against Ag108m 109.47 keV, Co60m 58.59 keV and Nb92m 135.5 keV.Reaction rate weighting.
sum(Y * xs * flux) / sum(xs * flux), the only weighting that preserves each isomer's production rate in a single group chain.MF=10 reactions need no cross sections. MF=9 reactions need one as a weight, and MF=3 is only the background in the resolved resonance range, so NJOY reconstructs it.
purr,heatrandgasprare turned off and the tolerance loosened, because only the shape is used: an actinide takes about 8 s instead of over 2 hours, while no branching ratio moves by more than 0.2%. Skipped channels are counted and reported by reason rather than dropped silently.Results
The TENDL derived chains cover much more of the library than the ORIGEN based ones: 15616 branched channels against 2355 for 2017. The 2019 base chain also covers 2670 nuclides with reactions against 629 in the openmc_activator chain, which was restricted to the TENDL-2019 ACE nuclide list.
All three were built identically, with
generate_tendl_chainand ENDF/B-VIII.0 decay data and neutron induced fission yields, and collapsed with the fusion spectrum shared by 91 of the 132 experiment files in the CoNDERC benchmark.The numbers differ from the ORIGEN chains
Ag107 capture to Ag108_m1 under a fusion spectrum:
The isomeric ratio runs from 0.028 at thermal to 0.517 at 14 MeV, and about 68% of the Ag107 capture rate under this spectrum sits below 7 keV, which is why the reaction rate weighted value is low. Worth being aware of when switching chains.
Also worth a look: Ag107 (n,gamma) is 0.0563, 0.0565 and 0.0353 for 2017, 2019 and 2025, so the 2025 evaluation moves this channel by about 37% while (n,2n) moves the other way.
Checks
download_chaincombination checked, valid and invalid, with invalid ones raising aValueErrornaming the available options rather than aKeyError--jobs 20verified to give byte identical output to a series runOther fixes here
download_chainincludes the branching ratios in the default filename, so downloading the same release twice with different branching no longer overwrites the first fileopenmc/data/ace.py ValueError: string or file could not be read to its end. The ENDF parses fine, so this is an openmc/NJOY round trip limitation. They are reported and skipped, 0.18% of channels and all actinides.