Repository navigation
Add implied a_0 to File 6 two-body Legendre distributions - #4190
Merged
Merged
Conversation
In ENDF-6 File 6, LAW=2 with LANG=0 stores the Legendre coefficients a_1 to a_NL only; a_0 = 1 is implied (ENDF-102, Eq. 6.8), as in File 4. _get_products passed the stored values straight to Legendre, so a_1 was used as a_0 and every order shifted down by one. The File 4 reader already prepends a_0 = 1. For example, Al-27 MT51 at 13.5 MeV in ENDF/B-VIII.0 gave a distribution that integrated to 0.257 and went negative; it now integrates to 1 with mean cosine 0.257. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017gaBBBNzyxaGJGHpSCJwm8
This was referenced Oct 13, 2026
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
In ENDF-6 File 6, two-body scattering (LAW=2) with Legendre data (LANG=0) stores only the coefficients a_1 to a_NL; a_0 = 1 is implied. ENDF-102 §6.2.4, Eq. 6.8 gives the distribution as 1/2 + Σ_{l=1}^{NL} (2l+1)/2 a_l P_l(μ) with NW = NL. NJOY reads these records the same way, passing them to
ptleg2as for File 4._get_productsinopenmc/data/reaction.pypassed the stored values straight toLegendre, so a_1 was used as a_0 and every order shifted down by one. The File 4 reader (AngleDistribution.from_endf) already prepends a_0 = 1. This change does the same for File 6.Only
IncidentNeutron.from_endfreaches this code, so it affects users who read ENDF files directly and use the angular distributions of reaction products. Libraries built with NJOY (from_njoy/from_ace), depletion chains and multigroup data are not affected.Checked on ENDF/B-VIII.0 Si-29 MT51, Al-27 MT51 and H-1 MT102 (201 distributions):
AI Assistance
Checklist
I have run clang-format (version 18) on any C++ source files (if applicable)I have made corresponding changes to the documentation (if applicable).I have added tests that prove my fix is effective or that my feature works (if applicable).Summary by CodeRabbit