From 3ee40ea37c290167a0f59061693b2c053f693e23 Mon Sep 17 00:00:00 2001 From: Yue JIN Date: Thu, 5 Nov 2020 10:18:26 +0800 Subject: [PATCH] Distribute depletable materials in all cell instances containing it. --- openmc/deplete/operator.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index 1f99abe95..0e28b7ed3 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -371,15 +371,17 @@ class Operator(TransportOperator): [mat for mat in self.geometry.get_all_materials().values() if mat.depletable and mat.num_instances > 1]) + for mat in distribmats: + if mat.volume is None: + raise RuntimeError("Volume not specified for depletable " + "material with ID={}.".format(mat.id)) + mat.volume /= mat.num_instances + if distribmats: # Assign distribmats to cells for cell in self.geometry.get_all_material_cells().values(): - if cell.fill in distribmats and cell.num_instances > 1: + if cell.fill in distribmats: mat = cell.fill - if mat.volume is None: - raise RuntimeError("Volume not specified for depletable " - "material with ID={}.".format(mat.id)) - mat.volume /= mat.num_instances cell.fill = [mat.clone() for i in range(cell.num_instances)]