Closed whaeck closed 6 years ago
Do NOT merge this unless the test builds pass.
This is still failing on test 24 for debug builds. Seems like something still isn't fixed.
Yes, but it is in acer, in the plotting part for 3D graphs - probably the angular distributions or the spectra. It has nothing to do with the changes I made in purr.
Changes were made to address the issue with test 24. The problem was due to the secondary neutron energy and angle distribution for n,4n in Pu239. The actual data in mf6 mt37 looks like placeholder data.
Some time ago, Paul Romano (ANL) proposed a fix to purr to correct a division by zero he observed for Po210 from ENDF/B-VIII.0b7. The fix by itself was straight forward and has been implemented in this pull request. However, when investigating the reason behind the division by zero, it become clear that the probability table was inherently wrong for Po210.
The way purr works is that it will generate a number of samples of cross section values corresponding to randomly sampled energy values over a predetermined energy range. This energy range is determined using (among other things) the lowest value of the average level spacing defined for the unresolved resonance parameters. It is here that things went wrong. To find this value, NJOY first initialises the dmin value to 500 after which it compares with the available data from the evaluation. If it is lower than dmin, NJOY sets the value of dmin to the new value until all values have been tested. For Po210, dmin remained 500 because the lowest value for the average level spacing was ~30000. This resulted in a negative value for the number of resonances nres and the emax value becoming negative while emin remained positive (these last two values determine the energy range).
This resulting energy value sampling led to the generation of cross section values of which 9500 were exactly the same. When constructing the probability bin limits, NJOY thus ran out of different cross section values to generate these bin limits. Due to the logic by which this is done in NJOY, it lead to the generation of bin limits that were actually smaller than the previous limit. As a result, no samples were accumulated in this bin and any following bins, giving a zero probability and zero cross section value. It is such a zero cross section value that caused the division by zero.
All this to say that by setting the initial dmin value to a higher value the problem will go away.
This problem does no occur for nuclides with an average level spacing of less than 500. For example, for U235, this is 0.7.
The following changes were implemented in this pull request:
The version number change still needs to be pushed up, pending additional changes to be requested.