diff_burnable_mats=True leads to InvalidIDError

Hi,

I am new to OpenMC and I tried running a burnup example on the openmc.examples.pwr_assembly().

I am using OpenMC version 0.15.2.

I got an:

openmc.exceptions.InvalidIDError: No material exists with ID=4.

while running this simple script below. The same script without ‘‘diff_burnable_mats=True’’ works fine.

import openmc
import openmc.deplete

model = openmc.examples.pwr_assembly()
model.geometry.root_universe.plot(pixels=(800, 800))
model.settings.particles = 10_000
model.settings.batches = 100
model.settings.inactive = 20
model.export_to_xml()

bbox = model.geometry.bounding_box

bbox[0][2] = 0.0
bbox[1][2] = 1.0

vc = openmc.VolumeCalculation(model.materials, 1_000_000_000, *bbox)

model.settings.volume_calculations = [vc]
model.calculate_volumes()

for m in model.materials:
m.add_volume_information(vc)

chain_file = ‘chain_endfb80_pwr.xml’
op = openmc.deplete.CoupledOperator(model, chain_file, diff_burnable_mats=True)

power = 57_800 # power in W/cm (assuming ~200 W/cm per pincell)
operation_time_steps = [0.05, 0.1, 0.1, 0.1, 0.1, 0.5, 0.25, 1.0, 1.0, 1.0, 1.0]
operating_power = [power] * len(operation_time_steps)
cooling_time_steps = [0.05, 0.1, 0.1, 0.1, 0.1, 0.5, 0.25, 1.0, 1.0, 1.0, 1.0]
cooling_power = [0.0] * len(cooling_time_steps)
integrator = openmc.deplete.PredictorIntegrator(op,
operation_time_steps + cooling_time_steps,
operating_power + cooling_power,
timestep_units=‘d’)
integrator.integrate()

Can anyone help with that?

Thank you,

Olivier

So I found the problem, I simply needed to add:

model.differentiate_depletable_mats()

after:
model = openmc.examples.pwr_assembly()

In case it can help someone…

Olivier

1 Like