Skip to content

Adding openmc processing#1

Open
shimwell wants to merge 13 commits intoIAEA-NDS:mainfrom
shimwell:adding-openmc-processing
Open

Adding openmc processing#1
shimwell wants to merge 13 commits intoIAEA-NDS:mainfrom
shimwell:adding-openmc-processing

Conversation

@shimwell
Copy link
Copy Markdown
Contributor

@shimwell shimwell commented Mar 20, 2026

This PR proposes to add processing of fenld endf files into hdf5 openmc files

I am adding as a draft as I would like to test the hdf5 files a bit more to be confident. On that topic can i ask, is testing the hdf5 files in particle transport something that this repo would be a good home for (I can add some CI to do that)?

@shimwell shimwell marked this pull request as draft March 20, 2026 12:30
@shimwell shimwell marked this pull request as ready for review March 26, 2026 09:55
@shimwell
Copy link
Copy Markdown
Contributor Author

thanks for the catchup just now @gschnabel I made the changes to the output folder and this PR is now ready for review

Copy link
Copy Markdown
Member

@gschnabel gschnabel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comments. Let me know if you want to implement the changes or prefer me doing it. In the latter case, I may need help with the openmc.data interface.

Comment thread code/process_fendl.def Outdated
ln -s /opt/NJOY2016/bin
ln -s /opt/NJOY2016/bin &&
cd /opt &&
git clone --branch master https://github.com/openmc-dev/openmc.git &&
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pin a specific commit of OpenMC (as done for NJOY2016) for traceability and reproducibility.

Comment thread code/process_fendl.py
'.', njoyexe, njoylib, njoyvers, fendlvers, cdate, endf_file=endf_file
)

if 'hdf5' in formats:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that openmc.data produces ACE files on-the-fly with its own defaults for NJOY as a prerequisite for the conversion to hdf5. This is one reason why the split here is problematic because the ACE file produced in the branch above would be inconsistent with the ACE file used for the hdf5 creation (e.g. different temperatures).

Therefore, I suggest giving up on format selection at this level and instead do the following:

Add the hdf5 output path to the
fendl_paths['output'] dict in determine_fendl_paths and extend the code in run_fendl_njoy to produce an hdf5 file, ideally using the ACE file generated by our custom FENDL NJOY in the same function. This also means that the additional module process_fendl_neutron_hdf5.py script should be removed.

Comment thread code/process_fendl.py
process_fendl_proton_lib(
'.', njoyexe, njoylib, njoyvers, fendlvers, cdate, endf_file=endf_file
)
if library_type in ('photon', 'all'):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional branch is okay. For streamlining, I suggest keeping exactly the same function signature as for the other fendl_process_*_lib functions used above. Then, it will also be nice to use the same internal logic within process_fendl_photon_hdf5.py as used in the other process_fendl_*.py files. Regarding this, see my comments added to process_fendl_photon_hdf5.py.

Comment thread code/process_fendl.sif Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I look at the PR locally, I see that this is a regular file but should be a symbolic link. I guess there was some issue with git-annex. I've usually encountered these issues on Windows. Anyway, this is a minor thing that we can fix at the end.

Comment thread code/process_fendl_neutron_hdf5.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest removing this file and implement its logic in process_fendl_neutron.py as described in this comment

Comment thread code/process_fendl_photon_hdf5.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other process_fendl_*.py modules follow a generic structure. They contain the functions run_fendl_njoy and determine_fendl_paths and then a main function process_fendl_neutron_lib (which will be named process_fendl_photoatomic.py or something like this) which calls the generic function process_fendl_sublib with arguments including the run_fendl_njoy and the determine_fendl_path functions. It would be nice to maintain the same kind of logic in the process_fendl_photoatomic.py (or similarly named file).

@gschnabel
Copy link
Copy Markdown
Member

On that topic can i ask, is testing the hdf5 files in particle transport something that this repo would be a good home for (I can add some CI to do that)?

@shimwell Sure, some basic verification with a transport code would be a good idea to catch issues early on.

- add process_fendl_photoatomic.py matching neutron/proton/deuteron layout
  (run_fendl_njoy, determine_fendl_paths, process_fendl_photoatomic_lib)
- remove process_fendl_photon_hdf5.py
- allow process_fendl_endf to tolerate modules without NJOY inputs/outputs
- use uniform *_lib signature for photo-atomic in process_fendl.py
@shimwell
Copy link
Copy Markdown
Contributor Author

shimwell commented Apr 22, 2026

Hi @gschnabel — sorry it's taken so long to get back to this. I've pushed commits that try to address the review comments:

  • OpenMC pinned to a specific commit in process_fendl.def
  • Neutron ACE and HDF5 are now produced together inside run_fendl_njoy from the same FENDL NJOY run, so they are consistent; process_fendl_neutron_hdf5.py has been removed
  • New process_fendl_photoatomic.py follows the same structure as the other process_fendl_*.py modules (run_fendl_njoy, determine_fendl_paths, process_fendl_photoatomic_lib calling process_fendl_sublib); process_fendl_photon_hdf5.py has been removed
  • process_fendl.sif restored to the symlink matching main
  • Small tweak to process_fendl_base.py::process_fendl_endf so the generic pipeline can accept modules without NJOY inputs/outputs (needed for the photo-atomic path)

Happy to make any further adjustments needed to get this merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants