openmc icon indicating copy to clipboard operation
openmc copied to clipboard

Get OpenMC to use DAGMC to automatically get cell volume information

Open jon-proximafusion opened this issue 11 months ago • 0 comments

Description

Feature request: An easy way of getting the DAGMC volume information in cm3 for each DAGMC cell.

I am doing a depletion simulation with DAGMC geometry and a couple of stages felt a bit clunky to me.

Finding the volumes of each material tag in the DAGMC geometry requires another package and the needs to load up the dagmc h5m file separately (which in my case takes a while as the geometry is large)

given that DAGMC knows the volume of these cells could we not add that information in at run time automatically? Then the user would not have to find the volumes (which is not easy and takes an extra file load).

Or perhaps e could add some code the openmc.DAGMCUniverse class so that it offers an API to find the volumes of a given material tag or ID

Alternatives

Alternative 1 Install this package https://github.com/svalinn/pydagmc/ and then load up the DAGMC volumes

import dagmc
dagmc_model = dagmc.DAGModel('dagmc.h5m')
material_volume_dic = {}
for entry in dagmc_model.volumes:
    print(f"id={entry.id} volume={entry.volume}, mat={entry.material}")
    material_volume_dic[entry.material] = entry.volume

Alternative 2 Use the stochastic volume calculation in OpenMC to find these volumes

Compatibility

This would be an additional feature

jon-proximafusion avatar Mar 03 '25 13:03 jon-proximafusion