Open
Conversation
Splitting a CRAM step into identical substeps and reusing LU
factorizations improves accuracy for nuclides with large λ·dt
while adding negligible computational cost.
This particularly improves accuracy for nuclides approaching zero,
where a single-step CRAM can undershoot to negative atom densities,
and then oscillate about zero.
- IPFCramSolver accepts substeps parameter (default 1)
- substeps=1 uses original spsolve path (bitwise identical)
- substeps>1 pre-computes LU via splu, reuses across substeps
- Integrator/SIIntegrator accept substeps parameter
- 4 new unit tests: default, bitwise match, two-half-steps,
CRAM16 self-convergence
Reference: Isotalo & Pusa, "Improving the Accuracy of the
Chebyshev Rational Approximation Method Using Substeps,"
Nucl. Sci. Eng., 183:1, 65-77 (2016).
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
As part of my continuing battle against OpenMC deplete producing negative atom results and oscillations about zero.
This PR adds a substeps parameter to Integrator and SIIntegrator that subdivides each depletion interval into identical sub-intervals, reusing LU factorizations across them. This improves CRAM accuracy for nuclides with large λ·dt products — particularly those depleting toward zero, where single-step CRAM can undershoot to negative atom densities.
The implementation follows:
Isotalo & Pusa (2016), "Improving the Accuracy of the Chebyshev Rational Approximation Method Using Substeps," Nucl. Sci. Eng., 183:1, 65-77. https://doi.org/10.13182/NSE15-67
This addresses the same problem as #3879, but does it through improvements to solver numerical accuracy (step approximation error).
The two are complementary. Clip would be a safety net, and a nice cleanup of low atoms.
Substeps is invoked with:
The default is left as substeps=1 (no substeps).
Personally, in future workflows with both PRs in, I would likely use both
substeps=2, clip_min_atom_density=1e-20. As an improvement in numerical accuracy and a full-guard against negative atoms.Similar script to #3879
demo.py
Here with substeps=2
Attached in a zip (actually a .xz) are two further synthetic benchmarks that demonstrate the improvements.
substeps_synthetic-benchmarks.zip
They also demonstrate the near zero impact on calculation performance (with an MC inspired FOM).
The error is with respect to the case with fine explicit steps.
One can see from these results, despite improved behaviour, negatives that persist and could be cleaned up with the clip.
Checklist