CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   use of static variable in udf's (

siva September 12, 2001 15:21

use of static variable in udf's
hi all,

can anybody tell me if it is permissible to use static variable with interpreted udfs-(static external actually) its giving me syntax error while i try to use it. is there any way around this(some other syntax). thanx for the help.

ravi October 12, 2001 07:04

Re: use of static variable in udf's
why don't you try the compiled udf instead of interpreted udf. Because in the compiled udf you can write all the c-syntaxes.(its not so with interpreted!)

thanks and regards,


sivakumar October 12, 2001 11:53

Re: hi ravi,use of static variable in udf's
hi ravi, thanks for the help. i am faced with a problem in setting up the compiled udf library. i run fluent on unix based machine and we have a gcc compiler. when i try to compile from my library directory, i get this error \path\cc: language optional software package not installed. i tried adding the gcc path to the directory bu it still gives the same error. can u please help me if u know about this one.

ravi October 15, 2001 15:50

Re: hi ravi,use of static variable in udf's
I don't know how did you create the directory structure in ur current working directory.

I hope u followed this procedure :

1. Create a directory called libudf ( U can name any thing to this directory).

2. copy Makefile.udf from path/Fluent.Inc/fluent5.x/src/Makefile.udf.

3. Create 2 directories src and ultra (if it is sun workstation or based on ur system architecture) in the libudf directory.

4. Copy path/Fluent.Inc/fluent5.x/src/makefile.udf in to the src directory.

Important : Note that u have to change the names of the Makefile.udf to Makefile and makefile.udf to makefile

5. Put the udf file (*.c file) in to the src directory.

6. create two directories called 2d and 3d in ultra (if ur's is sun machine or if it is hp machine hpux etc. - if u type "uname -a" at the command prompt it will show you the machine architecture name)

7. Edit makefile to set the following parameters :

SOURCES -- the user defined function to be compiled

FLUNET_INC --- the path to ur release directory

8. Go to libudf directory and type make 'FLUENT_ARCH=(architecture of ur machine)'

9. U can find out ur system architecture by starting any fluent session. Scroll up the Fluent console window to the message that begins with "Starting", and identify the Fluent architecture (for eg. ultra for sun)

10. Go to Define -->User-Defined-->Function Hooks--> compiled and give the name of the directory containing makefiles and udf file etc. In this case "libudf"

by the way where are u working on Fluent...



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