
[Sponsors] 
May 11, 2010, 01:45 
UDF error  parabolic velocity profile  3D turbine

#1 
New Member
Zaqie
Join Date: Jul 2009
Posts: 22
Rep Power: 7 
Hi
I was trying to write a UDF for a parabolic velocity profile for a turbine problem. The parabolic shape is only in the vertical direction(y direction), i.e velocity steadily increases upwards the domain(see the attached figure). Maximum velocity 1.73 m/sec. Domain diameter  30m The UDF is as followsreference fluent manual)  /************************************************** ********************* UDF for parabolic velocity profile at inlet boundary ************************************************** **********************/ #include"udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) /* inlet x velocity = name of the x velocity */ { real x[ND_ND]; /* this will hold the position vector */ real y,z; face_t f; /* f = all the cell faces on the boundary*/ begin_f_loop(f,thread) /* thread = given boundary zone, defined automatically when the UDF is hooked to inlet boundary, the macro begin_f_loop is applied to all the cell faces*/ { F_CENTROID(x, f, thread); /* the coordinates of the face centroid accessed by F_CENTROID */ y= x[1]; F_PROFILE(f, thread, position) = 1.73((15y)*(15y)*1.73/(30*30)); /* return velocity is assigned through F_PROFILE */ } end_f_loop(f, thread) }  But on compiling my UDF I get the error Opening library "libudf"... Error: open_udf_library: The system cannot find the file specified. Any clue what the error is? Regards Zaqie 

May 11, 2010, 11:30 
problem solved

#2 
New Member
Zaqie
Join Date: Jul 2009
Posts: 22
Rep Power: 7 
The source file was named parabolic profile.c . I removed the gap between the words in source files  parabolicprofile.c and it works!


May 24, 2010, 23:08 
3d Parabolic Profile Error

#3 
New Member
Sowmya K
Join Date: Nov 2009
Posts: 22
Rep Power: 7 
Hi
I have the following UDF written for fully developed flow as a boundary condition for a pipe inlet. The inlet face is on the YZ plane and the velocity is normal to the face in the X direction. But if I check the initialization, the profile doesnt look parabolic at all. I have just modified the profile given the Fluent guide. #include "udf.h" #include "math.h" DEFINE_PROFILE(inlet_x_velocity, thread, index) { real x[ND_ND]; /* this will hold the position vector */ real y; real z; real a; face_t f; begin_f_loop(f, thread) /*loops over all faces in the thread passed in the DEFINE macro argument*/ { F_CENTROID(x,f,thread); y =x[1]; z =x[1]; a = pow((pow(y,2)+pow(z,2)),0.5); F_PROFILE(f, thread, index) = 2*0.00000491976*(1 (a*a/(0.10214*0.10214))); } end_f_loop(f, thread) } Any ideas will be appreciated. Thanks 

May 24, 2010, 23:30 

#4 
New Member
Sowmya K
Join Date: Nov 2009
Posts: 22
Rep Power: 7 
Nevermind, I got it...
stupid mistake....it should be z=x[2] Thanks anyways 

September 6, 2012, 06:14 

#5 
New Member
n7310889
Join Date: Aug 2012
Posts: 26
Rep Power: 4 
Hi, could any of you can tell me whats wrong with this macro? Its for 3d to provide input heatflux profile around a semi circular cylinder of 33mm radius and 1.5m long.The heat profile varies along the verticle y direction and translates the same along the horizontal z axis.
#include "udf.h" DEFINE_PROFILE(heat_profile,thread,index) { real x[ND_ND]; real x,y,z,r,angle; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); x =x[0]; y =x[1]; z =x[2]; r =sqrt(pow(x,2)+pow(y,2)); angle =acos(y/r); if ((z>=0.0) && (z<=1.4)) { if ((angle>=0.0) && (angle<=60.0)) { F_PROFILE(f,thread,index) =6500.0; } if ((angle>50.0) && (angle<=180.0)) { F_PROFILE(f,thread,index) =0.0; } } else { F_PROFILE(f,thread,index) =0.0; } } end_f_loop(f,thread) } 

September 20, 2012, 07:05 

#6 
New Member
rayolau
Join Date: Aug 2012
Posts: 23
Rep Power: 4 
Hi, I am working in similar 3D case. At the moment, my macro is this:
____________________________________ #include "udf.h" #define S 0.0016 DEFINE_PROFILE(inlet_x_velocity, thread, index) { real x [ND,ND]; real y; real z; face_t,f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread) y=x[1] z=x[2] if (y>=S) F_PROFILE(f,thread,index)=0.55*double log (double (y/0.0016)) } end_f_loop(f,thread) } _________________________________ But on compiling my UDF I get the error. Why? What's wrong? Thanks! 

September 23, 2012, 01:48 

#7 
New Member
hzsme
Join Date: Sep 2012
Posts: 7
Rep Power: 4 
Try to declare the (face_t f at first and then other variables....like this:
face_t f; real x [ND,ND]; real y; real z; . . . . . Also there is an extra character between (face_t) and (f)....i mean the comma.....omit it and then compile your UDF. Bests. 

September 23, 2012, 03:23 

#8  
New Member
n7310889
Join Date: Aug 2012
Posts: 26
Rep Power: 4 
Quote:
Thanks a lot. However, I've written a udf for heat flux, and it is running well. Now I'm trying to add radiation in that macro at a fashion like that: F_PROFILE(x,t,i) = heat_flux_function  some_constant*(pow(F_T(f,t),4)pow(Temp_glass,4)); Whenever I try to interprate this macro, fluent shows me parse error, just at this line. One thing I'm wondering is, I'm assigning input heat to a certain face and again use the temperature of the same face to negate radiation exchange from the resultant heat flux! Input heat will be utilized first to raise the face temperature, then radiation exchange will be function of this temperature, is my understanding. I don't understand actually how should I assign radiation exchange in my model. Could you please help me to get rid of this riddle? I'll be thankful really. Regards 

Tags 
3d turbine, compile, macro, parabolic velocity, udf 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
UDF problems  velocity profile  Oli  Fluent UDF and Scheme Programming  4  September 30, 2013 15:39 
UDF inlet velocity profile mismatch with Fluent  ChristineL  Fluent UDF and Scheme Programming  10  June 24, 2013 06:10 
How to make a UDF to have a velocity profile in a square channel  Gigis  Fluent UDF and Scheme Programming  8  January 13, 2013 23:20 
Logarithmic velocity profile  cfdworker  Fluent UDF and Scheme Programming  0  April 23, 2009 19:09 
particle velocity and velocity profile  HGG  FLUENT  2  June 10, 2001 16:32 