Description
Description
Lattice universes inside a lattice universe is pretty much common in reactor design. Let’s say that we’re trying to simulate a full core of PWR like AP1000 or AP600. Each assemblies consist of rectangular fuel lattice of 17 x 17, and each core can load 100-200 assemblies.
If we run model.differentiate_depletable_mats
, we’ll get ~30-40k different materials, for each fuel cell. Suddenly we need supercomputer because it will eat hundreds of gigabytes of memory.
I think it would be very nice if we can limit the level of differentiation, so instead of differentiating to each material cell, we can differentiate to a universe. It would be great if we can even group several cells of lattice that contain that universe with a material to further simplify the conditions (as if we homogenize the material of particular part of the reactor in that way).
Ideas
model.differentiate_depletable_mats()
relies on geometry.get_all_material_cells()
. If we want it to differentiate only to certain universe, we should either:
- Extend geometry class with method to get all material cells inside a particular universe.
- Iteratively loop all universe which contains depletable materials, and for each loop we run the differentiate_deplatable_mats() algorithm for each depletable materials.
Alternatives
For now users who want this mechanism can instead homogenized the universe by using complicated for loops, which essentially recreate the lattice function, but all the cells in the lattice is now made as one unified cell per universe per lattice cell (so for 17 x 17 assembly, all the fuel pins in the assembly is counted as 1 cell instead of 264 different cells of fuel pins).
Compatibility
It shouldn't break compatibility with previous version of differentiate_depletable_mats(); just make the default target universe a None object, and if it's None we'll use the previous implementation of differentiate_depletable_mats().