Skip to content

BCGSTAB: do not return the initial guess as the best iterate - #2979

Open
rois1995 wants to merge 3 commits into
developfrom
fix_bcgstab_initial_guess
Open

rois1995 wants to merge 3 commits into
developfrom
fix_bcgstab_initial_guess

Conversation

@rois1995

@rois1995 rois1995 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

Since #2933, BCGSTAB returns the iterate with the smallest residual. The initial guess (zero) was also a candidate. When no step lowered the residual, the solver returned zero, so the variables got no update.

With few linear iterations this happens often. In RAE2822 SA (LINEAR_SOLVER_ITER= 3) the turbulence variable stops being updated from iteration 11, and the case converges to a wrong solution.

Now only the computed iterates are candidates.

Only the wedge regression test changes (hybrid). Its reference values are updated from the CI.

Related Work

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

🤖 Generated with Claude Code

When no BCGSTAB step lowered the residual, the initial guess (zero) was
returned, so the variables got no update. With few linear iterations
(RAE2822 SA, LINEAR_SOLVER_ITER= 3) the turbulence variable stayed frozen.
Only the computed iterates are now candidates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rois1995

Copy link
Copy Markdown
Contributor Author

@bigfooted test case: TestCases/rans/rae2822/turb_SA_RAE2822.cfg, run to rms[Rho] -11, 4 ranks.

CL CD Iterations Final rms[nu]
Before #2933 0.72478 0.013490 432 -12.2
After #2933 0.65141 0.009652 2198 -4.5
This PR 0.72478 0.013490 306 -12.9

After #2933 the turbulence linear residual (LinSolResTurb) is exactly 0 (no update) in 2188 of 2199 iterations.

Comment thread Common/src/linear_algebra/CSysSolve.cpp
rois1995 and others added 2 commits October 15, 2026 16:46
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l_guess

# Conflicts:
#	TestCases/hybrid_regression.py
@bigfooted bigfooted self-assigned this Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants