|
[Sponsors] |
February 15, 2013, 08:30 |
UDF_velocity profile
|
#1 |
New Member
Join Date: Feb 2013
Posts: 18
Rep Power: 13 |
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 |
|
February 15, 2013, 09:53 |
|
#2 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
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: 13 |
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 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
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. |
|
March 29, 2018, 04:12 |
|
#5 | |
New Member
David
Join Date: Nov 2017
Posts: 14
Rep Power: 9 |
Quote:
I am wondering how do you hook the UDF to a symmetry BC. Thank you, Dv |
||
|
|
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 |