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

Duplicate library entries when running a solver with custom library

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2020, 08:02
Default Duplicate library entries when running a solver with custom library
  #1
Member
 
Franco Marra
Join Date: Mar 2009
Location: Napoli - Italy
Posts: 67
Rep Power: 15
francescomarra is on a distinguished road
Dear Foamers,

I am trying to implement some new methods in the chemistryModel library with the current OpenFOAM version 7. I followed basically the indications given in the thread named “Include my own library in sprayFOAM”.
So I copied the original in the
Code:
OpenFOAM/user-7/src/thermophisicalModels/chemistryModel_extended
directory to use in place of the original one. I was able to implement my new reduction method and successfully compile and use it with the chemFoam solver. Again I copied this solver in the
Code:
OpenFOAM/user-7/applications/solver/chemFoamExt
directory, changed the main source file into chemFoamExt, updated dependencies in the Make/files and Make/options and it worked!

Then I would use this new library with the reactingFoam solver and so I discovered that it depends on the combustionModels library that in turn depends on chemistryModel. Therefore, I duplicated the combustionModels library into directory:
Code:
OpenFOAM/user-7/src/combustionModels_extended
updated all dependencies to chemistryModel into chemistryModel_extended, and created a new library combustionModels_extended. Then I created a new solver reactingFoamExt by copying the original source files into
Code:
OpenFOAM/user-7/applications/solver/reactingFoamExt
and there all dependencies to both chemistryModel and combustionModels were updated to chemistryModel_extended and combustionModels_extended into the Make directory.
Now, what I get when I run the new reactingFoamExt solver is a long list of warnings like the following:
Code:
#0      /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+0x3e) [0x7f47b750f1ae]
#1      /home/marra/OpenFOAM/marra-7/platforms/linux64GccDPInt32Opt/lib/libchemistryModel_extended.so(_ZN4Foam24chemistryReductionMethodINS_17psiReactionThermoENS_14constTransportINS_7species6thermoINS_12hConstThermoINS_24incompressiblePerfectGasINS_6specieEEEEENS_16sensibleEnthalpyEEEEEE31adddictionaryConstructorToTableINS_25chemistryReductionMethods3DRGIS1_SC_EEEC1ERKNS_4wordE+0xfb) [0x7f47b85acc8b]
#2      /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libchemistryModel.so(+0x56117e) [0x7f47b0a3b17e]
#3      /lib64/ld-linux-x86-64.so.2(+0x10733) [0x7f47be210733]
#4      /lib64/ld-linux-x86-64.so.2(+0x151ff) [0x7f47be2151ff]
#5      /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x6f) [0x7f47b5f372df]
#6      /lib64/ld-linux-x86-64.so.2(+0x147ca) [0x7f47be2147ca]
#7      /lib/x86_64-linux-gnu/libdl.so.2(+0xf96) [0x7f47b6b20f96]
#8      /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x6f) [0x7f47b5f372df]
#9      /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_error+0x2f) [0x7f47b5f3736f]
#10     /lib/x86_64-linux-gnu/libdl.so.2(+0x1735) [0x7f47b6b21735]
#11     /lib/x86_64-linux-gnu/libdl.so.2(dlopen+0x71) [0x7f47b6b21051]
#12     /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam6dlOpenERKNS_8fileNameEb+0x2e) [0x7f47b7508cce]
#13     /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openERKNS_8fileNameEb+0x13e) [0x7f47b719961e]
#14     /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openIPNS_9HashTableIPFNS_7autoPtrINS_14functionObjectEEERKNS_4wordERKNS_4TimeERKNS_10dictionaryEES6_NS_6string4hashEEEEEbSE_S8_RKT_+0x175) [0x7f47b71a6fa5]
#15     /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam14functionObject3NewERKNS_4wordERKNS_4TimeERKNS_10dictionaryE+0x579) [0x7f47b71a6089]
#16     /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam15functionObjects11timeControlC1ERKNS_4wordERKNS_4TimeERKNS_10dictionaryE+0x236) [0x7f47b71b8306]
#17     /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam18functionObjectList4readEv+0x786) [0x7f47b71a8f36]
#18     /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam18functionObjectList11setTimeStepEv+0x2f5) [0x7f47b71a9845]
#19     /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam4Time9setDeltaTEd+0x35) [0x7f47b71bb2c5]
#20     reactingFoamExt(+0x3245c) [0x7f47be83245c]
#21     /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f47b5df1b97]
#22     reactingFoamExt(+0x353ca) [0x7f47be8353ca]
Duplicate entry DRGEP<psiReactionThermo,const<hConst<incompressiblePerfectGas<specie>>,sensibleEnthalpy>> in runtime selection table chemistryReductionMethod
If I correctly interpret these messages, especially lines marked #1 and #2, it seems that the solver reactingFoamExt continues to call at runtime the old library libchemistryModel.so (line #2) together with the new library libchemistryModel_extended.so (line #1), causing a conflict in the names of multiply defined entries.

But why the solver is dynamically linked to the old library that should be unknown to it?

I tried to find other dependencies on the chemistryModel library into other linked libraries, but the only one depending on this seems to be the combustionModels one that I updated too.
Actually, the solver works and gives the expected results, so I could ignore these warnings, but I would like to understand something more and correct my error that certainly is present somewhere.
I hope somebody can help me.
Included here below the copy of the Make files of the two updated library combustionModels_extended and of the solver.
Thank you in advance and best regards,
Franco

Make/files of combustionModels_extended:
Code:
combustionModel/combustionModel.C
CombustionModel/CombustionModel/CombustionModels.C

diffusion/diffusions.C
infinitelyFastChemistry/infinitelyFastChemistrys.C

PaSR/PaSRs.C
EDC/EDCs.C

laminar/laminars.C

FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C
FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C
FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C
FSD/reactionRateFlameAreaModels/relaxation/relaxation.C

FSD/FSDs.C

zoneCombustion/zoneCombustions.C

noCombustion/noCombustions.C

functionObjects/Qdot/Qdot.C

radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C
radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C

LIB = $(FOAM_USER_LIBBIN)/libcombustionModels_extended
Make/options of combustionModels_extended
Code:
EXE_INC = \
    -I$(LIB_SRC)/transportModels/compressible/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
    -I$(LIB_USER_SRC)/thermophysicalModels/chemistryModel_extended/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
    -I$(LIB_SRC)/radiationModels/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

LIB_LIBS = \
    -L$(FOAM_USER_LIBBIN) \
    -lcompressibleTransportModels \
    -lturbulenceModels \
    -lcompressibleTurbulenceModels \
    -lchemistryModel_extended \
    -lradiationModels \
    -lfiniteVolume \
    -lmeshTools
Make/files of reactingFoamExt
Code:
reactingFoamExt.C

EXE = $(FOAM_USER_APPBIN)/reactingFoamExt
Make/options of reactingFoamExt
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
    -I$(LIB_SRC)/transportModels/compressible/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_USER_SRC)/thermophysicalModels/chemistryModel_extended/lnInclude \
    -I$(LIB_SRC)/ODE/lnInclude \
    -I$(LIB_USER_SRC)/combustionModels_extended/lnInclude

EXE_LIBS = \
    -L$(FOAM_USER_LIBBIN) \
    -lfiniteVolume \
    -lfvOptions \
    -lmeshTools \
    -lsampling \
    -lturbulenceModels \
    -lcompressibleTurbulenceModels \
    -lreactionThermophysicalModels \
    -lspecie \
    -lcompressibleTransportModels \
    -lfluidThermophysicalModels \
    -lchemistryModel_extended \
    -lODE \
    -lcombustionModels_extended
francescomarra is offline   Reply With Quote

Old   March 19, 2021, 10:42
Default
  #2
New Member
 
Tiziano Maffei
Join Date: Jun 2013
Location: Milan (Italy)
Posts: 11
Rep Power: 11
tmaffei is on a distinguished road
Hi Francesco,

did you solve your issue? I am facing the same problem. If yes, could you tell me how you solved it?

Thank you in advance

Tiziano
tmaffei is offline   Reply With Quote

Old   April 5, 2022, 07:07
Default
  #3
New Member
 
Animesh Nepal
Join Date: Apr 2022
Location: Barcelona, Spain
Posts: 1
Rep Power: 0
animeshnepal is on a distinguished road
Hi Francesco, Tiziano,


Did you guys found any solution or explanation to the problem?


Is it that the only solution to the problem is to rename the user libraries with a different names than it is in openfoam libraries?



Thanks in advance.
Animesh
animeshnepal is offline   Reply With Quote

Old   May 17, 2022, 08:37
Default
  #4
Member
 
Saleh Abuhanieh
Join Date: Nov 2017
Posts: 81
Rep Power: 6
Saleh Abuhanieh is on a distinguished road
Quote:
Originally Posted by animeshnepal View Post
Hi Francesco, Tiziano,


Did you guys found any solution or explanation to the problem?


Is it that the only solution to the problem is to rename the user libraries with a different names than it is in openfoam libraries?



Thanks in advance.
Animesh

Hi,


I faced this issue before. Actually, the warning is self explanatory. The problem that a certain class (DRGEP) with the same name has been defined two times: in the new developed library and in the original OpenFOAM.
In my case the solution was to use the one in the OpenFOAM library. If they are not the same, for sure different name shall be used.


Regards,
Saleh
Saleh Abuhanieh is offline   Reply With Quote

Reply

Tags
compilation, custom library, library dependencies

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PEMFC model with FLUENT brahimchoice FLUENT 22 April 19, 2020 15:44
Error running compiled solver of fireFoam and conjugate heat transfer solver charles4allme OpenFOAM Running, Solving & CFD 2 April 26, 2019 06:58
Error while running new solver phaseChangeHeatDyMFoam sabrinacarson OpenFOAM Running, Solving & CFD 4 July 10, 2018 07:28
CFX Solver stopped with error when requested for backup during solver running Mfaizan CFX 40 May 13, 2016 06:50
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 00:01


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