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 with lowRe-damping (as in Fluent) (https://www.cfd-online.com/Forums/openfoam-programming-development/134102-komegasst-lowre-damping-fluent.html)

RodriguezFatz April 24, 2014 08:31

kOmegaSST with lowRe-damping (as in Fluent)
 
5 Attachment(s)
Dear all,

I added some functions to the kOmegaSST model, that are called "low Reynolds number corrections" in the Fluent manual. Unfortunately, I don't get the same results as in Fluent, so obviously I did something wrong :o.
I tried to make everything as "fluent-like" as possible, so I used all the constant names and so on as in Fluent. I added a few functions (all these alphaStar, alphaStarZero, betaStar, ...) and changed a bit in the differential equations.

For debugging I used a periodic pipe flow (3D).
1) In the standard OpenFoam kOmegaSST model, I get nearly exactly the same results for k,omega,nut and U, as for the Fluent version (with deactivated "low Re corrections").
2) In the new lowRe model I get k-values and nut-values about a factor of 3 lower than in Fluent. I didn't compare omega and U here.

If anyone also wants to use this model, I would be happy about any debugging help. I attached the files to this post.

Attachment 30344
Attachment 30345

I could easily compile these functions by creating a directory "kOmegaSST_new" with the two sub-directories "k_omegaSST_lowRe" (<- place the .H and .C file here) and "Make". In "Make", create two files, one called "files" and one called "options".
"files" looks like:
Code:

kOmegaSST_lowRe/kOmegaSST_lowRe.C

LIB = $(FOAM_LIBBIN)/libMyIncompressibleRASModels

and "options" looks like:
Code:

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 = \
    -lincompressibleTurbulenceModel \
    -lincompressibleRASModels \
    -lfiniteVolume \
    -lmeshTools

For compiling I go into the main directory and type "wmake libso".
Then, in my OpenFoam case I change the controlDict libs to
Code:

libs
(
    "libOpenFOAM.so"
    "libincompressibleTurbulenceModel.so"
    "libMyIncompressibleRASModels.so"
    "libincompressibleRASModels.so"
);

and the RASProperties to
Code:

RASModel        kOmegaSST_lowRe;
k at the wall is set to 1e-12, nut to calculated and omega to omegaWallFunction.


Edit: These are results for the regular OpenFoam model and Fluent without low-Re damping I am talking about at "1)". The grid size is y+ = 0.44 at the pipe wall.
Attachment 30346
Attachment 30347
Attachment 30348

sangbin.hana May 7, 2014 11:55

Thank you for your help thanks

RodriguezFatz May 13, 2014 03:25

4 Attachment(s)
Hey guys,

I am glad to tell you that it works now. I made two comparisons between Fluent and my low-Re version in OpenFoam and they match!
After some debugging I found two errors in the Fluent manual but have a look:

Channel Flow:
Attachment 30786

Attachment 30787

Attachment 30788

Attachment 30789

RodriguezFatz May 13, 2014 03:26

4 Attachment(s)
Pipe Flow:
Attachment 30793

Attachment 30790

Attachment 30791

Attachment 30792

RodriguezFatz May 13, 2014 03:29

1 Attachment(s)
New version (1.0) of the OpenFoam model.
Attachment 30794
By the way: This is from Fluent version 15.0, incompressible flow,
boundary conditions for walls are:
U=(0,0,0), p=zeroGradient, k=1e-12, omega=omegaWallFunction, nut=calculated (or 0)

If you use it and find some bugs, please post!

bluenail May 13, 2014 03:52

I appreciate your support Thanks

k-w model is more powerful than k-e model in specific type of reactor

So, I will use this.

I have some question,

During your work, what is tool to edit your code?

Eclipse or Qt-creator or text based?

I hope you post more valuable thing about openfoam. Thanks

RodriguezFatz May 13, 2014 04:07

Hi, I use gedit in ubuntu.

sivakumar May 13, 2014 04:16

Hi Philip,
I am trying to compile the code, its giving the error message.

the message is:

