Creating a new HDF5 nuclear data library for UQ#3911
Draft
Grego01-biot wants to merge 29 commits intoopenmc-dev:developfrom
Draft
Creating a new HDF5 nuclear data library for UQ#3911Grego01-biot wants to merge 29 commits intoopenmc-dev:developfrom
Grego01-biot wants to merge 29 commits intoopenmc-dev:developfrom
Conversation
…hrough HDF5 files
…cross_section_sampling
…cross_section_sampling
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.
Description
The goal of this PR is to create a new HDF5 nuclear data library with covariance data stored in that would live on the OpenMC nuclear data libraries page. This is only the HDF5 data storage part with no modifications to the C++ source code. The final goal would be to have the capability to perform on-the-fly cross section sampling using the stored data in HDF5 format. Another draft PR will be added shortly to openmc-dev/data repository in order to have the capability to generate the entire nuclear data library with MF=33 evaluations.
In order to do so, two new Python files are created and added to openmc/data:
mf33_njoy.py is a minimal driver that runs ERRORR module from NJOY to produce multigroup relative covariance matrices from an ENDF-6 evaluation. The user provides an explicit energy grid (group boundaries in eV) and optionally a weight spectrum. The output is the raw ERRORR tape33 text.
xs_covariance_njoy.py is where the data model, ENDF text parser, covariance factorization. The key class is
NeutronXSCovariances, which holds parsed MF=33 covariance matrices and their lower-triangular factors. It provides the capability to read/write to HDF5 files and to write/read MF33 sub-tree inside an existing HDF5 group (used byIncidentNeutron).neutron.py is modified to add an
mg_covarianceproperty onIncidentNeutronand write covariance data inexport_to_hdf5()under/<nuclide>/covariance/mf33/. It also can read covariance data back infrom_hdf5().The idea is to start by generating multigroup covariance matrices for MF33 using ERRORR module from NJOY, parsing output tape33, performing an eigenvalue decomposition (QR factorization) and storing the energy grids, the reactions and the lower triangular matrices for each reaction. The covariance matrix is stored as a lower triangular matrix to reduce storage which will be used to perturb cross sections inside OpenMC later.
Covariance data is stored in a dedicated HDF5 library intended specifically for UQ, so file size is a secondary concern. Storage is kept compact by retaining only the lower-triangular factor L rather than the full covariance matrix. This enables two UQ workflows within OpenMC: sensitivity analysis via the sandwich rule, and direct cross-section sampling via the Total Monte Carlo approach (similar to SANDY). The data structure described here is a starting point — feedback on the schema and storage layout is more than welcome!
Here is an example of the code used to generate the new HDF5 file for Fe56.h5 using 1500 energy groups:
It is important to note that the code needs modularity to account for the tolerance used in NJOY, the dilution cross section used for the multigroup covariance generation and the combination or not of MF32 and MF33. This capability would also allow users to generate and store their own multigroup covariance data by providing a precomputed flux spectrum as input to NJOY and selecting the desired output energy grid.
Fixes # (issue)
Checklist
I have run clang-format (version 18) on any C++ source files (if applicable)