CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Error to run new compiled library in OpenFoam (

Shailja July 9, 2018 07:17

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

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 and also following

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



Selecting BreakupModel myReitzDiwakar

Unknown BreakupModelType type myReitzDiwakar, constructor not in hash table

Valid BreakupModel types are:


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.


zhangyan July 9, 2018 08:46

Did you recompile your sprayFoam solver?

Shailja July 9, 2018 09:01

No, I don't have permission in OpenFoam to do that. But I included new complied library name 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 09:02

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


Shailja July 9, 2018 09: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?


PositronCascade July 16, 2018 16:45

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



I think it should work this way.

Shailja July 18, 2018 06: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.


agustinvo July 19, 2018 06:34


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 02:15


yeah, but in that case, compilation of new library ( ) 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.
-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?


xmb October 12, 2021 00:00


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

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