CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Parabolic velocity profile in 3d with UDF (https://www.cfd-online.com/Forums/fluent-udf/173904-parabolic-velocity-profile-3d-udf.html)

mmk3818 June 29, 2016 15:12

Parabolic velocity profile in 3d with UDF
 
4 Attachment(s)
Hi,
I am trying to get parabolic velocity at circular inlet of the pipe(figures and UDF code attached). Ideally velocity contour at inlet should show maximum velocity at center then decreasing towards outer side. But i am getting that in only one plane. Any suggestions to solve that?
In attachments, image1 is vel contour at inlet, images 2 and 3 are the same at planes perpendicular to each other and in the pipe along its length.
Thanks in advance.

Tharanga August 21, 2016 18:35

Quote:

Originally Posted by mmk3818 (Post 607291)
Hi,
I am trying to get parabolic velocity at circular inlet of the pipe(figures and UDF code attached). Ideally velocity contour at inlet should show maximum velocity at center then decreasing towards outer side. But i am getting that in only one plane. Any suggestions to solve that?
In attachments, image1 is vel contour at inlet, images 2 and 3 are the same at planes perpendicular to each other and in the pipe along its length.
Thanks in advance.

This should work cheers
#include "udf.h"
#include "math.h"
DEFINE_PROFILE(inlet_x_velocity, thread, index)
{
real x[ND_ND]; /* this will hold the position vector */
real y;
real z;
real a;
face_t f;
begin_f_loop(f, thread) /*loops over all faces in the thread passed in the DEFINE macro argument*/
{
F_CENTROID(x,f,thread);
y =x[1];
z =x[1];
a = pow((pow(y,2)+pow(z,2)),0.5);
F_PROFILE(f, thread, index) = 2*0.00000491976*(1- (a*a/(0.10214*0.10214)));
}
end_f_loop(f, thread)
}
*****Axis is on the X direction


All times are GMT -4. The time now is 11:12.