Distinguish depletion materials when using diff_burnable_mats=True

Dear guys,
I’m trying to partition the fuel to realize an accurate burnup calculation , get power distribution evolution over time and obtain local burnup level . For this purpose, I use the diff_burnable_mats=True property in CoupledOperator instance to distinguish the same fuel material in different lattice. However, In the materials.xml file getting from the results class, these materials become indistinguishable except the id.
I want to know how to relate the id of these materials to the cell index where the fuel is located so that I can get the burnup depth at different locations.
Thank you.

Hi fyh_sinap

Perhaps you can use the cell bounding box to get the location of the material, here are some links to the docs for the latest version of openmc. Bounding_box has a . center attribute

https://docs.openmc.org/en/latest/pythonapi/generated/openmc.Cell.html
bounding_box

https://docs.openmc.org/en/latest/pythonapi/generated/openmc.BoundingBox.html#openmc.BoundingBox

Hello, I’m far too late to join the party, but for the records I think I get the gist of how to know which material at what cells.

Method 1:
First, we can get cell instance from a coordinate in geometry using Geometry.find:
targetCell = geometry.find((x,y,z))[-1]
Then add volume: targetCell.volume = fuelVolumeAtThatCell
At last, nuclidesInTarget = targetCell.atoms

Method 2:
First, generate the CSG paths:
geometry.determine_paths()
Then get instance number with Geometry.get_instances:
instanceIdx = geometry.get_instances(le_path)

To get le_path, we should consult the geometry docs. But if our lattices are simple enough, one could deduct the pattern of the CSG paths. Let say we want to know the path for all cell instances:
print(targetCell.paths)

It may returns something like:

['u9->c10->l7(7,1)->u5->c7->l3(0,0)->u1->c1',
 'u9->c10->l7(7,1)->u5->c7->l3(1,0)->u1->c1',
 'u9->c10->l7(7,1)->u5->c7->l3(2,0)->u1->c1',
 'u9->c10->l7(7,1)->u5->c7->l3(3,0)->u1->c1',
...
]

This is an AP-1000 miniaturized cores. Let’s say we want to get cell at assembly (8,8) (the center assembly), and in that assembly we want to get the fuel pin next to the center guide tube (coordinate 9,8), so:
le_path = 'u9->c10->l7(8,8)->u5->c7->l3(9,8)->u1->c1'

The result is instanceIdx = 20724 (the total pins inside AP-1000 is 41448, and 20724 is exactly half of it). We can use instanceIdx to then determine which materials assign to that cell specifically (just count all the materials with the same name until 20724, beware of off-by-one error!).

For the record, I don’t like either methods; there should be a way to return composition of nuclides inside a cell whose fill_type is distribmat, inside a lattices from the get-go.