Skip to content

Commit

Permalink
Warn users about bad equiprobable angles in S(a,b) (openmc-dev#2675)
Browse files Browse the repository at this point in the history
Co-authored-by: Gavin Ridley <gavin.keith.ridley@gmail.com>
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
  • Loading branch information
3 people authored Sep 6, 2023
1 parent be7a9c3 commit 7505f61
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions openmc/data/thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,15 @@ def from_ace(cls, ace_or_filename, name=None):
# here, because they are equiprobable, so the order
# doesn't matter.
mu.sort()

# Older versions of NJOY had a bug, and the discrete
# scattering angles could sometimes be less than -1 or
# greater than 1. We check for this here, and warn users.
if mu[0] < -1. or mu[-1] > 1.:
warn('S(a,b) scattering angle for incident energy index '
f'{i} and exit energy index {j} outside of the '
'interval [-1, 1].')

p_mu = 1. / n_mu * np.ones(n_mu)
mu_ij = Discrete(mu, p_mu)
mu_ij.c = np.cumsum(p_mu)
Expand Down

0 comments on commit 7505f61

Please sign in to comment.