-
Notifications
You must be signed in to change notification settings - Fork 104
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
CL solver improvements #246
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… chord for the moment computations
…rgence. also fixed the mgpc setup for ank turb ksp
13 tasks
Closing this PR to create a separate one with a clean history for the cl solver |
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This PR overhauls the CL solver in ADflow. Several features are added with the goal of increasing solver robustness and performance. The solver used to take about 3 times the cost of a standalone analysis for a CL solve with 1e-6 tolerance. Now it takes about 1.1-1.5 times a standalone analysis cost. We also print more information during iterations.
The features added to the solver is relatively easy to understand, so I won't explain them here. The biggest change is the ability to provide a relative convergence target, or a list of relative convergence targets that are used at each iteration. Besides checking for CL convergence, solver also checks if CFD L2 convergence is achieved. If not, we keep running more iterations. This is responsible from bulk of the performance improvements.
One major change separate from the CL solver is the modifications to the ANK solver to handle restarts better. Originally, we were setting ANK CFL to the initial
ANKCFL0
value at each restart. The default is 5.0. Based on nonlinear convergence, ANK CFL would usually end up slightly higher than this and this has been working well enough for most optimization cases.However, when we do a CL solve type iteration, there is no point to dump the last ANK CFL. The results now jump only due to the change in AoA, and the flowfield correction. As a result, we should be able to just keep whatever ANK CFL we had in the last iteration.
To do this, I am now saving the ANK_CFL in aero problems'
adflowData
attribute, which is a small object to keep some ADflow data. If the ADflow optionANKCFLReset
is set toFalse
, then we replace the ANK CFL from what it was in the last iteration. The default value ofANKCFLReset
isTrue
, and this recovers the original ANK behavior where we initialize the ANK CFL every time the solver restarts.Expected time until merged
After #231 is merged, I need to update this PR. Currently it looks like there are tons of changes but in reality this is a standalone feature. I also need to add tests.
Once I do these, it should be ready to be merged within a week after reviews.
Type of change
Testing
Checklist
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable