# Question about material volume vs cell volume

**URL:** <https://openmc.discourse.group/t/question-about-material-volume-vs-cell-volume/2829>\
**Category:** User Support\
**Created:** [March 14, 2023, 1:59pm UTC](https://openmc.discourse.group/t/question-about-material-volume-vs-cell-volume/2829 "2023-03-14T13:59:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![srichr221](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/srichr221/32/2360_2.png) [@srichr221](https://openmc.discourse.group/u/srichr221)\
**Post date:** [March 14, 2023, 1:59pm UTC](https://openmc.discourse.group/t/question-about-material-volume-vs-cell-volume/2829/1 "2023-03-14T13:59:10Z")

</div>

Hi all. First time running depletion/transmutation simulations. I’m following example 14 in the neutronics workshop here:

> **[GitHub - fusion-energy/neutronics-workshop: A workshop covering a range of...](https://github.com/fusion-energy/neutronics-workshop)**
>
> A workshop covering a range of fusion relevant analysis and simulations with OpenMC, DAGMC, Paramak and other open source fusion neutronics tools - GitHub - fusion-energy/neutronics-workshop: A wor...

It says material volume needs to be specified. In the code the line is:  
my\_material.volume = 13502000 # a volume is needed so openmc can find the number of atoms in the cell/material

It then creates a cell (sphere r=100) and fills it with my\_material:  
sph1 = openmc.Sphere(r=100, boundary\_type=‘vacuum’)  
shield\_cell = openmc.Cell(region=-sph1)  
shield\_cell.fill = my\_material

However the volume of this cell is 4/3_pi_r^3 which is ~ 4.2e6cm3

My question is: why are these volumes different. Surely if the cell is filled with the material then they should have the same volume?

---

<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:** [March 14, 2023, 2:12pm UTC](https://openmc.discourse.group/t/question-about-material-volume-vs-cell-volume/2829/2 "2023-03-14T14:12:43Z")

</div>

You are right the volume should be the same.

Thanks for finding this typo in the example script and letting me know, much appreciated.

Let me know if you are interested in fixing this mistake with a pull request, no worries if not as I can fix this example.

On a related topic soon we might be able to set the cell volume instead or as well as the material volume. See this [pull request](https://github.com/openmc-dev/openmc/pull/2412) for progress in that direction

---

<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:** [March 14, 2023, 9:32pm UTC](https://openmc.discourse.group/t/question-about-material-volume-vs-cell-volume/2829/3 "2023-03-14T21:32:44Z")

</div>

I’ve now fixed this on the develop branch

---

<div class="post-metadata">

**Author:** ![srichr221](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/srichr221/32/2360_2.png) [@srichr221](https://openmc.discourse.group/u/srichr221)\
**Post date:** [March 15, 2023, 9:04am UTC](https://openmc.discourse.group/t/question-about-material-volume-vs-cell-volume/2829/4 "2023-03-15T09:04:06Z")

</div>

awesome, many thanks.
