April 26, 2016, 04:58
|
|
#19
|
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
|
Quote:
Originally Posted by Keyu
Hi,
I have seen and used UDFs for the inlet x velocity, but what do I do to make a UDF for inlet y velocity.
Here is the UDF that I used for inlet x velocity.
[
#include "udf.h"
#define umean 10.0
#define R 0.0005
DEFINE_PROFILE(inlet-x-velocity,t,i)
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y = x[1];
F_PROFILE(f,t,i) = (3./2.)*umean*(1-pow((y-R)/R,2));
}
end_f_loop(f,t)
}
]
I tried replacing x with y and vice versa to hopefully get the y-direction velocity, but unsuccessful.
Any suggestions here will be useful.
Thanks,
Keyu
|
This line varies the position along the X, Y, Z axis (0,1,2 respectively).
y = x[1];
If you want a velocity profile normal to the Y direction, you need to use the variation of the position in the X direction if 2D and X and/or Z direction if 3D.
|
|
|