mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
add dagmc fill materials to homogenized materials method (#3026)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
97537d5e9a
commit
b0732cb6b3
1 changed files with 12 additions and 0 deletions
|
|
@ -211,6 +211,18 @@ class MeshBase(IDManagerMixin, ABC):
|
|||
|
||||
# Create homogenized material for each element
|
||||
materials = model.geometry.get_all_materials()
|
||||
|
||||
# Account for materials in DAGMC universes
|
||||
# TODO: This should really get incorporated in lower-level calls to
|
||||
# get_all_materials, but right now it requires information from the
|
||||
# Model object
|
||||
for cell in model.geometry.get_all_cells().values():
|
||||
if isinstance(cell.fill, openmc.DAGMCUniverse):
|
||||
names = cell.fill.material_names
|
||||
materials.update({
|
||||
mat.id: mat for mat in model.materials if mat.name in names
|
||||
})
|
||||
|
||||
homogenized_materials = []
|
||||
for mat_volume_list in mat_volume_by_element:
|
||||
material_ids, volumes = [list(x) for x in zip(*mat_volume_list)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue