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
Fix minor conservation issue + new diagnostic summary for conservation #1338
base: main
Are you sure you want to change the base?
Fix minor conservation issue + new diagnostic summary for conservation #1338
Conversation
- added actual aclp duct to illustrate and test for non-conservation
The mass conservation tables look like the following: massConservationReportIs assembly-wide and shows the pre- and post-axial expansion mass values for the unique materials and components.
detailedMassConservationReportBreaks downs the massConservationReport by component and can be useful to see how/if mass is being conserved in the assembly post-axial expansion.
|
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 left some comments throughout the code, and have one more here:
In the PR description you say
Downstream testing illustrated some minor conservation issues with non-axial expansion target components (e.g., clad, wire, or duct within a fuel block) during thermal expansion. This PR addresses this
It is unclear to me exactly what has changed to fix the problem that you were seeing (partly because I don't know the exact problem you were seeing).
Is the fix related to the change of c.height = growFrac * blockHeight
to c.height = growFrac * prevCompHeight
?
self.massConservationReport = None | ||
self.detailedMassConservationReport = None |
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 doesn't appear that there is any need to store these items on self
, since they're only really used in one method of this class.
I think that trashing these dicts after each call to axiallyExpandAssembly()
would be both safe and more memory efficient.
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 put them on self
in 29c345e simply to accommodate testing. I could use the mock logs to rebuild them if you'd prefer... But that seemed clunky to me and the easier solution was just to make them class variables.
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.
That said, if we kept them as class instances, we could empty them after they are populated and used. Maybe a compromise of sorts?
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.
Ok, so this should be resolved with 027db32. All of the logging now lives in its own class and only gets populated if the runLog
verbosity is either extra
or debug
. The dicts that get populated will go out of scope with the rest of the expansion changer and should follow suit with the expansion data, etc.
@keckler, yes, exactly. |
Just a note, I did confirm that the summary tables are identical post 027db32. |
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 that change, I think it streamlines this a lot!
self.massConservationReport["(prev) mass"], | ||
) | ||
] | ||
self.massConservationReport["round(post - prev, 9)"] = diff |
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.
Why is this "self.massConservationReport"? Isn't this just a local variable? Is it used outside this method?
It appears to be a new variable that is local, but is initialized in the constructor.
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 put it on self
to accommodate some unit testing.
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.
prefer returning it if its not actually needing to be an attribute.
we would have WAY more attributes if we did this every time we wanted to test.
This is breaking downstream testing... Converting to draft while I debug. |
What is the change?
Downstream testing illustrated some minor conservation issues with non-axial expansion target components (e.g., clad, wire, or duct within a fuel block) during thermal expansion. This PR addresses this and also introduces two things:
Some additional details on item 2. There are two tables that get printed.
massConservationReport
: prints the pre- and post-axial expansion assembly mass (as well as the difference) by material and by component if the difference if greater than 1e-9 grams. This 1e-9 g threshold was chosen semi-arbitrarily as the differences between pre- and post-axial expansion were found in downstream testing to range from 0.0 to on the order of 1e-10 g.detailedMassConservationReport
: prints the following component-level information for an assembly: grow fraction, bottom, top, height, and mass for pre- and post-axial expansion. The post-pre component mass is also printed. This summary table gets printed only for debug runs.Closes #1048.
Why is the change being made?
The axial expansion changer should not lose mass post thermal expansion. This PR fixes that. There are some cases where this is inevitable and these should be documented in the ARMI docs (in a subsequent PR).
Checklist
doc/release/0.X.rst
) are up-to-date with any important changes.doc
folder.setup.py
.