Subdivision of materials for depletion calculation with v0.13.0

Hi All. I have a depletion run which works correctly in v0.12.2 but doesn’t appear to work in v0.13.0. The only changes I have made to the input are to add lines to create the model object and then change the operator to the new format.

I’ve simplified the case down to the simplest possible example I can give which produces the error - which involves placing different types of fuel pin into a lattice. The error is ‘Could not find material 7 specified on cell 1’ but I also notice that the volume values given in the materials.xml are half in the v0.13 case. Any help toward resolving the issue would be appreciated. :slightly_smiling_face:

import openmc
import openmc.lib
import openmc.deplete

fuel_1 = openmc.Material(name='fuel 1')
fuel_1.set_density('g/cm3', 10)
fuel_1.add_nuclide('O16', 1.19e-1, 'wo')
fuel_1.add_nuclide('U235', 3.60e-2, 'wo')
fuel_1.add_nuclide('U238', 8.45e-1, 'wo')

fuel_2 = openmc.Material(name='fuel 2')
fuel_2.set_density('g/cm3', 10)
fuel_2.add_nuclide('O16', 1.19e-1, 'wo')
fuel_2.add_nuclide('U235', 2.60e-2, 'wo')
fuel_2.add_nuclide('U238', 8.55e-1, 'wo')

clad = openmc.Material(name='clad')
clad.set_density('g/cm3', 6)
clad.add_nuclide('Zr90', 1, 'wo')

water = openmc.Material(name='water')
water.set_density('g/cm3', 0.70)
water.add_nuclide('H1', 2.0)
water.add_nuclide('O16', 1.0)
water.add_s_alpha_beta('c_H_in_H2O')

fuel_1.volume = 1.056
fuel_2.volume = 1.056

s1 = openmc.ZCylinder(r=0.41)
s2 = openmc.ZCylinder(r=0.475)

fuel_pin1 = openmc.model.pin([s1, s2], [fuel_1, clad, water], subdivisions={0: 2}, divide_vols = True)
fuel_pin2 = openmc.model.pin([s1, s2], [fuel_2, clad, water], subdivisions={0: 2}, divide_vols = True)

l201 = openmc.RectLattice(name='pin lattice', lattice_id=201)
l201.lower_left = (-1.24, -1.24)
l201.pitch = (1.24, 1.24)
l201.universes = [
[fuel_pin1] + [fuel_pin2],
[fuel_pin2] + [fuel_pin1]]

bound_box = openmc.rectangular_prism(2.48, 2.48, boundary_type="reflective")
root = openmc.Cell(fill=l201, region=bound_box)
geometry_file = openmc.Geometry([root])
geometry_file.export_to_xml()

materials_file = openmc.Materials(list(geometry_file.get_all_materials().values()))
materials_file.export_to_xml()

settings_file = openmc.Settings()
settings_file.particles = 1000
settings_file.inactive = 10
settings_file.batches = 20
settings_file.export_to_xml()

chain_file = './chain_simple.xml'
# model = openmc.Model(geometry=geometry_file, materials=materials_file, settings=settings_file)
op = openmc.deplete.Operator(geometry_file, settings_file, chain_file)
time_steps = [(1.0, 'MWd/kg'), (2.0, 'MWd/kg')]
power = 532
integrator = openmc.deplete.CECMIntegrator(op, time_steps, power, timestep_units='d')
integrator.integrate(final_step=True)

Hi @ChrisG ;

I faced the same problem when I moved to 0.13 release lately and I tried you input example on the my installation (WSL Debian 11 with openmc installed via conda) and by a means of a small update of the following line in your code:
op = openmc.deplete.Operator(model, chain_file)
it works fine and did not get any of mentionned errors.

Hi

Thank you for your reply. I see that changing the operator is necessary when using v0.13. The edit you show does allow the code to run correctly.

I should apologize as I didn’t make it clear that I had posted the version of my code which works in v0.12 but not v0.13. I also realize I hadn’t included the ‘diff_burnable_mats’ option which I am trying to use and I think it may be the use of this option that is causing the issue.

The last block of code from my example should have read:

chain_file = './chain_simple.xml'
# model = openmc.Model(geometry=geometry_file, materials=materials_file, settings=settings_file) #v0.13 code
# op = openmc.deplete.Operator(model, chain_file, diff_burnable_mats=True) #v0.13 code
op = openmc.deplete.Operator(geometry_file, settings_file, chain_file, diff_burnable_mats=True) #v0.12 code
time_steps = [(1.0, 'MWd/kg'), (2.0, 'MWd/kg')]
power = 532
integrator = openmc.deplete.CECMIntegrator(op, time_steps, power, timestep_units='d')
integrator.integrate(final_step=True)

