Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix wording of comments
  • Loading branch information
HunterBelanger committed Nov 5, 2022
commit 6a0d5043030cffd791b0500e6eecdf11be3fb02b
4 changes: 2 additions & 2 deletions openmc/data/thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def from_ace(cls, ace_or_filename, name=None):
# sorted. This is problematic when the smearing algorithm
Comment on lines +673 to +674

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never realized this! Do you have an example of a particular library/nuclide/reaction/distribution for which this happens?

@HunterBelanger HunterBelanger Nov 5, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is actually a common occurrence as well (though not systematically the case as with the CDFs). In ENFB/B-VIII.0, I have seen warnings from PapillonNDL about this for important evaluations like H-H2O (all temperatures), D-D2O (all temperatures), O-D2O (all temperatures), and several other materials as well. I don't think it happens for every single incident/outgoing energy pair, but it certainly happens at least once in each of those evaluations. PapillonNDL stops reading the ACE file after the first error, so its hard for me to say with certainty how prevalent it is. When bench marking PapillonNDL, I don't believe I ever noticed a statistical difference with OpenMC due to my sorting of the angles, but this is still less than ideal, as smearing assumes that they are sorted. If you want, I have programs which directly sample the distributions, either from PapillonNDL or OpenMC, and then a script which gets the p-value of the energy and angle distributions to compare.

Another issue I noticed with the ENDF/B-VII.1 ACE files is that the scattering angles where sometimes larger than 1, or less than -1 (this happens in the ligher water TSL for sure). This was a bug in not-so-old versions of NJOY, but has since been fixed. I added a check for this to PapillonNDL, and because of that, I simply can't use the older ENDF/B-VII.0 ACE files that were distributed with MCNP for example. Currently, I don't see a check for this in the OpenMC processing. There isn't really a good solution for this problem, other than re-processing the evaluation with the newer version of NJOY. Do you want me to add a check for this @paulromano ? It might cause people problems if they want to generate HDF5 files from these older ACE files, but maybe this is better than letting them use physically invalid data ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should specify, when I mention ENDF/B-VIII.0 here, these are the ACE files made from lib80x, distributed by LANL.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: the check for values outside of [-1,1], perhaps the best thing to do would be to add a warning so that at least we're letting the user know they may be dealing with bad data. That doesn't necessarily need to be done as part of this PR though.

# is applied when sampling the angles. We sort the angles
# here, because they are equiprobable, so the order
# doesn't mater.
# doesn't matter.
mu.sort()
p_mu = 1. / n_mu * np.ones(n_mu)
mu_ij = Discrete(mu, p_mu)
Expand All @@ -686,7 +686,7 @@ def from_ace(cls, ace_or_filename, name=None):
# at 0. For NJOY and FRENDY evaluations, this is never the case,
# and can very rarely lead to negative energies when sampling
# the outgoing energy. From Eq. 7.6 of the ENDF manual, we can
# add the outgoing energy 0 eV, which has a PDF of 0 (and of
# add an outgoing energy 0 eV that has a PDF of 0 (and of
# course, a CDF of 0 as well).
if eout_i.c[0] > 0.:
eout_i.x = np.insert(eout_i.x, 0, 0.)
Expand Down