CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

3D velocity inlet UDF

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

LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2010, 14:20
Default 3D velocity inlet UDF
New Member
Join Date: Jan 2010
Posts: 11
Rep Power: 15
zumaqiong is on a distinguished road
I have a problem with 3D velocity inlet UDF.
My velocity is parabolic time dependent.
and I write UDF like this:

DEFINE_PROFILE(inlet_y_velocity, thread, position)
real x[ND_ND]; real r; face_t f;
real t;
int n;
real T=1;
real y,z;

begin_f_loop(f, thread)


r=sqrt(pow(y,2)+pow(z,2)); /*radius of cylinder*/


end_f_loop(f, thread)

but if I add #include "surf.h"
at the beginning of this UDF, the velocity is not parabolic. it will be constant changing only with time.

Is there anybody who knows why this will happen?
and what is the meaning of #include "surf.h"?

Thank you!
zumaqiong is offline   Reply With Quote

Old   June 4, 2010, 19:31
New Member
Join Date: Mar 2010
Posts: 17
Rep Power: 15
om1234 is on a distinguished road
as i know, udf.h is used in the beginig of your udf and surf.h is the library that the macros you use in your udf are defined in there. now depending in your importing your udf to fluent, if u use interpret, u dont need to do additional works(and the udf beginig must be udf.h).but when u use compile u must define the library(surf.h) in "add header" next to "add udf"
om1234 is offline   Reply With Quote

Old   October 24, 2016, 04:44
Question UDF for inlet temperature
New Member
Join Date: May 2016
Posts: 24
Rep Power: 8
mmunige is an unknown quantity at this point
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. Thanks in advance.

DEFINE_PROFILE(inlet_temperature,thread,position )


face_t f;



real t = RP_Get_Real("flow-time");

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);

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);




mmunige is offline   Reply With Quote


3d model, udf inlet boundary, velocity inlet

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
udf parabolic velocity inlet with unsteady case Faruk Beyca FLUENT 4 June 24, 2022 10:45
USED UDF for inlet velocity in 3D sara FLUENT 0 October 11, 2007 18:04
Urgent! Help on UDF to set inlet velocity Ray Hong FLUENT 4 December 30, 2005 12:32
Create hemisphere like velocity profile at inlet Nelson Main CFD Forum 3 July 27, 2005 12:05
UDF paraboloid velocity inlet Ronak Shah FLUENT 0 June 4, 2003 09:44

All times are GMT -4. The time now is 01:14.