Skip to content

Commit 6207f60

Browse files
committed
fabs around solution in ComputeUnderRelaxation()
1 parent 2a5a37c commit 6207f60

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

SU2_CFD/include/solvers/CFVMFlowSolverBase.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ void CFVMFlowSolverBase<V, R>::ComputeUnderRelaxationFactor(CSolver** solver_con
597597

598598
if ((iVar == 0) || (iVar == nVar - 1)) {
599599
const unsigned long index = iPoint * nVar + iVar;
600-
su2double ratio = fabs(LinSysSol[index]) / (nodes->GetSolution(iPoint, iVar) + EPS);
600+
su2double ratio = fabs(LinSysSol[index]) / (fabs(nodes->GetSolution(iPoint, iVar)) + EPS);
601601
if (ratio > allowableRatio) {
602602
localUnderRelaxation = min(allowableRatio / ratio, localUnderRelaxation);
603603
}

SU2_CFD/src/solvers/CTurbSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ void CTurbSolver::ComputeUnderRelaxationFactor(CSolver **solver_container, const
674674
turbulence variables can change over a nonlinear iteration. */
675675

676676
const unsigned long index = iPoint * nVar + iVar;
677-
su2double ratio = fabs(LinSysSol[index]) / (nodes->GetSolution(iPoint, iVar) + EPS);
677+
su2double ratio = fabs(LinSysSol[index]) / (fabs(nodes->GetSolution(iPoint, iVar)) + EPS);
678678
if (ratio > allowableRatio) {
679679
localUnderRelaxation = min(allowableRatio / ratio, localUnderRelaxation);
680680
}

0 commit comments

Comments
 (0)