Fix several issues related to independent operator depletion#3977
Open
paulromano wants to merge 6 commits into
Open
Fix several issues related to independent operator depletion#3977paulromano wants to merge 6 commits into
paulromano wants to merge 6 commits into
Conversation
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
This PR fixes a number of issues related to the use of
get_microxs_and_fluxandIndependentOperator:Skip missing nuclide/reaction entries in
IndependentOperatorMicroXS lookups.IndependentOperatorbuilds its reaction-rate storage from the depletion chain, but user-providedMicroXSobjects may intentionally contain only a subset of those chain nuclides or reactions. Previously, the rate helper indexed directly intoMicroXSfor every requested chain reaction and raisedKeyErrorwhen an entry was absent. This now treats missing MicroXS entries as zero reaction rate for that material while preserving the full chain-based reaction-rate indexing.Clarify
get_microxs_and_fluxdocumentation for flux-mode energy handling.In direct mode (
reaction_rate_mode="direct"), theenergiesargument defines the output energy structure for both fluxes and microscopic cross sections. In flux mode (reaction_rate_mode="flux"), however,energiesis used as the multigroup flux tally structure for collapsing continuous-energy microscopic cross sections withMicroXS.from_multigroup_flux; the resultingMicroXSobjects remain one-group collapsed cross sections. The docstring now states this distinction explicitly.Return one-group flux arrays in flux mode for
get_microxs_and_flux.Since flux mode returns one-group collapsed
MicroXSobjects, returning the original multigroup flux tally created a mismatch between the publicfluxesandmicrosoutputs. The multigroup flux is still used internally for the collapse calculation, but the returned flux arrays are summed to one group so they match the returned MicroXS group structure.Default hybrid direct reaction-rate tallies to all selected nuclides when
reaction_rate_optsspecifies reactions without nuclides.In
CoupledOperator, thereaction_rate_optsargument treats omitted direct-tally nuclides as "all nuclides" when direct reactions are requested.get_microxs_and_fluxnow follows the same convention:reaction_rate_opts={'reactions': [...]}creates direct reaction-rate tallies for all selected nuclides rather than creating no direct tally because the nuclide list was empty.Checklist
I have run clang-format (version 18) on any C++ source files (if applicable)