Skip to content

Photonuclear Physics part 1 - #3439

Closed
GuySten wants to merge 31 commits into
openmc-dev:developfrom
GuySten:photonuclear-physics-pt1
Closed

Photonuclear Physics part 1#3439
GuySten wants to merge 31 commits into
openmc-dev:developfrom
GuySten:photonuclear-physics-pt1

Conversation

@GuySten

@GuyStenGuySten commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

Description

This pull request is the first step of implementing photonuclear physics in OpenMC.
This pull request handle definition and conversion of nuclear data from endf/ACE formatted libraries to hdf5 format.
Because photonuclear physics is relatively a big feature, I feel that breaking it into chunks is preferable.
I am open to constructive criticism regarding code structure, documentation, testing, etc.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@shimwell

Copy link
Copy Markdown
Member

Wow super to see work on this, it sounds like the PR would help fix a long standing issue of not being able to process TENDL gamma cross sections.
#1941

Comment threadopenmc/data/kalbach_mann.py Outdated
Comment threadopenmc/data/data.py Outdated
enum class Type {
neutron = 1,
photon = 3,
photonuclear = 6,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@paulromano is this list out of order to test neurodivergents?

projectile_mass = ev.projectile["mass"]
if ev.projectile['mass'] == 0.0:
projectile_za = 0
elif np.isclose(ev.projectile['mass'], 1.0, atol=1.0e-12, rtol=0.):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are these tolerances set uniformly across the data module? Maybe this should be elevated to some constant somewhere that is globally accessible?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Those tolerances were originaly from a check in openmc/data/kalbach_mann.py.
So the only thing I did was to move code around.

I do not think that setting global tolerance variables will improve code readability so I am against this suggested change.

@GuySten

Copy link
Copy Markdown
ContributorAuthor

@makeclean Thanks for your review and suggested changes, most of which I accepted.

After including some tests I think this pr is ready for formal review.

@GuySten
GuySten marked this pull request as ready for review June 11, 2025 20:11
@GuySten
GuySten requested a review from paulromano as a code ownerJune 11, 2025 20:11
Comment threadtests/unit_tests/test_data_photonuclear.py
@GuySten
GuyStenforce-pushed the photonuclear-physics-pt1 branch 2 times, most recently from f55d2ed to 6f8df6bCompareJune 12, 2025 18:24

@ahnaf-tahmid-chowdhuryahnaf-tahmid-chowdhury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the excellent work! I have a few suggestions.

Comment thread.github/workflows/ci.yml
# Download HDF5 data
if [[ ! -e $HOME/nndc_hdf5/cross_sections.xml ]]; then
wget -q -O - https://anl.box.com/shared/static/teaup95cqv8s9nn56hfn7ku8mmelr95p.xz | tar -C $HOME -xJ
wget -q -O - https://github.com/GuySten/data/releases/download/v1.0.0/nndc_hdf5_test.tar.xz | tar -C $HOME -xJ

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The photonuclear data for Pu239.h5 is currently unavailable from ANL, isn't it? Perhaps we should consider serving this from ANL.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@paulromano, I leave the decision to you.

Comment threadtests/unit_tests/test_data_photonuclear.py Outdated
Comment threadopenmc/data/photonuclear.py
Comment threadopenmc/data/photonuclear.py
Comment threadopenmc/data/photonuclear.py Outdated
Comment threadopenmc/data/photonuclear.py Outdated
Comment threadopenmc/data/photonuclear.py
@GuySten

Copy link
Copy Markdown
ContributorAuthor

@ahnaf-tahmid-chowdhury Thanks for your review! You noticed some things that I missed.

Currently the ci tests crash on the test:
tests/regression_tests/deplete_decay_only/test.py::test_decay_only[coupled]
This crash also happens to me when I test locally so I will update this branch when I will figure out what happens.

@GuySten

Copy link
Copy Markdown
ContributorAuthor

I fixed a bug and now all tests pass.

@GuySten
GuyStenforce-pushed the photonuclear-physics-pt1 branch from 26ad64b to 8722e9bCompareJune 17, 2025 08:46
@GuySten
GuyStenforce-pushed the photonuclear-physics-pt1 branch from 8722e9b to a2fbdf5CompareJune 26, 2025 11:44
@GuySten
GuyStenforce-pushed the photonuclear-physics-pt1 branch from a2fbdf5 to b802e4aCompareJuly 21, 2025 07:53
@GuySten
GuyStenforce-pushed the photonuclear-physics-pt1 branch from af9d98a to c13c6a2CompareJuly 23, 2025 17:02
@GuySten
GuyStenforce-pushed the photonuclear-physics-pt1 branch 2 times, most recently from 2791541 to 44eb89cCompareAugust 31, 2025 05:30
@GuySten
GuyStenforce-pushed the photonuclear-physics-pt1 branch from 44eb89c to d4e55daCompareAugust 31, 2025 05:31
@GuySten
GuySten marked this pull request as draft July 30, 2026 13:32
@GuySten

Copy link
Copy Markdown
ContributorAuthor

closing in favor of #3675#3682 and #3683

@GuyStenGuySten closed this Aug 24, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@GuySten@shimwell@makeclean@ahnaf-tahmid-chowdhury