Error with 'diff_burnable_mats' in depletion of fuel assembly

Hi
When I use ‘diff_burnable =True’ to complate fuel consumption depth of every assembly to get fuel consumption depth distributioin of reactor core,There is an error ‘No cross_sections.xml file was specified in materials.xml or in the OPENMC_CROSS_SECTIONS enviroment variable’.But when i set ‘diff_burnable=False’,it can run successfully.
Could you tell me why did such an error occur and how can I solve this problem.
Thanks!

model = openmc.model.Model(geometry=assembly, materials=materials, settings=settings)
model.differentiate_depletable_mats(diff_volume_method = ‘divide equally’)
chain_file = ‘chain_casl_pwr.xml’
op = openmc.deplete.CoupledOperator(model, chain_file)
integrator = openmc.deplete.PredictorIntegrator(op, depletion_step, power_level, timestep_units=time_unit)
integrator.integrate()

This is the depletion code that I use, it may vary for you or depending on version. If you want to run a depletion you need a depletion chain file (‘chain_casl_pwr.xml’) in the same directory as your model. You can download one of these from the OpenMC homepage.

Thank for your answer!
I was using 0.13.2 with the previous version.But even though I updated the version to 0.14.0 and made changes to mine with your code, I still get the error:openmc.exeptions.DataError:Cross sections were not specified in Model.materials and openmc.config[‘cross_sections’] is not set.
I’m sure I’ve specified the cross_section.xml,this is my code to specify the cross_section.xml.
materials_file.cross_sections=‘/home/shuoxing/cs/mcnp-endfb71/cross_sections.xml’
materials_file.export_to_xml()
chain = openmc.deplete.Chain.from_xml(‘/home/shuoxing/chain/chain_enfb71_pwr.xml’)
But this error still appears, do you know what the reason is?
Thanks.

And there is no error if I did not set ‘model.differentiate_depletable_mats(diff_volume_method = ‘divide equally’)’ or ‘diff_burnable =True’.I don’t know the reason.

What type of lattice does your reactor use? rectangular? hexagonal? I’ve had issues with hexagonal lattices with depletion in the past and that may be the source of your problem.

I’m not sure what the issue is. I will say that the path to my cross sections file is defined as an environment variable in ubuntu rather than in the code itself, so maybe that’s the difference.

Thanks,I will try it.

I used rectangular in my reactor .Have you ever encountered a similar problem to me, and how did you solve it?

After reading @Daedalus’s solution in the thread, I would’ve suggested the same thing. Sorry I can’t provide any additional assistance. Good luck!