Skip to content
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

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions armi/materials/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 []
Expand Down Expand Up @@ -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 +859 to +861
Copy link
Member

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.

Copy link
Member

@jakehader jakehader Aug 13, 2024

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.

Comment on lines -850 to +861
Copy link
Contributor

Choose a reason for hiding this comment

The 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 puWtFracDefault. The puFrac parameter in ARMI is not weight fraction of total mass, but instead weight fraction of heavy metal.


def __init__(self):
self._puFrac = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will still need attributes for uFrac and zrFrac -- see duplicate method, so we can have setters and getters for accessing to keep self._uFrac, self._zrFrac, and self._puFrac private.

Copy link
Member Author

@onufer onufer Aug 13, 2024

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe myBlock.getComponent[Flags.FUEL].getMassFrac("PU")?

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we set the puFrac directly, should this assume a reduction in uFrac so that the total fraction is 1.0? I wonder if a 1.0 check should be added.

Copy link
Member Author

Choose a reason for hiding this comment

The 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,
Expand Down
Loading