# Problem with pincell depletion example

**URL:** <https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889>\
**Category:** User Support\
**Created:** [April 1, 2022, 10:26pm UTC](https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889 "2022-04-01T22:26:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bentridisalah](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/bentridisalah/32/1421_2.png) [@bentridisalah](https://openmc.discourse.group/u/bentridisalah)\
**Post date:** [April 1, 2022, 10:26pm UTC](https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889/1 "2022-04-01T22:26:56Z")

</div>

Hi everyone;

I am trying to practice the depletion example of “pincell depletion” included in the openmc package and I’m facing an issue when trying to execute it on my PC. OpenMC is installed from source on a WSL Debian 11. Once I’m getting here:  
_operator = openmc.deplete.Operator(model,chain\_file)_  
an error message is obtained like this:  
“ **OSError: No chain specified, either manually or under depletion\_chain in environment variable OPENMC\_CROSS\_SECTIONS.** ”  
even the chain\_file is defined and present at the same folder with the model example.  
Which I found a little bit weird is that the following command works proprely and the chain\_file could be read by this method:  
_chain = openmc.deplete.Chain.from\_xml(chain\_file)_

Another thing I noticed is that when it is executed on google.colab, everything is working well, I don’t know if it is related to the linux distribution or something missing in my openmc configuration!!!

Thanks for any help

---

<div class="post-metadata">

**Author:** ![skyawlker](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@skyawlker](https://openmc.discourse.group/u/skyawlker)\
**Post date:** [April 2, 2022, 2:30am UTC](https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889/2 "2022-04-02T02:30:23Z")

</div>

hi,i have meet the same problem ,you should use terminal get in the folder where the deletion example located,then your problem will be saved!

---

<div class="post-metadata">

**Author:** ![bentridisalah](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/bentridisalah/32/1421_2.png) [@bentridisalah](https://openmc.discourse.group/u/bentridisalah)\
**Post date:** [April 2, 2022, 7:29am UTC](https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889/3 "2022-04-02T07:29:48Z")

</div>

Hi Skywalker;

I tried this too but the error message always persists. IN fact, I tried both way to execute the example, using Jupyter notebook as recommanded and also as a simple python program from a terminal and I always verify that the pwd command tells that the execution is run in the same folder where the pincell model and chain\_file.xml are located.  
I tried also relative and abosulte path to tell the depletion operator where is the chain\_file.  
I’m just wondering how to define “depletion\_chain” under the OPENMC\_CROSS\_SECTIONS environment variable?  
Thanks

---

<div class="post-metadata">

**Author:** ![pshriwise](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pshriwise/32/3863_2.png) [@pshriwise](https://openmc.discourse.group/u/pshriwise)\
**Post date:** [April 2, 2022, 2:06pm UTC](https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889/4 "2022-04-02T14:06:45Z")

</div>

Hi @bentridisalah!

You might try making sure that you’re using the full path (i.e. `/home/username/openmc_depletion/chain.xml`) rather than a realtive path (i.e. `chain.xml` or `./chain.xml`) to the depletion chain file when creating a depletion operator in your script.

If that doesn’t work you might also try setting the `OPENMC_DEPLETION_CHAIN` environment variable (again, with a full path) – though this option is deprecated, so I’d recommend figuring out how to specify the chain file when creating the `openmc.deplete.Operator` object if possible.

I hope this helps!

-Patrick

---

<div class="post-metadata">

**Author:** ![bentridisalah](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/bentridisalah/32/1421_2.png) [@bentridisalah](https://openmc.discourse.group/u/bentridisalah)\
**Post date:** [April 2, 2022, 2:42pm UTC](https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889/5 "2022-04-02T14:42:09Z")

</div>

Hi @pshriwise

Thank you for your suggestion and your reply. In fact, I am trying to dig more about this problem and what I noticed is that the depletion is working when I’m using the old method to call depletion Operator, i.e:  
_openmc.deplete.Operator(geometry, settings, chain\_file)_  
whereas when I am using the new method (as recommanded for 0.13 release) with model definition, it does’nt work and I get the corresponding error message as mentionned in my first post:  
_openmc.deplete.Operator(model, chain\_file)_  
For the history, I was using openmc0.12.2 but two days later, I decided to install the latest version 0.13 to be up-to-date but I’m not sure that the kernel is using it because sometimes when it is running (for a simple criticality calculation) the code launching gives the 0.13 version and when I modified the python file to add depletion calculation it switchs to 0.12.2 relase, and it did not recognize the new method of depletion operator (using model instead of geometry and settings)…  
so I think now, it is better to uninstall all possible versions of openmc and reinstall it again (only the last version)  
by the way, how should I do to unistall openmc from the system, is there any specific command, because it is not mentionned on the online documentation, either the update of the opemnc.  
thanks a lot

---

<div class="post-metadata">

**Author:** ![bentridisalah](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/bentridisalah/32/1421_2.png) [@bentridisalah](https://openmc.discourse.group/u/bentridisalah)\
**Post date:** [April 2, 2022, 9:52pm UTC](https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889/6 "2022-04-02T21:52:56Z")

</div>

@pshriwise @skyawlker  
Finally I could fix the problem, I reinstalled a new WSL2-Ubuntu on my windows and installed a fresh openmc via conda and depletion method (with new version using model) is working.  
The proble came from the fact that in the ancient WSL2-Debian, the new version of openmc was installed besides the previous one and that created some conflict to use correctly the depletion method.

Thanks a lot for your help.

---

<div class="post-metadata">

**Author:** ![pshriwise](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pshriwise/32/3863_2.png) [@pshriwise](https://openmc.discourse.group/u/pshriwise)\
**Post date:** [April 3, 2022, 1:10am UTC](https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889/7 "2022-04-03T01:10:35Z")

</div>

Glad you got it sorted out! Yep, that object’s construcutor did indeed change between versions `0.12.0` and `0.13.0`.

---

<div class="post-metadata">

**Author:** ![bentridisalah](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/bentridisalah/32/1421_2.png) [@bentridisalah](https://openmc.discourse.group/u/bentridisalah)\
**Post date:** [April 3, 2022, 10:48am UTC](https://openmc.discourse.group/t/problem-with-pincell-depletion-example/1889/8 "2022-04-03T10:48:21Z")

</div>

@pshriwise ;

Thank you very much, it is very kind of you.

Regards
