Skip to content

[WIP] Pressure Based Solver#2812

Draft
thijsaalbers wants to merge 2 commits into
developfrom
feature_pressure_based_2026
Draft

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

Conversation

@thijsaalbers
Copy link
Copy Markdown

@thijsaalbers thijsaalbers commented May 7, 2026

Proposed Changes

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

Investigation

  • Identify major changes between latest SU2 version (8.5.0) and the previous attempts (v6/v7) which could cause implementation issues
  • Resolve issues present in the previous attempts (see Related Work)

Implementation (in order of priority)

  • Implement general structure i.e. driver/iterator/solver
  • Adapt the old numerics / solver details to modern SU2 coding standards.

Validation and Maintenance

  • Validation and Verification
  • Documentation, Tutorials etc.

Current Issues

  • Numerics are currently taken directly from previous attempts. This means they are not yet up to date with the current implementation. Work on this should involve existing scalar flux to avoid duplication of upwinding. Central flux could be moved to centered.*pp for consistency with the current centered schemes for density based methods.
  • Current flux in numerics is only upwinding and does not consider Rhie-Chow interpolation. The location of the implementation of Rhie-Chow in previous attempts is (currently) not yet investigated, it should be investigated if the Rhie-Chow interpolation can be moved to the flux computation for better separation of concerns.

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.

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.

Ok. Keep in mind that we prefer many small PRs over one big one. This way, lessons learned from one review carry over to the next small PR.
Very large PRs tend to take a long time to review because the authors tend to run out of time rather than finish the work.
https://su2code.github.io/docs_v7/Code-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