Velocity boundary condtion UDF help
I have a rectangular inlet (2x1in X and Z)for a 3 D problem where I want to give a UDF for y velocity (ve direction). The centre of the of the rectangular inlet is at (2.5,2,8). The maximum velocity is 10. The profile is parabolic in x and z directon. I have written a UDF. But the velocity comes out to be >100.
I don't know where I'm I doing wrong. /************************************************** ***********************/ /* udf velocity profile boundary condition */ /************************************************** ***********************/ #include "udf.h" DEFINE_PROFILE(inlet_y_velocity, thread, index) { real p[ND_ND]; real x,z; face_t f; begin_f_loop(f, thread) { F_CENTROID(p,f,thread); x = p[1]; z= p[1]; F_PROFILE(f, thread, index) = (1010*((x+2.5)*(x+2.5))10*(((z2)/0.5)*((z2)/0.5))); } end_f_loop(f, thread) } 
The x, y and zvalues of the face centroids are stored in p[0], p[1] and p[2], respectively.
So first of all you should change the line "x=p[1];" to "x=p[0]" and the line "z=p[1];" to "x=p[2]" Didn't check the rest of your formula, so there could still be some more errors. 
Thanks man.I totally forgot about that. I am getting proper results now. Also, I did miss negative sign in the formula.

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