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

Recompile turbulence model in OpenFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 20, 2007, 14:44
Default Hey, folks, I want to learn
  #1
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
qtian is on a distinguished road
Hey, folks,

I want to learn how to recompile turbulence models in OpenFoam. I did some tests as following.

I modified the turbulenceModel.H file by multiplying the effect viscosity by 2. Then use "wmake libso" to recompile the turbulence model.

virtual tmp<volscalarfield> nuEff() const
{
return tmp<volscalarfield>
(
new volScalarField("nuEff", 2*nut() + 2*nu())
);
}

I restarted a new simulaiton and the new results I got are almost exactly same as the previous one without changing the turbulence model. This makes me wondering whether I did right thing about recompiling the turbulence model. Can anyone give me some comments and suggestions? Thanks.

Quinn


QT
qtian is offline   Reply With Quote

Old   November 20, 2007, 16:45
Default Hi Quinn, maybe you forgot to
  #2
Senior Member
 
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17
cedric_duprat is on a distinguished road
Hi Quinn,
maybe you forgot to recompile again your solver (wmake).
because it did't change, you have to do a "touch *.C"
and then recompile to take into account ou modification in turbulence.H
hope it helps,
Cedric
cedric_duprat is offline   Reply With Quote

Old   November 20, 2007, 17:14
Default Cedric, Thanks for your rep
  #3
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
qtian is on a distinguished road
Cedric,

Thanks for your reply. I did recompile my simpleFoam solver with wmake. I did this after I recompiled the turbulence model. I don't know why the solver did not "see" the changes I made. Is there any other thing I did not consider? Thanks

Quinn
qtian is offline   Reply With Quote

Old   November 21, 2007, 04:08
Default Quinn, your solver didn't see
  #4
Senior Member
 
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17
cedric_duprat is on a distinguished road
Quinn,
your solver didn't see the changes because the solver didn't change.
that's why I told you to do a "touch simpleFoam.C" before compiling your solver.
The touch command updates the access and modification times of the named files to the current time and date. The command is useful because some commands rely on a file's access and modification times.
So the compilation will take into account your new library.
If it still doesn't work, maybe it is because it's not the right file to change :o)


Cedric
cedric_duprat is offline   Reply With Quote

Old   November 21, 2007, 10:28
Default Cedric, Thanks for the clar
  #5
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
qtian is on a distinguished road
Cedric,

Thanks for the clarification. I was thinking that "wclean" will do the same job as "touch" command.

I am rerunning my simulation now. Hopefully it will work this time. Thanks again for your help.

QT
qtian is offline   Reply With Quote

Old   November 21, 2007, 13:54
Default Unfortunately, even though I "
  #6
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
qtian is on a distinguished road
Unfortunately, even though I "touch" source file and recompiled it after I modified the turbulence model, my new simulation results is still same as before. This time, I multiplied effective viscosity by 1000 and I am not suppose to have the same results.

When I started the new simulation, I just cloned from the old simulaiton and started the new simulation from the last step of the old simulation. Will this be a problem? Is the old solver imbeded in the old case file?

If anyone know what I did wrong, please give me some suggestion. I am realy stuck here. Your help is appreciated.

QT
qtian is offline   Reply With Quote

Old   November 26, 2007, 15:15
Default Hello, folks, I deleted "k
  #7
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
qtian is on a distinguished road
Hello, folks,

I deleted "kOmegaSST/kOmegaSST.C" from turbulence model make/files and recompiled turbulence model with "wmake libso". I also recompiled my simpleFoam solver. What surprised me is that I can still use kOmegaSST model for my simulation after I removed the kOmegaSST.C file.

At the end of the compilation, I also got a message like this "/home/qtian/OpenFOAM/OpenFOAM-1.4/lib/linuxGcc4DPOpt/libincompressibleTurbulenc eModels.so' is up to date."

Can anyone tell me what is the problem? I have been stuck here for several days. Please give me some help if you can. Thanks for your help.

Quinn
qtian is offline   Reply With Quote

Old   November 26, 2007, 16:51
Default hello, all, I figured it ou
  #8
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
qtian is on a distinguished road
hello, all,

I figured it out what is the problem. Just for the record,since I had the same name "incompressibleTurbulenceModels.so" at $(FOAM_LIBBIN) and $(FOAM_USER_LIBBIN), OpenFOAM solver used the one under $(FOAM_USER_LIBBIN). The make/files for turbulence model update the new lib in the $(FOAM_LIBBIN) folder. That is why simpleFoam solver did not "see" my change in turbulence model.

QT
qtian is offline   Reply With Quote

Reply


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
Is there a soot model in OpenFoam skherad OpenFOAM Running, Solving & CFD 7 July 16, 2014 06:05
Incompressible RSM turbulence thermal transport Can OpenFOAM do this anothr_acc OpenFOAM Running, Solving & CFD 6 February 24, 2009 06:39
changing model constants in k-e turbulence model Sunil CFX 3 October 3, 2006 13:12
Does there any original reference for the turbulence models in OpenFOAM andycong OpenFOAM Running, Solving & CFD 0 March 1, 2006 03:07
HELP! TURBULENCE k-e OR k-omega TURBULENCE MODEL? Mirek Kabacinski FLUENT 5 August 24, 2003 23:31


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