CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF for varying inlet velocity with z-distance (http://www.cfd-online.com/Forums/fluent/41026-udf-varying-inlet-velocity-z-distance.html)

Peter Wilkins May 18, 2006 10:22

UDF for varying inlet velocity with z-distance
 
Hi,

I'm trying to write a UDF which will enable me to specify the inlet velocities at a boundary in terms of the z position of the point on the boundary. Can someone tell me what is wrong with my code (this is to specify x-velocity):

#include "udf.h"

DEFINE_PROFILE(unsteady_inlet_x_velocity, thread, position) { real z, x[ND_ND]; face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

z=x[1];

F_PROFILE(f, thread, position) = -1*0.129112*(z*10);

}

end_f_loop(f, thread) }

I've used similar UDFs in 2D problems but I'm not sure how to make it work in 3D. I'd appreciate it if someone can help!

Thanks very much,

Peter

Siddharth Khowala May 18, 2006 11:10

Re: UDF for varying inlet velocity with z-distance
 
hi I think if u need the z coordinate then it should be possibly x[2].The rest seems ok .Hope it helps

regards


All times are GMT -4. The time now is 15:23.