CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Turbulence models implementation (https://www.cfd-online.com/Forums/openfoam-solving/58916-turbulence-models-implementation.html)

vinz November 2, 2006 03:49

Hi everybody, Since I can't
 
Hi everybody,

Since I can't obtain expected results with the turbulence models presents in OpenFOAM. I would like to implement two other models, k-omega and SST.
Did someone allready tried this in the past?

Best regards,

Vincent

vinz November 6, 2006 02:44

Hi everibody, I did the imp
 
Hi everibody,

I did the implementation of the k-omega turbulence model, and I recompiled the turbuelence models. However, when opening FoamX I don't see my model. Should I recompile the whole code? Or is there any manipulation to do to see a model in FoamX.
Thanks in advance.

Vincent

dmoroian November 6, 2006 03:19

You don't need to recompile Fo
 
You don't need to recompile FoamX, just add the proper configuration files. Though, why bother, when you could do what FoamX does directly?

Dragos

jbrunel November 6, 2006 03:38

Hi Vincent, Just a question :
 
Hi Vincent,
Just a question : do you intend that model to be part of the public released openfoam distribution.
As there was some interest already expressed within this forum, I suppose that this model is of interest for many other users. (I was planning to do this in the mid term anyway)

And a more general question, this time for anybody : what is the process to follow to have any kind of model being incorporated within the openfoam public release? (the link related to this question in the faq of openCFD website doesn't work)

Thanks,

Jonathan BRUNEL

vinz November 6, 2006 03:58

Hi Jonathan and Dragos, Ok
 
Hi Jonathan and Dragos,

Ok for the configuration file, I just found it.
Concerning the k-omega model. Before putting it in the public release, I have to test it. But if it works, I would be pleased to see it in the next version of OpenFOAM. I'm also planing to add other models, like SST, if the k-omega implementation works fine.

vinz November 6, 2006 11:02

After the implementation of k-
 
After the implementation of k-omega model in the source. I tried to run simpleFoam from FoamX (but also using a command line). I end up with the following error:

Foam::error::printStack(Foam:: Ostream&)
Foam::sigSegv:: sigSegvHandler(int)
[0x552420]
std::basic_ostream<char,> >& std::operator<<>, std::allocator<char> >(std::basic_ostream<char,> >&, std::basic_string<char,>, std::allocator<char> > const&)
Foam:: OSstream::write(Foam::word const&)
Foam::operator<<(Foam:: Ostream&, Foam::word const&)
simpleFoam [0x805ebf4]
simpleFoam [0x806b2a1]
simpleFoam [0x8056f4d]
__libc_start_main
__gxx_personality_v0


Does anyone have any idea of where it can come from?

Thanks,

Vincent

mattijs November 7, 2006 03:32

Hi Jonathan, if you want to
 
Hi Jonathan,

if you want to make your code publicly available I guess the best thing is to put it on a central place in the OpenFOAM Wiki (http://openfoamwiki.net/index.php/Main_Page).

Vincent,

you could compile your code with -DFULLDEBUG -g -O0 and do a traceback in the debugger.

vinz November 7, 2006 03:46

Hi Mattijs, Should I compil
 
Hi Mattijs,

Should I compile the turbulence model using:
Allwmake -DFULLDEBUG -g -O0
or should I recompile simpleFoam?
SOrry if my question is stupid, I'm a beginer i the domain.
Thanks,

Vincent

jbrunel November 7, 2006 04:11

Thank you Mattijs for your ans
 
Thank you Mattijs for your answer!

mattijs November 7, 2006 12:22

>or should I recompile simpleF
 
>or should I recompile simpleFoam?

Your traceback shows it is trying to print something ('<<') from simpleFoam so I'd compile that with above debugging. Search this forum for Make/options.

jbrunel November 10, 2006 05:43

Hi Vincent, any success?
 
Hi Vincent,
any success?

vinz November 10, 2006 06:02

Hi Jonhatan, Unfortunately,
 
Hi Jonhatan,

Unfortunately, I didn't succes but I'm still working on it. I conduct different things at the same time, so it takes a while to have results. But I don't give up, I let you know as soon as I have interesting results.

Vincent

panara December 2, 2006 13:31

Dear All, I wrote the k-Ome
 
Dear All,

I wrote the k-Omega, k-Omega BSL and k-Omega SST turbulence models.

I tested them in a simple channel configuration and they seem to have resonable results.

I post them in the discussion group hoping that you can test them and contribute to their development..

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif kOmegaTutorials.tar.gz

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif kOmegaTurbulenceModels.tar.gz

regards,

Daniele

egp December 2, 2006 13:39

Hi Daniele, Awesome! I'm a
 
Hi Daniele,

Awesome! I'm a big fan of k-omega and will test today. By the way, are the designed to also work with wall functions, or are they for sub-layer resolution only?

Eric

panara December 2, 2006 14:04

no it works without wall funct
 
no it works without wall functions you have to specify omega at the boundary equal to 10*6*nu/(beta deltay^2)

I forgot to attach also the turbFoam with a pressure source term to be used with the test cases

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif turbFoamPsource.tar.gz

hani December 6, 2006 02:41

Great Daniele, that is what Op
 
Great Daniele, that is what OpenSource is all about - sharing and helping eachother. I'm eager to examine your k-omega turbulence models.

I have downloaded your files but when running I ran into some problems, which you might be able to explain to me:

1: The k and omega value at <fixedwalls> had to be rewritten as
<fixedwalls>
{
type fixedValue;
value uniform 1e-10;
}
i.e. including 'uniform'

2: I get a Floating exception when the solver reaches the k-equation in tutorial ChannelOmega:
Time = 0.0001
Courant Number mean: 0.0036 max: 0.1
BICCG: Solving for Ux, Initial residual = 1, Final residual = 1.47436e-07, No Iterations 3
BICCG: Solving for Uy, Initial residual = 1, Final residual = 3.0616e-06, No Iterations 2
ICCG: Solving for p, Initial residual = 1, Final residual = 8.87922e-07, No Iterations 16
time step continuity errors : sum local = 1.00885e-12, global = 4.13544e-14, cumulative = 4.13544e-14
ICCG: Solving for p, Initial residual = 0.330426, Final residual = 2.9432e-07,No Iterations 16
time step continuity errors : sum local = 9.1028e-13, global = 1.17317e-13, cumulative = 1.58671e-13
Floating exception

Was your development made in 1.3 or any other version? I managed to compile it for 1.3 (Hrvs development version) without modifications.

I guess that this tutorial runs perfectly for you?
Do you have any ideas what might cause the problem?

Håkan.

vinz December 6, 2006 03:01

Hi, And thanks Daniele sinc
 
Hi,

And thanks Daniele since you did what I didn't manage to do.
For me, the tutorial case is running perfectly (at least ChannelOmega, I didn't try the others yet). However, since I want to do the computaion on a flat plat, the first modification that I tried was to separate the <fixedwalls> into two seperated walls (top and down). Strangely, just making this modification, it doesn't work any more (for me). It blows up after two or three time step.Notice thta I kept all the original boundary conditions. (I just separated the one for <fixedwalls> into two similar bc for top and down)
Does somebody have an idea of what could be the problem?
Anyway, this turbulence model will certainly be very helpfull, thanks again.

Regards,

Vincent

hani December 6, 2006 05:59

I was using setenv FOAM_SIGFP
 
I was using
setenv FOAM_SIGFPE 1 #Halts on Nan/Floating Point Exceptions

I.e. there is a problem somewhere with floating point exceptions.

Without this environment variable everything seems to work fine.

Is there a way to name the library to something else than libincompressibleTurbulenceModels.so? I want to be able to use the original library in other runs without having to modify LD_LIBRARY_PATH all the time.

Håkan.

hani December 6, 2006 07:47

Maybe you already have a nice
 
Maybe you already have a nice way of doing turbulence model development, but here's an example of how you can do it without affecting executables linking with the original libincompressibleTurbulenceModels.so

Make a src directory in your $WM_PROJECT_USER_DIR
Put Daniele's turbulenceModels directory in that src directory (the turbulenceModels directory should have the same structure as that in the OpenFOAM src directory)

Modify the following files according to:
$WM_PROJECT_USER_DIR/src/turbulenceModels/incompressible/Make/files:
LIB = $(FOAM_USER_LIBBIN)/libincompressibleTurbulenceModelsOmega
(gives your new library a different name than the original one)

$WM_PROJECT_USER_DIR/applications/turbFoamPsource/Make/options:
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(WM_PROJECT_USER_DIR)/src/turbulenceModels \
-I$(LIB_SRC)/transportModels

EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lincompressibleTurbulenceModelsOmega \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools

There might be a nicer way to do this, but at least this seems to work.

Håkan.

panara December 7, 2006 14:56

Sorry for the late reply, I
 
Sorry for the late reply,

I made the models with OF 1.3.

The floating point exception could come from some division with zero.. try to initialize the field with small value of k and omega and see if you have the same problem... It could be that I have forgotten somewhere to prevent division with zero..

for the error of vincent.. I have no idea why you get this error, can you post the BC you are using?

Hakan, thanks for the tipp about the linking, I was wondering how to overcome the same problem but I didn't have much time to look at the problem more in details..

I will try your way..

Daniele

gschaider December 11, 2006 04:39

About the "I don't want to rec
 
About the "I don't want to recompile the Original-Libs if I test a new turbulence model" problem mentioned above. I did a small patch the supports that:

http://openfoamwiki.net/non_cdl/Open...ib_plugInPatch

With that patch you develop your turbulence model in a separate library (for instance libKOmega.so). If you want to use the new turbulence model with your case you add a file constant/plugInDict to it which has an entry that tells the executable to load the library. From then on all the turbulence models in the library are usable like the "regular" ones in the distribution (due to the technical wonder that is called runTime-selection). And there is no need to recompile Executables like rhoTurbFoam. (But you have to recompile libOpenFOAM.so once)

(BTW: this works for everything that is runTime-selectable: BCs, thermoPhysical-models etc)

gschaider December 11, 2006 12:17

Hi Daniele! As another guy
 
Hi Daniele!

As another guy here wants to test-drive your k-omega-Implementation and I don't want to modify our OpenFOAM-installation, I took the liberty and reorganized the code a bit into a library. Now the k-omega model should live in peace with the other incompressible turbulence models. You can either add it to a solver with -lkOmegaIncompressible or use the plugIn-patch described above.

What I did was add an intermediate class turbulenceModelOmega and let all kOmega-Models inherit from that. The class adds a method to calculate epsilon (because turbulenceModel expects that) from omega (I'm not sure about that. Maybe there is a Cmu missing in there).

Apart from that I didn't touch the physics (I hope).



regards
Berhard

gschaider December 11, 2006 12:25

The message-board hates me (an
 
The message-board hates me (and won't let me load up an attachment). The code of the library can be found at:
http://openfoamwiki.net/index.php/Im...essible.tar.gz
(but I'll try to upload the file once more)

gschaider December 11, 2006 12:27

Another try at uploading: htt
 
Another try at uploading: http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif kOmegaIncompressible.tar.gz

myting December 22, 2006 02:21

Hi, I compiled the k-Omega
 
Hi,

I compiled the k-Omega Model successful.My question is how I can use it in FoamX?

Thank you
Myting

gschaider December 22, 2006 07:00

You can't. You'll have to edit
 
You can't. You'll have to edit constant/turbulencePropertiesDict

panara January 9, 2007 17:01

Dear all, I have uploaded i
 
Dear all,

I have uploaded in the openFoam wiki the k-omega SST sas model.
I tested the model and the results seem to be quite ok..

have fun

Daniele

braennstroem August 1, 2007 05:38

Hi Daniele, just a small qu
 
Hi Daniele,

just a small question about the k-omega SST SAS model. Do you think that it can be used for room airflow calculations with mixed convection?

Regards!
Fabian

qtian August 5, 2007 11:02

Hi Daniele, Can you please an
 
Hi Daniele,
Can you please answer some my questions about your comments regarding "no it works without wall functions you have to specify omega at the boundary equal to 10*6*nu/(beta deltay^2)"?
Is the SST model in OPFoam 1.4 from this thread?

Do I have to refine my mesh near the wall accordingly: Y+>40 for high Reynolds RANS models, like for the K-epsilon model?

I am running a simulation of three dimensional flow over a hill with k-epsilon and k-omega model. I am very interested in the near wall pressure (adverse pressure gradient) and velocity results. Will this SST model behave well for this kind of flow, without wall function treatment?

Thank for your help and comment! If anyone can answer my question, please do so and I really appreciate it.

Quinn

waynezw0618 April 29, 2008 10:28

Hi Daniele where should i d
 
Hi Daniele

where should i download you code of SST-SAS model and is there any tutorial of that?
or could you please send me a copy?

thanks!

wayne


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