UDF for 3Dimensional geometry
I want to write a UDF for parabolic velocity proifles for flow in a 3Dimensional pipe. Can any one suggest me.

Re: UDF for 3Dimensional geometry
It's just the same as in 2D. Write the equation of the paraboloid which represents your profile.
Suppose your flow is oriented along the z axiz. Center the inlet with the origin of your reference system. Your profile will assume the simple form: z = a*x^2 + b*y^2 + c Use the macro F_CENTROID to retrieve the cell centroid coordinates, with a line like the following: F_CENTROID(x,f,t); where x is an array of dimension ND_ND, f is the face and t the thread. Then, you can put x = x[0]; y = x[1]; and use F_PROFILE(f, t, i) = a*pow(x,2) + b*pow(y,2) + c; replacing a, b and c with their values. Hi :) ap 
Re: UDF for 3Dimensional geometry
ap,
why do you put Hi :) at the end of your message? 
Re: UDF for 3Dimensional geometry
Just a nice and short way to say "Hello and good work". A smile always helps.
Hi :) ap 
Re: UDF for 3Dimensional geometry
Hi everyone,
Suppose i am using the velocity at the inlet of the st. pipe is 0.45 m/s. The ID of the tube is 0.0102 m, by using these values i made a UDF for 3D as #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y,z; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[0]; z = x[1]; F_PROFILE(f,thread,position)=0.45y*y/(.0051*.0051)*0.45z*z/(.0051*.0051)*0.45; } end_f_loop(f, thread) } when is read the velocity at the inlet of the tube it shows 2400 m/s. there is somthing wrong, can you please suggest me what is wrong here. 
Re: UDF for 3Dimensional geometry
If your velocity profile is function of y and z coordinates, these two lines are wrong:
y = x[0]; z = x[1]; The x vector contains in the order x,y,z coordinates. So: x[0] > x coordinate x[1] > y coordinate x[2] > z coordinate To check the paraboloid equation, just plot it in a softwnare like gnuplot. Hi :) ap 
All times are GMT 4. The time now is 18:33. 