# Volume of cells from DAGMC file?

**URL:** <https://openmc.discourse.group/t/volume-of-cells-from-dagmc-file/3155>\
**Category:** User Support\
**Created:** [June 27, 2023, 4:33pm UTC](https://openmc.discourse.group/t/volume-of-cells-from-dagmc-file/3155 "2023-06-27T16:33:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ewinkler](https://avatars.discourse-cdn.com/v4/letter/e/3e96dc/32.png) [@ewinkler](https://openmc.discourse.group/u/ewinkler)\
**Post date:** [June 27, 2023, 4:33pm UTC](https://openmc.discourse.group/t/volume-of-cells-from-dagmc-file/3155/1 "2023-06-27T16:33:01Z")

</div>

Hi all,

I’m trying to run flux tallies on individual cells from a DAGMC geometry. I’ve been able to use the cell IDs from the DAGMC file to create cell filters (and I’ve confirmed that these work properly, as I’ve corroborated the results with a materials filter for one of the cells). However, since I need to divide the flux tally output by the cell volume, I need to use the stochastic volume calculation, which demands that I input the cell itself, and not just the ID. I can’t calculate the volume by material, because some of my cells in different areas of the geometry use the same material.

I’m not really sure how to extract the each cell object itself from the dagmc geometry. When I use openmc.DAGMCUniverse.n\_cells, I get 5 (which is correct), but any attempt I make to get the cells themselves just gives me an empty ordered dictionary. Is there some get cell by ID function that I’ve missed? Am I going about this the wrong way?

Thank you,  
Eleanor

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [June 27, 2023, 7:32pm UTC](https://openmc.discourse.group/t/volume-of-cells-from-dagmc-file/3155/2 "2023-06-27T19:32:52Z")

</div>

Hi Eleanor

I know this is not an idea solution but I tend to use a separate material for each cell volume.

The volume ID numbers available are tricky to find. I did write a proof of concept package that can get the volume ID numbers with their correlated material names.

Perhaps this is a temporary solution till we get such functional in openmc.

> **[GitHub - fusion-energy/dagmc\_h5m\_file\_inspector: Extracts information from...](https://github.com/fusion-energy/dagmc_h5m_file_inspector)**
>
> Extracts information from DAGMC h5m files including volumes number, material tags - GitHub - fusion-energy/dagmc\_h5m\_file\_inspector: Extracts information from DAGMC h5m files including volumes numb...

---

<div class="post-metadata">

**Author:** ![ewinkler](https://avatars.discourse-cdn.com/v4/letter/e/3e96dc/32.png) [@ewinkler](https://openmc.discourse.group/u/ewinkler)\
**Post date:** [June 29, 2023, 9:14pm UTC](https://openmc.discourse.group/t/volume-of-cells-from-dagmc-file/3155/3 "2023-06-29T21:14:42Z")

</div>

I wound up using different materials, and that worked great! Thank you
