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

Addition of New Turbulence Models giviing errors

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 2 Post By floquation
  • 1 Post By sabyju88
  • 3 Post By floquation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 15, 2016, 22:48
Unhappy Addition of New Turbulence Models giviing errors
  #1
New Member
 
SD
Join Date: Dec 2016
Posts: 4
Rep Power: 10
sabyju88 is on a distinguished road
Hi,

I wanted to add a new turbulence model so I followed the instructions in http://www.tfd.chalmers.se/~hani/kur...lenceModel.pdf

I created the Make/files and Make/options and then I ran wmake libso. The library ("libmyIncompressibleRASModels.so") was created at the right spot without any error which I can see. I also changed the controlDict to add
libs ("libmyIncompressibleRASModels.so");
But when I try to run my new model "mykOmega" I get the error

Selecting RAS turbulence model mykOmega


--> FOAM FATAL ERROR:
Unknown RASModel type mykOmega


So I checked if my library path is included or not using

echo $LD_LIBRARY_PATH | tr ':' '\n'

which showed me

/home/sabyju88/OpenFOAM/sabyju88-4.1/platforms/linux64GccDPInt32Opt/lib

i.e., the required library which has the libmyIncompressibleRASModels.so is included indeed.

I do not understand what is creating this error.
Any help will be really appreciated.

Thanks in advance.
sabyju88 is offline   Reply With Quote

Old   December 16, 2016, 03:52
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
Silly suggestions:
  1. Typo in the library name?
  2. Does the variable FOAM_USER_LIBBIN point to the location your .so-file is in?
  3. Are there more "libs" in controlDict? Then I reckon they should be inside the same "libs" data block.
More complicated suggestions:
virmodoetiae and lpz456 like this.
floquation is offline   Reply With Quote

Old   December 16, 2016, 13:19
Default
  #3
New Member
 
SD
Join Date: Dec 2016
Posts: 4
Rep Power: 10
sabyju88 is on a distinguished road
Thank you for your suggestions which I followed to notice the following

1. I checked for any typo in the library name. There isn't any.
2. FOAM_USER_LIBBIN points to the location of my libmyIncompressibleRASModels.so file indeed.
3. I have used only this library inside libs.

Using "banana trick" I get

Valid RASModel types:

17
(
LRR
LamBremhorstKE
LaunderSharmaKE
LienCubicKE
LienLeschziner
RNGkEpsilon
SSG
ShihQuadraticKE
SpalartAllmaras
kEpsilon
kOmega
kOmegaSST
kOmegaSSTSAS
kkLOmega
qZeta
realizableKE
v2f
)


So, my RAS model is not inside.

However, I did not implement the runtime selection mechanism which I am gonna do it now and post my result.

Regards,
SD
sabyju88 is offline   Reply With Quote

Old   December 17, 2016, 17:23
Default
  #4
New Member
 
SD
Join Date: Dec 2016
Posts: 4
Rep Power: 10
sabyju88 is on a distinguished road
Hi,

I implemented the runtime selection mechanism following http://hassankassem.me/posts/newturb...l/#new-version.
After compiling when I try to run I get the following error:

Selecting RAS turbulence model mykOmega
simpleFoam: symbol lookup error: /home/sabyju88/OpenFOAM/sabyju88-4.1/platforms/linux64GccDPInt32Opt/lib/libmyIncompressibleRASModels.so: undefined symbol: _ZN4Foam9RASModels8mykOmegaINS_29IncompressibleTur bulenceModelINS_14transportModelEEEEC1ERKNS_17geom etricOneFieldES8_RKNS_14GeometricFieldINS_6VectorI dEENS_12fvPatchFieldENS_7volMeshEEERKNS9_IdNS_13fv sPatchFieldENS_11surfaceMeshEEESL_RKS3_RKNS_4wordE SQ_


I then copied the simpleFoam solver and changed it to mysimpleFoam with the addition of
#include "/home/sabyju88/OpenFOAM/sabyju88-4.1/src/TurbulenceModels/turbulenceModels/RAS/mykOmega/mykOmega.H"

But I am still getting the same error:

Selecting RAS turbulence model mykOmega
mysimpleFoam: symbol lookup error: /home/sabyju88/OpenFOAM/sabyju88-4.1/platforms/linux64GccDPInt32Opt/lib/libmyIncompressibleRASModels.so: undefined symbol: _ZN4Foam9RASModels8mykOmegaINS_29IncompressibleTur bulenceModelINS_14transportModelEEEEC1ERKNS_17geom etricOneFieldES8_RKNS_14GeometricFieldINS_6VectorI dEENS_12fvPatchFieldENS_7volMeshEEERKNS9_IdNS_13fv sPatchFieldENS_11surfaceMeshEEESL_RKS3_RKNS_4wordE SQ_


