CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF in Cylindrical Coordinates (http://www.cfd-online.com/Forums/fluent-udf/100044-udf-cylindrical-coordinates.html)

donmezayd April 19, 2012 03:14

UDF in Cylindrical Coordinates
 
dear all,
first of all, the problem is 3D and in cylindrical coordinates.
i have to specify a tangential velocity profile as a function of radius "r", but i think somthing is wrong with it. the values obtained from the udf does not match with real values (i also computed it with excell). i couldn't understand where the problem is. would you please have a look at the code? thanks!

#include "udf.h"
DEFINE_PROFILE(velocity_profile,t,i)
{
real x[ND_ND]; /* this will hold the position vector */
real r,R,omega;
face_t f;
R=0.1;
omega=20;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
r=sqrt((x[0]*x[0])+(x[1]*x[1]));

F_PROFILE(f,t,i) = (omega*R*R/r)*(1-exp(-r*r/R*R));
}
end_f_loop(f,t)
}


All times are GMT -4. The time now is 10:25.