-
Notifications
You must be signed in to change notification settings - Fork 93
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
pu frac storage update #1819
pu frac storage update #1819
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
from armi import runLog | ||
from armi.nucDirectory import nuclideBases | ||
from armi.reactor.flags import TypeSpec | ||
from armi.reactor import blocks | ||
from armi.utils import densityTools | ||
from armi.utils.units import getTk, getTc | ||
|
||
|
@@ -151,6 +152,16 @@ def getChildren( | |
"""Return empty list, representing that materials have no children.""" | ||
return [] | ||
|
||
def getAssociatedBlock(self): | ||
"""Return the grandparent (typically block) associated with this material""" | ||
# would be nice to use composite.getAncestor, but material is not a composite | ||
component = self.parent | ||
return ( | ||
None | ||
if component is None | ||
else component.getAncestor(lambda x: isinstance(x, blocks.Block)) | ||
) | ||
|
||
def getChildrenWithFlags(self, typeSpec: TypeSpec, exactMatch=True): | ||
"""Return empty list, representing that this object has no children.""" | ||
return [] | ||
|
@@ -845,9 +856,36 @@ class FuelMaterial(Material): | |
class1_wt_frac = None | ||
class1_custom_isotopics = None | ||
class2_custom_isotopics = None | ||
puFrac = 0.0 | ||
uFrac = 0.0 | ||
zrFrac = 0.0 | ||
puFracDefault = 0.0 | ||
uFracDefault = 0.0 | ||
zrFracDefault = 0.0 | ||
Comment on lines
-850
to
+861
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to be clear whether this is weight fraction or atomic fraction. Prefer |
||
|
||
def __init__(self): | ||
self._puFrac = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will still need attributes for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. code works as is (duplicate will continue to work), so we dont need them immediately without clear expectations on behavior of u and zr frac with depletion |
||
Material._init_() | ||
|
||
@property | ||
def puFrac(self): | ||
"""Get the Pu Frac.""" | ||
# ideally the parameters would be stored on component, not Block (parent, not grandparent) | ||
myBlock = self.getAssociatedBlock() | ||
if myBlock is not None: | ||
return myBlock.p.puFrac | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe |
||
runLog.warning( | ||
"{self} has no block attached, deferring to internally stored Pu Frac. " | ||
"Storing properties on the material objected will be deprecated in the near future.", | ||
single=true, | ||
) | ||
return self._puFrac | ||
|
||
@puFrac.setter | ||
def puFrac(self, puFrac): | ||
runLog.warning( | ||
"Materials should not store state, so this component will look at its (grand)parent for Pu fraction unless it us detached. " | ||
"Storing properties on the material objected will be deprecated in the near future.", | ||
single=true, | ||
) | ||
self._puFrac = puFrac | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we set the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i haven't gotten clear expecations for behavior on u frac or zr frac changing with depletion |
||
|
||
def applyInputParams( | ||
self, | ||
|
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.
Adding plutonium, uranium, and zirconium to a generic
FuelMaterial
seems odd. We should discuss.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.
Probably outside of the scope of this change, just a comment since this existed previously. Similar comment for @john-science in the
duplicate
method.