Any help will be appreciated.

Thank you,

Regards,
SD
sabyju88 is offline   Reply With Quote

Old   December 19, 2016, 07:29
Default
  #5
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Quote:
Originally Posted by sabyju88 View Post
Hi,

I implemented the runtime selection mechanism following http://hassankassem.me/posts/newturb...l/#new-version.
After compiling when I try to run I get the following error:

Selecting RAS turbulence model mykOmega
simpleFoam: symbol lookup error: /home/sabyju88/OpenFOAM/sabyju88-4.1/platforms/linux64GccDPInt32Opt/lib/libmyIncompressibleRASModels.so: undefined symbol: _ZN4Foam9RASModels8mykOmegaINS_29IncompressibleTur bulenceModelINS_14transportModelEEEEC1ERKNS_17geom etricOneFieldES8_RKNS_14GeometricFieldINS_6VectorI dEENS_12fvPatchFieldENS_7volMeshEEERKNS9_IdNS_13fv sPatchFieldENS_11surfaceMeshEEESL_RKS3_RKNS_4wordE SQ_


I then copied the simpleFoam solver and changed it to mysimpleFoam with the addition of
#include "/home/sabyju88/OpenFOAM/sabyju88-4.1/src/TurbulenceModels/turbulenceModels/RAS/mykOmega/mykOmega.H"

But I am still getting the same error:

Selecting RAS turbulence model mykOmega
mysimpleFoam: symbol lookup error: /home/sabyju88/OpenFOAM/sabyju88-4.1/platforms/linux64GccDPInt32Opt/lib/libmyIncompressibleRASModels.so: undefined symbol: _ZN4Foam9RASModels8mykOmegaINS_29IncompressibleTur bulenceModelINS_14transportModelEEEEC1ERKNS_17geom etricOneFieldES8_RKNS_14GeometricFieldINS_6VectorI dEENS_12fvPatchFieldENS_7volMeshEEERKNS9_IdNS_13fv sPatchFieldENS_11surfaceMeshEEESL_RKS3_RKNS_4wordE SQ_


Any help will be appreciated.

Thank you,

Regards,
SD
Hi,

In the solver you should not add it directly. I was facing with something similar a month ago. The tutorial you mention it's a bit old, but the core of the code should be similar. Did you follow the tree directory of OF4.1? Try to start your implementation from the kOmega code and modify it as you need. Remember that in OF4.1, you have two libraries, the turbulenceModels, and the incompressibleTurbulenceModels.
agustinvo is offline   Reply With Quote

Old   December 19, 2016, 23:05
Default
  #6
New Member
 
SD
Join Date: Dec 2016
Posts: 4
Rep Power: 10
sabyju88 is on a distinguished road
Quote:
Originally Posted by agustinvo View Post
Hi,

In the solver you should not add it directly. I was facing with something similar a month ago. The tutorial you mention it's a bit old, but the core of the code should be similar. Did you follow the tree directory of OF4.1? Try to start your implementation from the kOmega code and modify it as you need. Remember that in OF4.1, you have two libraries, the turbulenceModels, and the incompressibleTurbulenceModels.
Hi Agustin,

Thank you for your suggestions.
I started with the kOmega code and haven't changed anything in it yet and my Make/options look like this:

EXE_INC = \
-I$(FOAM_SOLVERS)/incompressible/simpleFoam/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/RAS/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/incompressibleTransportModels/Newtonian/lnInclude \
-I$(WM_PROJECT_DIR)/src/TurbulenceModels/turbulenceModels/RAS/mykOmega/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude


LIB_LIBS = \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lmeshTools \
-lfvOptions \
-lsampling \
-L$(FOAM_USER_LIBBIN)/libmyIncompressibleRASModels.so


I guess I have included more than I need but
  • am I missing any libraries or my directory path is incorrect resulting in the symbol lookup error?
  • do I need to change anything in the simpleFoam solver for this new turbulence model 'mykOmega' to work?

Again, thank you in advance for any suggestions.

Regards,
SD
lpz456 likes this.
sabyju88 is offline   Reply With Quote

Old   January 31, 2017, 10:33
Default
  #7
New Member
 
Tobias
Join Date: Apr 2014
Posts: 2
Rep Power: 0
tosc is on a distinguished road
Hello SD,

did you already fix your problem?
Today I did encounter the same one, however, after changing the file /Make/options it did work.
Here is my options-file:

EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude

LIB_LIBS = \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools

"files" looks like the following:
makeTurModel.C
LIB = $(FOAM_USER_LIBBIN)/v2f_Fluent

I did inlcude it via, system/controlDict:

libs ("v2f_Fluent.so")

control/turbulenceProperties:

