-
Notifications
You must be signed in to change notification settings - Fork 913
Correct inconsistency regarding the density used in conservative scalar solver #2458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Correct inconsistency regarding the density used in SST solver
pcarruscag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory we are doing exactly what you describe, we need density old because of the underrelaxation and clipping.
Have you tried printing some density values from inside the clipped update function to check if they are consistent or not?
|
I'm not sure I understand your answer. The density_old is not used for under-relaxation or clipping. Instead, it is used when advancing the time step, here is the function: ` /*!
} I have validated this inconsistency by printing out the density values. Moreover we have identified that the current implementation, which uses the old density values, leads in cases to negative values in the conserved SST variables (before clipping). When using the updated density values, these negative values do not appear. |
|
Ok, I suppose what you mean is that we should not use density old because when we compute the residuals to advance the SST equations we are already using the density at n+1? |
|
Yes that is exactly my point. While the change proposed here is critical for our feature, it is in our understanding that regardless of our work, the current implementation (even if not catastrophic because of the small differences between the two density values) is incorrect, and should be changed regardless of better convergence. |
|
Hi All, Let F denote the convective flux, and F^(n) is the flux at the current time level n and is given as follows: F^n = r^(n+1) * v^(n+1) * phi^(n) Where 'r' is the density, v is the velocity, and phi is the turbulence variables (TKE or Omega). It should be noted that 'r' and 'v' are taken at time level (n+1) because the flow equations were solved and updated before solving the turbulence model equations. Similarly, F at time level (n+1) is given as follows: F^(n+1) = r^(n+1) * v^(n+1) * phi^(n+1) Next, a linearization is of F^(n+1) is conducted as follows: F^(n+1) = F^n + DF/D(r*phi) * Delta(r * phi) = r^(n+1) * v^(n+1) * phi^(n) + v^(n+1) * Delta(r * phi) Now to find the definition of Delta(r * phi) we simply substract F^n from F^(n+1) as follows: F^(n+1) - F^n = v^(n+1) * Delta(r * phi) r^(n+1) * phi^(n+1) - r^n+1 * phi^n = Delta(r*phi) This may clarify the inconsistency present in the code. |
|
I should have emphasized that the current situation in the code is different. The present coding is given as follows: r^(n+1) * phi^(n+1) - r^n * phi^n = Delta(r*phi) Note that the r of the second term on the left-hand side is given at time level n, which should be at time level n+1. |
|
Thank you for the details, those will be helpful for someone reading the PR later. As you can see a lot of testcases need to be updated to be able to merge this PR https://github.com/su2code/SU2/actions/runs/13782145187/job/38543199068?pr=2458 If you want to do that you can check the values on GitHub and carry out the update of the test scripts (.py) inside the TestCases folder of the code. |
|
Thanks for your response and feedback. Our work includes a non trivial modification to the implicit treatment of the problem and will therefore will be added as an option for the user. Unless adopted as the default treatment in SU2 our modifications should have no impact on existing SST model results. To ensure this I thought it was more correct to divide the PR into two different ones. The easier option for me would indeed be to wrap this as part of our treatment, however it is my understanding that this fix should be available to all regardless of our treatment, and even if it does not donate to convergence in most/all cases. I see this as my minute contribution to the SU2 community. Though it may take me a few days I will correct the regression tests.. |
|
Looking at some of the new results from the regression tests it looks like the impact on convergence is minor. Sometimes a little better, sometimes not. |
Maybe it is due to the fact that the regression cases only run for very few iterations. Then, when a full simulation is considered, we may have visible gains in robustness. |
pcarruscag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating the tests 👍
Added comment on use of current density
Proposed Changes
In SU2 the flow equations and the RANS turbulence model equations are solved in a decoupled manner. The flow equations are first solved, and their solution is advanced to the next time level, 'n+1'. The advanced flow variables, specifically the density and velocity (of time level 'n+1'), are used to solve the RANS turbulence model equations.
Since the SST model solves the conservative variables (density * TKE, density * Omega), it's residuals and linearization of the implicit operator are taken at the mixed time level of density^(n+1) * (TKE, Omega)^n.
In a similar manner for consistency , the updated conservative variables (of the SST model) of time level 'n+1' should be advanced as follows:
density^(n+1) * (TKE, Omega)^(n+1) = density^(n+1) * (TKE,OMEGA)^n + Delta(densityTKE,densityOMEGA)
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.