mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Correctly apply volumes to materials when using DAGMC geometries (#2787)
Co-authored-by: Nicolas Linden <n.linden@naarea.fr>
This commit is contained in:
parent
87e00f76ed
commit
47c37f506d
2 changed files with 12 additions and 2 deletions
|
|
@ -787,7 +787,12 @@ class Model:
|
|||
for i, vol_calc in enumerate(self.settings.volume_calculations):
|
||||
vol_calc.load_results(f"volume_{i + 1}.h5")
|
||||
# First add them to the Python side
|
||||
self.geometry.add_volume_information(vol_calc)
|
||||
if vol_calc.domain_type == "material" and self.materials:
|
||||
for material in self.materials:
|
||||
if material.id in vol_calc.volumes:
|
||||
material.add_volume_information(vol_calc)
|
||||
else:
|
||||
self.geometry.add_volume_information(vol_calc)
|
||||
|
||||
# And now repeat for the C API
|
||||
if self.is_initialized and vol_calc.domain_type == 'material':
|
||||
|
|
|
|||
|
|
@ -240,4 +240,9 @@ class Summary:
|
|||
Results from a stochastic volume calculation
|
||||
|
||||
"""
|
||||
self.geometry.add_volume_information(volume_calc)
|
||||
if volume_calc.domain_type == "material" and self.materials:
|
||||
for material in self.materials:
|
||||
if material.id in volume_calc.volumes:
|
||||
material.add_volume_information(volume_calc)
|
||||
else:
|
||||
self.geometry.add_volume_information(volume_calc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue