Skip to content

Commit 2a5a37c

Browse files
committed
Fixed sign error for turbulent UR, and removed coupling of UR between solvers
1 parent a2da75e commit 2a5a37c

2 files changed

Lines changed: 6 additions & 20 deletions

File tree

SU2_CFD/include/solvers/CFVMFlowSolverBase.inl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,13 +604,6 @@ void CFVMFlowSolverBase<V, R>::ComputeUnderRelaxationFactor(CSolver** solver_con
604604
}
605605
}
606606

607-
/* In case of turbulence, take the min of the under-relaxation factor
608-
between the mean flow and the turb model. */
609-
610-
if (config->GetKind_Turb_Model() != NONE)
611-
localUnderRelaxation =
612-
min(localUnderRelaxation, solver_container[TURB_SOL]->GetNodes()->GetUnderRelaxation(iPoint));
613-
614607
/* Threshold the relaxation factor in the event that there is
615608
a very small value. This helps avoid catastrophic crashes due
616609
to non-realizable states by canceling the update. */

SU2_CFD/src/solvers/CTurbSolver.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)