Description
Describe the bug
I found a bug while testing the SST model.
I'm trying to simulate the high Mach number flat plate case. The flow condition is below.
Temperature (K) | Unit Re (1/m) | Mach | Pressure | Wall Temperature(K) |
---|---|---|---|---|
800 | 4.9×10^6 | 6.1 | 12100 | 300 |
After calculation, I check the flow field, including the boundary. But, the inlet boundary is not the same flow conditions I imposed.
Here is the comparison of other models using the same flow conditions.
So, I tried to find the cause.
When deriving the RANS equation from the energy equation, the turbulent kinetic energy(TKE) is derived from the kinetic energy of Total Energy(E) as shown below.
In the boundary condition and initialization part, k is considered depending on whether or not the SST model is used for Total Energy.
In CEulerSolver.cpp
bool tkeNeeded = (turbulent && config->GetKind_Turb_Model() == TURB_MODEL::SST);
if (tkeNeeded) { Energy_FreeStream += Tke_FreeStream; }; config->SetEnergy_FreeStream(Energy_FreeStream);
if (tkeNeeded) Energy_FreeStreamND += Tke_FreeStreamND;
But In the flux calculation part, when calculating the speed of sound(a), using the total enthalpy(H). But, in this part consider only the kinetic energy.
but in the SU2 code using below.
The speed of sound always has a slightly high value because TKE is not subtracted.
See "roe.cpp" line 119 ~ 149.
RoeSoundSpeed2 = (Gamma-1)*(RoeEnthalpy-0.5*sq_vel);
This line might be changed roughly like :
RoeSoundSpeed2 = (Gamma-1)*(RoeEnthalpy-0.5*sq_vel-k);
There seem to be two possible ways to this problem.
- Subtract TKE when the speed of sound calculation
- Store e(static energy) or k in primitive variables
I'm not sure which is clear and easy.
Bug report checklist
Please make sure that you have followed the checklist below, many common problems can be solved by:
- Consulting the build instructions (https://su2code.github.io/docs_v7/Build-SU2-Linux-MacOS/).
- Looking for similar problems on GitHub or CFD-Online (https://www.cfd-online.com/Forums/su2/).
- Updating to the newest version of SU2 (either develop, master, or the pre-built executables https://su2code.github.io/download.html).
Desktop (please complete the following information):
- OS: [e.g., Linux (Redhat 6.6)]
- C++ compiler and version: [e.g., g++ (GCC) 4.8.5]
- MPI implementation and version: [e.g., OpenMPI 3.0.0]
- SU2 Version: [e.g., v7.4.0]