Skip to content

[WIP] Pressure Based Solver#2812

Draft
thijsaalbers wants to merge 27 commits into
developfrom
feature_pressure_based_2026
Draft

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

Conversation

@thijsaalbers

@thijsaalbers thijsaalbers commented May 7, 2026

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.

Progress:

  • Pressure-based solver added as alternative to density based solver for the incompressible equations.
  • The pressure-based solver has been tested for constant density cases only for basic Navier-Stokes and Euler flow.
  • The pressure-based solver is implemented based on a pseudo time-stepping approach to remain consistent with the other solvers in SU2, as described in the thesis of Aksay. The pressure-based solver is currently set to the SIMPLE algorithm by default, with options for SIMPLEC and PISO available.
  • The Poisson solver is a major bottleneck in the computation speed. To account for this, an option was added to use a different linear solver and preconditioner for the poisson solver.
  • The current architecture is split between the CPBIncEulerSolver which solves the momentum equations only, and the CPoissonSolver which solves the pressure correction equation. The momentum solver is thus only responsible for the momentum solution variables and stores pressure only as a primitive and thus not as solution. The Poisson solver is subsequently initialized using information from CPBIncEulerSolver, after which the Poisson equation is solved and corrections to the momentum and pressure are computed, these are then communicated back to the CPBIncEulerSolver.

Current performance issues:

  • Time step size is very limited due to pressure-velocity coupling. (This issue is carried over from old pressure based versions). Attempts have been made with multiple PISO corrections but to no avail

  • Convergence issues with RANS

    • At high reynolds numbers the solver becomes difficult to resolve and needs a very large number of linear solver iterations for the poisson equation. Possible fixes include adding multigrid support or a DIC preconditioner (less efficient). Multigrid support is tricky as SU2 currently only considers multigrid for the main (flow) solver and not for auxiliary solvers.
    • SA and SST work but diverge under larger Reynolds numbers, cause has not yet been identified
  • Periodic boundary conditions have not been implemented/tested at all as of yet.

  • Any code related to adjoints has not been considered at all either.

Current code issues:

  • Failing regression tests due to a different value for the RMS[W] for incompressible density based simulations due to unknown reason.
  • when running OMP with more than 1 thread the momentum solve gives different (very wrong) results, there is maybe an issue with race conditions somewhere?
  • The constructor, nonDimensionalization and setReferenceValues functions of the CPBIncEulerSolver are largely a direct duplicate of CIncEulerSolver except for the nVar=... definition in the constructor and different fluid models which are not yet supported by the PB solver.
  • The CPBIncNSSolver is almost entirely duplicate to CIncNSSolver. They cannot be unified trivially as the underlying Euler solvers which they derive from are very different.

TODO list

  • Fix issues mentioned above
  • 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

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

Copy link
Copy Markdown
Contributor

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.

Comment thread SU2_CFD/src/numerics/poisson.cpp Outdated
Comment thread SU2_CFD/src/numerics/pbflow.cpp Outdated
Comment thread SU2_CFD/src/numerics/pbflow.cpp Outdated
Implements the full class structure required for the pressure-based solver in a minimal form.
The code compiles and runs but does not yet contain any numerical/physical implementation.

Future work will focus on implementing solver logic.

Note: In the previous attempts (see related work) there is noticeable code duplication between CIncEuler and CPBIncEuler.
The final architecture may be revised depending on how the implementation of CPBIncEuler evolves.
Comment thread SU2_CFD/src/solvers/CPBIncEulerSolver.cpp Fixed
Comment thread SU2_CFD/src/drivers/CDriver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CPBIncEulerSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CPBIncEulerSolver.cpp Fixed
Comment thread SU2_CFD/src/drivers/CDriver.cpp Fixed
Comment thread SU2_CFD/src/drivers/CDriver.cpp Fixed
Comment thread SU2_CFD/include/variables/CPoissonVariable.hpp Fixed
Comment thread SU2_CFD/include/solvers/CPoissonSolver.hpp Fixed
Comment thread SU2_CFD/include/solvers/CPoissonSolver.hpp Fixed
Comment thread SU2_CFD/include/solvers/CPBIncEulerSolver.hpp Fixed
Centered residual is not yet implemented as the old code did not have a working version. Upwind residual is functional but requires cleanup and move to more appropiate file.
Variables are a work in progress and still include some commented out code related to energy and pressure
@thijsaalbers thijsaalbers reopened this Jul 3, 2026
@thijsaalbers

Copy link
Copy Markdown
Author

I will have to review the code myself first, it is not ready for review as of yet.

@thijsaalbers thijsaalbers left a comment

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.

The current version of the solver is ready for review. It is however not yet finished and there is a list of known issues that I am still working through. I have updated the PR description with the current status and known limitations; please read that before reviewing the implementation.

su2double SemiSpan; /*!< \brief Wing Semi span. */
su2double MSW_Alpha; /*!< \brief Coefficient for blending states in the MSW scheme. */
su2double Roe_Kappa; /*!< \brief Relaxation of the Roe scheme. */
su2double RCFactor; /*!< \brief Relaxation for the Rhie-Chow interpolation contribution. */

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.

Should this variable still be named RCfactor? This factor is named RC to remain consistent with the thesis of Akshay, it however has no relation to Rhie-Chow at all and instead functions as a means of controlling the time dependent term on the momentum coefficients for the poisson equation... I do not know why he called it RC in his thesis, nor if we should keep this same name or change it.

Comment thread SU2_CFD/include/solvers/CPoissonSolver.hpp
Comment thread SU2_CFD/src/drivers/CDriver.cpp Outdated
Comment thread SU2_CFD/src/numerics/flow/convection/pressure_based.cpp Outdated
Comment thread SU2_CFD/src/numerics/flow/convection/pressure_based.cpp Outdated
Comment thread SU2_CFD/src/solvers/CPBIncEulerSolver.cpp Outdated
Comment on lines +33 to +34
//TODO: almost everything in this file is a direct or indirect copy of the code in
// the CIncNSSolver class. this will need to be refactored.

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.

The only really different thing in this file from the CIncNSSolver is the wall boundary condition defintion (which is just massively simplified). I again do not know how this should be unified with the CIncNSSolver class as the C..IncEuler classes in between are massively distinct.


unsigned short skipVars = nDim + solver[MESH_0][FLOW_SOL]->GetnVar();

if (config->GetKind_Incomp_System() == ENUM_INCOMP_SYSTEM::PRESSURE_BASED) skipVars+=2; // skip pressure

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.

This works, although i do not know why +2 and not +1...

Comment thread SU2_CFD/src/solvers/CPoissonSolver.cpp Outdated
Comment thread SU2_CFD/src/solvers/CPoissonSolver.cpp
@thijsaalbers
thijsaalbers requested a review from pcarruscag July 21, 2026 12:29
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.

4 participants