Modeling TRISO compacts with unique fuel materials

All, I am trying to deplete in a TRISO-fueled HTGR. To accurately burn the fuel, I would like to deplete the fuel compact-by-compact. The compacts are created following the example on the openmc documentation. I know I can clone my fuel at each compact instance to create a unique material to deplete. My issue is that this process creates a geometry.xml file that is gigabytes in size and is cumbersome to handle. The root of this is because each compact’s TRISO cells are defined individually for each unique compact. In other words, I cannot seem to create one generic fuel compact that is filled with unique TRISOs with unique fuel materials. Is there a convenient way to create a generic compact, then fill it with uniquely fueled TRISOs? From my digging so far, the openmc.model.TRISO class must be instantiated with a fill universe, so I could not use that class as written. I was thinking I could potentially manually defined a list of cells defining the TRISOs in the compact myself to avoid requiring an initial fill. If anyone has any ideas for this, please let me know! Thanks.
-Josh

1 Like

Hi @mayjosh,

That’s a challenging problem! Thanks for giving it a try using OpenMC. It sounds like at some point you’re calling openmc.Cell.clone. Is that right?

If so, one way to accomplish what you want without duplicating the geometry for each compact is to use distribmats. When defining OpenMC cells in the Python API, the fill of a cell an be specified as a material, lattice, universe or a list of materials. When a list of materials is used it is assumed that each material in the list is to be used for a different instance of the cell in in the model. So for an arbitrary cell in OpenMC one can use:

mat = cell.fill
cell.fill = [mat.clone() for _ in range(cell.num_instances)]

To take the current material filling the cell and generate a unique material for each cell instance without creating a duplicate representation of that cell in the geometry.xml file up on export.

Note that for the num_instances attribute to be populated, the determine_paths method of the openmc.Geometry object will need to be called first.

I hope this helps!

In case I’m misinterpreting your question, I’ll add that you can also clone cells without cloning their regions by setting clone_regions=False when calling openmc.Cell.clone.