CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

help for UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   February 7, 2008, 19:49
Default help for UDF
Posts: n/a
Hi everybody, I have a problem with my UDF program, if someone could help me, I would really appreciate. I am trying to set up a velocity which is egal to a constant(1.6) plus a random number (r). When I load this program on fluent, it tells me that "srand: undeclared variable". I don't know how to declare srand.

#include "udf.h"

DEFINE_PROFILE(random_velocity,thread,position) {

face_t f;

int seed;

double r;




{ r=( (double)rand()/((double)(RAND_MAX)+(double)(1))); F_PROFILE(f,thread,position)=1.6 +r;

} end_f_loop(f,thread)

  Reply With Quote

Old   February 8, 2008, 12:24
Default Re: help for UDF
Posts: n/a
even all the functions of "stdlib.h" like abs(),exit() dosen't work & will show the same error as shown in your case.

Actually I was advised to load VC++ compiler into the system.....really don't know whether it works.
  Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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