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

UDF_velocity profile

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2013, 08:30
Default UDF_velocity profile
  #1
New Member
 
Join Date: Feb 2013
Posts: 18
Rep Power: 13
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, 22 views)
Roby_1986 is offline   Reply With Quote

Old   February 15, 2013, 09:53
Default
  #2
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,395
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
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: 13
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
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,395
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
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

Old   March 29, 2018, 04:12
Default
  #5
New Member
 
David
Join Date: Nov 2017
Posts: 14
Rep Power: 8
uconcorde is on a distinguished road
Quote:
Originally Posted by flotus1 View Post
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.
Hi Alex,

I am wondering how do you hook the UDF to a symmetry BC.

Thank you,
Dv
uconcorde is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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 12 August 7, 2017 07:25
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 01:21.