Update CTurbSSTSolver.cpp to fix bug on calculating MuT by ShiheJia · Pull Request #2453 · su2code/SU2
Proposed Changes
When calculating the turb viscosity MuT for the SST 2003 version, the variable StrainMag is needed. However, in the current code, we use the wrong CVariable class to get the StrainMag so that we only get 0. The turb variable class should be replaced by the flow variable class.

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.
- 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 --allto 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.
Yep, setStrainMag updates the flownodes only. Can you update the regression tests?
A flatplate case is listed below.
|
|
||
| const su2double VorticityMag = max(GeometryToolbox::Norm(3, flowNodes->GetVorticity(iPoint)), 1e-12); | ||
| const su2double StrainMag = max(nodes->GetStrainMag(iPoint), 1e-12); | ||
| const su2double StrainMag = max(flowNodes->GetStrainMag(iPoint), 1e-12); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you looked for other uses of GetStrainMag to check if they are ok?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have checked the other part of code and they are all ok.
Yep, setStrainMag updates the flownodes only. Can you update the regression tests?
A flatplate case is listed below.
Here are the results from the nasa website. It looks like they also see a difference between SA and SST, maybe you can check if this corresponds to your results
https://turbmodels.larc.nasa.gov/flatplate.htmlOur validation case is here: https://su2code.github.io/tutorials/Turbulent_Flat_Plate/ is this the same as your setup?
The case above is just the SU2 validation case, with a finer mesh.
The results from NASA do show that SST will get a lower cf, however, it seems that the difference between SA and SST is larger in SU2.
I run a flatplate case and the results are shown below. It seems that the fixed code can accelerate the convergence very slightly, but the results deviates from SA a lot. I'm not sure how this happened and whether it was harmful.
Are you confident that this is converging? Two orders of magnitude seems rather small, maybe this could explain the discrepancy you are observing?
From the CD, I think the case has converged.
I will try the mesh from NASA, and we can exclude the grid effects.
From the CD, I think the case has converged. I will try the mesh from NASA, and we can exclude the grid effects.
Cool, I eagerly await the results!
This also fixes an issue I found in #2446. Thank you!
The case is not converging but stalling, this can also be a reason that drag is not going down. maybe reduce the cfl.
Converging well or not, this was certainly a bug.
@ShiheJia do you know what is the process to update the regression tests?
Converging well or not, this was certainly a bug. @ShiheJia do you know what is the process to update the regression tests?
Actually I know a little about that.
For updating regression tests, you will se a lot of cases that use the SST model that now have different results:
test_vals (stored): -4.029282, -2.181911, -7.734686, 0.000000, -0.939944
sim_vals (computed): -3.597708, -2.983823, -8.354806, 0.000000, -0.916525
So you will need to change the 'stored' values in Testcases/parallel_regression.py, serial_regression.py, etc. with the 'computed' values. You can download the logfiles from github and use them to update the regression files.
It seems the new code is alright. The new SST in SU2 is closer to CFL3D and FUN3D, although there is still small difference.
Beautiful!
For updating regression tests, you will se a lot of cases that use the SST model that now have different results:
test_vals (stored): -4.029282, -2.181911, -7.734686, 0.000000, -0.939944
sim_vals (computed): -3.597708, -2.983823, -8.354806, 0.000000, -0.916525So you will need to change the 'stored' values in Testcases/parallel_regression.py, serial_regression.py, etc. with the 'computed' values. You can download the logfiles from github and use them to update the regression files.
I have tried a lot but I failed to do that. I am not very familiar with the Github process. Maybe someone more skilled can help with updating the regression files.
pcarruscag
changed the base branch from
develop
to
fix_cornernode_normal
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




