mit-crpg/openmc — pull request #184 by nhorelik (2013-06-06 21:32:16+00:00)
Title: Cell overlap checking

This pull request was produced after the discussion in issue #175, providing a subroutine that uses simple_cell_contains to produces a fatal error if a particle is found to be inside two different cells in the same universe.

The overlap checking is enabled by default for all plot types - important so that plots don't erroneously produce what the user expects to see for bad geometry.

In addition, a new command-line flag was added to enable overlap checking during transport, *for each source position* and *for every particle move.* This means that the quality of the verification in any region of geometry is dependent on the spatial source distribution density in that region, the particle collision density in that region, and the density of surface crossings. Thus particles streaming through a void may not necessarily trigger an overlap check if they pass over a cell that is erroneously overlapping that void, but a starting source providing good enough coverage should still catch it.

When running in this mode, additional output was added to list the number of overlap checks conducted in each cell, so the user can approximately tell if they're getting good coverage in all cells with the source and number of particles they're running.

The additional overhead of the check will depend on the number of cells in the geometry - for the small core in the plotting demo of the openmc-workshop, the simulation/plotting time was roughly doubled. The run mode can be done in parallel with no issues.

This pull request also updates the documentation to reflect these changes.

Additional changes that aren't in here but would be quick to add if we think it's worth it:
* provide an option to turn off overlap checking while plotting, for faster plot generation when you know the geometry is valid
* have a particle restart file written for the particle that finds an overlap during transport