-
Notifications
You must be signed in to change notification settings - Fork 513
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
Allow pure decay IndependentOperator #2966
Conversation
Note: the multiprocessing error only seems to happen on mac. It's working fine on my ubuntu desktop. |
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.
Hi @gridley,
Good work on this quick fix. Fact-checking you here a bit, both @paulromano and myself are the authors of the IndependentOperator
class 😅. When we wrote IndependentOperator
the intention was indeed to be able to run IndependentOperator
in a decay-only mode. Checking through the regression and unit tests, it looks like we forgot to write one for this! Whoops! If you could add a regression test to this PR for this that'd be great!
Oh sick, thank you Olek! My apologies, unsure why I thought that. It is a lovely feature to have for analyzing reactors. Will get the test in fosho. |
OK @yardasol, I found that the test I've added here was able to reproduce the original problem, and passes with the introduction of these commits. |
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 the fix @gridley!
@yardasol are you satisfied with the changes in this PR? |
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.
Hi @gridley. Sorry for the delayed response. This is great. Can we also have a case where we have a non-empty MicroXS
object that we run a depletion simulation on at zero power?
I would really prefer to not do that. The only potential problem with zero power is hitting that branch between calculating a normalizing factor and not, so I can't think of any difference that would take place with a filled MicroXS object. |
If @paulromano thinks it's fine then I'm satisfied. |
Co-authored-by: Paul Romano <[email protected]>
Description
Fixes #2963
Fixes #2968
EDIT this also fixes #2968 with the second commit it adds.
Autopep8'd the independent operator file, and adds handling for decay only steps as we have in the coupled operator. This prevents an error where the heating is calculated as zero and an error is thrown erroneously. After taking this PR, the following code can produce this nice little plot in which we track the first two decay progeny of U239. It has a half life around 1400s and we can see that behavior nicely in this plot. Notably I need to turn off multiprocessing to have this work, described below.
It's so nice to have standalone decay like this, thanks @paulromano for implementing the
IndependentOperator
🙂HOWEVER I am running into issues with multiprocessing set to true and may need some help. This error recurrently appears if depletion multiprocessing is turned on:
I guess we've missed some idiom here and haven't hit this race condition before because this case runs the depletion solver without much latency? If anyone knows where this
freeze_support
might reasonably go, I would very much appreciate your input.Checklist