CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Error to run new compiled library in OpenFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/203873-error-run-new-compiled-library-openfoam.html)

Shailja July 9, 2018 06:17

Error to run new compiled library in OpenFoam
 
2 Attachment(s)
Hi


I am using sprayFoam case with sprayFoam solver in OpenFoam 4.1 version with Ubuntu 16.04 system. I am trying to compile a new library named myReitzdiwakar in my working folder /home/shailja-4.1/src/lagrangian/spray/submodels/BreakupModel/myReitzDiwakar/Make by following steps given as per http://openfoamwiki.net/index.php/Ho...dary_condition. and also following https://cfd.direct/openfoam/user-gui...-applications/



The libmylagrangianSpray.so file is created in the $FOAM_USER_LIBBIN" folder but while running the case with sprayFoam Solver, it gives following error



code:

---------------------------------------------------------------------------------------------------------------------------



Selecting BreakupModel myReitzDiwakar


--> FOAM FATAL ERROR:
Unknown BreakupModelType type myReitzDiwakar, constructor not in hash table

Valid BreakupModel types are:

7
(
ETAB
PilchErdman
ReitzDiwakar
ReitzKHRT
SHF
TAB
none
)


From function static Foam::autoPtr<Foam::BreakupModel<CloudType> > Foam::BreakupModel<CloudType>::New(const Foam::dictionary&, CloudType&) [with CloudType = Foam::SprayCloud<Foam::ReactingCloud<Foam::ThermoC loud<Foam::KinematicCloud<Foam::Cloud<Foam::SprayP arcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam ::KinematicParcel<Foam::particle> > > > > > > > >]
in file /opt/openfoam4/src/lagrangian/spray/lnInclude/BreakupModelNew.C at line 47.

FOAM exiting




--------------------------------------------------------------------------------------------------------------------------------



I am also attaching files and options files used. I tried to put all the dependencies but the new library is not taken into account during run. I have tried everything but every time .so files are created but new library is not accepted.


I also checked various threads and tried to follow but none is working, I don't understand what I am missing.



If compilation is not proper? how to remove this error? Please, any help is appreciated.


regards
Shailja

zhangyan July 9, 2018 07:46

Did you recompile your sprayFoam solver?

Shailja July 9, 2018 08:01

No, I don't have permission in OpenFoam to do that. But I included new complied library name libmylagrangianSpray.so in controldict which should be recognizable by sprayFoam.
Also to check my methodology, I compiled mysprayFoam --- new solver by copying sprayFoam.C and dependencies in user directory, renamed and compiled with same methodology successfully and it is working with tutorial case.

But both solver are taking newly compiled library.

Shailja July 9, 2018 08:02

Sorry , both solvers are not taking newly compiled library, that is the problem (written wrongly in previous reply)

regards
Shailja

Shailja July 9, 2018 08:17

In new solver mysprayFoam, I included follwing in EXE_INC

-I$(WM_PROJECT_USER_DIR)/src/lagrangian/spray/submodels/BreakupModel/myReitzDiwakar/lnInclude \


and in EXE_LIBS = \
..........(other libraries)
-L$(FOAM_USER_LIBBIN)/libmylagrangianSpray \

............(other libraries)


so I guess, new solver should consider the new library, but it is not. i am unable to figure out what is going wrong, Any idea?




regards
shailja

PositronCascade July 16, 2018 15:45

Did you try to include your compiled library to your controlDict file? In a way such that:


Code:

    libs
    (
        "libnew1.so"
        "libnew2.so"
    );

I think it should work this way.

Shailja July 18, 2018 05:20

2 Attachment(s)
Thank you for replying, I already did that, but main problem was linking to some libraries. somehow adding lmylagrangianSpray in LIB_LIBS is stopping compilation also I
Now I got it run but some repetition in start of the run of aachenbomb with sprayFoam.
This is because i have copied the Full sprayFolder in place of one renamed reitzDiwakar folder, but without that I am not able to compile and run.




regards
Shailja

agustinvo July 19, 2018 05:34

Hi,


I think the problem is that you're using the same libraries, but with different names. All the functions inside have the same name, and this is why you get this error.


What I do fot turbulence models, I only add the new model, and inside the options file of the library I mention the files from the original installation. Did you try this?

Shailja July 24, 2018 01:15

Hii

yeah, but in that case, compilation of new library (myReitzDiwakar.so ) is getting failed with error message for not getting files of atomization and spray models. Although I am also giving path in option file for the same.
EXE_INC = \
-.........................................
-.........................................
-I$(LIB_SRC)/lagrangian/spray/lnInclude \
-........................................

anyways, I am also stuck at one point, if anybody has created new liquid library for example remaned C7H16 folder and its contents and then compiled it with new name in User directory. I am doing this but while running the sprayFoam it is not accepting new liquid. Do I need to create chem.dat and therm.dat file for the new liquid?


regards
Shailja

xmb October 11, 2021 23:00

Shailja,

Were you able to solve your issue? I am running into the same problem.


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