|
[Sponsors] |
June 28, 2005, 03:11 |
UDF and random functions
|
#1 |
Guest
Posts: n/a
|
Can anybody tell us why Fluent does not interpret UDF with random functions calls (srand, rand)? The error message says that srand and rand are "undeclared variables"... thanks gino
----------------------------------- #include "udf.h" #define RAND_MAX 32767 DEFINE_PROFILE(temp_face,t,i) { real x[ND_ND]; face_t f; float ran ; srand( (unsigned) time (NULL) ); begin_f_loop(f,t) { ran = rand()/float(RAND_MAX) ; F_CENTROID(x,f,t); F_PROFILE(f,t,i) = 310.+2.*(ran-0.5); } end_f_loop(f,t) void srand( unsigned int seed ); } ------------------------------------- |
|
June 28, 2005, 03:14 |
Re: UDF and random functions
|
#2 |
Guest
Posts: n/a
|
Ciao Gino, try to compile your UDF. The problem should disappear.Luca
|
|
June 28, 2005, 04:55 |
Re: UDF and random functions
|
#3 |
Guest
Posts: n/a
|
thanks so much Luca, you are right, now it works! ciao gino
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fluent UDF - Random Noise | Tanner | FLUENT | 2 | May 29, 2014 03:27 |
Random Function in UDF per DPM | adriano | FLUENT | 1 | May 18, 2006 06:19 |
udf init random particles positions | olivia | FLUENT | 2 | August 3, 2004 03:35 |
Urgent: Random number in UDF | hedonists | FLUENT | 1 | March 4, 2004 03:26 |
Random function UDF for boundary condition | Chris | FLUENT | 4 | March 28, 2003 15:38 |