I can get the code to run with the ‘diff_burnable_mats=True’ in v0.12 but not in v0.13 (once I uncomment the two lines and remove the one below). I’d be interested if anyone else is having such issues or maybe it is something to do with my installation.

Hello @ChrisG and @bentridisalah,

I’m also facing the same issue. I’m using a little trick to overcome it. I have version 0.12 installed on my personal computer and 0.13 on my INL HPC account, so what I’m doing is creating the XML files using version 0.12, sending them to the HPC, and then I create a model using:

model = openmc.model.Model.from_xml(geometry='geometry.xml', materials='materials.xml',settings='settings.xml', plots='plots.xml')

and run the depletion.

It isn’t the most sophisticated solution, but it is the way I found to run these cases using version 0.13 while I didn’t find a proper way to solve the issue.

The code I’m using to run the model:

import openmc
import openmc.deplete
import numpy as np
import math
from matplotlib import pyplot

#chain_path = "/storage/home/lca5209/OpenMC/chains/chain_simple.xml"
#chain_path = "/storage/home/lca5209/OpenMC/chains/chain_casl_pwr.xml"
chain_path = "/storage/home/lca5209/OpenMC/chains/chain_endfb71_pwr.xml"

modelo =  openmc.model.Model.from_xml(geometry='geometry.xml', materials='materials.xml',settings='settings.xml',plots='plots.xml')



###############################################################################
#                      Depletion settings
###############################################################################

#setting the transport operator
operator = openmc.deplete.Operator(modelo,chain_path,diff_burnable_mats='True',normalization_mode='fission-q',fission_q={"U235": 202.27e6})
#,normalization_mode="energy-deposition"
#setting the system linear power [W/cm]
power = 200
#Burnup = [0.1, 0.5, 1.0, 3.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30, 35, 40, 45, 50 55, 60]
time_steps =  [0.1,0.4,0.5,2.0,2.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0]

print(time_steps)

#depleting usin a first-order predictor algorithm
integrator = openmc.deplete.PredictorIntegrator(operator, time_steps, power,timestep_units =  'MWd/kg')

integrator.integrate()

openmc.run()

Hi @ChrisG and @luizaldeia ;

I’m sorry to interact lately with the question.
@ChrisG I will rerun your input with the new version that you sent in your last message and I will give you back what it said on my machine.
I think also that an alternative is what @luizaldeia did to bypass this issure temporarily, but if he face the same issue on the 0.13 release I think that my test will be another confirmation :slight_smile: anyway it will be worthy to give feedback for specialists about this.

best regards

1 Like

Hi @ChrisG

I tried to run you input with the new lines you posted and the kernel is crashing each time I tried to run the depletion operator with the following message:
“The kernel appears to have died. It will restart automatically.”

It seems that there is an issue with the option “diff_burnable_mats” when it is activated…I’m not sure if the alternative given by @luizaldeia will work in this case !!!
probably he should try to run your input on his machine, just to see what will happen?

Hello @bentridisalah and @ChrisG

I just tried it right now, and it worked well. So, at least for me, when I used the diff_burnable_mats in version 0.13, the code didn’t create the materials.xml file properly. That’s why I’m using v0.12 to create the XML files, and then I run them on v0.13. But this is “a lot of work” and only compensates if you’re simulating something that the computer with the v0.12 can’t handle and you need to run it on a machine with v0.13 on it.

If you wanna try to run it, I’m attaching the XML files and the code I used to run it on v0.13.

import openmc
import openmc.lib
import openmc.deplete

chain_file = './chain_simple.xml'

model =  openmc.model.Model.from_xml(geometry='geometry.xml', materials='materials.xml',settings='settings.xml')
op = openmc.deplete.Operator(model, chain_file, diff_burnable_mats=True) #v0.13 code
time_steps = [(1.0, 'MWd/kg'), (2.0, 'MWd/kg')]
power = 532
integrator = openmc.deplete.CECMIntegrator(op, time_steps, power, timestep_units='d')
integrator.integrate(final_step=True)

settings.xml (176 Bytes)
materials.xml (2.2 KB)
geometry.xml (1.4 KB)

1 Like

@luizaldeia and @bentridisalah - Thank you both for your investigations into the issue. I will use the method of generating the materials.xml with v0.12 and runnig with v0.13 as a work around for the time being.

Regards

1 Like

Hi all – there was indeed a bug with diff_burnable_mats in the latest version of OpenMC that resulted in materials not getting assigned properly. This has since been fixed in the latest development version and will appear in our next release. @ChrisG I’ve confirmed that your original model (with diff_burnable_mats=True) does now run to completion. Sorry for the troubles you’ve experienced!

1 Like

Hello Paul/team,

Kindly confirm the challenge of using (with diff_burnable_mats=True) in openmc version 0.14.0 was fixed as I am experiencing challenge using this in my simulation. I get the error “ERROR: Could not find material 2 specified on cell 1”