mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Added check for zero cross section when calculating distance to collision.
This commit is contained in:
parent
97b8196c46
commit
7ba2b4d9ac
1 changed files with 5 additions and 1 deletions
|
|
@ -79,7 +79,11 @@ contains
|
|||
call distance_to_boundary(p, d_boundary, surface_crossed, lattice_crossed)
|
||||
|
||||
! Sample a distance to collision
|
||||
d_collision = -log(prn()) / material_xs % total
|
||||
if (material_xs % total == ZERO) then
|
||||
d_collision = INFINITY
|
||||
else
|
||||
d_collision = -log(prn()) / material_xs % total
|
||||
end if
|
||||
|
||||
! Select smaller of the two distances
|
||||
distance = min(d_boundary, d_collision)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue