-
Notifications
You must be signed in to change notification settings - Fork 514
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
Differentiate materials in DAGMC universes #3056
Conversation
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.
Not an easy task @bam241 and I think I see where you're going with it. My main concern with the current implementation is the amount of DAGMC-specific code in higher-level sections of the Python API. I think there's some refactoring we can do to avoid special logic in the Model
and (maybe) Geometry
classes.
I'd say this is optional for this PR, but now that we have additional DAGMC*
classes appearing I wonder if it would be best to move them all into a dagmc.py
file in the Python API. I thought doing this in the C++ code was nice as DAGMC constructs have their own special logic to some degree. It would reduce the size of our cell.py
and universe.py
files as well. I can tackle that afte we finish this PR though. Making an issue to track...
openmc/dagmc.py
Outdated
""" | ||
for cell in self.cells.values(): | ||
if isinstance(cell.fill, Iterable): | ||
self.add_material_override(cell, [mat for mat in cell.fill if mat]) |
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.
Won't this alter the intended cell fills if some of the entries in the cell.fill
are skipped?
…aintain current behavior
… using an invalid cell ID in overrides
Co-authored-by: Baptiste Mouginot <[email protected]>
…e a new method for material replacement. Other changes: * remove unused DAGMCUniverse.dagmc_cells attribute * update documentation on material_overrides attribute * alter XML layout so potentially long strings of material IDs are text of an element rather than attributes * update XML documentation to reflect structure changes
… with cell, override with cell ID, and replacement with mat name
…essaging corresponding to material overrides
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.
I think this is in a good place @bam241! Thank you for all your effort on this!
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.
Just finished making some updates throughout. Thanks for your work on this @bam241!
Description
This allows to differentiate materials in DAGMC universe when using the same DAGMC geometry to fill different CG cells
This provides a mechanism to overload material assignment embedded in the DAGMC geometry by providing a dict
{ref_mat_name:[mat_instances]}
This allows enrich the
Model.differentiate_depletable_material()
method from the Python API, to allows automatic differentiation of the depletable materials of a DAGMC geometry inserted multiple times.Checklist
this should address #2923
This work has been sponsored by NAAREA.