Skip to content

openmc interop

Getting an inventory out of OpenMC without depending on it.

openmc_interop

Getting an inventory out of OpenMC without depending on it.

OpenMC is imported only inside these functions and only when they are called, so installing this package pulls in nothing, and everything except these two functions works with no OpenMC present.

Functions:

from_openmc_material

from_openmc_material(openmc_material, *, decay_data=None) -> Material

Convert an openmc.Material into a Material.

Reads the atom densities in atoms per barn-cm, which fixes the mass density too, so the result supports both the Bq/g and the Ci/m3 limit sets.

Parameters:

  • openmc_material

    An openmc.Material. Its nuclides must be expanded, which get_nuclide_atom_densities does.

  • decay_data

    Half-life and mass tables to use instead of the defaults.

Returns:

  • Material

    The equivalent Material, carrying the OpenMC material's name

  • Material

    and volume where it has them.

from_depletion_results

from_depletion_results(results, material_id, *, decay_data=None) -> dict[float, Material]

Build a cooling time series from an OpenMC depletion results file.

The result is in the form time_to_clear expects, so a depletion can be taken straight through to a clearance date.

Parameters:

  • results

    An openmc.deplete.Results object.

  • material_id

    The depleted material's id, as a string or int.

  • decay_data

    Half-life and mass tables to use instead of the defaults.

Returns: