CFD Online Logo CFD Online URL
Home > Forums > FLUENT

UDF paraboloid velocity inlet

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

LinkBack Thread Tools Display Modes
Old   May 18, 2003, 13:37
Default UDF paraboloid velocity inlet
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)



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
  Reply With Quote

Old   May 18, 2003, 17:19
Default Re: UDF paraboloid velocity inlet
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.;


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


  Reply With Quote

Old   May 18, 2003, 17:47
Default Re: UDF paraboloid velocity inlet
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):

Could you put the code for a 1m/s velocity inlet (mean) for example with a typical poiseuille flow shape (paraboloid)?

Thx again ap
  Reply With Quote

Old   May 18, 2003, 20:42
Default Re: UDF paraboloid velocity inlet
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 axi-symmetric. The vertex of the paraboloid has z = v_max = 2*v_avg, and it's z = 0 for example in (x=0,y=r).


a = b = -v_max/(r^2)

c = v_max

v_max = 2*v_avg


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.e-3 // 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_PROFILE(f, thread, position) = coeff*(pow(x[0],2.) + pow(x[1],2)) + v_max;

} end_f_loop(f, thread) }

Hi and good work

  Reply With Quote

Old   May 19, 2003, 05:30
Default Re: UDF paraboloid velocity inlet
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
  Reply With Quote

Old   September 1, 2011, 02:29
Join Date: Jul 2011
Posts: 42
Rep Power: 6
niravtm007 is on a distinguished road
Send a message via Skype™ to niravtm007
thank you for detailed discription of udf for paraboloid
niravtm007 is offline   Reply With Quote


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 10 October 14, 2015 20:24
(ask) how to create UDF for inlet velocity profile sincity Fluent UDF and Scheme Programming 43 July 9, 2014 13:01
3D velocity inlet UDF zumaqiong Fluent UDF and Scheme Programming 1 June 4, 2010 19:31
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

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