adding trigger to mgxs convert#3925
Draft
shimwell wants to merge 3 commits into
Draft
Conversation
…ation # Conflicts: # openmc/model/model.py
6568bb7 to
fba86e3
Compare
Contributor
|
This PR has been updated and is now up to date with The auto-trigger settings are hardcoded in the source and used only when the user does not set So you keep exactly the control you have today — pass an integer for a fixed particle count — but you can now also leave before PR model.convert_to_multigroup(nparticles=2000) # guess a good number of particles, perhaps too few or perhaps excessiveafter PR model.convert_to_multigroup(nparticles=2000) # you can still guess a good number of particles
model.convert_to_multigroup() # let the trigger stop the simulation when converged |
convert_to_multigroup now defaults nparticles=None ("auto"). In auto mode the
continuous-energy generation run is no longer given a fixed, guessed particle
count; a relative-error trigger (ignore_zeros=True) is attached to the
cross-section tallies via Library.tally_trigger, so the run extends batches
until the group constants are statistically converged, bounded by an internal
max_batches cap. Passing an explicit integer keeps the previous fixed behaviour.
The convergence target, seed particles-per-batch and max-batches cap are
internal constants rather than new user-facing arguments, so the public API
gains no knobs.
fba86e3 to
9f1dea8
Compare
Contributor
|
@jtramm and @pshriwise I think this PR is better but still not very good as initially we had the issue of too many user args, now I think we have the issue of hard coded triggers, batches, particles |
4 tasks
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.
Description
At Physor 2026 an chatting with @jtramm and @pshriwise about making generation of multigroup use a trigger to allow it to end earlier if the reaction rates all meet the trigger relative error value. At the time it sounded like a good idea but in practice it appears to have enlarged the api interface to users which I was trying to avoid. I wanted to make this a draft PR just to show @jtramm and @pshriwise that I tried.
Fixes # (issue)
Checklist