CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

3d velocity inlet-help needed!

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

LinkBack Thread Tools Display Modes
Old   June 14, 2005, 15:18
Default 3d velocity inlet-help needed!
Posts: n/a
Hello CFD community,

The subject of how to define a 3d parabolic velocity profile as been explained at numerous occasions on this site.

My problem is the following: I cannot use a single one of these UDF succesfully although Fluent has no problem interpreting them succesfully. In other words, I can interpret a UDF but Fluent does not assign the proper veolcity values to the inlet face. In fact Fluent does not loop through each face of a surface as should be the case.

This appears very odd to since I have no trouble using the UDF for 2d cases. But as soon as I try using 3d, I get no response and the case will case converge within 1 iteration since no change occur in the domain.

As anyone experienced this problem before? I can email a small 3d mesh file to anyone curious about this. Below is a typical UDF tried.

Best Regards, David

----------------------------------------------------- #include "udf.h"

#define xc 0./*inlet face center cordinates are x=0 and y=0 since pipe is along z-axis*/

#define yc 0.

#define radius 0.0065

#define umean 0.232

DEFINE_PROFILE(z_velocity, thread, position)


float r, x[2];

face_t f;

begin_f_loop(f, thread)

{ F_CENTROID(x,f,thread);

r = sqrt(pow(x[0]-xc,2)+pow(x[1]-yc,2));

printf("r=%.6f\n",r); /* for control purposes*/

F_PROFILE(f,thread,position) = 2*umean*(1-pow(r/radius,2));

printf("x=%.6f\t r=%.6f\t u=%.5f\n",x[0],r,2*umean*(1-pow(r/radius,2))); /* for control purposes*/


end_f_loop(f, thread)

  Reply With Quote

Old   June 15, 2005, 07:34
Default Re: 3d velocity inlet-help needed!
Posts: n/a
David..try using the following declaration for x: real x[ND_ND]; "The constant ND_ND is defined as 2 for RP_2D ( FLUENT 2D) and RP_3D ( FLUENT 3D). It can be used when you want to build a matrix in 2D and a matrix in 3D. When you use ND_ND, your UDF will work for both 2D and 3D cases, without requiring any modifications." - Fluent UDF Manual, Ch. 6.6 Vector Macros

  Reply With Quote

Old   June 15, 2005, 10:06
Default Re: 3d velocity inlet-help needed!
Posts: n/a
Hello Peter, thank you for responding. I tried declaring this variable as you had suggested without any success. I don't understand why Fluent does not seem to loop on a planar surface such as the one used in my 3d case. Any other comments would be greatly appreciated!

Regards, David
  Reply With Quote

Old   June 17, 2005, 11:33
Default Re: 3d velocity inlet-help needed!
Posts: n/a
Just for the record:

I compiled the same UDF and it worked.
  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
Velocity Inlet BC -- Flow Reversal salihovic FLUENT 0 May 8, 2011 05:45
Changing Boundary: Decreasing Inlet Velocity - Convergence Issues VT_Bromley FLUENT 3 February 12, 2011 10:02
User Defined Profiles, Swirl, Velocity Inlet saurus FLUENT 0 January 26, 2011 16:35
Unexpected difference between velocity / mass-flow inlet jpo FLUENT 8 December 10, 2010 08:20
UDF problem : inlet velocity in cyl. coord. system Jongdae Kim FLUENT 0 June 15, 2004 11:21

All times are GMT -4. The time now is 22:16.