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