CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Bugs

Wrong calculation of nut in the kOmegaSST turbulence model

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 1, 2010, 08:00
Default Wrong calculation of nut in the kOmegaSST turbulence model
  #1
Senior Member
 
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 18
FelixL is on a distinguished road
Hello all,


lately there were a few threads coming up in the forums (eg. http://www.cfd-online.com/Forums/ope...lat-plate.html or http://www.cfd-online.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:
  • Coarse Grid: 70x50 cells, max. y+ = 1.80
  • Medium Grid: 140x100 cells, max. y+ = 1.05
  • Fine Grid: 280x200 cells, max. y+ = 0.62
The boundary conditions and dimensions of the domain were the same as the ones in the NASA computations. On the wall I used for the turbulent quantities:
  • k: fixedValue 0
  • omega: omegaWallFunction
  • nut: fixedValue 0
All computations were accomplished with a 2nd order convection scheme (SFCD) on all divergence terms.

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.cfd-online.com/Forums/ope...lat-plate.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

S = \sqrt{2S_{ij}S_{ij}} [2]

In OpenFOAM the function mag() calculates the magnitude of the strain rate tensor differently:

S_{OF} = \sqrt{S_{ij}S_{ij}} (see programmer's guide)

So the difference between these two methods is a factor of \sqrt 2.

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_)));
    volScalarField G("RASModel::G", nut_*2*S2);
As you can see, the factor 2 has been introduced to account for the missing factor of \sqrt 2. However, in the definition of nut, namely

\nu_t = {{a_1 k} \over {\mathrm{max}(a_1 \omega , S F_2)}} [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));
This results in too high values for the turbulent viscosity in regions, where S F_2 is greater than a_1 \omega and explains the observed overprediction of the skin friction coefficient.

The correct calculation of nut requires the intruduction of the missing factor \sqrt 2, 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));
With this correction I redid the aforementioned simulations. In the second attachement you can see the new behaviour of the skin fiction coefficient as the grid is systematically refined. As expected, the values are lower than before and the grid independent solution seems to be closer to the reference data.

In the third attachement the wall-normal 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...-SST-paper.pdf
Attached Images
File Type: png cf_original.png (42.9 KB, 394 views)
File Type: png cf_corrected.png (43.1 KB, 275 views)
File Type: png nuT_comparison.png (45.4 KB, 253 views)
File Type: png uPlus_corrected.png (53.8 KB, 217 views)
File Type: png uPlus_comparison.png (51.7 KB, 198 views)
FelixL is offline   Reply With Quote

Old   November 1, 2010, 08:06
Default
  #2
Senior Member
 
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 18
FelixL is on a distinguished road
Sorry about the transparent background of the attached PNG images. Here are the images with a white background.
Attached Images
File Type: png cf_original.png (42.8 KB, 324 views)
File Type: png cf_corrected.png (43.1 KB, 279 views)
File Type: png nuT_comparison.png (44.2 KB, 263 views)
File Type: png uPlus_corrected.png (51.0 KB, 254 views)
File Type: png uPlus_comparison.png (49.8 KB, 242 views)
nozaki likes this.
FelixL is offline   Reply With Quote

Old   November 5, 2010, 03:46
Default
  #3
New Member
 
