Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

fusion-energy/openmc_weight_window_generator

Repository files navigation

This package is depreciated, make use of inbuilt openmc.WeightWindowGenerator or openmc.lib.WeightWindows methods in OpenMC

Generate weight windows for use in OpenMC simulation with varience reduction

Based on a script by @pshriwise.

Please note that the weight window implementation in OpenMC is rapidly improving and the MAGIC method and other weight window generation techniques will become available in OpenMC directly without bolt on packages like this.

Once this pull request is merged it will add weight window generation directly to OpenMC and the subsequent release of OpenMC package will no longer be needed

Install

pip install git+https://github.com/fusion-energy/openmc_weight_window_generator.git

Usage

Generate weight windows from an OpenMC statepoint file. Note the statepoint file must contain a flux mesh tally.

import openmc
import openmc_weight_window_generator
# import adds the generate_wws method to openmc.StatePoint

sp_file = openmc.StatePoint(output_file)
weight_windows = sp_file.generate_wws(tally=flux_mesh_tally, rel_err_tol=0.7)

Generate a weight window from an openmc.Model using the MAGIC method to iteratively improve the weight window generated.

import openmc
import openmc_weight_window_generator
# import adds the generate_wws_magic_method method to openmc.Model

# assumes geometry, materials, settings and tallies are all correctly defined.
model = openmc.model.Model(geometry, materials, settings, tallies)
model.generate_wws_magic_method(tally=flux_mesh_tally, iterations=5, rel_err_tol=0.7)

Examples

  • See examples folder for usage

  • The fusion-energy/neutronics-workshop also has a task that makes use of this package

Acknowledgments

Many thanks to @pshriwise @eepeterson and @YuanHu-PKU-KIT for their work on OpenMC weight Windows without which this package would not be possible.

About

Generate weight windows for use in OpenMC simulation with varience reduction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages