CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   udf velocity profile (

hillat May 20, 2013 14:46

udf velocity profile
hi I am trying to write a udf function that use the index number in order to put a value from array. I wrote the following function that isn't working


DEFINE_PROFILE(unsteady_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y;real A[251]={8,7,6,5,4,3,2,1}; real t = CURRENT_TIME; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); c0 = F_C0(f,thread); y = x[1]*2000; F_PROFILE(f, thread, position) =A[c0];} end_f_loop(f, thread)}

for example the first y , index=1 so u=A[1]=8;

thanks for the help

All times are GMT -4. The time now is 09:55.