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/)
-   -   UDF_parabolic velocity profile (https://www.cfd-online.com/Forums/fluent-udf/85291-udf_parabolic-velocity-profile.html)

trantoan2008 February 22, 2011 05:28

UDF_parabolic velocity profile
 
Hi All,

I am studying fully developed flow in tube by using UDFs. The inlet face is on the X-Z plane and the velocity is parabolic profile and normal to the face in the Y direction. After I run some iteration, I checked profile velocity at inlet boundary condition. However, I did not see parabolic profile at inlet condition. Below code as following:


#include "udf.h" /* must be at the beginning of every UDF you write */
#include "math.h"
DEFINE_PROFILE(inlet_y_velocity,thread,index)
{
real y[ND_ND];
real z,x,r;
#define R 1.615 /* Radius of geometry at inlet region */
#define V 36
#define n 1
face_t f;
begin_f_loop(f,thread) /* loops over all faces in the thread passed in the DEFINE macro argument */
{
F_CENTROID(y,f,thread);
x=y[1];
z=y[2];
r=pow((pow(x,2)+pow(z,2)),0.5);
F_PROFILE(f,thread,index) = V*((3*n+1)/(n+1))*(1-pow((r/R),(n+1)/n));
}
end_f_loop(f,thread)
}

There are somethings wrong here? Anybody help me.

Amir February 22, 2011 08:26

Hi,
I think here's the problem:
Quote:

Originally Posted by trantoan2008 (Post 296389)
F_CENTROID(y,f,thread);
x=y[1];
z=y[2];

try this:
Quote:

F_CENTROID(y,f,thread);
x=y[0];
z=y[2];

trantoan2008 February 22, 2011 08:49

Hi Amir,

Thanks for your help. According to your instruction, I check accuracy inlet boundary condition. It's obsolutely accuracy.

Best Regard,
Tran Toan

alneama October 7, 2022 09:44

Hi Amir,
How to make a UDF to have a fully developed velocity profile in the entrance of 3D rectangular microchannel having a cross sectional area of 2mm (H) * 1mm (W) and length of 20mm? I want to interpreted it to ANSYS (Fluent). Assume that inlet velocity is 0.2 m/sec.
Regards.
Dr. Ahmed F. Al-Neama


All times are GMT -4. The time now is 16:29.