Unable to load chain_endfb71.xml into depletion code

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.

#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:

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

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

Hi Myles,

have you tried running your code using one of the depletion chains you can download from the OpenMC page? (Depletion Chains | OpenMC) You can download the chain_endfb71.xml file from here.

best,

Luiz

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

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

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)

Best,
Myles

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

Hi Paul,

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

Best,
Myles

1 Like