CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Pb with simple Fluent UDF example for inlet (https://www.cfd-online.com/Forums/fluent/49467-pb-simple-fluent-udf-example-inlet.html)

francois October 9, 2008 10:34

Pb with simple Fluent UDF example for inlet
 
Hi all,

I want use a fully turbulent velocity profile in the inlet of my computational domain.

I have used a very simple udf from the udf examples of Fluent. The udf is interpreted without error message but when:

* I want to initialize my solution with my velocity profile at the inlet I've got:

Error: prf-set-var: invalid flonum Error Object: nan

* I try to iterate, I have this error message:

Error: > (greater-than): invalid argument [2]: wrong type [not a number] Error Object: nan

So I suspect a division by zero, but can't find it in my udf.

Any ideas ? Thanks a lot for your help.

Regards Francois

------------------------udf begins here---------------------

#include "udf.h"

#define YMIN 0.5

#define YMAX 1.5

#define UMEAN 1.0

#define B 1./7.

#define DELOVRH 0.5

#define VISC 1.7894e-05

#define CMU 0.09

#define VKC 0.41

/* profile for x-velocity */

DEFINE_PROFILE(x_velocity, t, i)

{

real y, del, h, x[ND_ND], ufree;

face_t f;

h = YMAX - YMIN;

del = DELOVRH*h;

ufree = UMEAN*(B+1.);

begin_f_loop(f, t)

{

F_CENTROID(x,f,t);

y = x[1];

if (y <= del)

F_PROFILE(f,t,i) = ufree*pow(y/del,B);

else

F_PROFILE(f,t,i) = ufree*pow((h-y)/del,B);

}

end_f_loop(f, t)

}

----------------------udf end here-------------------------


All times are GMT -4. The time now is 00:39.