CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

UDF_velocity profile

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 15, 2013, 08:30
Default UDF_velocity profile
  #1
New Member
 
Join Date: Feb 2013
Posts: 18
Rep Power: 3
Roby_1986 is on a distinguished road
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];
F_PROFILE(f,thread,index) = Uo/k*log(y/ho);
}
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
File Type: jpg Dominio.jpg (58.1 KB, 10 views)
Roby_1986 is offline   Reply With Quote

Old   February 15, 2013, 09:53
Default
  #2
Senior Member
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,041
Rep Power: 17
flotus1 will become famous soon enough
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.
flotus1 is offline   Reply With Quote

Old   February 15, 2013, 10:34
Default
  #3
New Member
 
Join Date: Feb 2013
Posts: 18
Rep Power: 3
Roby_1986 is on a distinguished road
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
Roby_1986 is offline   Reply With Quote

Old   February 15, 2013, 10:54
Default
  #4
Senior Member
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,041
Rep Power: 17
flotus1 will become famous soon enough
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.
flotus1 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3D UDF Paraboilc Velocity Profile (Can't Maintain) Sing FLUENT 9 November 26, 2014 08:58
Pulsatile profile at inlet Josyula Fluent UDF and Scheme Programming 4 May 6, 2012 11:09
Boundary Profile E61 FLUENT 0 January 5, 2011 09:13
problem with importing and exporting profile BC Gui CFX 2 July 26, 2007 09:50
Wind profile tom Phoenics 2 September 28, 2005 11:51


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