|
[Sponsors] |
October 16, 2014, 17:28 |
Include my own library in sprayFOAM
|
#1 |
New Member
Stefanie
Join Date: Oct 2014
Posts: 7
Rep Power: 11 |
Hi,
I'm a total newbie to OpenFOAM and need some help... This should be easy but I can't seem to find the answer anywhere... I'm modifying SprayFOAM in various ways. For now I've started by adding a new member function to reactingCloudI.H and I'm going to implement a new evaporation model. --> All changes in lagrangian/intermediate... After making my changes I successfully compiled my library --> libmylagrangianIntermediate.so , which is now be stored in $(FOAM_USER_LIBBIN). I included the library with: -I$(FOAM_USER_LIBBIN)/libmylagrangianIntermediate When I compile mySprayFoam (that's my modified solver), it doesn't see the library because it gives an error that the member function (the one, I defined in my library) does not exist. Can anybody help? Thanks so much, Stef |
|
October 17, 2014, 05:48 |
|
#2 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
Hi,
I'm reasonably new (8 weeks) to OpenFOAM (and C/C++ for that matter) as well, but I figured your question would be a nice exercise to understanding libraries in C. In the past 2.5 hours I came to the following conclusions:
So, for your specific question, you will need the following statements in Make/options: Code:
-L$(FOAM_USER_LIBBIN) -lmylagrangianIntermediate -I$YOUR_HEADER_DIR Code:
Make/files myExe.c EXE = testWMake Make/options EXE_INC = \ -I../fooLib EXE_LIBS = \ -L$(FOAM_USER_LIBBIN) \ -lfoo Good refs: http://www.openfoam.org/docs/user/co...plications.php http://www.cprogramming.com/tutorial...linux-gcc.html ~ Kevin |
|
October 17, 2014, 17:51 |
|
#3 |
New Member
Stefanie
Join Date: Oct 2014
Posts: 7
Rep Power: 11 |
Hey Kevin,
thanks so much!!! That help me with my problem AND helped me understand libraries in C++ a little better. Stef |
|
October 29, 2014, 17:13 |
|
#4 |
New Member
Stefanie
Join Date: Oct 2014
Posts: 7
Rep Power: 11 |
Hi again,
now I've sucessfully added some functions to the ReactingCloud Template in my library, but a new issue arouse... I added a new Evaporation Model / PhaseChangeModel. added the following lines to intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H: #include "MyEvaporation.H" and makePhaseChangeModelType(MyEvaporation, CloudType); When I run my case with the myEvaporation option I get the following error message: --> FOAM FATAL ERROR: Unknown phase change model type myEvaporation Valid phase change model types are: 3 ( liquidEvaporation liquidEvaporationBoil none ) From function PhaseChangeModel<CloudType>::New(const dictionary&, CloudType&) in file /home/astefani/OpenFOAM/astefani-2.1.1/run/../lib_myLagrangian/intermediate/lnInclude/PhaseChangeModelNew.C at line 54. Why is my PhaseChangeModel not in the list yet? Any ideas on what I could have done wrong or forgotten? Thanks, Stef |
|
October 30, 2014, 02:54 |
|
#5 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
Is this line in your "myEvaporation.H" file?
Code:
public: //- Runtime type information TypeName("myEvaporation"); I.e. lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C (and similar for the other possible cloudTypes). |
|
April 11, 2018, 03:52 |
|
#6 |
New Member
Join Date: Jun 2017
Posts: 12
Rep Power: 8 |
Hello,
I am trying to add some of the Openfoam libraries(like lagrangian etc.) in flameletFoam. My openfoam and flameletfoam are compiled seperately. My solver did compile but when i ran solver it gave error stating Duplicate entries. I am starting to wonder that i may have not compiled the libraries correctly. I started by copying my openfoam libraries in flameletfoam and compiling them in flameletfoam. Then in my solver in flameletfoam, i called some of the libraries from flameletfoam and some(like meshTools, sampling etc.) from Openfoam. Is this the correct approach? Kindly consider my request. It would be a great help. Sincelery, beginner |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
cyclic boundary conditions for FSI | kanuk | OpenFOAM Programming & Development | 10 | April 25, 2014 02:52 |
OpenFoam install script Error during paraFoam installation | SePe | OpenFOAM Installation | 10 | June 19, 2010 15:15 |
critical error during installation of openfoam | Fabio88 | OpenFOAM Installation | 21 | June 2, 2010 03:01 |
Problems in compiling paraview in Suse 10.3 platform | chiven | OpenFOAM Installation | 3 | December 1, 2009 07:21 |
OpenFOAM15 paraFoam bug | koen | OpenFOAM Bugs | 19 | June 30, 2009 10:46 |