-
Notifications
You must be signed in to change notification settings - Fork 1.2k
PIDTransientControl update to better support recover #31845
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
base: next
Are you sure you want to change the base?
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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| [Tests] | ||
| [pid] | ||
| requirement = "The Control system shall be able to control an input parameter to make a postprocessor match a target value," | ||
| issues = '#17271' | ||
| issues = '#17271 #31842' | ||
| design = 'syntax/Controls/index.md source/controls/PIDTransientControl.md' | ||
| [basic] | ||
| type = 'CSVDiff' | ||
|
|
@@ -16,7 +16,8 @@ | |
| type = 'CSVDiff' | ||
| input = 'pid_control.i' | ||
| csvdiff = 'min_max_limits.csv' | ||
| cli_args = 'Outputs/file_base=min_max_limits Controls/integral_value/maximum_output_value=4.0 Controls/integral_value/minimum_output_value=2.0 Executioner/nl_abs_tol=1e-14 Executioner/end_time=10' | ||
| cli_args = 'Outputs/file_base=min_max_limits Controls/integral_value/maximum_output_value=4.0 Controls/integral_value/minimum_output_value=2.0 | ||
| Executioner/nl_abs_tol=1e-14 Executioner/end_time=10 Controls/integral_value/execute_on=timestep_end' | ||
|
Contributor
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. was that necessary? the regold is due to that right?
Contributor
Author
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 can undo this change and add a new test instead. Changing this test so
Contributor
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. yes let s have another test. |
||
| detail = 'allowing the Proportional Integral Derivative control to have limits for its maximum and minimum output,' | ||
| [] | ||
| [abs_max_rate_change] | ||
|
|
||
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's unusual to execute on initialSetup ?
why is this control the only one that needs to do that?
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 appear to not be many controls that work on parameters and the point of this is obviously only to restore parameter values after recovery. I think the only other control that works on parameters is
RealFunctionControl. And perhaps initialSetup should be added toRealFunctionControlbecause if it is executing on timestep_end, it will have the same problem thatPIDTransientControlhas, restore won't work properly because the controlled parameter will be reset to it's initial value instead of the last value it had before recovery.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.
Normally, restoring something that was computed on timestep_end is not a problem because the data item would be declared recoverable. But the problem in general with controllable things is that the control object has the recoverable data, not the controlled object. So controlled objects like parameters do not recover like recoverable data. I think using initialSetup is okay, but maybe there is a better way to enforce proper recovery. The problem seems to be that a developer may add another control object that works on parameters, but then not add an
initialSetupmethod to do a proper restore. I think we need a common base class for controls that work on parameters and that base class will have aninitialSetupmethod that is markedfinalthat does restore properly. But since there are so few controls that work on parameters, I don't know if that should be done nowThere 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.
we would need to track the names and types of the parameters in that base class to have the ability to set them on initialSetup. Types might be fine, there are only so many types that are controllable.
timestep_end is also not the only problem flag, it's anything that is not executed before the first recovered step occurs.
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.
even INITIAL is odd actually. You run without recover, the parameter is changed, you ran with recover, the parameter is not recovered
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.
Yes executing on INITIAL along with TIMESTEP_END would not properly recover as the code is because there is an early return if the app is recovering and the early return happens before the control actually sets the controlled objects.
This is a reason I'd like to implement something similar to my solution, that is using
initialSetup()which one would expect to always be called regardless of the execution flagsThere 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.
even without timestep_end.
I don't think we can impose in C++ that initialSetup is ALWAYS called by the derived class, unless we override final it and offer an initialSetupDerived() virtual routine for the derived classes