openmc-dev / plotter

Native plotting GUI for model design and verification
MIT License
46 stars 18 forks source link
geometry monte-carlo-simulation openmc particle-transport visualization

PyPI

OpenMC Plot Explorer

Description

A graphical interface for visualizing and navigating OpenMC models.

Originally created by @landonjmitchell at the University of Chicago (original repository).

beavrs

beavrs_zoom

Dependencies

OpenMC, Matplotlib, NumPy, PySide6

Installation

This package is available from PyPI and conda-forge. To install from PyPI run the following command from the terminal:

python -m pip install openmc-plotter

Alternatively, conda can be used to install the plotter (recommended option for conda enviroments):

conda install -c conda-forge openmc-plotter

Usage

From a directory containing an OpenMC model run:

$ openmc-plotter <path_to_openmc_model_dir>

or simply run

$ openmc-plotter

from the directory containing the model.

Once the viewer has opened, press ? to view a variety of keyboard shortcuts.

shortcuts

Batch Mode

Plot view (.pltvw) files generated in interactive sessions (see Saving and Exporting) can be used to generate images from the command line without opening the plotter GUI.

$ openmc-plotter -b view1.pltvw view1.pltvw view1.pltvw

Features

Tally Visualization

The plotter also provides the ability to view tallies with spatial filters (mesh filter, cell filter, etc.). After loading a statepoint file from the "Edit" menu, tallies can be displayed on top of the geometry.

tally

Filters, scores, and nuclides on the tally can be enabled/disabled to isolate data.

Color Manipulation

Cell and material colors can be customized in the color dialog menu. Overlap coloring can be enabled as well to debug problems in the geometry definition.

colors

DAGMC Geometry Visualization

The plotter can also present the CAD-based tesellation geometry enabled by the Direct Accelerated Geometry Monte Carlo (DAGMC) toolkit. Below is the cross section of a tokamake model generated using paramak:

dagmc

As well as a DAGMC model of the Advanced Test Reactor (ATR):

atr

Saving and Exporting

Options/Functionality

Menu Bar:

Dock:

Origin:

Options:

Resolution:

Other:

Plot Image

Actions:

Color Options Dialog

General Tab:

Cells/Materials Tabs:

On Open:

Application windows are restored to their previous locations and sizes. If the .xml files match those of the previous sessions, the plot model will be restored to its previous state.

On Close:

Application status, including window size and location, will be saved. The current state of the plot model, including current plot and up to 10 previous/subsequent plots (i.e. for undo/redo) will be saved. Active plot changes that have not been applied will be lost.

Developer Notes

Structure

Terminology

Plot Image

The plot slice image in the central area of the application.

Active Plot

Plot settings that are changed as dock and color dialog fields are changed. Not necessarily reflected in the plot image.

Current Plot

Plot settings currently displayed in the plot image.

Applying changes causes the active plot to become the current plot, and a new plot image to be generated.