Skip to content

Conversation

@shbhmexe
Copy link

Proposed Changes

This PR fixes initialization inconsistencies, numerical robustness issues, and a critical copy-paste logic bug across multiple solver files:

CTransLMSolver.cpp:

  • Added missing EdgeFluxesDiff.Initialize() call in ReducerStrategy block for consistency with CTurbSSTSolver and CTurbSASolver
  • Added zero protection for VelocityMag to prevent division by zero at stagnation points
  • Fixed inconsistent arrow operator spacing
    CTurbSSTSolver.cpp:
  • Added zero protection for wall_dist division using max(wall_dist, EPS)
  • Added zero protection for FrictionVelocity using max(..., 1e-10)
    CSpeciesSolver.cpp (Critical Bug Fix):
  • Fixed copy-paste bug in multigrid loop where MESH_0 was incorrectly used instead of iMesh, causing turbulence and species solvers to post-process on the wrong mesh level during multigrid iterations

Related Work

  • No related issues or PRs
  • Found during code review of solver files for GSoC contribution

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.

- 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 <[email protected]>
Comment on lines 87 to 90
if (ReducerStrategy) {
EdgeFluxes.Initialize(geometry->GetnEdge(), geometry->GetnEdge(), nVar, nullptr);
EdgeFluxesDiff.Initialize(geometry->GetnEdge(), geometry->GetnEdge(), nVar, nullptr);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently do not have MG active for scalars, and there is no mesh dependent stuff in PostProcessing so this does not do anything.

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.

3 participants