fusion-energy / openmc_tally_unit_converter

A Python package that finds and converts OpenMC tally units.
MIT License
5 stars 2 forks source link

converting heating tally units #1

Closed shimwell closed 3 years ago

shimwell commented 3 years ago

This first version allows heating tally to be converted from eV per source particle into a range of different units

example usage

import openmc_post_processor as opp

statepoint = opp.StatePoint(filepath='statepoint.10.h5')

statepoint.process_tally(
    tally=statepoint.tallies[723],
    required_units='MeV / simulated_particles'
)

statepoint.process_tally(
    fusion_energy_per_pulse=1.3e6,
    tally=statepoint.tallies[723],
    required_units='Melectron_volt / pulse'
)

statepoint.process_tally(
    fusion_energy_per_pulse=1.3e6,
    tally=statepoint.tallies[723],
    required_units='joules per pulse'
)

statepoint.process_tally(
    fusion_power=1e9,
    tally=statepoint.tallies[723],
    required_units='joules / second'
)