# UDF_velocity profile

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

February 15, 2013, 08:30
UDF_velocity profile
#1
New Member

Join Date: Feb 2013
Posts: 18
Rep Power: 4
Hi everybody,
I'm studying, with Fluent, the model shown in the attached image.
I've to impose a loarithmic velocity profile at the upwind boundary, that is:
U(h)=Uo/k*ln(h/ho)
where: Uo= 1,068 m/s
ho=o,005 m
k=0,41 (-)

The questions are two:

1)In setting the boundary conditions, I've to select, for the upwind face, a UDF velocity profil (created on the basis of the formula: U(h)=Uo/k*ln(h/ho)). While, for the other three faces, which are also inlet faces, I have to select the same UDF or to create other ones?

2)I've imposted a possible code for UDF, that is:

#include "udf.h"

#DEFINE Uo 1,068 //unit m/s
#DEFINE k 0,41
#DEFINE ho 0,005 //unit m

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];
}
end_f_loop(f,t)
}

Is it correct in your opinion?
I've never programmed in C language, so I don't know how to crate a UDF file, for loading it in FLUENT. Someone could please tell me how to do this?
Or, eventually, could I copy the code directly within command lines of fluent?

Thanks
Attached Images
 Dominio.jpg (58.1 KB, 11 views)

 February 15, 2013, 09:53 #2 Senior Member     Alex Join Date: Jun 2012 Location: Germany Posts: 1,097 Rep Power: 19 First of all, you should use "." instead of "," as a decimal separator. Yes, according to your sketch, you could use the same UDF for inlet, side walls and top walls. But it depends on the type of boundary conditions you want to use. Velocity inlet at the inlet face is certainly a straightforward choice. At the side walls, i would either use a symmetry boundary condition or a moving wall with the velocity profile from the UDF. Same for the top wall, the choice between moving wall and symmetry bc is up to you. How to get the UDF into fluent? Refer to the UDF manual The quick path: define -> user defined -> functions -> interpret or compile.

 February 15, 2013, 10:34 #3 New Member   Join Date: Feb 2013 Posts: 18 Rep Power: 4 Dear Flotus, Thanks for the answer. So, in your opinion I couldn't set 4 faces of the parallelepiped (except the basis) as velocity inlet, defining the same UDF for all? I can't understand what you mean with setting symmetry boundary at the other faces; I should not have a symmetry with respect to anything? As regard the moving walls, for the top face probably I would not have problems, becouse I should calculate the value of U at the max height (through the formula:U(h)=Uo/k*ln(h/ho)) and set up the obtained value in the settings of Moving Wall(Motion/Speed...). But, with reference to right and left faces, I can't set a velocity profile for a moving wall, but just a value of speed. So, what do you mean? Finally, do you think that different Boundary Condition would affect considerably the results? Thanks a lot. Bests

 February 15, 2013, 10:54 #4 Senior Member     Alex Join Date: Jun 2012 Location: Germany Posts: 1,097 Rep Power: 19 My bad. I thought using UDFs for the velocity of moving walls was possible. Apparently, it isnt. The problem with inlet BCs at the side walls is that the flow should be perpendicular to the face. In your case, the velocity is tangential to the surface. A symmetry boundary condition (zero shear stress) is the usual way to model such a boundary. The influence of the type of boundary condition (lets only discuss the top wall, because only here you are free to choose) depends on your setup. If the top wall is "far" away from the obstacle and the flow is dominated by inertial forces, then the difference between the two BCs (symmetry, moving wall) will vanish.

 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 Sing FLUENT 9 November 26, 2014 08:58 Josyula Fluent UDF and Scheme Programming 4 May 6, 2012 10:09 E61 FLUENT 0 January 5, 2011 09:13 Gui CFX 2 July 26, 2007 08:50 tom Phoenics 2 September 28, 2005 10:51

All times are GMT -4. The time now is 21:06.