Fix/inc unsteady variable density#2744
Closed
Soumyadipta-Banerjee wants to merge 1 commit intosu2code:developfrom
Closed
Fix/inc unsteady variable density#2744Soumyadipta-Banerjee wants to merge 1 commit intosu2code:developfrom
Soumyadipta-Banerjee wants to merge 1 commit intosu2code:developfrom
Conversation
…1) for unsteady incompressible solvers
Contributor
|
we already have a pull request for this, why open another one? |
Author
|
My apologies, I thought the other PR was closed so I opened this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
This fixes #2480 by removing the constant density assumption in the unsteady incompressible solvers.
Previously, the solvers were just calling nodes->GetDensity(iPoint) for all three dual-time levels (n+1, n, n-1). This breaks variable-density simulations (e.g., when running with the energy equation or species transport). There was a comment in the code noting this as a "temporary fix," so this PR finally addresses it.
I added proper historical density storage (Density_time_n and Density_time_n1) to CIncEulerVariable. CIncEulerSolver and CScalarSolver now grab the correct density for each time step when computing dual-time residuals. I also made sure the density pushback routines in CIntegration and CFVMFlowSolverBase use SU2_OMP_FOR_STAT and parallelCopy to stay thread-safe with OpenMP.
Related Work
Fixes #2480.
This takes the core idea from the closed draft PR #2481 but implements it fully for both 1st and 2nd-order time stepping.
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.
pre-commit run --allto format old commits.