-
Notifications
You must be signed in to change notification settings - Fork 91
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
Fixing the affect of custom isotopics on material density #1822
Conversation
@jakehader Just a reminder of the ARMI PR policy: armi/doc/developer/tooling.rst Lines 45 to 49 in bd0b43a
We are all extremely busy, and if a PR gets opened before it is ready I will get an email:
I love the help, and the interesting in fixing the feature. But in the future, please wait until the feature is ready for final review before opening a PR. |
Thanks for the reminder @john-science - I put the PR here but forgot to make it a draft. This was just intended to provide some ideas for how to resolve the ticket and to put something out there to be stress tested by @keckler and others. There are failing unit tests because I changed the construct arguments so that needs to be resolved still (probably a poor design to require case settings to build a component). Also, we will need to add more unit tests around custom Isotopics (same comment on the ticket). |
I ran some tests on my FFTF model to see if this branch works. A couple points:
So it seems like this change is half working. Somehow the initialized model is getting the densities very incorrect, though. |
Was this fixed elsewhere @keckler? |
Nope, still broken |
…ad of the whole cs
@@ -394,6 +394,7 @@ def apply(self, material): | |||
material.massFrac = dict(self.massFracs) | |||
if self.density is not None: | |||
if not isinstance(material, materials.Custom): | |||
# TODO I think this warning should go away? |
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 would like a second set of eyes on the runLog statement below. I am 99% sure that that print should be removed completely, because we are now allowing for non-Custom
materials to have density specified.
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.
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.
The runlog appears to still be correct and applicable, as the density is not applied to material
in this function if material
is not a custom material per line 396. I don't recognize anywhere in the changes that the density of a library material is being set, am I missing it?
Related: I believe this was intended to explicitly call out that setting a custom density for a library material using custom isotopics is not allowed. Presumably a library material would have known, vetted properties that should not be overwritten by users in a passive way. From recollection, using custom isotopics on a library material allows the density to be set on a component specifically using the custom isotopics, but using custom isotopics to set the density for the reference material is no bueno.
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 you're right.
The thing that keeps tripping me up is the last sentence: "Only custom materials may have a density specified."
I feel like that can be reworded to make the intention more clear. Right now I read that and think that its saying "the density that you specified is doing nothing".
I'll try to rejigger a bit.
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.
Yeah, I vaguely remember struggling how to phrase this without being very wordy. Some ideas:
"Only custom materials may have a density specified using custom isotopics, though components using custom materials may have their densities changed."
"The reference density of materials in the materials library will not be changed by custom isotopics, but components with custom isotopics using a library material will use the density implied by the custom isotopics."
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.
Alright, I updated the wording. Thanks for helping here.
@john-science I believe that this is ready for your eyes. In addition to the updated unit tests, I did quite a bit of offline testing with my FFTF model to convince myself that this is working properly. |
Random thought: I think this PR is big enough for a release note in |
@@ -186,7 +186,7 @@ def shape(self, shape): | |||
mergeWith = yamlize.Attribute(type=str, default=None) | |||
area = yamlize.Attribute(type=float, default=None) | |||
|
|||
def construct(self, blueprint, matMods): | |||
def construct(self, blueprint, matMods, inputHeightsConsideredHot): |
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.
Okay, so the variable name here is strange. Because "input heights" makes sense if this Component is part of an Assembly
in some way, sure.
But Components
are a very general idea of the leaf of the data model. They don't have to be in a pin-type reactor.
What do you think?
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.
Also, maybe this new parameter should have a default value? What do you think?
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.
This parameter and its name are directly copied from the case setting of the same name. I tried to reflect that intention in the docstring, but maybe I could be more clear there.
When Jake put up the draft PR, he was originally passing an entire case settings object down to this level. I did away with that because I find it frustrating when I have to whip up an entire cs
just for a single boolean.
So I made the name for this parameter exactly the same as the case setting whose value should be passed down here. I thought that made things simpler, but if you think it'd be more clear either (1) with a different name, or (2) if we passed the entire cs
, then I am open to those options.
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.
With respect to a default value...
I'm not sure how I feel there.
On the one hand, we could potentially make the default be the same as the default for the inputHeightsConsideredHot
case setting (True
). On the other hand, I really don't like that because the default on that case setting is the opposite of our typical workflow at this point in time (i.e. having axial expansion turned on).
I think my ideal solution would be if there were a way to not have to pass the value via method calls. But the only way I could conceive to do that is to store a cs
on the ComponentBlueprint
, and that is something I really don't want to do.
Maybe you see a clean way to get around all 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.
It is definitely better to pass one value instead of the entire settings object. For sure. Nice.
I suppose "input dimensions considered hot" would have been a more accurate name for that setting. But the people who created it were definitely thinking of pin-type reactors.
Co-authored-by: John Stilley <[email protected]>
What is the change?
This fixes some problems that were found with #1745. Those issues are described in #1818 .
Why is the change being made?
We are fixing a bug that made it into the codebase.
Checklist
doc
folder.pyproject.toml
.