/kOmegaSST_lowRe$ wmake libso
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file kOmegaSST_lowRe/kOmegaSST_lowRe.C
SOURCE=kOmegaSST_lowRe/kOmegaSST_lowRe.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/cerecam/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels -I/home/cerecam/OpenFOAM/OpenFOAM-2.1.1/src/transportModels -I/home/cerecam/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude -I/home/cerecam/OpenFOAM/OpenFOAM-2.1.1/src/meshTools/lnInclude -I/home/cerecam/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/RAS/lnInclude -IlnInclude -I. -I/home/cerecam/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/home/cerecam/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/kOmegaSST_lowRe.o
kOmegaSST_lowRe/kOmegaSST_lowRe.C: In member function ‘virtual void Foam::incompressible::RASModels::kOmegaSST_lowRe:: correct()’:
kOmegaSST_lowRe/kOmegaSST_lowRe.C:495:28: error: ‘GName’ was not declared in this scope
make: *** [Make/linux64GccDPOpt/kOmegaSST_lowRe.o] Error 1


can you please tell me, what i need to change.

Thanks,
Sivakumar

RodriguezFatz May 13, 2014 04:30

Hi Sivakumar,

Please have a look here:
http://www.cfd-online.com/Forums/ope...tml#post469730
It seems that you are facing an error because you use version 2.1 and not 2.3 like me.
I hope that helps.

pbachant June 1, 2014 13:34

This is great, thanks! Have you compared this to the foam-extend-3.0 kOmegaSST_lowRe model?

Also, you may want to put this up on GitHub or similar to make it easier to distribute new versions and collaborate on new developments.

RodriguezFatz June 2, 2014 02:54

Pete, I didn't know they also have a version. But I just had a look and it is not the same. It seems that they integrated the omega boundary condition into the code. I don't see any big differences to the regular kOmegaSST model. Maybe someone should correct me.

In "my" (Fluent's) version, there are several damping functions as suggested by Wilcox in his paper "Simulation of Transition with a Two-Equation Turbulence Model", AIAA Journal Vol 32 No 2 February 1994. Equations 9 - 15. The exact values are slightly changed in Fluent.

akidess November 16, 2015 02:03

For anyone interested, Pete put the code on Github :)

https://github.com/petebachant/kOmegaSSTLowRe

giammy92 April 27, 2016 06:37

Hi,
I have compiled K-Omega SST LowRe follwing instructions by github, but when I run renumberMesh or decomposePar, i have this warning:

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : /home/gianmichele/OpenFOAM/gianmichele-3.0.1/platforms/linux64GccDPInt32Opt/lib/libmyIncompressibleRASModels.so: undefined symbol: _ZTIN4Foam29incompressibleTurbulenceModelE
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libmyIncompressibleRASModels.so"

Does it mean library isn't loaded? How resolve it?

pbachant April 27, 2016 07:13

Yep, that means the lib isn't loading. Did you get any errors when compiling?

giammy92 April 27, 2016 07:57

This compare me after compiling:

gianmichele@gianmichele-K52Jc:~/OpenFOAM/gianmichele-3.0.1/kOmegaSSTLowRe$ wmake libso
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file makeTurbulenceModels.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/turbulenceModels -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 -IlnInclude -I. -I/opt/openfoam30/src/OpenFOAM/lnInclude -I/opt/openfoam30/src/OSspecific/POSIX/lnInclude -fPIC -c makeTurbulenceModels.C -o Make/linux64GccDPInt32Opt/makeTurbulenceModels.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/turbulenceModels -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 -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/makeTurbulenceModels.o -L/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib \
-lincompressibleTransportModels -lturbulenceModels -lfiniteVolume -lmeshTools -o /home/gianmichele/OpenFOAM/gianmichele-3.0.1/platforms/linux64GccDPInt32Opt/lib/libmyIncompressibleRASModels.so
'/home/gianmichele/OpenFOAM/gianmichele-3.0.1/platforms/linux64GccDPInt32Opt/lib/libmyIncompressibleRASModels.so' is up to date.

pbachant April 27, 2016 16:57

I was able to reproduce the warning and just pushed a commit to GitHub that should fix it. Good luck!

giammy92 April 27, 2016 17:49

Thank you dear! Therefore there was an error on the library downloaded from GitHub and not an error of compilation. Now i try to recompile.
Cheers

giammy92 April 27, 2016 19:10

I don't have any warning now but my values of cl and cd are very instable and after a while my results explode. Do you recommend me particular schemes?

iLyrics June 1, 2016 08:15

I have met the same question. How do you overcome the mistake?

RodriguezFatz June 1, 2016 08:27

Hey,

What schemes do you use right now? How does the log file look like?

Philipp.


All times are GMT -4. The time now is 04:32.