CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Compiling UDF (https://www.cfd-online.com/Forums/fluent/43115-compiling-udf.html)

Claud December 13, 2006 04:59

Compiling UDF
 
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

RoM December 13, 2006 05:40

Re: Compiling UDF
 
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

Claud December 13, 2006 08:57

Re: Compiling UDF
 
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


RoM December 13, 2006 09:05

Re: Compiling UDF
 
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

PAD December 13, 2006 09:51

Re: Compiling UDF
 
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

Claud December 13, 2006 10:42

Re: Compiling UDF
 
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

RoM December 13, 2006 11:19

Re: Compiling UDF
 
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

Jason December 13, 2006 17:54

Re: Compiling UDF
 
Hi Claud,

Iam facing the same problem as your's.

Can you please how did you get over it.

Thanks

Regards

Jason

Claud December 14, 2006 02:35

Re: Compiling UDF
 
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

jasond December 14, 2006 11:17

Re: Compiling UDF
 
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

Zhang December 18, 2006 16:52

Re: Compiling UDF
 
check this out please.

http://www.cfd-online.com/Forum/fluent.cgi?read=44764


All times are GMT -4. The time now is 09:19.