Skip to content

Commit

Permalink
Merge pull request #1577 from ArneVoss/feature_improved_cauchy_conver…
Browse files Browse the repository at this point in the history
…gence

Improve cauchy convergence to handle quantities that converge to small values
  • Loading branch information
pcarruscag authored May 15, 2022
2 parents e129c1e + c59ed24 commit 2ce680a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SU2_CFD/src/output/COutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,12 @@ bool COutput::Convergence_Monitoring(CConfig *config, unsigned long Iteration) {

oldFunc[iField_Conv] = newFunc[iField_Conv];
newFunc[iField_Conv] = monitor;
cauchyFunc = fabs(newFunc[iField_Conv] - oldFunc[iField_Conv]) / fabs(monitor);
/*--- Automatically modify the scaling factor of relative Cauchy convergence 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. ---*/
cauchyFunc = fabs(newFunc[iField_Conv] - oldFunc[iField_Conv]) / fmax(fabs(monitor), 0.1);

cauchySerie[iField_Conv][Iteration % nCauchy_Elems] = cauchyFunc;
cauchyValue = 0.0;
Expand Down

0 comments on commit 2ce680a

Please sign in to comment.