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

flow solver won't recognize custom library

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 10, 2013, 07:48
Default flow solver won't recognize custom library
  #1
New Member
 
Håkon Bartnes Line
Join Date: Mar 2013
Posts: 27
Rep Power: 4
hakonbar is on a distinguished road
Hi everyone,

I've written a modified version of the SpalartAllmarasIDDES model, named "SpalartAllmarasBasicIDDES", and I'm having some problems getting it to run.
The code compiles just fine, and creates a custom library called "libMyIDDESModels.so". When I try to run a case with it, however, I get the following error message, indicating that the solver could not read my library:

Code:
-> FOAM Warning : 
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/hakonbar/OpenFOAM/hakonbar-2.2.0/platforms/linux64GccDPOpt/lib/libMyIDDESModels.so: undefined symbol: _ZTIN4Foam14incompressible9LESModels20SpalartAllmarasBasicE
--> FOAM Warning : 
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libMyIDDESModels.so"
I've customized the RANS version of the SA model as well, and the solver recognized that custom library, although certain applications like decomposePar didn't.

It's odd that the RANS version worked, and not the IDDES version. On the other hand, the latter includes two custom objects that talk together, so maybe that adds some complexities that need to be accounted for when compiling?

Here are the contents of the "options" file in my "Make" directory:
Code:
EXE_INC = \
    -I$(LIB_SRC)/turbulenceModels \
    -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/incompressible/LES/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude
    -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude

LIB_LIBS = \
    -lincompressibleTurbulenceModel \
    -lLESdeltas \
    -lfiniteVolume \
    -lmeshTools
And here's the "files" file:
Code:
SpalartAllmarasBasic/SpalartAllmarasBasic.C
SpalartAllmarasBasicIDDES/SpalartAllmarasBasicIDDES.C
LIB = $(FOAM_USER_LIBBIN)/libMyIDDESModels
I've searched the forums, and found many similar threads, but unfortunately none that I could apply to this situation. I've almost zero experience compiling C++ code,though, so I'm sure I'm just missing some glaringly obvious point.
Any suggestions from you would be greatly appreciated, dear foamers =)

best regards,
Håkon
hakonbar is offline   Reply With Quote

Old   November 8, 2013, 07:55
Default
  #2
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 4
Sherlock_1812 is on a distinguished road
Dear Hakon,

I have the same problem as you do. But I feel the EXE_INC misses a ' \ ' (backslash) in the penultimate line. That might've lead to your error.
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   April 7, 2014, 08:09
Default
  #3
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,099
Rep Power: 16
RodriguezFatz will become famous soon enough
Hakon, I am facing exactly the same problem: simpleFoam works for my custom RANS model, but decomposePar doesnt. Did you solve the problem?
Philipp.

EDIT: I found the solution here:
Undefined symbol error after compiling a new LES model

Additionally to the "options" file of kOmegaSST I had to add an " -lincompressibleRASModels \". Now it works
LIB_LIBS = \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lfiniteVolume \
-lmeshTools
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz 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
Error due to Unstructured Mesh with custom solver fredo490 OpenFOAM Running, Solving & CFD 2 March 6, 2015 03:46
thobois class engineTopoChangerMesh error Peter_600 OpenFOAM 4 August 2, 2014 09:52
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
Suitable solver for Air/Air flow with different temperatures cjm OpenFOAM 1 January 20, 2011 05:17
Troubleshooting Unsteady Incompressible Flow Solver dandalf Main CFD Forum 0 November 15, 2010 11:55


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