Skip to content

Approximate multigroup velocity #3766

Open
GuySten wants to merge 39 commits intoopenmc-dev:developfrom
GuySten:check-xs-vacuum
Open

Approximate multigroup velocity #3766
GuySten wants to merge 39 commits intoopenmc-dev:developfrom
GuySten:check-xs-vacuum

Conversation

@GuySten
Copy link
Contributor

@GuySten GuySten commented Feb 4, 2026

Description

Currently, void regions in multigroup mode makes openmc crash (#3723).

This PR implements the following changes:

  1. When inverse-velocity data is missing default to an approximate formula (group collapse of inverse-velocity data with 1/E spectrum).
  2. Ensure that lowest neutron energy boundary is at least 1e-5 (ensure 1/E spectra is defined)

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)

@GuySten GuySten requested a review from nelsonag as a code owner February 4, 2026 00:43
@GuySten GuySten requested review from paulromano and pshriwise and removed request for nelsonag and paulromano February 4, 2026 00:43
@GuySten GuySten added the Bugs label Feb 4, 2026
@paulromano paulromano requested a review from nelsonag February 4, 2026 03:43
Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

@nelsonag would love to get your thoughts on this one!

@GuySten GuySten added the MGXS label Feb 5, 2026
@nelsonag
Copy link
Contributor

nelsonag commented Feb 6, 2026

Why not tally a 1/v based on the group midpoint energy (I assume logarithmic midpoint is best) if no specific data is present? This could be done void or not.
I agree having data is better than not, but can assume this would work great for a UFG collapse sort of approach.

@GuySten
Copy link
Contributor Author

GuySten commented Feb 6, 2026

Do you mean instead of defaulting to speed 0 when 1/v data is missing using velocity that match the logarithmic energy midpoint of the group?

@nelsonag
Copy link
Contributor

nelsonag commented Feb 6, 2026 via email

@GuySten GuySten changed the title Handle multigroup void velocity Approximate multigroup velocity Feb 10, 2026
@GuySten
Copy link
Contributor Author

GuySten commented Feb 11, 2026

@nelsonag, can you look at this PR again?
I've implemented your suggestions.

@meltawila
Copy link

I’m very interested in this to support use cases in Cardinal. Is there any testing/support I can provide to help see this PR merged?

@GuySten
Copy link
Contributor Author

GuySten commented Mar 2, 2026

Currently this PR waits for a review of either @nelsonag or @paulromano.
Maybe one of them can answer your question?

Copy link
Contributor

@nelsonag nelsonag left a comment

Choose a reason for hiding this comment

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

Two highly-related comments: why not generalize for any MGXS without 1/v data present?

@GuySten
Copy link
Contributor Author

GuySten commented Mar 6, 2026

@nelsonag, I've implemented your suggestions and now the code is alot simpler.
I decided to put searching for mgxs data named void for another PR (maybe we can do without)

Now the approximate inverse velocity data is stored only once.

@GuySten GuySten requested a review from nelsonag March 6, 2026 19:21
Sign up for free to 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