CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Turbulence models implementation

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 2, 2006, 04:49
Default Hi everybody, Since I can't
  #1
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
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 is offline   Reply With Quote

Old   November 6, 2006, 03:44
Default Hi everibody, I did the imp
  #2
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
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
vinz is offline   Reply With Quote

Old   November 6, 2006, 04:19
Default You don't need to recompile Fo
  #3
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
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
dmoroian is offline   Reply With Quote

Old   November 6, 2006, 04:38
Default Hi Vincent, Just a question :
  #4
jbrunel
Guest
 
Posts: n/a
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
  Reply With Quote

Old   November 6, 2006, 04:58
Default Hi Jonathan and Dragos, Ok
  #5
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
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 is offline   Reply With Quote

Old   November 6, 2006, 12:02
Default After the implementation of k-
  #6
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
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
vinz is offline   Reply With Quote

Old   November 7, 2006, 04:32
Default Hi Jonathan, if you want to
  #7
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
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.
mattijs is offline   Reply With Quote

Old   November 7, 2006, 04:46
Default Hi Mattijs, Should I compil
  #8
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
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
vinz is offline   Reply With Quote

Old   November 7, 2006, 05:11
Default Thank you Mattijs for your ans
  #9
jbrunel
Guest
 
Posts: n/a
Thank you Mattijs for your answer!
  Reply With Quote

Old   November 7, 2006, 13:22
Default >or should I recompile simpleF
  #10
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
>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.
mattijs is offline   Reply With Quote

Old   November 10, 2006, 06:43
Default Hi Vincent, any success?
  #11
jbrunel
Guest
 
Posts: n/a
Hi Vincent,
any success?
  Reply With Quote

Old   November 10, 2006, 07:02
Default Hi Jonhatan, Unfortunately,
  #12
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
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
vinz is offline   Reply With Quote

Old   December 2, 2006, 14:31
Default Dear All, I wrote the k-Ome
  #13
Senior Member
 
Daniele Panara
Join Date: Mar 2009
Posts: 101
Rep Power: 17
panara is on a distinguished road
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..

kOmegaTutorials.tar.gz

kOmegaTurbulenceModels.tar.gz

regards,

Daniele
panara is offline   Reply With Quote

Old   December 2, 2006, 14:39
Default Hi Daniele, Awesome! I'm a
  #14
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road
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
egp is offline   Reply With Quote

Old   December 2, 2006, 15:04
Default no it works without wall funct
  #15
Senior Member
 
Daniele Panara
Join Date: Mar 2009
Posts: 101
Rep Power: 17
panara is on a distinguished road
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

turbFoamPsource.tar.gz
panara is offline   Reply With Quote

Old   December 6, 2006, 03:41
Default Great Daniele, that is what Op
  #16
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 203
Rep Power: 18
hani is on a distinguished road
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.
hani is offline   Reply With Quote

Old   December 6, 2006, 04:01
Default Hi, And thanks Daniele sinc
  #17
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
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
vinz is offline   Reply With Quote

Old   December 6, 2006, 06:59
Default I was using setenv FOAM_SIGFP
  #18
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 203
Rep Power: 18
hani is on a distinguished road
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 is offline   Reply With Quote

Old   December 6, 2006, 08:47
Default Maybe you already have a nice
  #19
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 203
Rep Power: 18
hani is on a distinguished road
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.
hani is offline   Reply With Quote

Old   December 7, 2006, 15:56
Default Sorry for the late reply, I
  #20
Senior Member
 
Daniele Panara
Join Date: Mar 2009
Posts: 101
Rep Power: 17
panara is on a distinguished road
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
panara 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
SA Turbulence model implementation ganesh Main CFD Forum 0 March 6, 2006 13:23
k-w Turbulence model implementation suneesh Main CFD Forum 4 November 23, 2005 18:35
Numerical Implementation of LES Wall models dragon Main CFD Forum 2 March 14, 2005 01:53
turbulence models rail cfd Main CFD Forum 7 August 25, 2004 01:20
A reference on implementation of Spalart-Alam. Turbulence Model? Mohammad Kermani Main CFD Forum 2 December 26, 1999 03:56


All times are GMT -4. The time now is 05:31.