openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
769 stars 495 forks source link

Error when neutron scatters to energy >20 MeV #478

Closed wbinventor closed 9 years ago

wbinventor commented 9 years ago

I've recently run into an interesting error where one neutron will scatter to an energy greater than 20 MeV. In particular, I've run into the cryptic fatal error message "Value outside of array during binary search." I turned the verbosity up to its maximum of 10 and determined that this occurs during an (n,3n) event with an outgoing neutron at ~23 MeV. A truncated version of the verbose output is shown below:

  ...

 ===========================================================================
 ========================>     INITIALIZATION     <=========================
 ===========================================================================

 Reading settings XML file...
 Reading cross sections XML file...
 Reading geometry XML file...
 Reading materials XML file...
 Reading tallies XML file...
 Building neighboring cells lists for each surface...

 ===========================================================================
 ====================>     K EIGENVALUE SIMULATION     <====================
 ===========================================================================

  Bat./Gen.      k            Average k         
  =========   ========   ====================   

     ...

     Reflected from surface 10007
     (n,3n) with 92238.71c. Energy = 1.40620E+07 eV.
     (n,elastic) with 8016.71c. Energy = 2.38621E+07 eV.
 ERROR: Value outside of array during binary search
 Batch:               14
 Generation:           1

Is this behavior intentional? Is there any way to inform the code to skip this event rather than fatally error out? Since I'm less familiar with the scattering physics than @walshjon and @paulromano I don't want to go hacking things up since you may have ideas for how this can be more elegantly dealt with.

I should note that I've only observed this error on my "iso-lab" branch when using isotropic scattering in the lab reference frame (see PR #376). However, I do not think that I am seeing this error because I am using isotropic-in-lab scattering - I think it just so happens that I've only exposed this on my branch for a particular random number stream.

paulromano commented 9 years ago

I'm not sure I'm convinced that your isotropic in lab assumption doesn't necessarily cause the problem. I just took a look at the data in ENDF/B-VII.1 for U-238(n,3n). The angle/energy distribution is in Kalbach-Mann form, which gives a tabulated energy distribution for each incoming energy. The corresponding angular distribution is determined analytically through a formula. When I look at the maximum tabulated energy for each incoming energy, I get the following:

Incoming energy: 11326350.0, Max outgoing energy: 7468.355
Incoming energy: 12000000.0, Max outgoing energy: 746835.5
Incoming energy: 13000000.0, Max outgoing energy: 1742616.0
Incoming energy: 14000000.0, Max outgoing energy: 2738397.0
Incoming energy: 15000000.0, Max outgoing energy: 3734178.0
Incoming energy: 16000000.0, Max outgoing energy: 4729958.0
Incoming energy: 17000000.0, Max outgoing energy: 5626161.0
Incoming energy: 18000000.0, Max outgoing energy: 6621942.0
Incoming energy: 19000000.0, Max outgoing energy: 7617722.0
Incoming energy: 20000000.0, Max outgoing energy: 8613503.0
Incoming energy: 22000000.0, Max outgoing energy: 10605060.0
Incoming energy: 24000000.0, Max outgoing energy: 12497050.0
Incoming energy: 26000000.0, Max outgoing energy: 14488610.0
Incoming energy: 28000000.0, Max outgoing energy: 16549880.0
Incoming energy: 30000000.0, Max outgoing energy: 18461770.0

Do you have the energy of the incoming neutron?

wbinventor commented 9 years ago

After exploring this issue some more, I think you may be right @paulromano, it appears that a bug may have crept in when I merged with the latest develop. I'm going to close this issue for now. Thanks for looking at the U-238(n,3n) data.