OpenFOAM v2306 Sigma Turbulence Model Wrong Behavior
Summary
In OpenFOAM v2306 a new turbulence model, the Sigma model, has been introduced. However, using OpenFOAM v2306, compiled on Ubuntu 22.04 LTS with GCC 11.4, results in wrong turbulent viscosity fields. At our institute, we had been using the Sigma model before it was introduced in the main OpenFOAM branch and had already experienced problems in prior OpenFOAM versions if the compiler GCC 11.4 was used. This could be fixed in two ways:
- Compile with Gcc 9.5
- Modify the calculation of the Ssigma() term
We would encourage to modify the Ssigma() function to avoid this bug with the Gcc 11.3 compiler. Also it would be great to know why this error appears for newer OpenFOAM versions.
Steps to reproduce
We can provide a simple jet case where you can clearly see the issue in the turbulent viscosity.
Alternatively, use a case with a shear layer or jet flow and use the provided program, which calculates the turbulent viscosity and writes out the result.src.tar.gz
What is the current bug behaviour?
As visible in the attached image, the turbulent viscosity is not smooth and does have significantly larger outliers.
What is the expected correct behavior?
The turbulent viscosity should look like it is displayed on the right hand side of the attached image.
Environment information
- OpenFOAM version : v2306
- Operating system : Ubuntu 22.04 LTS
- Hardware info : AMD processor
- Compiler : GCC 11.4
Possible fixes
In the Ssigma() function located in DESModel::Ssigma()
(DESModel.C line 88) split the calculation of G in line 110 up into two parts:
const volTensorField gradUT = gradU.T();
const volTensorField G = gradUT & gradU;
For some reason, it works then correctly.