Repository navigation
fix A325_generator_diamond on openmc >= 0.15.3 for reference_uvw=(1, 0, 0) - #95
Merged
Merged
Conversation
…, 0, 0) OpenMC 0.15.3 added reference_vwu to PolarAzimuthal, defaulting to (1, 0, 0). A reference_uvw parallel to it raises a ValueError (openmc #3582), so a beam along x could not be built. reference_vwu is now passed only when reference_uvw is parallel to x, using an orthogonal unit vector. Every other axis keeps OpenMC's default and gives the same particles as before. A zero or non-finite reference_uvw raises a clear ValueError. Tests cover each beam axis including (1, 0, 1), check that unaffected axes match OpenMC's own default, and check invalid directions raise.
RemDelaporteMathurin
approved these changes
Oct 5, 2026
RemDelaporteMathurin
left a comment
Member
There was a problem hiding this comment.
I'm happy with this, @SteSeg @davidepettinari do you mind giving this a look?
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.
on openmc 0.15.3+,
A325_generator_diamond(..., (1, 0, 0))raises "reference v direction must not be parallel to reference u direction". that's what's failing CI on LIBRA-project/BABY-1L-run-4#26 (@davidepettinari if you already have a fix I'll close this). #89 uses (1, 0, 0) too.cause is openmc-dev/openmc#3582, which added
reference_vwutoPolarAzimuthalwith a default of (1, 0, 0).this only passes an orthogonal
reference_vwuwhen the beam axis is along x, so other axes are untouched. phi is uniform so the x-axis source matches 0.15.0 statistically. a zero/nan axis now raises a ValueError.tests sample 20k particles to check the angle distribution, and check the other axes are unchanged. full suite passes on 0.15.0, 0.15.3 and 0.16.0 except
test_get_peaks[NaI-nuclide4-0.1], which fails now and then on main too (unseeded noise).the run repos will need a new release to pick this up. pinning
openmc<0.15.3should unblock run-4#26 for now.(AI-assisted)