Peter
Join Date: Aug 2010
Posts: 16
Rep Power: 16
Peter85 is on a distinguished road
Hey! I found another post concerning this (#4 onwards):
http://www.cfd-online.com/Forums/ope...komegasst.html

It is not a mistake in the implementation, the programmer just used another paper as reference
Peter85 is offline   Reply With Quote

Old   November 11, 2010, 12:58
Default
  #4
Senior Member
 
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 18
FelixL is on a distinguished road
Hey, Peter,


I searched through different Papers regarding the Menter SST turbulence model and couldn't find another definition of S other than S = \sqrt{2S_{ij}S_{ij}} there. Are you sure about that special paper with another definition of nut? It truely puzzles me, why just this definition was used in the implementation for OpenFOAM, when Menter's original definition of the stress limiter in the nut equation (like I stated above) leads to much better results (at least for wall bounded flows)?


Greetings,
Felix
FelixL is offline   Reply With Quote

Old   November 14, 2010, 15:58
Default
  #5
New Member
 
Peter
Join Date: Aug 2010
Posts: 16
Rep Power: 16
Peter85 is on a distinguished road
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 SST-code:
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 SST-model. He answered a lot of questions about this model in the topic posted above.

Peter
Peter85 is offline   Reply With Quote

Old   November 15, 2010, 04:08
Default
  #6
Member
 
Juho Peltola
Join Date: Mar 2009
Location: Finland
Posts: 89
Rep Power: 17
juho is on a distinguished road
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
juho is offline   Reply With Quote

Old   February 8, 2011, 08:07
Default
  #7
jms
Member
 
José
Join Date: Jan 2011
Posts: 73
Rep Power: 15
jms is on a distinguished road
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 copy-pasting 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é
jms is offline   Reply With Quote

Old   February 8, 2011, 08:10
Default
  #8
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 250
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
José

it is fixed in 1.7.1 (read last post)
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   February 8, 2011, 09:17
Default
  #9
jms
Member
 
José
Join Date: Jan 2011
Posts: 73
Rep Power: 15
jms is on a distinguished road
Hello!

I checked on the file kOmegaSST.C in the cluster whre I am working it was not fixed there... :S.
jms is offline   Reply With Quote

Old   February 8, 2011, 10:02
Default
  #10
Senior Member
 
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 18
FelixL is on a distinguished road
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....28OF-1.4.1.29

Hint: you can use the source files of the git-repository if you like:
https://github.com/OpenCFD/OpenFOAM-.../RAS/kOmegaSST


Greetings,
Felix.
FelixL is offline   Reply With Quote

Old   February 14, 2011, 10:18
Default
  #11
jms
Member
 
José
Join Date: Jan 2011
Posts: 73
Rep Power: 15
jms is on a distinguished road
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é
jms is offline   Reply With Quote

Old   February 15, 2011, 05:01
Default
  #12
Senior Member
 
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 18
FelixL is on a distinguished road
Hello, José,


there currently is no possibility to simulate laminar-turbulent transition within the standard distribution of OpenFOAM. Defining trip-terms or something like that is not possible, too, since this is rather challenging on unstructured meshes.

I was working on an implementation of the gamma-ReTheta 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 non-local 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.
FelixL is offline   Reply With Quote

Old   February 17, 2011, 03:50
Default
  #13
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
Quote:
Originally Posted by FelixL View Post
Hello, José,


there currently is no possibility to simulate laminar-turbulent transition within the standard distribution of OpenFOAM. Defining trip-terms or something like that is not possible, too, since this is rather challenging on unstructured meshes.

I was working on an implementation of the gamma-ReTheta 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 non-local 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.
Felix,
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
ivan_cozza is offline   Reply With Quote

Old   February 23, 2011, 09:36
Default
  #14
Member
 
Join Date: Oct 2010
Location: Naples
Posts: 50
Rep Power: 16
salvoblack is on a distinguished road
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!
salvoblack is offline   Reply With Quote

Old   February 23, 2011, 10:35
Default
  #15
jms
Member
 
José
Join Date: Jan 2011
Posts: 73
Rep Power: 15
jms is on a distinguished road
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 k-omega 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 e-mail.

Thank you very much for your help.

I really look forward to reading your answer.

Regards,

José
jms is offline   Reply With Quote

Old   February 23, 2011, 11:48
Default
  #16
Senior Member
 
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 18
FelixL is on a distinguished road
Hello, everybody,


I didn't expect there to be such a high demand after the transitional model I tried to implement. It's the gamma-ReTheta turbulence model based upon the k-omega SST model and two additional transport equations to predict laminar-turbulent 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 Correlation-Based 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 Cf-values 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.
Attached Images
File Type: png T3A_inlet.png (9.7 KB, 167 views)
File Type: png T3A_cf.png (9.6 KB, 118 views)
File Type: png T3AM_cf.png (7.7 KB, 101 views)
File Type: png T3B_cf.png (7.4 KB, 98 views)
FelixL is offline   Reply With Quote

Old   February 23, 2011, 13:01
Default
  #17
jms
Member
 
José
Join Date: Jan 2011
Posts: 73
Rep Power: 15
jms is on a distinguished road
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é
jms is offline   Reply With Quote

Old   February 24, 2011, 06:52
Default
  #18
Senior Member
 
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 18
FelixL is on a distinguished road
Hello, everyone,


I posted the code in this thread:
http://www.cfd-online.com/Forums/ope...nal-flows.html

Please continue to discuss this issue there since this thread originally wasn't about simulating transition.


Greetings,
Felix.
FelixL is offline   Reply With Quote

Old   March 9, 2011, 13:33
Default
  #19
Member
 
Timo K.
Join Date: Feb 2010
Location: University of Stuttgart
Posts: 66
Rep Power: 16
timo_IHS is on a distinguished road
Hello all,

I'm running a simulation of a standard guide vane. When I use the old version of the SST-model (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 SST-SAS Turbulence Model in the DESIDER Project"; Egorov, Menter; 2008
that the production term in the omega-equation is not like in OF:
Code:
gamma(F1)*2*S2
but more like:
Code:
gamma(F1)*omega_/k_*nut_2*S2
This leads to a really more stable result (blue curve), which is not too far from the result of the CC.



But running a diffuser with this last version (with sqrt(2) and modified omega-equation) 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
timo_IHS is offline   Reply With Quote

Old   March 15, 2011, 08:24
Default
  #20
Senior Member
 
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 18
FelixL is on a distinguished road
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)?
\nu_t = {{a_1 k} \over {\mathrm{max}(a_1 \omega , S F_2)}}

or do they use a formulation without the application of a stress limiter term?
\nu_t = {{k} \over {\omega}}

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 Wilcox-k-omega 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 \gamma S^2. With your implementation it is additionally dependent on wall distance - viz. close to the wall (where F2=1) it is approx. \gamma \omega S, 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.
FelixL is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of k omega turbulence model john_w OpenFOAM Running, Solving & CFD 2 September 22, 2009 05:15
Discussion: Reason of Turbulence!! Wen Long Main CFD Forum 3 May 15, 2009 09:52
Fan heater model: what turbulence source to use? andy20 Main CFD Forum 0 March 2, 2008 12:46
Advanced Turbulence Modeling in Fluent, Realizable k-epsilon Model Jonas Larsson FLUENT 5 March 13, 2000 03:27


All times are GMT -4. The time now is 13:58.