Skip to main content

A Python package for converting OpenMC mesh tallies to VTK files and optionally converting the units

Project description

Convert an OpenMC mesh tally to a VTK file with optional unit conversion

Installation

pip install openmc-mesh-tally-to-vtk

Python API Usage

The package can be used in conjunction with OpenMC to produce a VTK file of a openmc.RegularMesh tally.

The simplest example is to read in an OpenMC tally and write it out as a VTK file which can then be opened with programs like Paraview.

from openmc_mesh_tally_to_vtk import write_mesh_tally_to_vtk
import openmc

# assumes you have a statepoint file from the OpenMC simulation
statepoint = openmc.StatePoint('statepoint.3.h5')

# assumes the statepoint file has a RegularMesh tally with a certain name
my_tally = statepoint.get_tally(name='tally_on_regular_mesh')

# converts the tally result into a VTK file
write_mesh_tally_to_vtk(
    tally=my_tally,
    filename = "vtk_file_from_openmc_mesh.vtk",
)

Acknowledge

This package is based on a GitHub Gist by by Patrick Shriwise

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openmc_mesh_tally_to_vtk-0.2.1.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

openmc_mesh_tally_to_vtk-0.2.1-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page