Skip to content

Add mechanics to build fine energy group structures - #4176

Draft
yrrepy wants to merge 4 commits into
openmc-dev:developfrom
yrrepy:fine-group-structures
Draft

yrrepy wants to merge 4 commits into
openmc-dev:developfrom
yrrepy:fine-group-structures

Conversation

@yrrepy

@yrrepy yrrepy commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR follows up #3564.
It was requested to not have the large energy structures in the Python file but rather in an .H5.

The implementation here one ups that, a generic method, build_fine_group_structure, that can be used to build these types of formulaic fine energy group structures.
These structures often follow similar styles, 1000 groups per decade between 1eV and 100 keV, etc.
The built method allows equal-lethargy or equal-width groups per interval.

FOMG-16000, VESTA-43000, VESTA-100000 are added as named groups that immediately leverage this functionality to populate their GROUP_STRUCTURES

N.B.

  • FOMG-16000 was built for and is recommended for fusion
  • VESTA-43000 was built for and is recommended for LWR (U-238 dominated systems)

These two energy structures are then explicitly included on tests/unit_tests/fine_group_structures_reference.npz
as the test of build_fine_group_structure.

These types of energy structure are needed for the multi-group binning (MGB) method of neutron activation.
Found in Aleph, VESTA, Shift and SMURE.

https://fispact.ukaea.uk/wp-content/uploads/2016/07/snamc2013_05203.pdf
https://www.kns.org/files/pre_paper/44/20A-413-%EA%B9%80%EA%B2%BD%EB%AF%BC-%EB%B0%9C%ED%91%9C%EC%9E%90%EB%A3%8C.pdf
https://etheses.whiterose.ac.uk/id/eprint/4427/1/PhD_Thesis_Corrected_FINAL_FINAL_3_9_13.pdf
https://www.osti.gov/etdeweb/servlets/purl/20902503 https://roma.sckcen.be/ws/portalfiles/portal/4558859/An_Optimum_Approach_to_Monte_Carlo_Burn_Up.pdf https://rsicc.ornl.gov/codes/ccc/ccc7/ccc-769.html
https://www.tandfonline.com/doi/abs/10.13182/NSE07-A2695

AI Assistance

  • Harness: Claude Code
  • Model: Claude Fable 5.1, Opus 5.5, Opus 5.5
  • Reasoning effort: max, high, max
    Planning/orchestration/final review, implementation, review

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) 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)

yrrepy added 4 commits October 7, 2026 00:56
The ultra-fine structures are generated from their published definitions
with the new build_fine_group_structure(), which builds any structure
defined as equal-lethargy or equal-width groups per macro-interval. The
FOMG and VESTA-43000 edges tabulated in openmc-dev#3564 serve as the test reference.
changed some of the primary variable names to hopefully be a bit clearer
num_groups  -> num_fine_bins
bounds      -> macro_bounds
n_intervals -> num_macro_groups

General cleanup, comments, description
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant