# 3D rectangular velocity profile UDF

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

 November 20, 2014, 14: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, 04:17 #2 Member   Join Date: Jul 2013 Posts: 75 Rep Power: 6 #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, 08: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

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post kailingkk Fluent UDF and Scheme Programming 7 August 4, 2017 14:39 nabster Fluent UDF and Scheme Programming 0 September 7, 2014 04:01 Gigis Fluent UDF and Scheme Programming 8 January 13, 2013 23:20 cfdworker Fluent UDF and Scheme Programming 0 April 23, 2009 19:09 William177 FLUENT 1 February 3, 2008 07:47

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