CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Velocity profile UDF (https://www.cfd-online.com/Forums/fluent-udf/101607-velocity-profile-udf.html)

 egge24 May 8, 2012 18:29

Velocity profile UDF

Hi,

I'm trying to create a tranverse velocity profile UDF to use it as velocity inlet boundary condition to simulate flow in a water tank. The UDF is as follows:

########################################

{
real x[ND_ND]; /* this will hold the position vector */
real z;
face_t f;
in the DEFINE macro argument */
{
z = x[1];

if (z < 0)

z = z*(-1);

else

}
}

############################################

When I run the simulation, once it converges I plot a XY Plot, see attached figure . In my case the Z-axis represents the abscissa and the velocity magnitude the ordinate. The plot shows that even do the function represents the desire velocity profile, there is almost none velocity magnitude variation!!!

Does anyone have an idea of why is that happening??

http://img715.imageshack.us/img715/8965/zvelprofile.jpg[/URL]

 Daniel Tanner May 9, 2012 04:11

You have set z = x[1]. This is the y direction on your mesh, is that correct? The x vector is given by: (x[0], x[1], x[2]) which is equivalent to (x,y,z).

Worth checking this.

 egge24 May 10, 2012 13:03

Thanks Daniel!!

That was the problem!!!!!

 All times are GMT -4. The time now is 19:31.