Merge pull request #2376 from shimwell/adding_mat_name_to_error_message

making error message more helpful with material name
This commit is contained in:
Paul Romano 2023-02-10 07:40:01 -06:00 committed by GitHub
commit d65c6ca13a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -223,8 +223,13 @@ class OpenMCOperator(TransportOperator):
if mat.depletable:
burnable_mats.add(str(mat.id))
if mat.volume is None:
raise RuntimeError("Volume not specified for depletable "
"material with ID={}.".format(mat.id))
if mat.name is None:
msg = ("Volume not specified for depletable material "
f"with ID={mat.id}.")
else:
msg = ("Volume not specified for depletable material "
f"with ID={mat.id} Name={mat.name}.")
raise RuntimeError(msg)
volume[str(mat.id)] = mat.volume
self.heavy_metal += mat.fissionable_mass
@ -242,7 +247,6 @@ class OpenMCOperator(TransportOperator):
for nuc in model_nuclides:
if nuc not in nuclides:
nuclides.append(nuc)
return burnable_mats, volume, nuclides
def _load_previous_results(self):