# K-eff time plot

**URL:** <https://openmc.discourse.group/t/k-eff-time-plot/5176>\
**Category:** User Support\
**Created:** [January 23, 2025, 5:46pm UTC](https://openmc.discourse.group/t/k-eff-time-plot/5176 "2025-01-23T17:46:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![giiiuseppe](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@giiiuseppe](https://openmc.discourse.group/u/giiiuseppe)\
**Post date:** [January 23, 2025, 5:46pm UTC](https://openmc.discourse.group/t/k-eff-time-plot/5176/1 "2025-01-23T17:46:24Z")

</div>

Hello, everyone!  
I created a fuel assembly of a PWR and I calculated the k-eff value every 5 days for 12 times. Is there a way in OpenMC to create a plot with time on the x-axis and k-eff on the y-axis?

This is the part of the code i used for the depletion:  
sim\_settings = openmc.Settings()  
sim\_settings.run\_mode = ‘eigenvalue’  
sim\_settings.particles = 5000  
sim\_settings.inactive = 10  
sim\_settings.batches = 30  
sim\_settings.source = source1

chain = openmc.deplete.Chain.from\_xml(‘/home/student/Desktop/chain\_endfb80\_pwr.xml’)  
model = openmc.Model(geometry=bundle\_geometry, settings=sim\_settings)  
operator = openmc.deplete.CoupledOperator(model, “/home/student/Desktop/chain\_endfb80\_pwr.xml”, diff\_burnable\_mats=“True”)  
operator.finalize()  
power = 19e6  
timesteps = [60 \* 60 \* 24 \* 5] \* 12  
integrator = openmc.deplete.PredictorIntegrator(operator, timesteps, power)  
integrator.integrate()

---

<div class="post-metadata">

**Author:** ![magnoxemo](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@magnoxemo](https://openmc.discourse.group/u/magnoxemo)\
**Post date:** [January 23, 2025, 6:26pm UTC](https://openmc.discourse.group/t/k-eff-time-plot/5176/2 "2025-01-23T18:26:36Z")

</div>

You should have a depletion.h5 file after integrator does it’s job. You can get the eigenvalue from that. Ig should look something like this.

```auto
results = openmc.deplete.ResultsList.from_hdf5("./depletion_results.h5")
time, k = results.get_eigenvalue()

```

time and k are just normal python list. Hope it answers your question.

---

<div class="post-metadata">

**Author:** ![wahidluthfi](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/wahidluthfi/32/3375_2.png) [@wahidluthfi](https://openmc.discourse.group/u/wahidluthfi)\
**Post date:** [January 23, 2025, 10:38pm UTC](https://openmc.discourse.group/t/k-eff-time-plot/5176/3 "2025-01-23T22:38:19Z")

</div>

Hi giiiuseppe, welcome to the openmc community.  
I think this jupyter notebook depletion example can help you in post processing the depletion results with methods being mentioned by magnoxemo.

> <https://github.com/openmc-dev/openmc-notebooks/blob/main/depletion.ipynb>
