CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Undefined symbol error after compiling a new LES model

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

Like Tree7Likes
  • 1 Post By ctl
  • 3 Post By Artur
  • 1 Post By huangxianbei
  • 1 Post By Artur
  • 1 Post By hy1112006

Reply
 
LinkBack Thread Tools Display Modes
Old   June 24, 2011, 16:29
Default Undefined symbol error after compiling a new LES model
  #1
New Member
 
Abhijit Joshi
Join Date: May 2011
Location: Atlanta, GA
Posts: 5
Rep Power: 6
jabhiji is on a distinguished road
Hi all,

I am developing a new LES turbulence model, using the existing models in OpenFOAM as a starting point and there are no errors during the compilation of the new model. However, when I use this new model for the channel395 simulation (instead of the default oneEqEddy model), I get the following error:

channelFoam: symbol lookup error:/OpenFOAM/OpenFOAM-2.0.0/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so: undefined symbol: _ZN4Foam14incompressible9LESModels16subgridSGSStre ss4readEv

SubgridSGSstress is a new class created one level below LESModels, similar to classes like GenSGSStress or GenEddyVisc. This new class (SubgridSGSStress) has a model called subgridTLS, which directly computes the subgrid stress.

While using channelFoam, I specified subgridTLS as the LESModel.

Actually, after compiling the new models, even the original models do not work with channelFoam (I get the same error above if I switch back to using oneEqEddy). Thus, this compilation using the new model sort of corrupts the entire OpenFOAM installation and I need to re-install in order to make channelFoam work again for the channel395 tutorial.

Any suggestions on what causes this problem will be greatly appreciated.

Thanks,

- jabhiji
jabhiji is offline   Reply With Quote

Old   June 26, 2011, 22:07
Default LES implementation undefined symbol problem solved
  #2
ctl
New Member
 
Christopher
Join Date: Jun 2011
Posts: 1
Rep Power: 0
ctl is on a distinguished road
Hey jabhiji,

I ran in the same or similar problem and just solved it, maybe the same will work for you. I've developed a custom (lighthill equation) solver based on the pisoFoam solver and haven't tested this on any other solver. The LES model I incorporated is a selective Smagorinsky model.

To do this I have created a selectiveSmagorinsky.H and .C file, based on the normal Smagorinsky files, in which I added some extra functions which basically alter the SGS values throughout the field. Also I copied the option file from src/turbulenceModels/incompressible/LES/Make and the files document simply reads:

selectiveSmagorinsky.C
LIB = $(FOAM_USER_LIBBIN)/libmyTurbulenceModels

On compilation I encountered an error: the GenEddyVisc.H file could not be found. Looking at the selectiveSmagorinsky.depp file I noticed that the compiler was looking locally for this file instead of using the file from the installation directory(does anybody knows why? I tried changing the option file without succes..). I fixed this problem by copying the GenEddyVisc.H file to the local directory (the same needed to be done for LESModel.H). It compiled but now gave a similar error to what you had.

Then I tried to make a link using in a terminal:

sudo ln -s /absolute file path to/GenEddyVisc.H /absolute path to lnInclude folder(placed in folder with source code)

Also in my selectiveSmagorinsky.H file I made a direct reference to the source folder hence using (I think this is the most important part):

#include "incompressible/LES/GenEddyVisc/GenEddyVisc.H"

Further I adapted the dependency file to fix the references.

I don't know what exactly solved the problem but now it runs. (using only the direct referencing of the include file worked for one computer but was not sufficient for an other). Using decomposePar I still get warnings (but domain gets decomposed nonetheless ), the solver works perfectly without a warning.

Hopefully this post is a bit useful for you. It's my first on this forum so I hope I was not too elaborate or to short.

Good luck!

Christopher
wyldckat likes this.
ctl is offline   Reply With Quote

Old   June 27, 2011, 19:02
Default
  #3
New Member
 
Abhijit Joshi
Join Date: May 2011
Location: Atlanta, GA
Posts: 5
Rep Power: 6
jabhiji is on a distinguished road
Hello Christopher,

Thanks a lot for your detailed explanation. I have not checked whether this works for me yet, but will keep you posted.

Regards,

jabhiji
jabhiji is offline   Reply With Quote

