# Depletion calculation no xsection xml error

**URL:** <https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577>\
**Category:** User Support\
**Created:** [November 30, 2021, 2:54pm UTC](https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577 "2021-11-30T14:54:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yohannes](https://avatars.discourse-cdn.com/v4/letter/y/bbce88/32.png) [@Yohannes](https://openmc.discourse.group/u/Yohannes)\
**Post date:** [November 30, 2021, 2:54pm UTC](https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577/1 "2021-11-30T14:54:42Z")

</div>

Hi,  
I am trying to run the pin cell example for depletion calculation. But I am getting this error message “OSError: No cross\_sections.xml specified in materials.”. Here is a part my input  
materials = openmc.Materials([fuel, clad, water])  
settings.export\_to\_xml()  
fuel.volume = math.pi \* radii[0] \*\* 2  
materials.cross\_sections= ‘…/JEFF33\_hdf5/cross\_sections.xml’  
materials.export\_to\_xml()  
import openmc.deplete  
chain = ‘./chain\_simple.xml’  
operator = openmc.deplete.Operator(geometry, settings, chain)  
power = 174  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [December 12, 2021, 11:03pm UTC](https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577/2 "2021-12-12T23:03:11Z")

</div>

Hi @Yohannes. What version of OpenMC are you using? It used to be the case that you had to use the `OPENMC_CROSS_SECTIONS` environment variable when running depletion calculations, but @andrewjohnson added a [fix](https://github.com/openmc-dev/openmc/pull/1846/files) in version 0.12.2 that allows the `materials.cross_sections` attribute to be used.

---

<div class="post-metadata">

**Author:** ![Yohannes](https://avatars.discourse-cdn.com/v4/letter/y/bbce88/32.png) [@Yohannes](https://openmc.discourse.group/u/Yohannes)\
**Post date:** [December 22, 2021, 8:35am UTC](https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577/3 "2021-12-22T08:35:46Z")

</div>

Hi @paulromano Thank you for the reply. I am running the same version but it worked with the cross sections env variable. Maybe a revisit to the fix if there still are some bugs!?

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [January 9, 2022, 2:15pm UTC](https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577/4 "2022-01-09T14:15:44Z")

</div>

@Yohanes I haven’t been able to reproduce the behavior you’re seeing with version 0.12.0 or with the latest developmental branch. Are you able to post your entire script?

---

<div class="post-metadata">

**Author:** ![Yohannes](https://avatars.discourse-cdn.com/v4/letter/y/bbce88/32.png) [@Yohannes](https://openmc.discourse.group/u/Yohannes)\
**Post date:** [January 11, 2022, 11:14am UTC](https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577/5 "2022-01-11T11:14:31Z")

</div>

[depl2.py](https://openmc.discourse.group/uploads/short-url/8jUGSWfUysiwUp0rXDKMzT1kBRf.py) (3.5 KB)  
@paulromano Hi, sorry for the late reply, I was away from work for sometime. I attached my script. However, I changed somethings, which I don’t remember since the last conversation. The openmc Version is 0.12.2

---

<div class="post-metadata">

**Author:** ![Yohannes](https://avatars.discourse-cdn.com/v4/letter/y/bbce88/32.png) [@Yohannes](https://openmc.discourse.group/u/Yohannes)\
**Post date:** [January 11, 2022, 1:33pm UTC](https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577/6 "2022-01-11T13:33:28Z")

</div>

@paulromano I just figured out that the cross\_sections.xml and the chain\_file can be merged using the DataLibrary. I haven’t tried this option but I think is the answer for my question I guess.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [January 11, 2022, 11:56pm UTC](https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577/7 "2022-01-11T23:56:15Z")

</div>

@Yohannes There is actually a bug here when the `OPENMC_CROSS_SECTIONS` environment variable is not set. I have a fix ready to go that I’ll submit a pull request for, so this should make it into the next version.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [January 12, 2022, 4:43pm UTC](https://openmc.discourse.group/t/depletion-calculation-no-xsection-xml-error/1577/8 "2022-01-12T16:43:18Z")

</div>

A fix for this issue has just been [submitted](https://github.com/openmc-dev/openmc/pull/1948) for review.
