diff --git a/openmc/model/model.py b/openmc/model/model.py index a40a79bc91..9da834e139 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -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': diff --git a/openmc/summary.py b/openmc/summary.py index 43224334d0..6423f8ce1d 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -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)