CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   compiled udf (https://www.cfd-online.com/Forums/fluent/31877-compiled-udf.html)

rafat July 24, 2003 06:46

compiled udf
 
I am trying to get my code compiled using FLUENT 6.1. It seems it does not want to work. I have Microsoft visual C++ @ 6. I included the "udf.h". whenever I try to build the library the message come up: -------------------------------------------------------

1 file(s) copied. (system "move user_nt.udf trial1\ntx86\3d")0 (system "copy C:\FLUENT.INC\fluent6.1\src\makefile_nt.udf trial1\ntx86\3d\makefile") 1 file(s) copied. 0 (chdir "trial1")() (chdir "ntx86\3d")() raf.c # Generating udf_names.c because of makefile raf.obj udf_names.c udf_names.c(7) : error C2059: syntax error : '}' udf_names.c(8) : warning C4034: sizeof returns 0

Done. -------------------------------------------------------

if I ignored this message and tried to build load the library the message come up:

------------------------------------------------------- Opening library "trial1"... Error: open_udf_library: The system cannot find the file specified.

Error Object: () -------------------------------------------------------

I have no clue what so ever what to do. I hope that someone can help me with this. thank you all.

alex July 24, 2003 13:03

Re: compiled udf
 
HI

A commun mistake of new CFD users is try to implement there own UDF in their first trial. A better aproach is to make sure your library was set up properly and then implement the UDF that they wrote.

Consequently, I suguest that you 1)copy a UDF example from fluent to your .../libudf/src directory (do not forget to delete the filename and write the new one on the makefile) 2) delete the 2d or 3d directory and create it again, just to ensure that the already compiled files will not cause problems. this directory is under the architecture machine that you are using ...ntx86/3d 3)change your location to the libudf directory and type -- make "FLUENT_ARCH=ntx86" 4) if the example UDF compile properly you can conclude that your UDF has to be improved 5) it seems to my that you have an extra "}" symbol

Good luck

Alex Munoz

rafat July 25, 2003 01:57

Re: compiled udf
 
Thanks alex. I followed your advice and I found out the following:

my old code was:

#include "udf.h"

DEFINE_DPM_DRAG(drag, Re, p)

{

float rafat1 = 1000.0;

return (rafat1);

}

Then I have changed "float to real" and the resulted code become:

#include "udf.h"

DEFINE_DPM_DRAG(drag, Re, p)

{

real rafat1;

rafat1 = 1000.0;

return (rafat1);

}

it seems working now. I did not know that "float" is not recognised by the compiler I am using.

Thanks to everyone.


All times are GMT -4. The time now is 18:40.