
[Sponsors] 
May 18, 2003, 13:37 
UDF paraboloid velocity inlet

#1 
Guest
Posts: n/a

Hi, I have to put a velocity profile (fully developed) at the inlet of a 3D case but I never use UDF to define boundaries. The profile is like a paraboloid centered at middle of the pipe. I read the UDF chapter on FLuent doc but there's no 3D case example, only 2D as above (definition of a parabolic profile at inlet):
 #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, position) = 20.  y*y/(.0745*.0745)*20.; } end_f_loop(f, thread) }  I don't know how to change that in 3D . Someone could help me by give the right UDF file format in 3D? Thx a lot 

May 18, 2003, 17:19 
Re: UDF paraboloid velocity inlet

#2 
Guest
Posts: n/a

The x vector contains contains x and y position of the cell centroid in 2D, and x,y,z in 3D. So, if you write your paraboloid in the form
z = f(x,y) your x will be the first position (0) of x vector and your y will be the second one (1). So you have to remove the line y = x[1]; and change F_PROFILE(f, thread, position) = 20.  y*y/(.0745*.0745)*20.; in F_PROFILE(f,thread,position) = f(x[0],x[1]); P.S. I'm supposing your pipe axis is along z axis. If you want the code, post the equation of the paraboloid Hi ap 

May 18, 2003, 17:47 
Re: UDF paraboloid velocity inlet

#3 
Guest
Posts: n/a

Hi ap
The velocity take several values (derived of the mass flow inlet boundary), the diameter of pipe is 10mm , pipe axis is along Z axis. Here is the mesh for the waterblock (a water flow in a copper shape with a maze) to understand situation (inlet in blue and outlet in red color): http://membres.lycos.fr/roscool/forum/temp/mesh.gif Could you put the code for a 1m/s velocity inlet (mean) for example with a typical poiseuille flow shape (paraboloid)? Thx again ap 

May 18, 2003, 20:42 
Re: UDF paraboloid velocity inlet

#4 
Guest
Posts: n/a

I write what I did so you can check it (did it in a hurry )
I suppose that the origin of reference system is the center of the inlet. If this is not true...translate your mesh with Gambit The general paraboloid form is: z = a*x^2 + b*y^2 + c But in our case a=b because it's axisymmetric. The vertex of the paraboloid has z = v_max = 2*v_avg, and it's z = 0 for example in (x=0,y=r). So a = b = v_max/(r^2) c = v_max v_max = 2*v_avg and z = v_max/(r^2) * (x^2+y^2) + v_max In the code i put v_max/(r^2) = coeff. Here's the code. Remember it requires you have the origin of your reference system in the center of the inlet pipe. If you need to change diameter and average velocity, change their values in the corresponding #define. #include "udf.h" #define PIPE_DIAMETER 10.e3 // Set here the diameter of your pipe in meters #define AVG_Z_VELOCITY 1. // Set here the average z velocity at inlet in m/s DEFINE_PROFILE(paraboloid_velocity, thread, position) { real x[ND_ND]; real coeff,r,v_max; face_t f; r = PIPE_DIAMETER/2.; //Calculating radius v_max = 2.*AVG_Z_VELOCITY; //Calculating paraboloid vertex z (max velocity) coeff = v_max/pow(r,2.); begin_f_loop(f, thread) { F_CENTROID(x,f,thread); F_PROFILE(f, thread, position) = coeff*(pow(x[0],2.) + pow(x[1],2)) + v_max; } end_f_loop(f, thread) } Hi and good work ap 

May 19, 2003, 05:30 
Re: UDF paraboloid velocity inlet

#5 
Guest
Posts: n/a

Oki, I understand now how to define each velocity on each face at inlet I'll try that soon, I hope it works
Thank you very much ap to help me each time 

September 1, 2011, 02:29 

#6 
Member

thank you for detailed discription of udf for paraboloid


March 24, 2016, 10:48 

