CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   kOmegaSST Transition Model in OF 3.0.1 (https://www.cfd-online.com/Forums/openfoam-programming-development/167864-komegasst-transition-model-3-0-1-a.html)

Kina March 10, 2016 10:12

kOmegaSST Transition Model in OF 3.0.1
 
Hi there,
I am currently doing some analysis of airfoils and I have read about the transition formulation for the OF kOmegaSST model here:
http://www.tfd.chalmers.se/~hani/kur...transition.pdf

Unfortunately, the tutorial is written for OF 2.0 while I am running 3.0.1. I can't compile the turbulence model because some data simply isn't there or has significantly changed during the updates. Thus, I have 2 questions:

1. Does a newer version of this transition model implementation exist somewhere?
2. In what way is the kkLOmega-model similar to this and is it possible to generate this transition model from the kkLOmega and kOmegaSST source files?

I am thankful for any kind of help!
Cheers
Alex

HelioVillanueva March 17, 2016 20:27

kOmegaSST Transition Model in OF 3.0.x
 
Just did and you can find the code here: https://github.com/HelioVillanueva/helio-3.0.x.git

I used the material of prof. Hakan Nillson and Ayyoob Zarmehri and tried to change as little as possible starting from the kOmegaSST. What significantly changed was the transitionDict file which is no longer needed. The freeStreamU parameter is provided inside the turbulenceProperties and has a standard value of 5.4 (used in the flatPlate tutorial).

The code seems to work as expected for the tutorial presented in the report. Please, help validate the code and share your experience with it.

The tutorial case reported is also in the link above (flatPlate). Note that to plot the last figure of the report in paraview I used the Plot Over Line filter with the points (0.05,1e-6,0.05) and (2.95,1e-6,0.05) in the internal mesh.

To use this code clone the repository and copy the contents of helio-3.0.x to your OpenFOAM user folder. Then compile the 'findroot' codes in src/findroot by
Code:

wmake libso
inside findroot folder.

For the turbulence models, just run the Allwmake scrip in src/TurbulenceModels and it should compile well.

Kina March 20, 2016 06:36

Hi Helio,

thank you very much for the implementation of the code for OF 3.0.1! :) I will do extensive testing in the following days and report back to you how well it compares to CFX transition data.

Cheers
Alex

giammy92 May 12, 2016 15:50

Hi Elio!
How do you have calculated Ret to inlet?

HelioVillanueva May 13, 2016 10:23

