UDF error  parabolic velocity profile  3D turbine
1 Attachment(s)
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 follows:(reference 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 
problem solved
The source file was named parabolic profile.c . I removed the gap between the words in source files  parabolicprofile.c and it works!:)

3d Parabolic Profile Error
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 
Nevermind, I got it...
stupid mistake....it should be z=x[2] Thanks anyways:) 
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) } 
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! 
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. 
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 
1 Attachment(s)
Hello every body.
I would like to ask a question about UDF. I want to write a velocity profile with use of UDF an I don't know How I can write this periodic profile: Attachment 30761 thank you. 
Quote:
https://confluence.cornell.edu/displ...rcating+Artery UDF CODE /************************************************** *********************/ /* vinlet_udf.c */ /* UDFs for specifying time dependant velocity profile boundary condition */ /************************************************** *********************/ //Written by Chiyu Jiang //Cornell University #include "udf.h"//file that contains definitions for define functions and fluent operations #define PI 3.141592654 DEFINE_PROFILE(inlet_velocity,th,i) { face_t f; begin_f_loop(f,th) double t = (CURRENT_TIME*2floor(CURRENT_TIME*2))/2; //t is the local time within each period { if(t <= 0.218) F_PROFILE(f,th,i) = 0.5*sin(4*PI*(t+0.0160236)); else F_PROFILE(f,th,i) = 0.1; } end_f_loop(f,th); } 
All times are GMT 4. The time now is 22:21. 