CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Urgent: Random number in UDF (https://www.cfd-online.com/Forums/fluent/33156-urgent-random-number-udf.html)

hedonists March 3, 2004 20:11

Urgent: Random number in UDF
 
Hi,

Can anyone tell me which function to use to generate uniform random numbers in (0~1) or Gaussian random numbers in Fluent UDF?

URGENT, S.O.S.!

Ale March 4, 2004 03:26

Re: Urgent: Random number in UDF
 
Hi, Your UDF is programmed in C, so that I think you can only use C language to generate random numbers.

The function rand() is defined in sdtlib.h.

Have a look to the following links:

http://home.earthlink.net/~ddruml/random2.htm

http://cplus.about.com/library/weekly/aa041403c.htm

Regards,

Ale


All times are GMT -4. The time now is 01:26.