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 details)

Uploaded Source

Built Distribution

File details

Details for the file openmc_mesh_tally_to_vtk-0.2.1.tar.gz.

File metadata

  • Download URL: openmc_mesh_tally_to_vtk-0.2.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for openmc_mesh_tally_to_vtk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e3d74ec1d0d227efc9921a930622d3010023e2cdb35e77ce09553c9a44152273
MD5 d8e062f165d7f282a72dec0d20b53e64
BLAKE2b-256 09c7b6ef592b99afdf4c775a2d51427c78d40e50a0718bd1c58f812b00389d8e

See more details on using hashes here.

File details

Details for the file openmc_mesh_tally_to_vtk-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: openmc_mesh_tally_to_vtk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for openmc_mesh_tally_to_vtk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4fc9c8afddbb781a020e443382f3406ed0145a04d03d8d1c3cd1cb30ceaefb75
MD5 1fe79af2a1f9b154bcd484af40dacf64
BLAKE2b-256 40ec096a770efca5df2a518ae4b8f918e1a3c2b7eb70948ff0c00d4472f8a4c4

See more details on using hashes here.

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