3D rectangular velocity profile UDF

 Register Blogs Members List Search Today's Posts Mark Forums Read

 November 20, 2014, 13:54 3D rectangular velocity profile UDF #1 New Member   John Join Date: Nov 2014 Posts: 2 Rep Power: 0 Hi guys, I am quite inexperienced with UDFs and was wondering if anyone could help me, I am trying to create a UDF for a fluent simulation. It is a 3D domain (cuboid) with an inlet face that needs to have a boundary layer conforming to the law: U=((y/d)^(1/7))*Ufree Where U is the inlet velocity at a given point, y is the vertical coordinate, d (delta) is the boundary layer thickness and Ufree is the freestream velocity. When y=d (top of boundary layer) then U=Ufree When I try to interpret the file in fluent I get several errors, but I can't see where the code is wrong. The fluent UDF manual only has one a code for a 2D velocity profile. The code I've been trying is below: #include "udf.h" #define P 1./7. //power law n value 7// #define del 0.005 // boundary layer thickness value// #define ufree 0.05 //freestream velocity value// DEFINE_PROFILE(x_velocity,thread,position) { real x[ND_ND], real y, real z; { face_t f; begin_f_loop(f, thread) } { F_CENTROID(x, f, thread); y=x[1]; z=x[2]; if (y<=del) F_PROFILE(f, thread, position) = ufree*pow(y/del,P); else F_PROFILE(f, thread, position) = ufree; } end_f_loop(f, thread) } Does anyone have a working 3D velocity profile UDF that is similar I could use? Or if anyone could help me I'd really appreciate it.

 November 21, 2014, 03:17 #2 Member   Join Date: Jul 2013 Posts: 80 Rep Power: 12 #include "udf.h" #define P 1./7. //power law n value 7// #define del 0.005 // boundary layer thickness value// #define ufree 0.05 //freestream velocity value// DEFINE_PROFILE(x_velocity,thread,position) { real x[ND_ND], y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x, f, thread); y=x[1]; if (y<=del) F_PROFILE(f, thread, position) = ufree*pow(y/del,P); else F_PROFILE(f, thread, position) = ufree; } end_f_loop(f, thread) } //Cheers

 November 21, 2014, 07:49 #3 New Member   John Join Date: Nov 2014 Posts: 2 Rep Power: 0 Eureka!! It works perfectly! Thank you so much, really appreciate it!

 Tags fluent, power law, udf, velocity profile