# Flux variation with respect to time

**URL:** <https://openmc.discourse.group/t/flux-variation-with-respect-to-time/570>\
**Category:** User Support\
**Created:** [March 14, 2020, 4:34am UTC](https://openmc.discourse.group/t/flux-variation-with-respect-to-time/570 "2020-03-14T04:34:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fsabab](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fsabab/32/1374_2.png) [@fsabab](https://openmc.discourse.group/u/fsabab)\
**Post date:** [March 14, 2020, 4:34am UTC](https://openmc.discourse.group/t/flux-variation-with-respect-to-time/570/1 "2020-03-14T04:34:32Z")

</div>

Hello,  
Is there any way to show flux variation with respect to time if depletion data are present (using openmc.deplete module)?

---

<div class="post-metadata">

**Author:** ![Andrew\_Johnson](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Andrew\_Johnson](https://openmc.discourse.group/u/Andrew_Johnson)\
**Post date:** [March 14, 2020, 5:31pm UTC](https://openmc.discourse.group/t/flux-variation-with-respect-to-time/570/2 "2020-03-14T17:31:57Z")

</div>

Hi Farshid,

After each transport simulation, the depletion module will write tally data to statepoint files, just like you would obtain from a single transport solution. These are named “openmc\_simulation\_n.h5”, where is the current time step. You can open each file using the [StatePoint class](https://docs.openmc.org/en/latest/pythonapi/generated/openmc.StatePoint.html). With one StatePoint instance per file (and each file at a unique point in time) you can view and plot tally data over time manually.

I hope this is helpful,

Andrew

---

<div class="post-metadata">

**Author:** ![pdeng](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@pdeng](https://openmc.discourse.group/u/pdeng)\
**Post date:** [March 15, 2023, 3:33am UTC](https://openmc.discourse.group/t/flux-variation-with-respect-to-time/570/3 "2023-03-15T03:33:47Z")

</div>

Hi Andrew @andrewjohnson,

I am running into a similar problem. With the latest release 0.13.2, I tested a homogeneous fuel depletion. I did see openmc\_simulation\_n.h5 files at each step. However, I failed to read them with StatePoint. The error messages are:

reading statepoint file: openmc\_simulation\_n0.h5  
Traceback (most recent call last):  
File “/home/puran/openmc\_job/run\_pindep/…/Read\_OpenMC\_Tallies.py”, line 20, in   
sp = openmc.StatePoint(statepoint, autolink=True)  
File “/home/group\_share/miniconda3/lib/python3.9/site-packages/openmc/statepoint.py”, line 150, in **init**  
self.link\_with\_summary(su)  
File “/home/group\_share/miniconda3/lib/python3.9/site-packages/openmc/statepoint.py”, line 678, in link\_with\_summary  
for tally in self.tallies.values():  
File “/home/group\_share/miniconda3/lib/python3.9/site-packages/openmc/statepoint.py”, line 372, in tallies  
if self.tallies\_present and not self.\_tallies\_read:  
File “/home/group\_share/miniconda3/lib/python3.9/site-packages/openmc/statepoint.py”, line 446, in tallies\_present  
return self.\_f.attrs[‘tallies\_present’] \> 0  
File “h5py/\_objects.pyx”, line 54, in h5py.\_objects.with\_phil.wrapper  
File “h5py/\_objects.pyx”, line 55, in h5py.\_objects.with\_phil.wrapper  
File “/home/group\_share/miniconda3/lib/python3.9/site-packages/h5py/\_hl/attrs.py”, line 56, in **getitem**  
attr = h5a.open(self.\_id, self.\_e(name))  
File “h5py/\_objects.pyx”, line 54, in h5py.\_objects.with\_phil.wrapper  
File “h5py/\_objects.pyx”, line 55, in h5py.\_objects.with\_phil.wrapper  
File “h5py/h5a.pyx”, line 80, in h5py.h5a.open  
KeyError: “Can’t open attribute (can’t locate attribute: ‘tallies\_present’)”

I used HDFView to open openmc\_simulation\_n0.h5 and found those tallies were there but no tally results were recorded. For your information, I attached the StatePoint files. The file “statepoint.150.h5” was obtained at the last time step and it could be read using openmc.StatePoint(‘statepoint.150.h5’) without a problem.

Thanks,  
Puran

[openmc\_simulation\_n0.h5](https://openmc.discourse.group/uploads/short-url/34ribMKqBMWTcMrPOm4PpvJP7eO.h5) (39.6 KB)  
[openmc\_simulation\_n1.h5](https://openmc.discourse.group/uploads/short-url/uwTaT3lRNB7Zb8l8ySLaBJw5YhT.h5) (39.6 KB)  
[openmc\_simulation\_n2.h5](https://openmc.discourse.group/uploads/short-url/5UG5wP5g2Woksqio759UQ6WeOTw.h5) (39.6 KB)  
[openmc\_simulation\_n3.h5](https://openmc.discourse.group/uploads/short-url/mTtHSuWXdZ2UvoAgyijbkZ8Fpw5.h5) (39.6 KB)  
[statepoint.150.h5](https://openmc.discourse.group/uploads/short-url/cDkgUFbMbsh7R55NT4I04XuKWD7.h5) (450.5 KB)
