diff --git a/docs/source/pythonapi/index.rst b/docs/source/pythonapi/index.rst index fb6cfe927..80da52998 100644 --- a/docs/source/pythonapi/index.rst +++ b/docs/source/pythonapi/index.rst @@ -185,6 +185,7 @@ Running OpenMC :template: myfunction.rst openmc.run + openmc.run_volume_calculation openmc.plot_geometry Post-processing diff --git a/man/man1/openmc.1 b/man/man1/openmc.1 index 1cf4fb97a..847089d63 100644 --- a/man/man1/openmc.1 +++ b/man/man1/openmc.1 @@ -13,9 +13,12 @@ It is assumed that if no is specified, the XML input files are present in the current directory. .SH OPTIONS .TP +.B "\-c\fR, \fP\-\-volume" +Run in stochastic volume calculation mode +.TP .B "\-g\fR, \fP\-\-geometry-debug" -Run in geometry debugging mode, where cell overlaps are checked for after each -move of a particle +Run with geometry debugging turned on, where cell overlaps are checked for after +each move of a particle .TP .B "\-p\fR, \fP\-\-plot" Run in plotting mode diff --git a/openmc/executor.py b/openmc/executor.py index 3b9b8abd8..dcb894d07 100644 --- a/openmc/executor.py +++ b/openmc/executor.py @@ -39,10 +39,26 @@ def plot_geometry(output=True, openmc_exec='openmc', cwd='.'): Path to working directory to run in. Defaults to the current working directory. """ - return _run(openmc_exec + ' -p', output, cwd) +def run_volume_calculation(output=True, openmc_exec='openmc', cwd='.'): + """Run stochastic volume calculations in OpenMC + + Parameters + ---------- + output : bool + Capture OpenMC output from standard out + openmc_exec : str + Path to OpenMC executable + cwd : str, optional + Path to working directory to run in. Defaults to the current working directory. + + """ + return _run(openmc_exec + ' --volume', output, cwd) + + + def run(particles=None, threads=None, geometry_debug=False, restart_file=None, tracks=False, output=True, cwd='.', openmc_exec='openmc', mpi_args=None): diff --git a/src/initialize.F90 b/src/initialize.F90 index 2ed47a8ba..152cf2a11 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -363,6 +363,9 @@ contains case ('-g', '-geometry-debug', '--geometry-debug') check_overlaps = .true. + case ('-c', '--volume') + run_mode = MODE_VOLUME + case ('-s', '--threads') ! Read number of threads i = i + 1 diff --git a/src/output.F90 b/src/output.F90 index b1b8320c6..4c8be0f29 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -194,7 +194,8 @@ contains write(OUTPUT_UNIT,*) 'Usage: openmc [options] [directory]' write(OUTPUT_UNIT,*) write(OUTPUT_UNIT,*) 'Options:' - write(OUTPUT_UNIT,*) ' -g, --geometry-debug Run in geometry debugging mode' + write(OUTPUT_UNIT,*) ' -c, --volume Run in stochastic volume calculation mode' + write(OUTPUT_UNIT,*) ' -g, --geometry-debug Run with geometry debugging on' write(OUTPUT_UNIT,*) ' -n, --particles Number of particles per generation' write(OUTPUT_UNIT,*) ' -p, --plot Run in plotting mode' write(OUTPUT_UNIT,*) ' -r, --restart Restart a previous run from a state point'