Repository navigation
Conversation
The average k column written each generation held the average of the tracklength estimator over active generations, while the combined estimator -- the minimum variance combination of the collision, absorption and tracklength estimators, and the value reported as k-effective at the end of a run -- only appeared in the final results table. The column now carries the combined estimator, so what is watched during a run is the same quantity that is reported at the end of it. The combination is undefined until MIN_REALIZATIONS_TO_COMBINE active batches have been accumulated; the column is left empty until then rather than switching estimator partway through a run. The random ray solver produces a single estimate of k with nothing to combine, so it keeps reporting its average over active generations. The condition under which openmc_get_keff() forms a combination is factored out as keff_combined_available() so that the two cannot drift apart. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017H56JcnTBLoYssMHo2sBbA
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.
Note
Depends on openmc-dev#4113 and is stacked on it, so the diff against
developalso carries that PR's five commits. Only the last commit, e475c10, belongs here.Description
The average k column written each generation held the average of the tracklength estimator over active generations, while the combined estimator — the minimum variance combination of the collision, absorption and tracklength estimators, and the value reported as k-effective at the end of a run — only appeared in the final results table. The column now carries the combined estimator, so what is watched during a run is the same quantity that is reported at the end of it.
The combination is undefined until
MIN_REALIZATIONS_TO_COMBINEactive batches have been accumulated. The column is left empty until then rather than switching estimator partway through a run, so the number under it always means one thing. A batch is only accumulated after its generations have been written, so with one generation per batch the first value appears at batchinactive + 5.The random ray solver estimates k from the scalar flux and produces a single estimate with nothing to combine, so it keeps reporting its average over active generations exactly as before.
The condition under which
openmc_get_keff()forms a combination is factored out of it askeff_combined_available()and used for both, so the printing condition and the fallback condition cannot drift apart.This is display only.
simulation::keffstill drives fission site production, so no physics or random number stream moves and no regression results change. Nothing else consumes the generation table: the statepoint, the C API and the final results table are all untouched.The one behavior worth calling out is that
openmc_get_keff()now runs once per generation on the master rank rather than twice per run. The cost is negligible, but it does make openmc-dev#4113's "report whatever comes out, including for a degenerate covariance" stance more visible: a problem where all three estimators coincide exactly every batch would printnaneach generation instead of once at the end.Checklist
tests/unit_tests/test_eigenvalue_output.pyparses the generation table out of captured output and checks that the column is empty before the combination is defined and populated after, then pins the final row against the combined estimator in the statepoint written at the end of the preceding batch — the value that row was printed with.🤖 Generated with Claude Code
https://claude.ai/code/session_017H56JcnTBLoYssMHo2sBbA