# Pin power distribution for VVER assembly

**URL:** <https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355>\
**Category:** User Support\
**Created:** [July 30, 2021, 6:38pm UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355 "2021-07-30T18:38:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TOWHID](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TOWHID](https://openmc.discourse.group/u/TOWHID)\
**Post date:** [July 30, 2021, 6:38pm UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355/1 "2021-07-30T18:38:16Z")

</div>

Hi there, I am trying to plot pin power distribution for hexagonal assembly.  
There is an example for square assembly [here] ([Multigroup Mode Part II: MGXS Library Generation with OpenMC — OpenMC Documentation](https://docs.openmc.org/en/stable/examples/mg-mode-part-ii.html#Pin-Power-Visualizations)) but no example for hexagonal assembly.  
Can anyone describe how to plot pin power distribution for hexagonal assembly in openmc?

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [July 30, 2021, 6:59pm UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355/2 "2021-07-30T18:59:49Z")

</div>

@TOWHID Take a look at [Distributed-Cell-Tally-Visualization for Hexagonal Lattice](https://nbviewer.jupyter.org/gist/paulromano/f2fbf3d4731e324b6f5ab31ef3fcaa26#Distributed-Cell-Tally-Visualization) example.

Hope this will help you

---

<div class="post-metadata">

**Author:** ![TOWHID](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TOWHID](https://openmc.discourse.group/u/TOWHID)\
**Post date:** [July 31, 2021, 4:40am UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355/3 "2021-07-31T04:40:16Z")

</div>

Thank you for your suggestion @Pranto

---

<div class="post-metadata">

**Author:** ![TOWHID](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TOWHID](https://openmc.discourse.group/u/TOWHID)\
**Post date:** [August 1, 2021, 6:34pm UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355/4 "2021-08-01T18:34:04Z")

</div>

Hi @Pranto, i tried according to your last suggestion and i was able to plot pin power distribution. But now i am having problem to plot pin power distribution, when i am using burnable absorber pin cell with normal pin cell in my assembly. As it seems for some reason it only showing the burnable absorber mixed one’s but not the normal pins. Can you kindly tell me what i have to do if i want to plot in this case.  
i am adding my script here. So kindly take a look at it and let me know what i am doing wrong or what i have to do?  
[again test (copy).py](https://openmc.discourse.group/uploads/short-url/sgtiqnjMS0ztgzGraQ4TMn5omLB.py) (76.5 KB)

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [August 2, 2021, 8:03am UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355/5 "2021-08-02T08:03:06Z")

</div>

```python
# Normal fuel pin
fuel = openmc.Cell(cell_id=2, name='Fuel')
fuel.fill = uo2

# IFBA pin
fuel = openmc.Cell(cell_id=10, name='Fuel')
fuel.fill = iba

```

You have two variables with the same name. Use a different one.

---

<div class="post-metadata">

**Author:** ![TOWHID](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TOWHID](https://openmc.discourse.group/u/TOWHID)\
**Post date:** [August 2, 2021, 10:14am UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355/6 "2021-08-02T10:14:25Z")

</div>

@Pranto thanks for the help, I missed this one. Now it’s working.  
But i am having trouble normalizing two different tally.  
here is the code line

"ce\_fission\_rates1 /= np.mean(ce\_fission\_rates1[ce\_fission\_rates1 \> 0.])  
ce\_fission\_rates2 /= np.mean(ce\_fission\_rates2[ce\_fission\_rates2 \> 0.]) "

The problem is that the 2nd one is normalized using only the 2nd one’s data  
but i want to normalize the 2nd one but using the mean value of 1st one.  
Kindly tell me how should i do it?

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [August 2, 2021, 11:38am UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355/7 "2021-08-02T11:38:02Z")

</div>

@TOWHID You can use `mean()` method to calculate the mean of the first data set, `ce_fission_rates1.mean()`

---

<div class="post-metadata">

**Author:** ![TOWHID](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TOWHID](https://openmc.discourse.group/u/TOWHID)\
**Post date:** [August 2, 2021, 12:30pm UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355/8 "2021-08-02T12:30:54Z")

</div>

thanks a lot for your help

---

<div class="post-metadata">

**Author:** ![lichw](https://avatars.discourse-cdn.com/v4/letter/l/bb73d2/32.png) [@lichw](https://openmc.discourse.group/u/lichw)\
**Post date:** [January 11, 2024, 7:22am UTC](https://openmc.discourse.group/t/pin-power-distribution-for-vver-assembly/1355/9 "2024-01-11T07:22:21Z")

</div>

Hello, Pranto, I have some questions about this example, that is, when distribcell is changed from fuel\_cell to main\_cell, of course, the following fuel\_cell.id is also changed to main\_cell.id, the drawing becomes blank, why is this? I hope you can answer my questions, thank you very much!
