Problem with pincell depletion example

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

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!

1 Like

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

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

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

@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.

2 Likes

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

1 Like

@pshriwise ;

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

Regards