Skip to content

Fix triggers - #2344

Merged
aprilnovak merged 2 commits into
openmc-dev:developfrom
pshriwise:fix_triggers
Jan 10, 2023
Merged

aprilnovak merged 2 commits into
openmc-dev:developfrom
pshriwise:fix_triggers

Conversation

@pshriwise

@pshriwise pshriwise commented Jan 5, 2023 •

Copy link
Copy Markdown
Contributor

This PR resolves #2342 and #2343.

For #2342, The loop over tally scores in check_tally_trigger has been removed -- only the score index on the trigger is checked. A test was added ensuring that the addition of unrelated scores on a tally doesn't influence the number of batches needed to satisfy a tally trigger.

For #2343, the get_tally_uncertainty function returns an invalid result for a tally value if the mean is zero. This invalid result prompts the check_tally_trigger function to set the outgoing uncertainty-to-trigger threshold ratio value to infinity and exit early (no other tally result will produce a larger ratio, so we can do this safely). A ratio of infinity is used to trigger a different output to the console to indicate that the reason the trigger is unsatisfied is there was no contribution for the specified score.

Update: Adding a link to a CI run on my fork that contains only the first commit from this PR that adds the tests https://github.com/pshriwise/openmc/actions/runs/3850717720/jobs/6561182511

@pshriwise
pshriwise requested a review from aprilnovak January 6, 2023 00:05
@aprilnovak

Copy link
Copy Markdown
Contributor

This fixes the issue I was seeing - thanks for this really thorough fix!

@aprilnovak
aprilnovak merged commit ee0fcd3 into openmc-dev:develop Jan 10, 2023
apingegno pushed a commit to apingegno/openmc that referenced this pull request May 7, 2026
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.

Tally triggers evaluated with incorrect score

2 participants