CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   gamma-ReTheta turbulence model for predicting transitional flows (http://www.cfd-online.com/Forums/openfoam-programming-development/85382-gamma-retheta-turbulence-model-predicting-transitional-flows.html)

FelixL February 24, 2011 07:50

gamma-ReTheta turbulence model for predicting transitional flows
 
1 Attachment(s)
Hello, everybody,


since there seems to be a high demand for simulating boundary layer transition with OpenFOAM (see here), I am willing to publish the source code of my implementation of the gamma-ReTheta transition model originally proposed by LANGTRY and MENTER.

This implementation - though complete - is highly unvalidated and I found a couple of problems during my test simulations. I didn't want to release the code until I have fully tested the implementation but since people were asking for it and I don't have the time to continue testing the source code is attached to this post. I don't guarantee that the turbulence model works and leads to reasonable results! It worked well for me at simple zero-pressure gradient flat plate test cases but that's it.

However - there are a few things to account for when using the turbulence model. I won't give support on what boundary and initial conditions to use etc. For questions like that please refer to the literature, this model is well documented here:

R.B. LANGTRY: "A Correlation-Based Transition Model using Local Variables for Unstructured Parallelized CFD codes", 2006, Ph.D. thesis, University of Stuttgart


I created this thread so the community can discuss their results using this (experimental) model. Hopefully together we can validate or improve the model depending on how the turbulence model performs on different test cases. Also feel free to contact me via e-Mail if you have any questions. The address is found inside the header file of the code.



Greetings,
Felix.

ivan_cozza February 24, 2011 08:36

Quote:

Originally Posted by FelixL (Post 296699)
Hello, everybody,
since there seems to be a high demand for simulating boundary layer transition with OpenFOAM (see here), I am willing to publish the source code of my implementation of the gamma-ReTheta transition model originally proposed by LANGTRY and MENTER.
Greetings,
Felix.

Very good Felix!
I hope to have time to validate it soon, anyway it will be a great improvement for the OF community to have a modern transitional model in the code!

Ivan

FelixL February 24, 2011 08:48

1 Attachment(s)
I completely forgot to attach a sample case with the basic setup for running a simulation with the turbulence model. You can find it attached to this post.


Greetings,
Felix.

jms February 24, 2011 11:06

Thank you Felix!

Next Monday I will start to work with it and I will tell you how it is working for my case (thick airfoils).

aloeven February 24, 2011 11:08

Thank Felix!

I've been waiting for a transition model for a long time, but didn't have the time to implement it myself.

I'm running some airfoil tests at the moment. If the results for 0deg are ok, I will do a full polar tomorrow.

Best regards,
Alex

ivan_cozza February 24, 2011 11:33

Quote:

Originally Posted by aloeven (Post 296755)
Thank Felix!

I've been waiting for a transition model for a long time, but didn't have the time to implement it myself.

I'm running some airfoil tests at the moment. If the results for 0deg are ok, I will do a full polar tomorrow.

Best regards,
Alex

Alex, if you have any comparison with experiments of your polar (and if you can, of course!), please post here your results!
It could be a good start to validate this model in a collaborative way!

aloeven February 25, 2011 04:25

2 Attachment(s)
Ok, I have some first results using the default settings for the coefficients.

The case is a NACA63-618 airfoil at 0 degrees angle of attack. Re=6 million.
My grid has a maximum y+ of 0.48 and a stretching ratio of 1.1 close to the airfoil.
The turbulence intensity at the inlet is 0.1%

Experiments Fully turbulent Transition model
Cd 0.0055 0.0097 (+67%) 0.0061 (+11%)
Cl 0.4620 0.4870 (+5%) 0.5242 (+13%)
Cm -0.1094 -0.1180 (-8%) -0.1266 (-15%)


The experimental results are from Abbott & von Doenhoff

As you can see the drag prediction significantly improves. Unfortunately the lift coefficient gets worse. I have no experience with transition models, but perhaps somebody who is familiar with CFX can tell if this is also observed in CFX.

Hopefully, I have a full polar after the weekend.
Alex.

FelixL February 25, 2011 05:08

Hello, Alex,


your first results look promising. The reduction of draf actually is expected with any transition model so the much more interesting question would be, how well the current implementation predicts the location of transition onset?

As for the increased lift, I'm not quite sure about this. I suspect the shape of the boundary layers - a plot of pressure coefficients along the airfoil surface would be helpful to analyze the influence on the lift coefficient.


Greetings,
Felix.

aloeven February 25, 2011 05:58

Hi Felix,

I agree with you on the drag coefficient. Unfortunately I don't have an experimental skin friction distribution to compare with.

I was a bit to quick on the lift. It makes sense that it goes up, since the result is now more physical. The laminar part makes the lift go up. If you would have a fully laminar airfoil with a certain lift, the lift will be much lower if the same airfoil would be fully turbulent (rough or tripped). This is because of the effective camber of the airfoil.

The first test was with the coefficients as you have set them. Perhaps for airfoils, there is a better choice. For now, I'm reading Langtry's thesis and your source code to get a better idea of the model.

Best regards,
Alex.

FelixL February 25, 2011 06:20

Hello, Alex,


sounds like an explanation to me. So the conclusion is, the k-Omega-SST turbulence model overpredicts lift values using your current setup. For the fully turbulent case it should lie below experimental data. Could be a mesh dependency, couldn't it?


Greetings,
Felix.

salvoblack February 25, 2011 06:41

Hello,
which file i have to include in the make\options for compile it???
i have an error when i put wmake in the terminal:
salvatore@ubuntu:~/OpenFOAM/salvatore-1.7.1/applications/gammaReThetatSST$ wmake
options:7: warning: backslash-newline at end of file
SOURCE=gammaReThetatSST.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/turbulenceModels -I/opt/openfoam171/src/turbulenceModels/incompressible/RAS/RASModel -I/opt/openfoam171/src/transportModels -I/opt/openfoam171/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/gammaReThetatSST.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/turbulenceModels -I/opt/openfoam171/src/turbulenceModels/incompressible/RAS/RASModel -I/opt/openfoam171/src/transportModels -I/opt/openfoam171/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/gammaReThetatSST.o -L/opt/openfoam171/lib/linux64GccDPOpt \
-lincompressibleTurbulenceModel -lincompressibleRASModels -lincompressibleTransportModels -lfiniteVolume -lOpenFOAM -liberty -ldl -lm -o /home/salvatore/OpenFOAM/salvatore-1.7.1/applications/bin/linux64GccDPOpt/gammaReThetatSST
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 8 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 9 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 10 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 19 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 20 has invalid symbol index 20
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [/home/salvatore/OpenFOAM/salvatore-1.7.1/applications/bin/linux64GccDPOpt/gammaReThetatSST] Errore 1
salvatore@ubuntu:~/OpenFOAM/salvatore-1.7.1/applications/gammaReThetatSST$

could you help me please???

aloeven February 25, 2011 06:45

@Felix

Indeed you can say that kOmegaSST is overpredicting lift. Did you observe this in your simulations as well?

I have done a grid convergence study and I'm confident that this solution is not mesh dependent. I actually did the same case on a mesh (also checked grid convergence there) from a different mesh generator. So I'm pretty confident that the results are mesh independent. The far field is 50 chords away in all directions, so also boundary effects are not an issue. The mesh also complies with the recommendations of Langtry (page 43 of the thesis).

aloeven February 25, 2011 06:55

@salvatore

You have to compile a turbulence model as a library using: wmake libso

You can make a Make directory in the gammaThetatSST directory with two files: files and options.

files:
gammaReThetatSST.C
LIB = $(FOAM_USER_LIBBIN)/libGammaThetatSSTmodel

options:
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude
LIB_LIBS =


To use it, you have to add to system/controlDict :
libs ("libGammaThetatSSTmodel.so");

This is well explained here:
http://openfoamwiki.net/index.php/Si...ry_/_Tutorials
or here:
http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2008/implementTurbulenceModel.pdf

I would put the model not under applications, but of course you're free to choose.

Good luck.
Alex.

FelixL February 25, 2011 06:59

@salvoblack: Can't really help you on this one... it compiles without complaining on my system. This is how I compile it:

- put the folder gammaReThetatSST inside the directory src/turbulenceModels/incompressible/RAS/
- in src/turbulenceModels/incompressible/RAS/Make/files I add the line gammaReThetatSST/gammaReThetatSST.C
- compile with wmake libso (working directory src/turbulenceModels/incompressible/RAS/)

@Alex: Thanks for doing a grid dependency study, I appreciate the effort you're putting into this.
I haven't done external aerodynamic simulations with kOmegaSST yet, it usually isn't my turbulence model of choice for airfoil calculations. So, no, no experience with this.

salvoblack February 25, 2011 08:51

ok!! now it works thanks a lot!!

p.s. do you know if it is possible to do a run with a 3D mesh???...i would study the case of a wing...

aloeven February 25, 2011 10:27

Quote:

Originally Posted by salvoblack (Post 296952)
...i would study the case of a wing...

Ok, I would suggest to try an airfoil first to get an idea of how this model works. And definitely read the thesis of Langtry. There are important mesh requirements on y+, stretching ratio and resolution on the surface.
Langtry shows a lot of 3D test cases in his thesis, so it is possible, yes.

salvoblack February 25, 2011 14:06

Hello.
I have implemented the model of turbulence proposed by Felix and I have studied the case of a NACA 64312 airfoil.
These are the results
Re = 3 * 10 ^ 6 M = 0.16 Alpha = 4

Spalart-Allmaras model (fully turbulent)
Cd = 0.0325551
Cl = 0.662492
Cm = 0.0686287

K-omega model (fully turbulent)
Cd = 0.00995945
Cl = 0.701517
Cm = 0.0665175

Transition model
Cd = 0.0113176
Cl = 0.696949
Cm = 0.0652054

I also used xfoil and i heve these results with the same conditions cl=0.707 cd=0.008

As you can see the results of the model of transition are very good when compared to the model Spalart-allmaras (decrease of Cd and increase of Cl), while they are a little less when compared to the k-omega.
What do you think?

Finally could you clarify the discussion on the prerequisites that must have the mesh? where can I check that my mesh is ok??

FelixL February 27, 2011 05:52

Hello,


what k-Omega model were you using for your simulations? The "old" version of Wilcox' model (as implemented in OF) ist quite sensitive to freestream data.

For the grid requirements when using the gamma-ReTheta turbulence model please read the Thesis of LANGTRY. If I recall correctly he dedicated a whole subchapter of the appendix to this topic.


Greetings,
Felix

salvoblack February 27, 2011 16:41

hello felix, thank you for your answer. i will study the thesis....
for the version of the k-omega model, i use the one that is present in the version 1.7. do you think that this version is not reliable???

FelixL February 28, 2011 02:48

Hello,


no, I wouldn't say that. It's just the model is quite sensitive to inlet conditions. You can try and vary omega at the inlet/freestream a bit and have a look if it changes the drag values.

You could also try another turbulence model - k-omega SST for example.


Greetings,
Felix.


All times are GMT -4. The time now is 17:49.