
[Sponsors] 
April 5, 2004, 13:08 
Wall temp UDF

#1 
Guest
Posts: n/a

Dear Frnds,
I am relatively new user to FLUENT .I have two queries, 1. I want to access wall tempearture from FLUENT and that I have to use in my UDF(interpreted) which is return as follows, but it is giving an error as Error: allnew.c: line 9269: face: undeclared variable I hve been trying it for a long time but I couldn't solve it. So what is wrong in the UDF Is syntax for wall temperature is wrong? #include "udf.h" DEFINE_PROFILE(hvar_comb,thread,position) { face_t f; real x[ND_ND]; real temp=F_T(face,thread); real to,m,p,q,taw,h,murf,rhorf,trf,st,rerf,v,rho,ht,hr; real gamma=1.4,r=0.878,Pr=0.68; real tw=300,C=1006,R=287; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); t = 69.224*(pow(x[0],2)) + 441.47*x[0] + 684.92; if(x[0]>=1.15 && x[0] < 1.509) { m = 0.8668*x[0] + 2.9991; } if(x[0]>=1.509 && x[0]<= 3.0) { m= 0.1631*(pow(x[0],4)) + 1.6039*(pow(x[0],3))  5.9183*(pow(x[0],2)) + 9.5667*x[0]  3.9286; } if(x[0]>=1.15 && x[0]<1.5224) { p = 51394*x[0] + 1818.1; } if (x[0]>=1.5224 && x[0]<=3.0) { p = 25791*(pow(x[0],3)) + 198961*(pow(x[0],2))  519832*x[0]+ 499456; } rho=p/(R*t); v=m*(sqrt(gamma*R*t)); to=t*(1+0.2*(pow(m,2))); taw=t+r*(tot); trf=t+0.5*(twt)+0.22*(tawt); murf = 1E11*pow(trf,2) + 5E08*trf + 6E06; rhorf=p/(R*trf); rerf=rhorf*v*x[0]/murf; st=0.0296 *(pow(rerf,(0.2)))/(pow(Pr,0.6667)); h=st*rho*C*v; hr=((0.9*5.67e8*((pow(temp,4))(pow(237,4)))/(1843temp); ht=hhr; F_PROFILE(f,thread,position)=ht; } end_f_loop(f, thread) } Second problem I facing in variable properties . 2. I need to give variable thermal conductivity in material properties(which is polynomial eaquation k = 1E06x2 + 0.0158x + 11.421.) I am selecting polynomial option in the fluent giving three coefficients as 1e06,0.0158 and 11.421. so is it correct? results I am getting are absurd. So could u please extend help regarding these queries? Sorry for troubling u,but I hope u will not mind it. thanks and regards. 

April 5, 2004, 15:10 
Re: Wall temp UDF

#2 
Guest
Posts: n/a

real temp=F_T(face,thread);
should be real temp=F_T(f,thread); as you have defined face_t f , I noticed that you have used f at all other places , Its the 3rd line which is giving you problem as "face " is undeclared . Ajay 

April 5, 2004, 22:41 
Re: Wall temp UDF

#3 
Guest
Posts: n/a

Hi,
The second question of your remarks is O.K. Your inputs are correct. Thank you FJ 

April 11, 2004, 02:56 
Define_adjust

#4 
Guest
Posts: n/a

Hi friends, thanks a lot ajay & FJ for ur valuable suggestions.
have second problem now. I need to control the coolant flow through a channel with reference to flow time. For e.g. for first 40 sec of computatation i don't want to allow the coolant to pass through for next 40 sec(ie 40 to 80 sec)I want aloow the coolant to pass through. again for next 150 sec i don't want to allow the coolant to pass through a channel. This I know that I have do by using DEFINE_on_demand or DEfine_adjust. But I don't know how to do it and where to implement this UDF (tht means at velocity inlet bondary condition or somewhere else) Could anybody help me out regarding this problem. Thanks in advance 

April 11, 2004, 22:17 
Re: Define_adjust

#5 
Guest
Posts: n/a

Hi,
Do you want to switching your BC as a time function,don't you?. If it is, DEFINE_PROFILE is suitable. Other macros make you bother. I'll explain below. DEFINE_ON_DEMAND is called when you want to do(I mean , writing a file or reading a file, calculate a certain value). So I think this macro makes no sense in this problem. DEFINE_ADJUST is called at every iteration. If calculation is steady flow, it's O.K. But if it's unsteady flow ,this thing is sometimes bothering us and DEFINE_ADJUST should not be used. Since DEFINE_ADJUST is called at every iteration(it's not the end of time step), when we defined some equations in this macro ,returned values are calculated from unconvergence results. This thing is unphysical and makes calculation divergence . So DEFINE_EXECUTE_AT_END should be used. This macro is called at the end of each time step and can return values but is not able to set a value for BC. So we have to use both DEFINE_EXECUTE_AT_END and DEFINE_PROFILE. It's bother but we are able to do everything via UDF . Thank you. FJ 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
How to get the wall shear stress by UDF  Chen Fangzhi  FLUENT  3  November 11, 2014 07:03 
udf variable for wall temperature  Kiran  FLUENT  0  July 31, 2008 08:31 
wall suction udf  osman turan  FLUENT  2  July 17, 2008 07:09 
Wall boundary condition – UDF  Ssn  FLUENT  0  January 25, 2008 04:43 
How to write udf of slip wall condition  cxzhao  FLUENT  0  April 27, 2005 21:20 