# Same Flux distribution

**URL:** <https://openmc.discourse.group/t/same-flux-distribution/2645>\
**Category:** User Support\
**Created:** [January 21, 2023, 4:18am UTC](https://openmc.discourse.group/t/same-flux-distribution/2645 "2023-01-21T04:18:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niloy](https://avatars.discourse-cdn.com/v4/letter/n/6a8cbe/32.png) [@Niloy](https://openmc.discourse.group/u/Niloy)\
**Post date:** [January 21, 2023, 4:18am UTC](https://openmc.discourse.group/t/same-flux-distribution/2645/1 "2023-01-21T04:18:55Z")

</div>

Hello everyone,  
I am trying to determine the axial flux distribution for a BWR assembly. To achieve this, I have created a mesh filter and an energy filter. The code is:

tallies\_file = openmc.Tallies()

mesh = openmc.RegularMesh(mesh\_id=1)  
mesh.dimension = [1, 1, 381]  
mesh.lower\_left = [5.951855, 5.951855, -169.6]  
mesh.upper\_right= [7.63016, 7.63016, 211.4]  
#mesh.width = [1.678305, 1.678305, 1]  
mesh\_filter = openmc.MeshFilter(mesh)  
energy\_filter = openmc.EnergyFilter([0.0, 1.0])

tally = openmc.Tally(name=‘flux’)  
tally.filters = [mesh\_filter, energy\_filter]  
tally.scores = [‘flux’]  
tallies\_file.append(tally)

I then loaded the statepoint file, extracted the flux tally, and plotted the axial flux distribution. The code is:

# Load the statepoint file

sp = openmc.StatePoint(“statepoint.200.h5”)

# Extract the flux tally

tally = sp.get\_tally(name=‘flux’)

# Extract the flux data for all particle types

flux\_data = tally.get\_slice(scores=[“flux”])

# Extract the values of the flux data

flux\_values = flux\_data.mean.ravel()

# Plot the axial flux distribution

plt.plot(flux\_values)  
plt.xlabel(“Axial Position”)  
plt.ylabel(“Flux”)  
plt.show()  
However, I am encountering an issue where the plot consistently displays the same flux distribution for all fuel rods within the assembly, regardless of any variations in fuel or burnable absorbers. I am uncertain as to the cause of this discrepancy and would greatly appreciate any guidance in resolving this issue.  
Thanks,  
Niloy

---

<div class="post-metadata">

**Author:** ![lorenzoloi](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@lorenzoloi](https://openmc.discourse.group/u/lorenzoloi)\
**Post date:** [January 24, 2023, 10:04am UTC](https://openmc.discourse.group/t/same-flux-distribution/2645/2 "2023-01-24T10:04:00Z")

</div>

Hello Niloy,

How do you check the flux in different pins? Do you define different tallies changing the lower\_left and upper\_right attribute?  
Why don’t you use a CellFilter or a MaterialFilter to select the desired pins? It should be easier to track in which pin you are collecting the scores