#7  
New Member
Yu Lu
Join Date: Jul 2015
Location: England
Posts: 26
Rep Power: 10 
Quote:
This is so detailed thank you! Just one thing, F_PROFILE(f, thread, position) = coeff*(pow(x[0],2.) + pow(x[1],2)) + v_max why it's not coeff*(pow(x,2.) + pow(y,2)) + v_max ?? 

March 30, 2016, 17:28 

#8 
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 
The F_CENTROID(x,f,thread) macro returns an array, 'x', of coordinate positions of the centroid of the face. Each value in this array is for a different spatial coordinate: x[0] for xdirection, x[1] for ydirection and x[2] for zdirection (only in 3D cases).


October 24, 2016, 04:48 
UDF for inlet temperature

#9 
New Member
mm
Join Date: May 2016
Posts: 24
Rep Power: 9 
Dear all
I have following UDF for inlet temperature, untill 1300s it takes correct values according to equation, but after 1300s values are higher and not accorrding to equation, like at 1301s it should have value of 405C but in simulation inlet temperature is 621C. I could not find the error in my UDF after lot of try. please check this and guide me. help please. #include"udf.h" DEFINE_PROFILE(inlet_temperature,thread,position ) { face_t f; begin_f_loop(f,thread) { real t = RP_Get_Real("flowtime"); if (t <=1300.0 ) { F_PROFILE(f,thread,position) = 379.13 + 0.0005*t; } else if (1300.0 < t && t <= 1500.0 ) { F_PROFILE(f,thread,position)= 1.04289036878969*pow(10,10)*pow(t,6.0)+ 8.86126436853789*pow(10,7)*pow(t,5.0)3.13621260398811*pow(10,3)*pow(t,4.0)+5.91804640375908*pow(t,3.0)6.27969461279651*pow(10,3)*pow(t,2.0)+ 3.55273415252714*pow(10,6)*t  8.37223405676245*pow(10,8); } else { F_PROFILE(f,thread,position) = 9.51538261322402*pow(10,23)*pow(t,6) + 8.26192751387975*pow(10,18)*pow(t,5)2.85237398505875*pow(10,13)*pow(t,4)+4.97518353700886*pow(10,9)*pow(t,3)4.58733775886876*pow(10,5)*pow(t,2)+ 2.10251137071757*pow(10,1)*t +3.57252192344954*pow(10,2); } } end_f_loop(f,thread) } 

March 5, 2017, 00:51 

#10  
New Member
Gary
Join Date: Jan 2017
Posts: 6
Rep Power: 9 
Quote:
Thanks ap for such a detailed description of the UDF. I need a similar one for my project where my average velocity is sinusoidal variation with time and the inlet centre is located at 20 mm from the origin along the y direction and 120 mm along the z direction. Can you please tell me what changes should I make in the UDF program? Please post a quick answer if it is not much of a problem. The time varying velocity profile is #include "udf.h"//file that contains definitions for define functions and fluent operations #define PI 3.141592654 DEFINE_PROFILE(in_vela,th,i) { face_t f; real t = CURRENT_TIME; begin_f_loop(f,th) { F_PROFILE(f,th,i) = ((0.086)*(sin(((2*PI/3)*t) + 0.0873)))  0.0075; } end_f_loop(f,th); } 

June 2, 2017, 08:01 

#11 
New Member
Rakesh Ramesh
Join Date: May 2017
Posts: 1
Rep Power: 0 
Hey
My parabola's equation is 0.0064*(x1.25)*(x1.25)0.01 = y Can you please type the code for it Maximum velocity should be 0.01m/s and dimension of 2d rectangle is 250x1000mm 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
(ask) how to create UDF for inlet velocity profile  sincity  Fluent UDF and Scheme Programming  83  May 16, 2022 13:04 
3D UDF Paraboilc Velocity Profile (Can't Maintain)  Sing  FLUENT  12  August 7, 2017 06:25 
3D velocity inlet UDF  zumaqiong  Fluent UDF and Scheme Programming  2  October 24, 2016 04:44 
USED UDF for inlet velocity in 3D  sara  FLUENT  0  October 11, 2007 18:04 
Fluent UDF load and apply inlet velocity b.c.  Knut Lehmann  Main CFD Forum  2  June 29, 2007 04:53 