Improve cauchy convergence to handle quantities that converge to small values#1577
Conversation
for coefficients that are close to zero. Example: For the clean aircraft, the rolling moment coefficient MOMENT_X is close to zero and thus will never reach a relative cauchy convergence ->> dividing tiny numbers is not a good idea. Using absolute cauchy convergence is more robust in this case. See also short discussion on the CFD-online forum: https://www.cfd-online.com/Forums/su2/240148-cauchy-convergence-criteria-cmx-cmy-cmz.html
by multiple SU2 runs, leading to io conflicts. Thus, the name of the temporary file should not be hard-coded. This bugfix simply adds a '_tmp' to the original config file name.
ArneVoss
left a comment
There was a problem hiding this comment.
Thank you for your review and for shortening/simplifying the code! Do I need to agree to your propsal? How do I do this?
pcarruscag
left a comment
There was a problem hiding this comment.
No need to aprove, it is already applied.
As with many similar constants, having the limit at 0.1 is a bit arbitrary, but it is better than diving by zero for sure.
Because this may change the way the code behaves (some folks may have tuned the convergence criteria for some small functions) let's wait for a bigger release (7.4.0) to merge this PR, it is very local so there should not be any issues.
We will probably have 7.3.1 this month (with mostly just bug fixes), and we should have 7.4.0 not long after.
Thank you again for contributing to SU2. By the way, we have weekly developer meetings, Wednesdays at 4pm CET, you are welcome to join if you want (https://meet.jit.si/SU2_DevMeeting)
|
OK, great, thank you! |
Proposed Changes
Give a brief overview of your contribution here in a few sentences.
I believe it would be helpful if the user can choose between relative or absolute values for cauchy convergence.
Example: For the clean aircraft, the rolling moment coefficient MOMENT_X is close to zero and thus will never reach a relative cauchy convergence ->> dividing tiny numbers is not a good idea. Using absolute cauchy convergence is more robust in this case.
At the same time, I understand that a more complex input / more parameters might confuse users. An automatic switch, as propsed in this pull request, is a good compromise. The code now switches automatically to absolut cauchy convergence if the coefficient is < 0.1 to avoid the problem described above. The config file is unchanged.
See short discussion here: https://www.cfd-online.com/Forums/su2/240148-cauchy-convergence-criteria-cmx-cmy-cmz.html.
Related Work
Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.