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

How to customize a library and link it to present case

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By olesen
  • 2 Post By überschwupper

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2022, 03:49
Default How to customize a library and link it to present case
  #1
New Member
 
Mehdi Badri
Join Date: Apr 2013
Posts: 7
Rep Power: 13
Mehdi80 is on a distinguished road
Hi there,

I would genuinely appreciate it if you could help me on this issue:

I am going to solve an FSI problem with a modified version of rigidBodyDynamics library. To start, I just copied its directory somewhere:

Code:
 
cp -r  $FOAM_SRC/rigidBodyDynamics $FOAM_RUN/MyrigidBodyDynamics
and changed the last line of the Make/files to:

Code:
LIB = $(FOAM_USER_LIBBIN)/libMyrigidBodyMeshMotion
Then using wmake I complied this new(!) library into $(FOAM_USER_LIBBIN) directory.

Now the question is how I can use this new library in my cases. When I set the constant/dynamicMeshDict as

Code:
 
dynamicFvMesh        dynamicMotionSolverFvMesh;
motionSolverLibs    ("path_to_the_lib/libMyrigidBodyDynamics.so");
motionSolver             rigidBodyMotion;
...
the OpenFoam can seemingly find my new motionSolverLibs but it has some problems with motionSolver as it complains:

Code:
 
--> FOAM FATAL IO ERROR: (openfoam-2112)
Unknown solver type rigidBodyMotion

Valid solver types :
6(coded displacementInterpolation displacementLayeredMotion multiSolidBodyMotionSolver solidBody velocityDisplacement)
Is there any way to make it use the new library?
Mehdi80 is offline   Reply With Quote

Old   June 29, 2022, 04:42
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
I must be missing something here, you want to load rigidBodyMotion from librigidBodyMeshMotion automatically required through your libMyrigidBodyDynamics ?
Did you actually add that as compile option somewhere (eg, LIB_LIBS) and it didn't work, or something else? Really confused here.
Mehdi80 likes this.
olesen is offline   Reply With Quote

Old   June 29, 2022, 05:38
Default
  #3
Member
 
Join Date: Jan 2022
Location: Germany
Posts: 72
Rep Power: 4
überschwupper is on a distinguished road
Are yoou sure, that you used the correct libname? Because you have written you renamed the library to "libMyrigidBodyMeshMotion" but you are loading "libMyrigidBodyDynamics" ??


If this isnt the case I would try $(FOAM_USER_LIBBIN)/libMyrigidBodyMeshMotion.so


But these are just guesses, never worked with that before
Mehdi80 and Marpole like this.
überschwupper is offline   Reply With Quote

Old   June 29, 2022, 23:50
Default
  #4
New Member
 
Mehdi Badri
Join Date: Apr 2013
Posts: 7
Rep Power: 13
Mehdi80 is on a distinguished road
Quote:
Originally Posted by olesen View Post
I must be missing something here, you want to load rigidBodyMotion from librigidBodyMeshMotion automatically required through your libMyrigidBodyDynamics ?
Did you actually add that as compile option somewhere (eg, LIB_LIBS) and it didn't work, or something else? Really confused here.
Thank you for your reply.
You are right! I had forgotten to compile libMyrigidBodyDynamics.so. Thus both the situation and my question were confusing. After getting the comments, I figured out what the problem was. Thanks.
Mehdi80 is offline   Reply With Quote

Old   June 29, 2022, 23:58
Default
  #5
New Member
 
Mehdi Badri
Join Date: Apr 2013
Posts: 7
Rep Power: 13
Mehdi80 is on a distinguished road
Quote:
Originally Posted by überschwupper View Post
Are yoou sure, that you used the correct libname? Because you have written you renamed the library to "libMyrigidBodyMeshMotion" but you are loading "libMyrigidBodyDynamics" ??


If this isnt the case I would try $(FOAM_USER_LIBBIN)/libMyrigidBodyMeshMotion.so


But these are just guesses, never worked with that before
Thank you. The issue you pointed out was not exactly the problem, but it was very constructive.
Mehdi80 is offline   Reply With Quote

Reply

Tags
compile new library, fsi, openfoam, rigid body dynamics


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
how to link the path of a newly compiled library to another library in OpenFOAM sourav8016 OpenFOAM 3 December 28, 2023 17:21
Forcing a solver to use your custom library. cdunn6754 OpenFOAM Programming & Development 0 March 30, 2017 17:05
How to call FORTRAN files as UDF? Ehsan-F Fluent UDF and Scheme Programming 6 September 11, 2012 12:03
CFX 4.4: NAG Library Link to CFX subroutine... Robin K CFX 2 September 21, 2005 11:40
why can't link shared library? wanghong CFX 1 September 19, 2005 02:37


All times are GMT -4. The time now is 11:52.