Old   December 3, 2013, 06:59
Default
  #4
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 226
Rep Power: 6
Artur is on a distinguished road
Hi,

Today I faced a very similar problem when compiling a new LES model:

Code:
--> FOAM Warning : 
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/akl1g09/OpenFOAM/akl1g09-2.2.2/platforms/linux64GccDPOpt/lib/libdynamicSmagorinskyModel.so: undefined symbol: _ZTIN4Foam14incompressible9LESModels11GenEddyViscE
Changing the Make/options file so that it includes the following:

Code:
    -lincompressibleTurbulenceModel \
    -lincompressibleLESModels \
instead of just the former seems to have solved the issue. Thought I'd share in case anyone else runs into the same thing.

Peace,

Artur
Bernhard, JackW and huangxianbei like this.
Artur is offline   Reply With Quote

Old   August 13, 2014, 07:46
Default
  #5
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: CAU,China
Posts: 266
Rep Power: 4
huangxianbei is on a distinguished road
Quote:
Originally Posted by Artur View Post
Hi,

Today I faced a very similar problem when compiling a new LES model:

Code:
--> FOAM Warning : 
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/akl1g09/OpenFOAM/akl1g09-2.2.2/platforms/linux64GccDPOpt/lib/libdynamicSmagorinskyModel.so: undefined symbol: _ZTIN4Foam14incompressible9LESModels11GenEddyViscE
Changing the Make/options file so that it includes the following:

Code:
    -lincompressibleTurbulenceModel \
    -lincompressibleLESModels \
instead of just the former seems to have solved the issue. Thought I'd share in case anyone else runs into the same thing.

Peace,

Artur
Thank you very much. This is exactly the best solution.
Artur likes this.
huangxianbei is offline   Reply With Quote

Old   March 6, 2015, 05:08
Default undefined symbol: _ZTIN4Foam14incompressible9LESModels11GenEddyViscE
  #6
New Member
 
Yi Han
Join Date: Oct 2013
Location: Laramie WY
Posts: 5
Rep Power: 3
hy1112006 is on a distinguished road
Quote:
Originally Posted by huangxianbei View Post
Thank you very much. This is exactly the best solution.
Hi, huangxianbei,

Can I ask where to add

-lincompressibleTurbulenceModel \
-lincompressibleLESModels \

Can you show me the path?
Thank you so much!
hy1112006 is offline   Reply With Quote

Old   March 6, 2015, 05:12
Default
  #7
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 226
Rep Power: 6
Artur is on a distinguished road
Quote:
Originally Posted by Artur View Post
Changing the Make/options file so that it includes the following:
This refers to a file called "options" inside the "Make" folder inside your model's folder (where all the other .C and .H files are).

You're supposed to add the lines following this line
[CODE]EXE_LIBS = \[\CODE]

Make sure to place a backslash at the end of each line except for the last one.

A
hy1112006 likes this.
Artur is offline   Reply With Quote

Old   March 6, 2015, 05:36
Default
  #8
New Member
 
Yi Han
Join Date: Oct 2013
Location: Laramie WY
Posts: 5
Rep Power: 3
hy1112006 is on a distinguished road
Quote:
Originally Posted by Artur View Post
This refers to a file called "options" inside the "Make" folder inside your model's folder (where all the other .C and .H files are).

You're supposed to add the lines following this line
[CODE]EXE_LIBS = \[\CODE]

Make sure to place a backslash at the end of each line except for the last one.

A
Hi A,

Thanks so much! It seems that we need put my own model's name in the corresponding "options" file. And it did work!

THanks!
Artur likes this.
hy1112006 is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
libudf error: undefined symbol: Prashanth FLUENT 5 July 28, 2010 07:03
help for different between les model (subgrid-scale model) liuyuxuan FLUENT 1 October 2, 2009 15:25
Statically Compiling OpenFOAM Issues herzfeldd OpenFOAM Installation 21 January 6, 2009 10:38
Problem with compiling my boundary conditions peita OpenFOAM Running, Solving & CFD 4 February 21, 2008 09:48
2-equation model of LES and source code M.R.Hadian Main CFD Forum 0 February 3, 2002 06:00


All times are GMT -4. The time now is 11:02.