Hi!
You can find in the report by prof. Hakan Nillson (http://www.tfd.chalmers.se/~hani/kur...transition.pdf, same link Alex pointed) on page 22 that the inlet condition for Ret was calculated using eqs 3.24-3.28 on page 16. You can also find these eqs on page 14 (eqs 24-25) in Malan, Paul, Keerati Suluksna, and Ekachai Juntasaro. "Calibrating the γ-Reθ transition model for commercial cfd." 47th AIAA Aerospace Sciences Meeting. 2009.

giammy92 May 18, 2016 06:20

Hi Helio, i have a problem in compilation. For compilation in findroot all ok, but when i run allwmake from directory bin a i type:
wmake $targetType ../findroot/
the terminal is closed and i can't conclude compilation. Could you help me to resolve this error?:confused:

HelioVillanueva May 18, 2016 08:07

compilation kOmegaSST Transition Model in OF 3.0.x
 
Hi giammy92!

It was a little confusing to have to compile the findroot folder first and then the turbulence models, so I included in the Allwmake a line to compile it automatically. In summary after cloning the repository and copying the files to your OF user folder, you just have to run the Allwmake in a terminal to compile all. Could you please try it again and see if it works.

giammy92 May 18, 2016 08:30

I have proper follow instructions in your Allwmake file:

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory

# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType ../findroot/
#wmake $targetType turbulenceModels
wmake $targetType incompressible
wmake $targetType compressible

but when i arrive to type wmake $targetType ../findroot/ the terminal is closed inexplicably.

HelioVillanueva May 18, 2016 10:21

Hi giammy92!

Sorry but I don't actually know why it is happening. If you managed to compile the findroot separately (going to the folder and wmake libso there), you could try to skip this line of the Allwmake and jump to the compilation of the models. Please see if it works.

giammy92 May 18, 2016 13:48

sorry helio, could show me how to compile a turbulence model? i need SST transition gamma-theta

HelioVillanueva May 19, 2016 08:53

It should be as simple as open a terminal in yourOFuser-3.0.x/src/TurbulenceModels and run the Allwmake (like this ./Allwmake). I assumed that this way didn't work for you since you were typing line by line of the Allwmake, so if this is really the case, type the lines and skip the one for the findroot (but this way you have to compile findroot separately before). The commands to compile the turbulence models are
Code:

wmake $targetType incompressible
wmake $targetType compressible


giammy92 June 8, 2016 09:57

Hi Helio! i have compiled with Allwmake in src/turbulencemodels and it seems that has compiled with Allwmake but in the end tell me that miss findRoot.H:

gianmichele@gianmichele-K52Jc:~/OpenFOAM/gianmichele-3.0.1/helio-3.0.x-master/src/TurbulenceModels$ ./Allwmake
+ wmake libso ../findroot/
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file findRoot.C
g++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam30/src/finiteVolume/lnInclude -I/opt/openfoam30/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam30/src/OpenFOAM/lnInclude -I/opt/openfoam30/src/OSspecific/POSIX/lnInclude -fPIC -c findRoot.C -o Make/linux64GccDPInt32Opt/findRoot.o
g++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam30/src/finiteVolume/lnInclude -I/opt/openfoam30/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam30/src/OpenFOAM/lnInclude -I/opt/openfoam30/src/OSspecific/POSIX/lnInclude -fPIC -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/findRoot.o -L/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib \
-lfiniteVolume -o /home/gianmichele/OpenFOAM/gianmichele-3.0.1/platforms/linux64GccDPInt32Opt/lib/libfindroot.so
'/home/gianmichele/OpenFOAM/gianmichele-3.0.1/platforms/linux64GccDPInt32Opt/lib/libfindroot.so' is up to date.
+ wmake libso incompressible
Make/options:13:34: warning: backslash-newline at end of file [enabled by default]
LIB_LIBS = -L$(FOAM_USER_LIBBIN) \
^
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file makeMyIncompressibleTurbulenceModel.C
could not open file findRoot.H for source file makeMyIncompressibleTurbulenceModel.C due to No such file or directory
g++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I../turbulenceModels/RAS/kEpsilonPANS -I../turbulenceModels/RAS/kOmegaSSTSASnew -I../turbulenceModels/RAS/kOmegaSSTPANS -I../turbulenceModels/RAS/kOmegaSSTgammaReTheta -I/opt/openfoam30/src/transportModels -I/opt/openfoam30/src/finiteVolume/lnInclude -I/opt/openfoam30/src/meshTools/lnInclude -I/opt/openfoam30/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam30/src/TurbulenceModels/incompressible/lnInclude -I/home/gianmichele/OpenFOAM/gianmichele-3.0.1/run/../src/findroot -IlnInclude -I. -I/opt/openfoam30/src/OpenFOAM/lnInclude -I/opt/openfoam30/src/OSspecific/POSIX/lnInclude -fPIC -c makeMyIncompressibleTurbulenceModel.C -o Make/linux64GccDPInt32Opt/makeMyIncompressibleTurbulenceModel.o
In file included from makeMyIncompressibleTurbulenceModel.C:74:0:
../turbulenceModels/RAS/kOmegaSSTgammaReTheta/kOmegaSSTgammaReTheta.H:124:22: fatal error: findRoot.H: File o directory non esistente
#include "findRoot.H"
^
compilation terminated.
make: *** [Make/linux64GccDPInt32Opt/makeMyIncompressibleTurbulenceModel.o] Errore 1
gianmichele@gianmichele-K52Jc:~/OpenFOAM/gianmichele-3.0.1/helio-3.0.x-master/src/TurbulenceModels$

giammy92 June 8, 2016 11:02

Ok i have been able to compiled incompressible turbulence models, adding missing files in lnInclude of incompressible's directory.
So now i can use komegaSSTRetheta but i can't give a value to Ret in inlet because by equation that you have suggested Ret = (1173.51 - 589.428Tu + 0.2196 / (Tu)^2) * F(lambatheta) when turbulence intensity Tu < 1.3
So i have to know function F(lambdatheta) but i don't know the value of lambdatheta...do you know how i can determine it?

malv83 June 17, 2016 15:51

new transition model
 
After 8 years, there is a new version (or new model) of the k-kl-omega model.

There are a few problems with the k-kl-omega model in the farfield. One of them is the growth of Laminar Kinetic energy when separation occurs. Lopez and Walters have a paper (have not been published yet) correcting this issue:

Maurin Lopez. D. K. Walters. “A recommended correction to the k-kl-omega transition sensitive eddy-viscosity model”. Journal of Fluid Engineering.

This correction has to be made to the 2008 k-kl-omega model from now on.

Now, Lopez and Walters also developed a new transitional model (k-omega-v2) as an alternative to the k-kl-omega one. This new model has more capabilities (it is more reliable) than the k-kl-omega model, especially in the farfield computations. Fortunately the paper for this new model is already publish.

Maurin Lopez. D. K. Walters. “Prediction of transitional and fully turbulent free shear flows using an alternative to the laminar kinetic energy approach”. Journal of Turbulence, Vol 17, Iss. 3, 2016.

If you see the papers, you will immediately see how the k-kl-omega model is not good for free shear flows, and how the new model corrects all those issues. From now on, k-kl-omega users have to start using the new k-omega-v2 model.
malv83 is online now Add to malv83's Reputation Report Post Edit/Delete Message Reply With Quote Multi-Quote This Message Quick reply to this message

HelioVillanueva June 17, 2016 17:57

BCs
 
Hi giammy92!

By the log you posted and your directory structure (gianmichele@gianmichele-K52Jc:~/OpenFOAM/gianmichele-3.0.1/helio-3.0.x-master/src/TurbulenceModels$) the make files won't work properly. Your directory structure should be like this:

Code:

gianmichele@gianmichele-K52Jc:~/OpenFOAM/gianmichele-3.0.1/src/TurbulenceModels$
You see, the files from the repo should be copied to your OF user folder (without the directory with the repos name). This way I think the compilation by just "./Allmake" should work.

Concerning the BCs, in prof. Hakan Nillson report you find in page 15 eq. 3.21 the way to calculate lambdaTheta. If you read the report on page 22 you will see how they used this equation

Code:

The inlet boundary condition for Ret should be calculated by Eq.s 3.24-3.28 based on zero velocity
gradient and free stream turbulent velocity which in this case becomes 171.


Jack001 November 6, 2016 12:07

Hello,

I followed the steps above and running the Allwmake proceeded without any problems. However when running the flatplate test case I get the following error. This is despite the fact that the library libmyincompressibleturbulenceModels.so is found in

/home/foamusr/OpenFOAM/foamusr-3.0.0/platforms/linux64GccDPInt32Opt/lib

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  3.0.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 3.0.0-6abec57f5449
Exec  : simpleFoam
Date  : Nov 06 2016
Time  : 17:04:29
Host  : "loginusr"
PID    : 109472
Case  : /home/foamusr/OpenFOAM/foamusr-3.0.0/run/flatplate
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

--> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : libmyincompressibleturbulenceModels.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libmyincompressibleturbulenceModels.so"
Create mesh for time = 0


SIMPLE: convergence criteria
    field p        tolerance 0.01
    field U        tolerance 0.001
    field "(k|omega|Ret|intermittency)"        tolerance 0.001

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model kOmegaSSTgammaReTheta


--> FOAM FATAL ERROR:
Unknown RASModel type kOmegaSSTgammaReTheta

Valid RASModel types:

17
(
LRR
LamBremhorstKE
LaunderSharmaKE
LienCubicKE
LienLeschziner
RNGkEpsilon
SSG
ShihQuadraticKE
SpalartAllmaras
kEpsilon
kOmega
kOmegaSST
kOmegaSSTSAS
kkLOmega
qZeta
realizableKE
v2f
)


    From function RASModel::New(const volScalarField&, const volVectorField&, const surfaceScalarField&, transportModel&, const word&)
    in file ../turbulenceModels/lnInclude/RASModel.C at line 161.

FOAM exiting


tilasoldo November 21, 2016 08:34

The same for 4.x
 
Hello,

Thanks Helio Villanueva for your work, I just did the same for OpenFoam 4.x in this thread. It has changed again because kOmegaSST is now also a template, and the files to modify are now in TurbulenceModels/turbulenceModels/Base.

bullmut February 2, 2017 03:32

Hi all

I have been going through the code for the 3.0 version and the original 2.0.x
I am struggling with 1 line: In the git repository posted by HelioVillanueva, in
src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTgammaReTheta/kOmegaSSTgammaReTheta.C on line 591:
Code:

volScalarField Ptheta = 0.03*pow(mag(U),2.0)/(500.0*nu*(1.0-Ftheta,1.0));
My confusion is around the last term (1.0-Ftheta,1.0). In C++ does this not mean that both statements are evaluated and only the 2nd statement returned? If thats the case what does statement 1 achieve? do we not always return
Code:

0.03*pow(mag(U),2.0)/(500.0*nu*1.0);
In evaluate statement 1 we dont change any linked variables within the code...

Also as an edit -> should the division not be just by 500*nu()? The 1.0-Ftheta should not be included in the division.

I hope someone can help me with this.
Regards


All times are GMT -4. The time now is 08:16.