-
Notifications
You must be signed in to change notification settings - Fork 849
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
Restart Features for some python scripts #964
Conversation
…_restart Merge develope into feature_restart
…_restart pull develop into feature_restart, maybe this fixes bug of not found sensitivity
Concerning this error (I am glad you brought it up): Error in "virtual void CPhysicalGeometry::SetSensitivity(CConfig*)":Sensitivity x not found in file. Did you solve this issue? I think that the problem is related to specifying VOLUME_OUTPUT fields different than the default (or at least I have had one other person report this to me). When you put in custom fields, the sensitivities are not also added by automatically. I think that we should enforce that the sensitivities are always written to the adjoint restart files, like we do with the coords and conservatives for the primal. |
Hi @economon
yes I noticed that adding sensitivity in the output solves the issue. |
I have a question regarding the failed test case: Edit: Fixed this issue without touching the test case. I got the point of this test case wrong :)... |
That option has a default value, set somewhere in CConfig.cpp. |
…o heavy - removed
…to feature_restart
I've added this in the last commit. :) |
I'm wondering, if a test case for unsteady restart shape optimization would be computationally too expensive for the test system. Best |
If you add it to the tutorials test suite... and it runs in < 5min, or it covers a few of the commonly untested options, I'd say go for it. Out of curiosity, do you use the windowing feature to discard a few initial time steps? |
Ok!
No not directly. The idea and motivation was, that I didn't want to wait until the transient phase of the flow field is computed. So I use a precomputed restart file, which serves as a better "inital guess" than freestream values. Then, so the idea, the transient phase is skipped for the first design, and it is at least shortened for other designs. This way, we safe CPU time. |
…to feature_restart
…to feature_restart
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 seems the test cases still runs in reasonable time so LGTM, give it a few days before merging in case the optimization people have something to say (I have no skin in this game as I don't use it).
@@ -62,6 +62,11 @@ CAdjElasticityOutput::CAdjElasticityOutput(CConfig *config, unsigned short nDim) | |||
nRequestedVolumeFields = requestedVolumeFields.size(); | |||
} | |||
|
|||
if (find(requestedVolumeFields.begin(), requestedVolumeFields.end(), string("SENSITIVITY")) == requestedVolumeFields.end()) { |
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 this way of what happens in the output stays in the output is clearer, even if it requires duplicating a bit of code across the different adjoint output classes.
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, thanks for your feedback on this :)
Proposed Changes
Allows direct flow computations in shape_optimization.py to run from given restart solution for unsteady optimization.
All you have to do is to copy your restart files e.g.
restart_flow_00008.dat
andrestart_flow_00009.dat
in the directory of your.cfg
and.su2
(mesh) file and set the corresponding options:RESTART_SOL=YES
RESTART_ITER=10
(in this example).The
shape_optimization.py
script will use this direct restart file for each design. This means, the direct computation will be started from iteration 10 and will run up to the final iteration. The adjoint will run from the final iteration, but stop at the iteration of the restart file.direct_differentiation.py
now also accepts restart files in the same manner.SENSITIVITY
is now a default field inVOLUME_OUTPUT
, if the computation mode isDISCRETE_ADJOINT
.Related Work
Issue #909
PR Checklist