|
[Sponsors] |
Undefined symbol error after compiling a new LES model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 24, 2011, 17:29 |
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: 15 |
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 |
|
June 26, 2011, 23:07 |
LES implementation undefined symbol problem solved
|
#2 |
New Member
Christopher
Join Date: Jun 2011
Posts: 1
Rep Power: 0 |
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 |
|
June 27, 2011, 20:02 |
|
#3 |
New Member
Abhijit Joshi
Join Date: May 2011
Location: Atlanta, GA
Posts: 5
Rep Power: 15 |
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 |
|
December 3, 2013, 06:59 |
|
#4 |
Senior Member
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20 |
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 Code:
-lincompressibleTurbulenceModel \ -lincompressibleLESModels \ Peace, Artur |
|
August 13, 2014, 08:46 |
|
#5 | |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Quote:
|
||
March 6, 2015, 05:08 |
undefined symbol: _ZTIN4Foam14incompressible9LESModels11GenEddyViscE
|
#6 |
New Member
Yi Han
Join Date: Oct 2013
Location: Laramie WY
Posts: 15
Rep Power: 13 |
||
March 6, 2015, 05:12 |
|
#7 |
Senior Member
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20 |
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 |
|
March 6, 2015, 05:36 |
|
#8 | |
New Member
Yi Han
Join Date: Oct 2013
Location: Laramie WY
Posts: 15
Rep Power: 13 |
Quote:
Thanks so much! It seems that we need put my own model's name in the corresponding "options" file. And it did work! THanks! |
||
November 24, 2015, 06:19 |
|
#9 | |
Member
Fengjiao Bian
Join Date: Nov 2013
Location: beijing
Posts: 30
Rep Power: 12 |
Hi, I meet the same problem,but i cannot understand how to realize [CODE]EXE_LIBS = \[\CODE],could you tell me more detail?thanks very much!
Quote:
|
||
November 24, 2015, 06:23 |
|
#10 |
Senior Member
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20 |
It refers to something like this:
Code:
LIB_LIBS = \ -L$(FOAM_USER_LIBBIN) -ldynamicSmagorinskyModel \ -lincompressibleTurbulenceModel \ -lincompressibleLESModels \ -lfluidThermophysicalModels \ -lspecie \ -lLESdeltas \ -lLESfilters\ -lfiniteVolume \ -lmeshTools Hope this helps A |
|
November 24, 2015, 07:01 |
|
#11 | |
Member
Fengjiao Bian
Join Date: Nov 2013
Location: beijing
Posts: 30
Rep Power: 12 |
Hi,thanks for your reply, I should add this to every make/options one by one or i could use one command to finish it ?
Quote:
|
||
November 24, 2015, 07:32 |
|
#12 |
Senior Member
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20 |
I'm not really sure what you mean. Are you compiling a big set of libraries where errors like the one further up in this thread occur? Because normally you wouldn't need to make this an automated process since you have to type this in only once for every new utility you devise. Probably easier just to keep a "blank" version somewhere to kick off each new model or whatever you're trying to code up. Please be a bit more specific about what your problem actually is.
A |
|
November 24, 2015, 07:49 |
|
#13 | |
Member
Fengjiao Bian
Join Date: Nov 2013
Location: beijing
Posts: 30
Rep Power: 12 |
Dear A,I am not combiling a big set of libraries.I simulate a tutorial of SOWFA,which is on the OpenFoam platform.When I run the script,it always display such warning
[--> FOAM Warning : From function dlOpen(const fileName&, const bool) in file POSIX.C at line 1179 dlopen error : /gpfs/automountdir/gpfs1/software/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libuserincompressibleLESModels.so: undefined symbol: _ZTIN4Foam14incompressible9LESModels11GenEddyViscE --> FOAM Warning : From function dlLibraryTable:pen(const fileName&, const bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99 could not load "libuserincompressibleLESModels.so"] I am not sure whether it has influence in simulation,because it still can simulate. Quote:
|
||
December 15, 2021, 11:01 |
|
#14 |
New Member
Join Date: Aug 2020
Posts: 20
Rep Power: 6 |
Hi everyone,
I had the same problem yesterday while making my own function object but the above soltuions didn't solve it. I'm no expert in OpenFOAM and I just copied the function object yPlus to base my FO on it. While I was cleaning up the implementations in my yPlus.C copy to write my own code, I deleted the implementation of void Foam::functionObjects::yPlus::writeFileHeader(cons t label i) {} as I dind't need it. This function is declared in one of the classes that yPlus inherets from and therefore the compiler didn't complain about not having an implementation, but when I tried to run the code I was getting the 'undefined symbol' error. I'm just posting this here as I coulnd't find that source of error in the forum, maybe it will be of help to someone in the future Cheers |
|
December 16, 2021, 05:00 |
|
#15 |
Senior Member
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20 |
Thanks for sharing your experience, always worth doing it!
To expand a bit on that, the writeFileHeader routine is declared as a pure virtual member of the logFiles class: Code:
virtual void writeFileHeader(const label i=0) = 0; Happy foaming, Artur |
|
December 16, 2021, 08:08 |
|
#16 |
New Member
Join Date: Aug 2020
Posts: 20
Rep Power: 6 |
Thanks a lot Artur!
Do you know why the compiler didn't identify that as a compilation error? Thanks Markella |
|
December 18, 2021, 15:18 |
|
#17 |
Senior Member
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20 |
Hi
I'm not sure, to be completely honest, I'd have to dig a bit deeper into it. Cheers A |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
libudf error: undefined symbol: | Prashanth | FLUENT | 6 | August 22, 2019 01:24 |
Problem with compiling my boundary conditions | peita | OpenFOAM Running, Solving & CFD | 5 | October 6, 2015 10:16 |
help for different between les model (subgrid-scale model) | liuyuxuan | FLUENT | 1 | October 2, 2009 16:25 |
Statically Compiling OpenFOAM Issues | herzfeldd | OpenFOAM Installation | 21 | January 6, 2009 10:38 |
2-equation model of LES and source code | M.R.Hadian | Main CFD Forum | 0 | February 3, 2002 06:00 |