CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   impose same velocity at inlet (http://www.cfd-online.com/Forums/fluent-udf/121468-impose-same-velocity-inlet.html)

 rayan24 July 29, 2013 12:36

impose same velocity at inlet

I want to impose by UDF a same velocity profile in 3 inlets, but i don't get same velocity in the 3 inlets apparently i impose my profile in function of the distance r!!

how can i impose my velocity profile in the "surface" of inlet to get samevelocity please??

my udf is :
include "udf.h"
Quote:
 DEFINE_PROFILE(z_velocity_inlet,t,i) { real x[ND_ND]=3; real r; face_t f; begin_f_loop(f,t) { F_CENTROID(x,f,t); r = x[0]; F_PROFILE(f,t,i) = -((0.0431*pow(r,3))-(0.3857*pow(r,2))+(0.3129*r)+8.8045); } end_f_loop(f,t)
Thanks

 flotus1 July 29, 2013 14:14

Apparently, you are using the absolute value of the x-coordinate for each of the 3 inlets. If they dont have identical position, the velocity will be different.

Additionally, "real x[ND_ND]=3;" is some kind of strange.
You initialize the value 3 to the variable x here, which makes no sense as it is overwritten anyway. Use "real x[ND_ND];" instead.

 rayan24 July 30, 2013 03:02

I confirme that the inlets are diffrents coordinate of X, so how can i specify this difference in UDF please

 flotus1 July 30, 2013 03:12

Write 3 similar UDFs and shift the coordinate to match the "local" coordinate system of each inlet.
Change the variable "offset" so that r actually becomes the distance (I suppose distance from the wall?) in each inlet.
Code:

`r = x[0]-offset;`
If you are having trouble with this, we will need a sketch of your setup and the velocity profiles you want in order to give further advice.

 rayan24 July 30, 2013 03:26

Thank you very much Alex that's what I did :), I needed your confirmation! its OK:p

but in the results of simulation I feel that the velocity is not properly difffuse ? (i use RSM model) do you have an idea ?

 flotus1 July 30, 2013 04:07

I dont know what you mean by "the velocity is not properly diffuse".

 rayan24 July 30, 2013 04:53

It's okay, it was just a display problem :)