@@ -660,9 +660,8 @@ void CTurbSolver::ComputeUnderRelaxationFactor(CSolver **solver_container, const
660660 /* Loop over the solution update given by relaxing the linear
661661 system for this nonlinear iteration. */
662662
663- su2double localUnderRelaxation = 1.00 ;
664- const su2double allowableDecrease = -0.99 ;
665- const su2double allowableIncrease = 0.99 ;
663+ su2double localUnderRelaxation = 1.00 ;
664+ const su2double allowableRatio = 0.99 ;
666665
667666 SU2_OMP_FOR_STAT (omp_chunk_size)
668667 for (unsigned long iPoint = 0 ; iPoint < nPointDomain; iPoint++) {
@@ -674,21 +673,15 @@ void CTurbSolver::ComputeUnderRelaxationFactor(CSolver **solver_container, const
674673 /* We impose a limit on the maximum percentage that the
675674 turbulence variables can change over a nonlinear iteration. */
676675
677- const unsigned long index = iPoint*nVar + iVar;
678- su2double ratio = LinSysSol[index]/(nodes->GetSolution (iPoint, iVar)+EPS);
679- if (ratio > allowableIncrease) {
680- localUnderRelaxation = min (allowableIncrease/ratio, localUnderRelaxation);
681- } else if (ratio < allowableDecrease) {
682- localUnderRelaxation = min (fabs (allowableDecrease)/ratio, localUnderRelaxation);
676+ const unsigned long index = iPoint * nVar + iVar;
677+ su2double ratio = fabs (LinSysSol[index]) / (nodes->GetSolution (iPoint, iVar) + EPS);
678+ if (ratio > allowableRatio) {
679+ localUnderRelaxation = min (allowableRatio / ratio, localUnderRelaxation);
683680 }
684681
685682 }
686683 }
687684
688- /* Choose the minimum factor between mean flow and turbulence. */
689-
690- localUnderRelaxation = min (localUnderRelaxation, solver_container[FLOW_SOL]->GetNodes ()->GetUnderRelaxation (iPoint));
691-
692685 /* Threshold the relaxation factor in the event that there is
693686 a very small value. This helps avoid catastrophic crashes due
694687 to non-realizable states by canceling the update. */
0 commit comments