UDF and random functions
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 ); } ------------------------------------- |
Re: UDF and random functions
Ciao Gino, try to compile your UDF. The problem should disappear.Luca
|
Re: UDF and random functions
thanks so much Luca, you are right, now it works! ciao gino
|
All times are GMT -4. The time now is 15:57. |