Duplicate nuclide with S(a,b)
Created by: liangjg
OpenMC allows duplicate nuclide input in one material, but if S(a,b) is assigned with the duplicate nuclide, the code is possible to throw an error. Here is an example sab_bug.zip :
<material id="1"> <density value="4.5" units="g/cc" /> <nuclide name="H-1" xs="71c" ao="0.5" /> <nuclide name="U-235" xs="71c" ao="1.0" /> <nuclide name="H-1" xs="71c" ao="1.5" /> <sab name="HH2O" xs="71t" /> </material>
Bat./Gen. k Average k ========= ======== ==================== 1/1 0.56001 2/1 0.46410 3/1 0.44300 ERROR: Did not sample any nuclide during collision.
The error is caused by wrong processing of sab nuclide xs in the
calculate_xs() subroutine, where the first
H is treated as a sab nuclide but the second
H is not, since the sab checking is just skipped on line 89 in
cross_section.F90. The micro-xs of
H has been overwritten as non-sab nuclide when it is used in the function
sample_nuclide(). As a result, the sum of nuclide xs is not equal to the previous calculated material xs. When the sab xs is larger than non-sab xs and the prn is large enough, that error occurs.
mat_xs = xs(H1, sab) + xs(U5) + xs(H1) = 30+100+20 = 150 prn = 0.95 prn*mat_xs = 142.5 > xs(H1) + xs(U5) + xs(H1) = 140
then throws the
ERROR: Did not sample any nuclide during collision.