Skip to content

Implementing variable density for unsteady incompressible flow - #2641

Open
tkiymaz wants to merge 119 commits into
developfrom
fix_inc_unsteady_density
Open

Implementing variable density for unsteady incompressible flow#2641
tkiymaz wants to merge 119 commits into
developfrom
fix_inc_unsteady_density

Conversation

@tkiymaz

@tkiymaz tkiymaz commented Dec 10, 2025

Copy link
Copy Markdown

Proposed Changes

Implements variable density treatment for unsteady incompressible flow simulations. Currently, SU2 uses constant density in transient simulations, which is inaccurate for combustion cases where density varies significantly due to heat release and species composition changes. This contribution enables proper density updates during time-stepping for flamelet-based combustion modeling. For now, only 1st order time marching is implemented

Related Work

Related to incompressible flow solver and flamelet combustion modeling. No specific issue linked yet.

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.

Tahsin Berk Kiymaz and others added 3 commits June 17, 2025 10:28
@pcarruscag

Copy link
Copy Markdown
Member

@Cristopher-Morales can you review this pr please?

Removed commented-out code for setting density at local point.
Updated the comment for density retrieval to reflect changes for transient density handling.
Removed unnecessary blank lines in CIncEulerVariable.hpp
Removed unnecessary blank lines in CVariable.hpp
Removed unnecessary blank lines to improve code readability.
@Cristopher-Morales

Copy link
Copy Markdown
Contributor

@Cristopher-Morales can you review this pr please?

Hi @pcarruscag !

Yes, I can help reviewing this PR.

Please let me know if you need something else from my side

Removed commented-out code and updated density calculation.
@bigfooted

Copy link
Copy Markdown
Contributor

@Cristopher-Morales I guess the changes to the preconditioner can be removed from this PR since we now have your implementation

Comment thread SU2_CFD/include/variables/CVariable.hpp Outdated
Removed debug print statement from SetPrimVar function.
Comment thread SU2_CFD/include/output/COutput.hpp Outdated
Comment thread SU2_CFD/include/variables/CIncEulerVariable.hpp Outdated
Comment thread SU2_CFD/include/variables/CIncEulerVariable.hpp Outdated
@bigfooted

Copy link
Copy Markdown
Contributor

@tkiymaz @pcarruscag
Done from my side, please have a look...

Comment thread SU2_CFD/src/solvers/CIncEulerSolver.cpp Outdated
Comment thread SU2_CFD/src/solvers/CIncEulerSolver.cpp Outdated
Comment thread SU2_CFD/include/solvers/CSolver.hpp Outdated
Comment thread SU2_CFD/include/variables/CFlowVariable.hpp Outdated
Comment thread SU2_CFD/include/variables/CVariable.hpp Outdated
Comment thread SU2_CFD/include/variables/CIncEulerVariable.hpp Outdated
Comment thread SU2_CFD/src/output/CFlowIncOutput.cpp Outdated
Comment thread SU2_CFD/include/solvers/CIncEulerSolver.hpp Outdated
Comment thread SU2_CFD/include/solvers/CScalarSolver.inl Outdated
Comment thread SU2_CFD/include/solvers/CScalarSolver.inl Outdated
Comment thread SU2_CFD/include/variables/CIncEulerVariable.hpp Outdated
Comment thread SU2_CFD/include/variables/CIncEulerVariable.hpp Outdated
Comment thread SU2_CFD/include/variables/CVariable.hpp
Comment thread SU2_CFD/src/solvers/CDiscAdjSolver.cpp Outdated
Comment thread SU2_CFD/src/solvers/CIncEulerSolver.cpp Outdated
Comment thread SU2_CFD/src/solvers/CIncEulerSolver.cpp Outdated
Comment thread SU2_CFD/src/variables/CIncEulerVariable.cpp Outdated
tkiymaz and others added 11 commits July 28, 2026 08:56
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>
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>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
@tkiymaz

tkiymaz commented Jul 29, 2026

Copy link
Copy Markdown
Author

The two remaining CI failures are da_sp_pinArray_cht_2d_dp_hf and da_unsteadyCHT_cylinder. @bigfooted can you check that? I tried but could not find the issue.

@bigfooted

Copy link
Copy Markdown
Contributor

The two remaining CI failures are da_sp_pinArray_cht_2d_dp_hf and da_unsteadyCHT_cylinder. @bigfooted can you check that? I tried but could not find the issue.

The residuals are barely above the threshold so I would not worry about it. They are both related to a change to the adjoint implementation, but that (unsteady adjoint) needs to be tested in more depth anyway for the variable density case. So I suggest to update the residuals now and create a verification test using finite differences later.

@tkiymaz

tkiymaz commented Aug 3, 2026

Copy link
Copy Markdown
Author

The two remaining CI failures are da_sp_pinArray_cht_2d_dp_hf and da_unsteadyCHT_cylinder. @bigfooted can you check that? I tried but could not find the issue.

The residuals are barely above the threshold so I would not worry about it. They are both related to a change to the adjoint implementation, but that (unsteady adjoint) needs to be tested in more depth anyway for the variable density case. So I suggest to update the residuals now and create a verification test using finite differences later.

Then let me know if there is anything i can do to finalize the PR.

@bigfooted

Copy link
Copy Markdown
Contributor

The two remaining CI failures are da_sp_pinArray_cht_2d_dp_hf and da_unsteadyCHT_cylinder. @bigfooted can you check that? I tried but could not find the issue.

The residuals are barely above the threshold so I would not worry about it. They are both related to a change to the adjoint implementation, but that (unsteady adjoint) needs to be tested in more depth anyway for the variable density case. So I suggest to update the residuals now and create a verification test using finite differences later.

Then let me know if there is anything i can do to finalize the PR.

just go to the failed testcases overview and copy the line with computed results and update the parallel_regression_AD.py with these values.

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.

5 participants