CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Compiling UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 13, 2006, 05:59
Default Compiling UDF
  #1
Claud
Guest
 
Posts: n/a
Hi everybody,

i am trying to compile a UDF into FLUENT. I have checked the different posts in that forum but nothing could really give me the clue.

Do I have to copy anything to anywhere?

I am doing the following steps: [read] the case -> [define]->[user defined]-> [function] -> compiled -> add source file -> add header file -> click [build] -> [load] but that just results in:

Opening library "libudf"... Error: open_udf_library: The system cannot find the specified file. Error Object: ()

Any further hints? Thanx a lot. Claud
  Reply With Quote

Old   December 13, 2006, 06:40
Default Re: Compiling UDF
  #2
RoM
Guest
 
Posts: n/a
Do you use Unix or WinXP? Usually Fluent will take care of all copy operations and give some feedback during compiling/linking like "Working... compiling ... linking ... done." You can do a file search in your working directory to see if the library has been built. The default names are "libudf.dll" for WinXP or "libudf.so" for Unix.

RoM
  Reply With Quote

Old   December 13, 2006, 09:57
Default Re: Compiling UDF
  #3
Claud
Guest
 
Posts: n/a
Hi RoM, I am using Windows2000. Up to now I am not getting any feedback regarding working...compiling... At least the library is created after hitting the "build"-button but with a message. During that one it misses the command "nmake". Then I copy the nmake.exe file it into the 2d-folder and then I dont get that message anymore. After hitting the load button I get the earlier mentioned error... Any suggestions? Claud

  Reply With Quote

Old   December 13, 2006, 10:05
Default Re: Compiling UDF
  #4
RoM
Guest
 
Posts: n/a
If the library is built you can load it using the udf library manager (define-> user-defined -> functions ->manage). Type in the full path and click "Load". I am not shure if you have to add the .dll extension to the library name, its a bit try an error.

Good luck, RoM
  Reply With Quote

Old   December 13, 2006, 10:51
Default Re: Compiling UDF
  #5
PAD
Guest
 
Posts: n/a
Try copying everything to a directory like c:\fluent.calc and compile from there. Sometimes the error happens when you are using names with whitespaces etc.

Regards, PAD
  Reply With Quote

Old   December 13, 2006, 11:42
Default Re: Compiling UDF
  #6
Claud
Guest
 
Posts: n/a
Hi RoM, I finally got it to work. It was a bit tricky. I figured out that I didnt have to copy the nmake.exe... but I had to "convert" the file with the Visual Studio Command Prompt typing "nmake". Then I was able to load it in Fluent... and it seems to work now... Thanx. Claud
  Reply With Quote

Old   December 13, 2006, 12:19
Default Re: Compiling UDF
  #7
RoM
Guest
 
Posts: n/a
I am glad to hear this, happy steamreforming . I will be on my winter vacation for the next 2 weeks so if you have some specific questions about the udf i sent to you it will have to wait until next year. I wish you and all who are reading this post right now a nice december, merry christmas a happy new year. I know its a bit early ....

RoM
  Reply With Quote

Old   December 13, 2006, 18:54
Default Re: Compiling UDF
  #8
Jason
Guest
 
Posts: n/a
Hi Claud,

Iam facing the same problem as your's.

Can you please how did you get over it.

Thanks

Regards

Jason
  Reply With Quote

Old   December 14, 2006, 03:35
Default Re: Compiling UDF
  #9
Claud
Guest
 
Posts: n/a
Hi Jason,

I have performed the following steps: 1) write your UDF and save it as .c 2) save your case/dat/c-file and .h-file (e.g. udf.h) in the same folder 3) open FLUENT and load your case file 4) Define --> User-Defined-Functions --> Compiled 5) Add your source file (ending .c) and add your header file (ending .h) 6) click on "build" --> here I got a message saying that "nmake" is unknown --> "ignore" that since your libudf-folder is being created anyway 7) here I used the Visual Studio .Net 2003 Command Prompt window which I copied into the 2d-folder from the libudf-folder (you could also open that prompt window from any other place but than you have to make sure that you have navigated it into the right folder 8) write "nmake" (without "" of course) into the command window and hit Enter 9) there should come up some lines.... 10) Define --> User-Defined-Functions --> Compiled --> click the "load" button (that should result in lines generated by Fluent like "Opening library "libudf" .... Done")

11) feel happy that you finally overcome that problem! At least I was happy about it Hope that helps you a bit.

Best wishes and good luck. Let me know if it worked. The FLuent Guides are not helpful at all regarding that problem.

Claud
  Reply With Quote

Old   December 14, 2006, 12:17
Default Re: Compiling UDF
  #10
jasond
Guest
 
Posts: n/a
Perhaps I should have posted sooner on this, but this is most probably a configuration problem with your compiler (and thus is not really a Fluent issue, so their docs won't really address it). This is addressed in the Fluent FAQ, but to get things working properly you'll need to fix your compiler configuration. As far as I know, this sort of thing is most likely because the command line version of the compiler is not fully set up. Usually, you'll get some complaints about missing DLL's too, so this might be different.

Jason
  Reply With Quote

Old   December 18, 2006, 17:52
Default Re: Compiling UDF
  #11
Zhang
Guest
 
Posts: n/a
check this out please.

http://www.cfd-online.com/Forum/fluent.cgi?read=44764
  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
compiling udf at window Nt(64BIT) noa FLUENT 3 July 30, 2014 00:01
Compiling UDF on a cluster Adya FLUENT 1 December 14, 2009 12:30
UDF compiling problem in Flient 6.3 jeevan kumar FLUENT 2 February 25, 2009 01:43
udf compiling problem akr FLUENT 3 August 22, 2007 08:14
On Compiling a UDF David Chabot FLUENT 5 May 20, 2005 10:13


All times are GMT -4. The time now is 03:44.