Skip to content

[WIP] Pressure Based Solver#2812

Draft
thijsaalbers wants to merge 2 commits intodevelopfrom
feature_pressure_based_2026
Draft

[WIP] Pressure Based Solver#2812
thijsaalbers wants to merge 2 commits intodevelopfrom
feature_pressure_based_2026

Conversation

@thijsaalbers
Copy link
Copy Markdown

Proposed Changes

The current work aims at getting a working version of the pressure based incompressible flow solver into the development branch.

Finished:

  • Basic configuration options

TODO:

  • Implement the entire solver
  • Identify major changes between latest SU2 version (8.5.0) and the previous attempts (v6/v7) which could cause implementation issues
  • Resolve issues the previous attempts still suffered from (see related work)
  • Validation and Verification
  • Documentation, Tutorials etc.

Related Work

This work is based on earlier attempts by Nitish Anand (2024) and Akshay Koodly (2021), see feature branches feature_PBFlow_V8 and feature_Pressure_based respectively. Also see PR #2210

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.

@thijsaalbers thijsaalbers self-assigned this May 7, 2026
Copy link
Copy Markdown
Contributor

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please think about ways of reusing the numerics used by the scalar solvers, not duplicating code is part of the criteria for merging PRs.

Comment on lines +164 to +179
Diff_U = new su2double [nVar];
Velocity_i = new su2double [nDim];
Velocity_j = new su2double [nDim];
Velocity_upw = new su2double [nDim];
MeanVelocity = new su2double [nDim];
Flux = new su2double [nDim];
ProjFlux_i = new su2double [nVar];
ProjFlux_j = new su2double [nVar];
Jacobian_i = new su2double* [nVar];
Jacobian_j = new su2double* [nVar];
Jacobian_upw = new su2double* [nVar];

for (iVar = 0; iVar < nVar; iVar++) {
Jacobian_i[iVar] = new su2double [nVar];
Jacobian_j[iVar] = new su2double [nVar];
Jacobian_upw[iVar] = new su2double [nVar];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please look at more recent examples of introducing new numerics classes or cleaning old ones, this is not the way for new code.

Comment on lines +107 to +113
Face_Flux = 0.0;
for (iDim = 0; iDim < nDim; iDim++) {
Velocity_i[iDim] = V_i[iDim+1];
Velocity_j[iDim] = V_j[iDim+1];
MeanVelocity[iDim] = 0.5*(Velocity_i[iDim] + Velocity_j[iDim]);
Face_Flux += MeanDensity*MeanVelocity[iDim]*Normal[iDim];
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not a correct implementation of Rhie-Chow momentum interpolation.
Please consider attending a developer meeting to explain your plans with this PR, the way I see it going, it's not going to make the cut to merge into develop.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for your feedback. I will let you know when it is ready for review.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants