Fix solver initialization and multigrid logic bugs#2662
Merged
pcarruscag merged 8 commits intosu2code:developfrom Dec 28, 2025
Merged
Fix solver initialization and multigrid logic bugs#2662pcarruscag merged 8 commits intosu2code:developfrom
pcarruscag merged 8 commits intosu2code:developfrom
Conversation
- CTransLMSolver: Add EdgeFluxesDiff init, VelocityMag protection - CTurbSSTSolver: Add wall_dist and FrictionVelocity protection - CSpeciesSolver: Fix multigrid loop using wrong mesh level Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
pcarruscag
reviewed
Dec 27, 2025
Comment on lines
+87
to
+90
| if (ReducerStrategy) { | ||
| EdgeFluxes.Initialize(geometry->GetnEdge(), geometry->GetnEdge(), nVar, nullptr); | ||
| EdgeFluxesDiff.Initialize(geometry->GetnEdge(), geometry->GetnEdge(), nVar, nullptr); | ||
| } |
Member
There was a problem hiding this comment.
Not necessary, only turbulence solvers use the EdgeFluxesDiff variable at the moment.
|
|
||
| if (config->GetKind_Turb_Model() != TURB_MODEL::NONE) | ||
| solver[iMesh][TURB_SOL]->Postprocessing(geometry[MESH_0], solver[MESH_0], config, MESH_0); | ||
| solver[iMesh][TURB_SOL]->Postprocessing(geometry[iMesh], solver[iMesh], config, iMesh); |
Contributor
There was a problem hiding this comment.
We currently do not have MG active for scalars, and there is no mesh dependent stuff in PostProcessing so this does not do anything.
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
…thub.com/shbhmexe/SU2 into fix/solver-initialization-and-logic-bugs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
This PR fixes initialization inconsistencies, numerical robustness issues, and a critical copy-paste logic bug across multiple solver files:
CTransLMSolver.cpp:
EdgeFluxesDiff.Initialize()call in ReducerStrategy block for consistency with CTurbSSTSolver and CTurbSASolverVelocityMagto prevent division by zero at stagnation pointsCTurbSSTSolver.cpp:
wall_distdivision usingmax(wall_dist, EPS)FrictionVelocityusingmax(..., 1e-10)CSpeciesSolver.cpp (Critical Bug Fix):
MESH_0was incorrectly used instead ofiMesh, causing turbulence and species solvers to post-process on the wrong mesh level during multigrid iterationsRelated Work
PR Checklist
pre-commit run --allto format old commits.