Wrong calculation of nut in the kOmegaSST turbulence model
5 Attachment(s)
Hello all,
lately there were a few threads coming up in the forums (eg. http://www.cfdonline.com/Forums/ope...latplate.html or http://www.cfdonline.com/Forums/ope...behaviour.html) discussing an unusual behavior of the kOmegaSST turbulence model when using meshes that had near wall y+ values of 1 and below. While the kOmegaSST turbulence model was originally implemented in OpenFOAM for the use with wall functions, this implementation actually should also work (with satisfying accuracy) in the near wall regions without the use of any damping functions (as with many other turbulence model based on k and omega, see [1]). Also computations by the NASA show a very good behavior of the kOmegaSST turbulence model applied on very fine grids without the use of wallfunctions. To further investigate the uncommon behavior of the kOmegaSST model in OpenFOAM I tried to reproduce the aforementioned NASA flat plate test case. I used three different grids for this case:
The results for the skin friction coefficient can be seen in the first attachement. As already discovered by the member cboss in the thread http://www.cfdonline.com/Forums/ope...latplate.html , the grid independent solution for the skin friction coefficient (when using grids with a wall y+ of the order of 1) seems to be too high. This made me look deeper into the source code of kOmegaSST and I found the problem: The magnitude of the strain rate tensor is defined as [2] In OpenFOAM the function mag() calculates the magnitude of the strain rate tensor differently: (see programmer's guide) So the difference between these two methods is a factor of . In the production term G for the k equation of the kOmegaSST model in OpenFOAM this discrepancy is being considered by setting Code:
volScalarField S2 = magSqr(symm(fvc::grad(U_))); [3], this factor is missing in turbulenceModels/incompressible/RAS/kOmegaSST.C, lines 240 and 392: Code:
nut_ = a1_*k_/max(a1_*omega_, F2()*mag(symm(fvc::grad(U_)))); Code:
nut_ = a1_*k_/max(a1_*omega_, F2()*sqrt(S2)); The correct calculation of nut requires the intruduction of the missing factor , to be consistent with OpenFOAM's calculation of the strain rate tensor magnitude: Code:
nut_ = a1_*k_/max(a1_*omega_, F2()*sqrt(scalar(2))*mag(symm(fvc::grad(U_)))); Code:
nut_ = a1_*k_/max(a1_*omega_, F2()*sqrt(scalar(2)*S2)); In the third attachement the wallnormal distribution of the dimensionless eddy viscosity for the original and the corrected kOmegaSST implementation can be seen at the location of x=0.97m. The original model clearly overpredicted the eddy viscosity at y>0.005m, while the corrected calculation of nut now yields results more closely to the reference data of the NASA calculations. So far I've only tested the incompressible version of the kOmegaSST model. I am not entirely sure if the same problem exists with the compressible kOmegaSST implementation  the source code looks a bit different, I have to take a deeper look at it some time. I hope, this little correction resolves the issues encountered when applying the kOmegaSST model to very fine meshes, fully releasing the power of OpenFOAM's new blended wall functions, making the kOmegaSST turbulence model applicable to a wider range of y+ values. Greetings, Felix. [1] WILCOX, David C.: "Turbulence Modeling for CFD", 3rd Edition, p. 178 [2] http://turbmodels.larc.nasa.gov/sst.html [3] http://cfd.mace.manchester.ac.uk/flo...SSTpaper.pdf 
5 Attachment(s)
Sorry about the transparent background of the attached PNG images. Here are the images with a white background.

Hey! I found another post concerning this (#4 onwards):
http://www.cfdonline.com/Forums/ope...komegasst.html It is not a mistake in the implementation, the programmer just used another paper as reference 
Hi Felix,
unfortunately, I don't have the paper, so I can't tell you if the implemented model is consistent with the paper. You can find the name of the paper within the headerfile of the SSTcode: Menter, F., Esch, T. "Elements of Industrial Heat Transfer Prediction" 16th Brazilian Congress of Mechanical Engineering (COBEM), Nov. 2001 If you have a look on the topic I posted above, you will get more information, they were discussing the same problem, beginning with post number 4. For further information I suggest contacting Henry, the person who implemented the SSTmodel. He answered a lot of questions about this model in the topic posted above. Peter 
Hi Peter and Felix,
It seems that the issue has been corrected in the 1.7.x version last thursday. Commit: https://github.com/OpenCFD/OpenFOAM...f7a0b26d64265d 
Dear Felix,
I am running OpenFOAM 1.7.1 and I would like to include this change you mention on the first message of this thread in order to improve the drag coefficient calculation. But, to be honest I don´t know how to do it (I am running it from a cluster where I don´t have the permission of modifying files, so I should do my own solver by copypasting files and recompiling). Could you explain me how? Or maybe there ir any other thread where this is explained... Thank you for your attention. Regards, José 
José
it is fixed in 1.7.1 (read last post) 
Hello!
I checked on the file kOmegaSST.C in the cluster whre I am working it was not fixed there... :S. 
Hello, José,
the kOmegaSST turbulence model was fixed in OF 1.7.x which is being regularly updated and realeased via git. OF 1.7.1 doesn't have the newest changes and additions that 1.7.x has. To change kOmegaSST without actually modifying the original files you probably have to compile your own library and put it into the $FOAM_USER_LIBBIN directory. This tutorial will help you: http://openfoamwiki.net/index.php/Si....28OF1.4.1.29 Hint: you can use the source files of the gitrepository if you like: https://github.com/OpenCFD/OpenFOAM.../RAS/kOmegaSST Greetings, Felix. 
Hello Felix,
I hope everything is ok. I am still working on studying flow around airfoils and I would like to apply any transition model for the boundary layer. I have read on some other threads that there is not any of these models implemented in OpenFOAM yet. is it true? or does it exist any? If not...do you know if the transition point can be fixed somehow in OpenFOAM? Thank you very much for your help. Regards, José 
Hello, José,
there currently is no possibility to simulate laminarturbulent transition within the standard distribution of OpenFOAM. Defining tripterms or something like that is not possible, too, since this is rather challenging on unstructured meshes. I was working on an implementation of the gammaReTheta transition model developed by Langtry and Menter and it looks promising. The implementation still needs a lot of testing which I haven't found the time for lately, so it's status is currently frozen. You might be lucky and find someone else who implemented and fully verified a transitional model in OpenFOAM. Nonetheless these nonlocal transition models are pretty sensitive to freestream turbulence intensities (FSTI). If you're lacking data of FSTI, the location of transition onset pretty much relies on guesswork which I am not a real big fan of, to be honest. In a nutshell: unfortunately it's not possible to simulate transiton with OF 1.7.1. (except for DNS, of course) Greetings, Felix. 
Quote:
I spend a lot of time in the past in trying to simulate transitional flows over airfoils with SST, so I have some freestream turbulence data and airfoils Cf measurements that could help in developing your transitional model. If you want, you can share your pieces of code, and I can try to validate it. Maybe it could be an opportunity to have a transitional model in OF! Ivan 
Hello,
I am preparing my thesis on the possibility of implementing a transitional model for OF. So I can add to try to test your file, felix. Also would you give to me a great help! 
Dear Felix and "salvoblack",
I am doing my thesis about a study of thick airfoils and based on some results obtained with CFX I need to take into account transition if I want to get good/acceptable results. Felix, if you have something already implemented I could try to apply it on my cases and of course send you the results I would get so you could use them as part of your validation if it works. I know this is the easiest way for me and that maybe it does not sound good for you. But, anyway, I was thinking on starting to change the komega SST turbulence model on Monday next week to apply this transition by fixing the transition point. So I had thought on fixing the value of nut to 0 in the values inside what it should be the laminar boundary layer. Then, I would apply some kind of smoothing between the values of nut between this laminar boundary layer and the turbulent one. My problem here it comes, I am new in making changes in OpenFOAM´s code and I would like to ask you something. How to select these cells where I want to fix this nut to 0? (let´s say they will be from the x coordinate where the airfoil start to the one where transition begins, and for vel=0 to vel=0.99*vel_fluid). Maybe you can send me an example of such a code, because I understand that explaining it may be cumbersome. If you don´t want to send any of these through the forum, I can always give you my email. Thank you very much for your help. I really look forward to reading your answer. Regards, José 
4 Attachment(s)
Hello, everybody,
I didn't expect there to be such a high demand after the transitional model I tried to implement. It's the gammaReTheta turbulence model based upon the komega SST model and two additional transport equations to predict laminarturbulent transition. Since transition is a highly complicated phenomena, the model strongly depends upon correlations and even minor changes can drastically change the model's predictive behaviour. I strongly recommend to you to read the dissertation of Robert Langtry ("A CorrelationBased Transition Model using Local Variables for Unstructured Parallelized CFD codes", Stuttgart University) before using my implementation. It's important to understand the physics of this turbulence model! I only tested the model on different test cases available through the ERCOFTAC database. These cases were all flat plate test cases with zero pressure gradient and different freestream turbulence intensity levels. I attached plots of skin friction coefficient for three different cases I calculated (T3A, T3AM, T3B). The results are okay but there seem to be problems with too high Cfvalues in the laminar and turbulent regime, especially visible for the T3AM and T3B cases. While other authors had similar problems, I think there's still something wrong with my implementation or how OF handles wall shear stresses. I doublechecked everything but I came to no success and for now my time for checking the model is up. Long story short: I will upload the code tomorrow. BUT it is unfinished and untested. I did no calculations for nonzero pressure gradient cases and I didn't simulate anything else than flat plates! Please don't expect to be more accurate with this model  it could even be that you get worse results. Please bear this warning in mind, this turbulence model is powerful but no magic bullet. Anyway, if you stumble upon something which might improve the model's performance in OF, feel free to share your ideas. Greetings, Felix. 
Dear Felix,
Thank you for your information! I look forward to try your code! I will tell you what I will get with it! Regards, José 
Hello, everyone,
I posted the code in this thread: http://www.cfdonline.com/Forums/ope...nalflows.html Please continue to discuss this issue there since this thread originally wasn't about simulating transition. Greetings, Felix. 
Hello all,
I'm running a simulation of a standard guide vane. When I use the old version of the SSTmodel (without this factor sqrt(2) in nut, red curve), my simulation converges very well, but the loss in total pressure is more than 10% higher than the same simulation with a commercial code (CC). So inserting this factor like in the current version leads to a very unstable result, green curve. But this is closer to the result of the CC. So I've found in the help of the CC or also in this newer paper (okay about SAS) "Development and Application of SSTSAS Turbulence Model in the DESIDER Project"; Egorov, Menter; 2008 that the production term in the omegaequation is not like in OF: Code:
gamma(F1)*2*S2 Code:
gamma(F1)*omega_/k_*nut_2*S2 http://www.cfdonline.com/Forums/mem...ptotnorm.htmlhttp://www.cfdonline.com/Forums/mem...ptotnorm.htmlhttp://www.cfdonline.com/Forums/mem...ptotnorm.htmlhttp://www.cfdonline.com/Forums/mem...ptotnorm.htmlhttp://www.cfdonline.com/Forums/mem...ptotnorm.png But running a diffuser with this last version (with sqrt(2) and modified omegaequation) I don't get the expected separation. Is there a switch between the "version", like depending on the pressure gradient or something like that? Has anybody experience with this or any comments? Thanks in advance. Cheers 
Hello, Timo,
I checked the paper and couldn't find any info about how they calculate the eddy viscosity. Do they apply the usual formula, applying a stress limiter (like in OF)? or do they use a formulation without the application of a stress limiter term? If it's the latter case, then both omega source term definitions in OF and your commercial code are equal. Otherwise, this seems to me like the omega source term implementation of the Wilcoxkomega turbulence model (see http://turbmodels.larc.nasa.gov/wilcox.html ). Since both turbulence models are related, a deviation of Menter's formulation shouldn't be too much of an issue. When using the original implementation in OF, the omega source term is everywhere equal to . With your implementation it is additionally dependent on wall distance  viz. close to the wall (where F2=1) it is approx. , further away from the wall it is the same like in the original implementation. Maybe this behavior improves your numerical stability. I currently don't have the time to go deeper into it, sorry. So much about the theortetical stuff... what I don't understand is what you mean by "unstable result, but closer to the result of the cc". If you have a result which is actually quite close to the results of the cc (that don't neccesarily have to be correct!) then why did you change the code? I don't understand the term unstable  unstable simulations usually lead to unphysical results or crashes. Regarding the separation point: is this the same case or were you speaking about two different cases? Is separation better predicted when not using your modification? Couldn't this be a shortcoming of the SST model in general? Of course does your modification alter the turbulence model's capabilities. It's still a model (amongst the two equation turbulence models one with the most closure coefficients!), so it's difficult to get it to perform nicely for every testcase. Sorry about these pretty general answers, but I can't be more specific without more knowledge about grids, numerical schemes, fluid properties etc. Greetings, Felix. 
All times are GMT 4. The time now is 04:59. 