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

Error to run new compiled library in OpenFoam

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 9, 2018, 06:17
Post Error to run new compiled library in OpenFoam
  #1
New Member
 
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 6
Shailja is on a distinguished road
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:article> > > > > > > > >]
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
Attached Files
File Type: txt options.txt (2.3 KB, 7 views)
File Type: txt files.txt (224 Bytes, 6 views)
Shailja is offline   Reply With Quote

Old   July 9, 2018, 07:46
Default
  #2
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 10
zhangyan is on a distinguished road
Did you recompile your sprayFoam solver?
__________________
https://openfoam.top
zhangyan is offline   Reply With Quote

Old   July 9, 2018, 08:01
Default
  #3
New Member
 
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 6
Shailja is on a distinguished road
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 is offline   Reply With Quote

Old   July 9, 2018, 08:02
Default
  #4
New Member
 
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 6
Shailja is on a distinguished road
Sorry , both solvers are not taking newly compiled library, that is the problem (written wrongly in previous reply)

regards
Shailja
Shailja is offline   Reply With Quote

Old   July 9, 2018, 08:17
Default
  #5
New Member
 
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 6
Shailja is on a distinguished road
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
Shailja is offline   Reply With Quote

Old   July 16, 2018, 15:45
Default
  #6
Member
 
Hasan Celik
Join Date: Sep 2016
Posts: 63
Rep Power: 8
PositronCascade is on a distinguished road
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.
PositronCascade is offline   Reply With Quote

Old   July 18, 2018, 05:20
Post
  #7
New Member
 
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 6
Shailja is on a distinguished road
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
Attached Files
File Type: txt log.sprayFoam.txt (100.7 KB, 5 views)
File Type: txt options.txt (1.7 KB, 5 views)
Shailja is offline   Reply With Quote

Old   July 19, 2018, 05:34
Default
  #8
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Fuenlabrada
Posts: 304
Rep Power: 13
agustinvo is on a distinguished road
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?
agustinvo is offline   Reply With Quote

Old   July 24, 2018, 01:15
Default
  #9
New Member
 
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 6
Shailja is on a distinguished road
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
Shailja is offline   Reply With Quote

Old   October 11, 2021, 23:00
Default
  #10
xmb
New Member
 
Join Date: Sep 2021
Posts: 3
Rep Power: 3
xmb is on a distinguished road
Shailja,

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

Last edited by xmb; October 14, 2021 at 23:29.
xmb is offline   Reply With Quote

Reply

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
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 05:29
OpenFOAM can't be run in parallel in cluster sibo OpenFOAM Running, Solving & CFD 4 February 21, 2017 16:29
How can I run OpenFOAM to benchmark/compare two environment performance ZhouYoung OpenFOAM 11 December 7, 2016 10:01
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 5, 2016 03:18
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 13:36


All times are GMT -4. The time now is 13:25.