-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed volume allocation in openmc.deplete.Operator._differentiate_burnable_mats #1392
Fixed volume allocation in openmc.deplete.Operator._differentiate_burnable_mats #1392
Conversation
Changed burnable material volume to volume of material instance
@awgolas Yes, originally I thought the users specify the volume as the If we want to change this logic -- assume the users are specifying the total volume, I suggest changing the differentiated materials themselves when they are cloned (L312). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out. I understand the confusion here, as the documentation isn't clear how the volumes are treated for the cloned materials. Both approaches I think are equally valid, e.g.
- User-specified volume is for a single instance. Cloned materials copy the volume as well
- User-specified volume is the total volume this material occupies. Cloned materials take an equal share of the volume (as you proposed)
I'm not convinced that either is worse, but our documentation should indicate what method we choose.
If you want to proceed with this PR, please make sure the test suite passes. The issue appears to be the materials don't know how many instances when you scale the volumes
@liangjg When I've created geometries with fuel cells in which the volume of the fuel cell region is not constant, I've used the same material id in each case. If I were to run a depletion calculation in which the material volume specified is equal to the total volume of the material, does OpenMC perform the nuclide accumulation calculations as if each cell volume is equal to the total volume of the material? @drewejohnson |
@awgolas I agree it is more self-consistent to assume the input volume is always the total volume, no matter whether the differetiation is on or off. --- a/openmc/deplete/operator.py
+++ b/openmc/deplete/operator.py
@@ -309,7 +309,12 @@ class Operator(TransportOperator):
# Assign distribmats to cells
for cell in self.geometry.get_all_material_cells().values():
if cell.fill in distribmats and cell.num_instances > 1:
- cell.fill = [cell.fill.clone()
+ 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)] |
@liangjg has made excellent points and I agree with their proposed implementation. If you want to adjust the PR accordingly, please do so. Otherwise we can raise this as a separate issue / PR later |
Thank you for this! I will put up a PR shortly with some changes to the documentation 👍 |
In PR openmc-dev#1392, it was revealed that the distribution of material volumes with ``diff_burnable_mats`` was not clear. In that PR, the Operator now divides the volume of the shared material equally across all identical and newly created instances. This commit adds some clarifying language into the Operator docstring and depletion users guide on the handling of volumes across repeated materials.
In PR openmc-dev#1392, it was revealed that the distribution of material volumes with ``diff_burnable_mats`` was not clear. In that PR, the Operator now divides the volume of the shared material equally across all identical and newly created instances. This commit adds some clarifying language into the Operator docstring and depletion users guide on the handling of volumes across repeated materials.
In PR openmc-dev#1392, it was revealed that the distribution of material volumes with ``diff_burnable_mats`` was not clear. In that PR, the Operator now divides the volume of the shared material equally across all identical and newly created instances. This commit adds some clarifying language into the Operator docstring and depletion users guide on the handling of volumes across repeated materials.
When the variable
diff_burnable_mats=True
was specified when callingopenmc.deplete.Operator()
, the volume of each material instance was specified as the same as the non-differentiated burnable materials, e.g, if the given burnable material had 3 instances:The
diff_burnable_mats=True
would produce differentiated burnable materials:This changed the material instance creation such that the sum of the differentiated material volumes is the same as the original undifferentiated material volume.