# Unable to load chain\_endfb71.xml into depletion code

**URL:** <https://openmc.discourse.group/t/unable-to-load-chain-endfb71-xml-into-depletion-code/2123>\
**Category:** User Support\
**Created:** [June 16, 2022, 6:27pm UTC](https://openmc.discourse.group/t/unable-to-load-chain-endfb71-xml-into-depletion-code/2123 "2022-06-16T18:27:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![myless](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@myless](https://openmc.discourse.group/u/myless)\
**Post date:** [June 16, 2022, 6:27pm UTC](https://openmc.discourse.group/t/unable-to-load-chain-endfb71-xml-into-depletion-code/2123/1 "2022-06-16T18:27:54Z")

</div>

Hello,

I am trying to run a depletion code example from John Shimwell’s neutronics-workshop repo, but am unable to load the xml file into the depletion operator. I used the generate\_endf71\_chain.py from the openmc-dev/data repo, and saved the xml file in the same path as my notebook.

```auto
#Chain file setup
chain_filename = 'chain_endfb71.xml'
chain = openmc.deplete.Chain.from_xml(chain_filename)

operator = openmc.deplete.Operator(model, chain_filename)

#1e9 neutrons per second for 5 years then 5 years of no neutrons (shut down cooling time)

time_steps = [365*24*60*60] * 5 + [365*24*60*60] * 5
source_rates = [1e9]*5 + [0] * 5

integrator = openmc.deplete.PredictorIntegrator(
    operator=operator, timesteps=time_steps,source_rates=source_rates
)

integrator.integrate()

---------------------------------------------------------------------------
OSError Traceback (most recent call last)
Input In [12], in <cell line: 5>()
      2 chain_filename = 'chain_endfb71.xml'
      3 chain = openmc.deplete.Chain.from_xml(chain_filename)
----> 5 operator = openmc.deplete.Operator(model, chain_filename)
      7 #1e9 neutrons per second for 5 years then 5 years of no neutrons (shut down cooling time)
      9 time_steps = [365*24*60*60] * 5 + [365*24*60*60] * 5

File ~/.mambaforge3/envs/openmc/lib/python3.9/site-packages/openmc/deplete/operator.py:200, in Operator. __init__ (self, geometry, settings, chain_file, prev_results, diff_burnable_mats, normalization_mode, fission_q, dilute_initial, fission_yield_mode, fission_yield_opts, reaction_rate_mode, reaction_rate_opts, reduce_chain, reduce_chain_level)
    198 warn("Fission Q dictionary will not be used")
    199 fission_q = None
--> 200 super(). __init__ (chain_file, fission_q, dilute_initial, prev_results)
    201 self.round_number = False
    202 self.settings = settings

File ~/.mambaforge3/envs/openmc/lib/python3.9/site-packages/openmc/deplete/abc.py:113, in TransportOperator. __init__ (self, chain_file, fission_q, dilute_initial, prev_results)
    111 break
    112 else:
--> 113 raise IOError(
    114 "No chain specified, either manually or "
    115 "under depletion_chain in environment variable "
    116 "OPENMC_CROSS_SECTIONS.")
    117 chain_file = lib['path']
    118 else:

OSError: No chain specified, either manually or under depletion_chain in environment variable OPENMC_CROSS_SECTIONS.

```

The example I looked at initially had `chain_filename = '/chain_endfb71.xml'` , but I got the following error:

 ![image](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/8/8cc99a7d73d98e944d1ab7dd1c8b78302250406a.png)

I also tried `chain_filename = './chain_endfb71.xml'`, but got the following error:

```auto
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
Input In [11], in <cell line: 5>()
      2 chain_filename = './chain_endfb71.xml'
      3 chain = openmc.deplete.Chain.from_xml(chain_filename)
----> 5 operator = openmc.deplete.Operator(model, chain_filename)
      7 #1e9 neutrons per second for 5 years then 5 years of no neutrons (shut down cooling time)
      9 time_steps = [365*24*60*60] * 5 + [365*24*60*60] * 5

File ~/.mambaforge3/envs/openmc/lib/python3.9/site-packages/openmc/deplete/operator.py:200, in Operator. __init__ (self, geometry, settings, chain_file, prev_results, diff_burnable_mats, normalization_mode, fission_q, dilute_initial, fission_yield_mode, fission_yield_opts, reaction_rate_mode, reaction_rate_opts, reduce_chain, reduce_chain_level)
    198 warn("Fission Q dictionary will not be used")
    199 fission_q = None
--> 200 super(). __init__ (chain_file, fission_q, dilute_initial, prev_results)
    201 self.round_number = False
    202 self.settings = settings

File ~/.mambaforge3/envs/openmc/lib/python3.9/site-packages/openmc/deplete/abc.py:113, in TransportOperator. __init__ (self, chain_file, fission_q, dilute_initial, prev_results)
    111 break
    112 else:
--> 113 raise IOError(
    114 "No chain specified, either manually or "
    115 "under depletion_chain in environment variable "
    116 "OPENMC_CROSS_SECTIONS.")
    117 chain_file = lib['path']
    118 else:

OSError: No chain specified, either manually or under depletion_chain in environment variable OPENMC_CROSS_SECTIONS.

```

Curious to see where I went wrong here, should the xml file be saved somewhere in the openmc root folder?

Thanks,  
Myles

---

<div class="post-metadata">

**Author:** ![luizaldeia](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/luizaldeia/32/1824_2.png) [@luizaldeia](https://openmc.discourse.group/u/luizaldeia)\
**Post date:** [June 16, 2022, 8:44pm UTC](https://openmc.discourse.group/t/unable-to-load-chain-endfb71-xml-into-depletion-code/2123/2 "2022-06-16T20:44:13Z")

</div>

Hi Myles,

have you tried running your code using one of the depletion chains you can download from the OpenMC page? ([Depletion Chains | OpenMC](https://openmc.org/depletion-chains/)) You can download the chain\_endfb71.xml file from here.

best,

Luiz

---

<div class="post-metadata">

**Author:** ![myless](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@myless](https://openmc.discourse.group/u/myless)\
**Post date:** [June 16, 2022, 8:51pm UTC](https://openmc.discourse.group/t/unable-to-load-chain-endfb71-xml-into-depletion-code/2123/3 "2022-06-16T20:51:07Z")

</div>

Hi Luiz,

Thanks for your suggestion! I gave the endf\_pwr and endf\_sfr chains a try, and got the same error… with and without using . or / in the name.

Best  
Myles

---

<div class="post-metadata">

**Author:** ![luizaldeia](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/luizaldeia/32/1824_2.png) [@luizaldeia](https://openmc.discourse.group/u/luizaldeia)\
**Post date:** [June 16, 2022, 8:57pm UTC](https://openmc.discourse.group/t/unable-to-load-chain-endfb71-xml-into-depletion-code/2123/4 "2022-06-16T20:57:17Z")

</div>

Myles, could you please send me the model you’re using, so I can run it here to see what will happen.

---

<div class="post-metadata">

**Author:** ![myless](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@myless](https://openmc.discourse.group/u/myless)\
**Post date:** [June 17, 2022, 1:52pm UTC](https://openmc.discourse.group/t/unable-to-load-chain-endfb71-xml-into-depletion-code/2123/5 "2022-06-17T13:52:44Z")

</div>

Hi Luiz,

Sorry for the delay, here’s a link to the example that I am following (for a sanity check I have even copied and pasted everything to make sure my implementation wasn’t incorrect, but I still get the same errors)

> <https://github.com/fusion-energy/neutronics-workshop/blob/develop/tasks/task_14_activation_transmutation/1_example_transmutation_isotope_build_up.ipynb>

Best,  
Myles

---

<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:** [August 5, 2022, 3:44am UTC](https://openmc.discourse.group/t/unable-to-load-chain-endfb71-xml-into-depletion-code/2123/6 "2022-08-05T03:44:40Z")

</div>

@myless I think the problem is that you are using syntax for OpenMC version 0.13.0 (notably, passing a `Model` object to `Operator(...)`) but you are actually using version 0.12.2 or earlier (which expects a `Geometry` and `Materials` object. I would recommend updating your OpenMC installation to 0.13.0 and then trying again.

---

<div class="post-metadata">

**Author:** ![myless](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@myless](https://openmc.discourse.group/u/myless)\
**Post date:** [August 5, 2022, 4:32pm UTC](https://openmc.discourse.group/t/unable-to-load-chain-endfb71-xml-into-depletion-code/2123/7 "2022-08-05T16:32:47Z")

</div>

Hi Paul,

Thanks for your reply. The newest version of OpenMC fixes this!

Best,  
Myles
