udf
Temp Gradient in UDF
Hi I have a problem accessing the temperature gradient in a UDF. I want to give temperature gradient on the 2-D wall. (Methematical fucntion is T(x)= 30 + ( 1.5 * lxl ) I am writing using DEFINE_PROFILE. I just following UDF manuals Ex. But my udf file didn't warking. I didn't know what is problem.. becuz I'm rookie on fluent. Could anyone help me in this *** cpp file (made by me) *** #include "udf.h" DEFINE_PROFILE(wall_temp,thread,index) { real x[ND_ND]; real temp; face_t f; begin_f_loop(f,thread) { temp = F_T(f,thread); F_UDMI(f,thread,0) = 30 + (1.5 * x ); if (x < 1) x * = - 1 } end_f_loop(f,t) } |
Re: udf
there are errors in the udf. F_UDMI(f,thread,0) is reqd. only if a user defined memory is not needed for storing some information.
begin_f_loop(f,thread) will loop over all the faces where you are hooking the udf. get the centroid of each face using the macro F_CENTROID(x,f,thread) u will get x,y,z coordinates as x[0],x[1],x[2] then define your profile F_PROFILE(f,t,i) = f(x,y,z) You may refer the documentations.... Best wishes, Sujith |
Re: udf
dear Sugith
Thanks for your advice. I'll more try again. Can I send mail to you when I have a problen about this? Have a nice day. |
Re: udf
most welcome
|
Re: udf
hi Sujith
I tried again.. But I failed again.. I was so confuse. can you help me? I made new udf file... even though that failed interpreted. ****************************************** #include <udf.h> #include <math.h> DEFINE_PROFILE(temp_wall,thread,position) { real x [ND_ND]; real r,z,y; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); r=x[1]; r=sqrt(x*x); F_PROFILE(f,thread,position)=30.+(1.5*r); } end_f_loop(f,thread) } |
Re: udf
Hi Sujith
I succeed interpreted. But I failed the compiling.. I don't know what is problem.. ************************************************** ** #include <udf.h> DEFINE_PROFILE(temp_wall,thread,position) { real x [ND_ND]; real a,y; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); a=x[1]; F_T(f,thread)=30.+(1.5*fabs(a)); } end_f_loop(f,thread) } I need your help |
Re: udf
What is the error message? Probly u will not be havin a recommended microsoft compiler for windows
|
Re: udf
Message is
I succeed interpreted. but I failed compiling.. massage aappear after clik Load button at compiling. "pening library "Temp_wall"... Error: open_udf_library: can't not found file. Error Object: ()" And I use visual c++ |
All times are GMT -4. The time now is 18:12. |