CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Parabolic velocity profile at vertical entrance (http://www.cfd-online.com/Forums/fluent/68447-parabolic-velocity-profile-vertical-entrance.html)

ztp911 September 20, 2009 20:29

Parabolic velocity profile at vertical entrance
 
Hi Guys,

I'm working on a FLUENT question involving a tee-junction. I have one problem which I don't know how to handle. The vertical
inlet is 1 m wide and has its velocity has a parabolic profile. This seems to require some
sort of User Defined Function as part of the boundary condition. I
searched on the Net and found the following C source code which can be compiled into FLUENT:

/************************************************** ***********************/
/* udfexample.c */
/* UDF for specifying a steady-state velocity profile boundary condition */
/************************************************** ***********************/

#include "udf.h"


DEFINE_PROFILE(inlet_y_velocity, thread, position)
{
real y[ND_ND]; /* this will hold the position vector */
real x;
face_t f;

begin_f_loop(f, thread)
{
F_CENTROID(y,f,thread);
x = y[1];
F_PROFILE(f, thread, position) = 20. - y*y/(.0745*.0745)*20;
}
end_f_loop(f, thread)
}

However, this code defines a parabolic velocity profile for a
horizontal inlet and doesn't quite apply to the question which has a
vertical inlet. Could someone help me please? Much appreciated!!!

Cheers

Bernhard September 21, 2009 15:26

Code:

F_CENTROID(y,f,thread);
x = y[1];

These lines store the y-coordinate in a variable x. If you want the vertical z-direction, you should do x=y[2].

In the next line your code used y, but I assume you want to use your new variable x there. Good luck!

Goutam September 3, 2013 06:10

UDF for inlet profile
 
I considered a simple laminar pipe flow problem:

#include "udf.h"
DEFINE_PROFILE(inlet_velocity, t, i)
{
real y[ND_ND];
real x,r;
face_t f;
r=0.0095;
begin_f_loop(f, t)
{
F_CENTROID(y,f,t);
x = y[1];
F_PROFILE(f, t, i) = 0.009022 - 0.009022*((x*x)/(r*r));
}
end_f_loop(f, t)
}

I used this code at inlet but I am always getting uniform velocity at the inlet. Why? When I initialize the solution from inlet, it shows the value 0.009022?

I didn't find the error? Any suggessions ?????


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