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

How to compile?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 18, 2012, 08:57
Default How to compile?
  #1
Member
 
Alexander A
Join Date: Jun 2012
Posts: 53
Rep Power: 13
A.A. is on a distinguished road
Hi,

I am absolute beginner in OF and I need to know how to compile if I want to make changes to the oscillatinRotatingMotion:C and .H files.

Could somebody explain the steps to do like for dummies?

Best,
Alex
A.A. is offline   Reply With Quote

Old   September 18, 2012, 15:13
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Alex,

To learn how to create a modified solver: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

The idea is nearly identical when it comes to creating a custom library. The detail is that with libraries, you only have to copy-paste-change what you really want.

I've helped other people with similar situations, where the most recent is this one: http://www.cfd-online.com/Forums/ope...tml#post380430 post #5

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   September 19, 2012, 02:54
Default
  #3
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
Dear Alexander,

if you do not already know them
http://www.personal.psu.edu/dab143/OFW6/training.htm =>New Developer Sessions
http://sourceforge.net/projects/open...OAM_Workshops/
http://sourceforge.net/projects/open...tadt/Training/

http://www.tfd.chalmers.se/~hani/kurser/OS_CFD/
http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2007/ change year 2007..2012 to see different material
http://www.tfd.chalmers.se/~hani/kur.../debugging.pdf
elvis is offline   Reply With Quote

Old   September 19, 2012, 04:54
Default Hi
  #4
Member
 
Alexander A
Join Date: Jun 2012
Posts: 53
Rep Power: 13
A.A. is on a distinguished road
Hi,

I followed the steps in the links you posted.
But if I write this in the terminal $FOAM_USER_APPBIN it says no such file or directory.
As I couldn't find the location above I placed my folder called newApp in $WM_PROJECT_USER_DIR. I hope thats also ok.

I have attached the newApp folder. There I created the Make/files and Make/options
and the code for myoscillatingRotatingMotion. In the code I changed all class names to myoscillatingRotaingMotion.

Then I wrote wmake and also tried wmake libso.

But I get the following error message:

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file myoscillatingRotatingMotion.C
could not open file solidBodyMotionFunction.H for source file myoscillatingRotatingMotion.C
SOURCE=myoscillatingRotatingMotion.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/triSurface/lnInclude -I/opt/openfoam211/src/meshTools/lnInclude -I/opt/openfoam211/src/dynamicMesh/lnInclude -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/myoscillatingRotatingMotion.o
In file included from myoscillatingRotatingMotion.C:26:0:
myoscillatingRotatingMotion.H:38:37: fatal error: solidBodyMotionFunction.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/myoscillatingRotatingMotion.o] Error 1

What am I doing wrong?

Thanks allot,
Alex
Attached Files
File Type: gz newApp.tar.gz (2.2 KB, 5 views)
A.A. is offline   Reply With Quote

Old   September 19, 2012, 08:27
Default
  #5
Member
 
Alexander A
Join Date: Jun 2012
Posts: 53
Rep Power: 13
A.A. is on a distinguished road
Hi,

I managed to compile my newApp library which comprises myoscillatingRotatingMotion.

The problem is I call multiMotion in my dynamicMeshdict file which should offer to use myoscillatingRotatingMotion. But when I run the case it comes an error which says valid solidBodyMotionFunctions for the multiMotion are ...and list the valid functions . This List doesen't comprise my oscillatingRotatingMotion.

What do I have to do that the multiMotion also offers to call myoscillatingrotatingMotion?

Best,
Alex
A.A. is offline   Reply With Quote

Old   September 19, 2012, 08:47
Default
  #6
Member
 
Alexander A
Join Date: Jun 2012
Posts: 53
Rep Power: 13
A.A. is on a distinguished road
Hi,

I made a mistake I forgot to put libs ("...") in the controlDict file.
After correcting this I get the following error in log.pimpleDyMFoam:

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : libnewApp.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load "libnewApp.so"

Could the problem be that the location of my library is wrong? As I said I couldn't find $FOAM_USER_APPBIN on my PC and I put It in $WM_PROJECT_USER_DIR.

Best,
Alex
A.A. is offline   Reply With Quote

Old   September 19, 2012, 10:21
Default
  #7
Member
 
Alexander A
Join Date: Jun 2012
Posts: 53
Rep Power: 13
A.A. is on a distinguished road
Hi,

Got it in the end ! My function works.

It's all in the links from Bruno.

Many thanks,
Alex
A.A. is offline   Reply With Quote

Reply


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 06:05
How to compile OpenFOAM-1.7.x on CrunchBang linux 10 gwierink OpenFOAM Installation 0 April 5, 2011 04:38
PV3FoamReader compile error.... PEM_GUY OpenFOAM Installation 6 April 5, 2010 17:22
compile errors of boundary condition "expDirectionMixed" liying02ts OpenFOAM Bugs 2 February 1, 2010 20:11
Error compile file udf czfluent Fluent UDF and Scheme Programming 24 September 26, 2009 13:24


All times are GMT -4. The time now is 21:28.