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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for openmc_mesh_tally_to_vtk-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d74ec1d0d227efc9921a930622d3010023e2cdb35e77ce09553c9a44152273 |
|
MD5 | d8e062f165d7f282a72dec0d20b53e64 |
|
BLAKE2b-256 | 09c7b6ef592b99afdf4c775a2d51427c78d40e50a0718bd1c58f812b00389d8e |
Close
Hashes for openmc_mesh_tally_to_vtk-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fc9c8afddbb781a020e443382f3406ed0145a04d03d8d1c3cd1cb30ceaefb75 |
|
MD5 | 1fe79af2a1f9b154bcd484af40dacf64 |
|
BLAKE2b-256 | 40ec096a770efca5df2a518ae4b8f918e1a3c2b7eb70948ff0c00d4472f8a4c4 |