simulationType RAS;
RAS
{
RASModel v2f_Fluent;
turbulence on;
printCoeffs on;
}



I hope it did help.
Cheers,
Tobias
tosc is offline   Reply With Quote

Old   February 1, 2017, 22:21
Default
  #8
Senior Member
 
khedar
Join Date: Oct 2016
Posts: 111
Rep Power: 10
khedar is on a distinguished road
Thers is a big difference between Turbulence model compilation before 2.3 and after it. Since you are using OF 4.1 use this tutorial,

https://pingpong.chalmers.se/public/...o?item=3256524
khedar is offline   Reply With Quote

Old   February 2, 2017, 11:06
Thumbs up
  #9
New Member
 
Tobias
Join Date: Apr 2014
Posts: 2
Rep Power: 0
tosc is on a distinguished road
Thank you! Thats really perfect! No more nasty errors when starting a simulation of using the sample function.
tosc is offline   Reply With Quote

Old   August 10, 2017, 11:20
Default Lookup error
  #10
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
I tried making a new model or new solver yesterday and messed up to get this error.
Code:
simpleFoam: symbol lookup error: /storage/home/vjc5126/OpenFOAM/vjc5126-2.3.x/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so: undefined symbol: _ZTIN4Foam14incompressible8RASModelE
Make/files
Code:
myLaunderSharmaKE.C

LIB = $(FOAM_USER_LIBBIN)/myLaunderSharma
Make/options
Code:
EXE_INC = \
    -I$(LIB_SRC)/turbulenceModels/ \
    -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/incompressible/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/tranportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

LIB_LIBS = \
    -lturbulenceModels\
    -lincompressibleTurbulenceModel \
    -lincompressibleRASModels \
    -lfiniteVolume \
    -lmeshTools
Can someone please help me resolve a similar problem. icoFoam works fine but I have problem running simpleFoam. I even tried remaking simpleFoam in the /applications/solvers/incompressible but still receive the same error.
vcvedant is offline   Reply With Quote

Old   August 11, 2017, 04:42
Default
  #11
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
I assume this is a new turbulence model that you include in a case using a "libs" subdictionary in your controlDict?
In that case, the library is dynamically loaded at run-time. That is, you don't have to recompile your solver, as your new library is not even used at compile-time.

Symbol lookup errors are nasty... I've encountered quite a few myself, and I have resolved all of them... But I do not yet have a good tactic to figure out where they come from.
One time, my problem arose because I did not explicitly define a (virtual) destructor in my derived class. The other time I had simply forgotten one line of the RTS.
That is, they are problems in which there is "nothing" wrong with your library, and therefore it compiles. But when you actually try and use the library, errors pop up, because the library is incomplete in some manner.

Since you are trying to compile a new turbulence model:
  • How did you write the turbulence model? More specifically:
  • Did you take an existing turbulence model, and then simply adapt it to your purposes... or
  • did you write it from scratch?
Either way, it is always a good idea to copy an existing turbulence model, as you can be sure that everything is already in there.


Either way, without your code, there is no way to diagnose the problem. But first, compare your code with an existing turbulence model to see whether you forgot something.
vcvedant, purnp2 and lpz456 like this.
floquation is offline   Reply With Quote

Old   March 27, 2018, 06:44
Default
  #12
New Member
 
Join Date: Mar 2018
Posts: 7
Rep Power: 8
Luis F is on a distinguished road
Dear Kevin,

I have the same problem:

yPlusRAS: symbol lookup error: /home/flowuser/OpenFOAM/flowuser-2.3.0/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so: undefined symbol: _ZTIN4Foam14incompressible8RASModelE

I tried to create my own turbulent solver using:

http://www.tfd.chalmers.se/~hani/kur...lenceModel.pdf

I am using OF 2.3. Somehow I get that error everytime I use simpleFoam now.
Luis F is offline   Reply With Quote

Old   October 30, 2018, 03:07
Default
  #13
New Member
 
Karl Yang
Join Date: Jul 2016
Posts: 11
Rep Power: 10
HoneyBadger is on a distinguished road
I ran into the same problems as well. I successfully compiled a new turbulence model. However, I realized new things to be implemented, the second time I use the same method to compile, I encountered the same symbol look up error and never found a solution to debug it.
HoneyBadger is offline   Reply With Quote

Reply

Tags
new ras turbulence model, wmake libso


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
Multiphase Turbulence Models im_lenny OpenFOAM Running, Solving & CFD 8 January 31, 2019 11:37
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
AMI interDyMFoam for mixer nu problem danny123 OpenFOAM Programming & Development 8 September 6, 2013 03:34
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 08:47
Turbulence Models and external flow. Alan FLUENT 3 November 22, 2005 05:46


All times are GMT -4. The time now is 10:29.