
[Sponsors] 
May 10, 2012, 05:21 
UDF to change heat transfer coefficient with wall temperature

#1 
New Member

Hi
I need to change the heat transfer coefficient on a wall with changing temperature on the wall. I have written a simple UDF to change the heat transfer coefficient, which is interpreting into Fluent with no problems, but when I run a monitor on the wall for Total surface heat transfer coefficient it is giving me strange answers with negative values. I know that very low values of ln() will give a negative answer but anything over ln(0.4) in this equation will give a postivie answer. At a temperature of 297, this equation should give a h value of 3.06, but instead it keeps returning a value of 0.0002. Is my UDF too basic? or is the problem with my monitor? #include "udf.h" DEFINE_PROFILE(HTC, thread, index) { face_t f; real Temp = 293.15; F_PROFILE(f, thread, index) = 1.2854*log(Temp  293) + 1.2822; } Or should i be using the return HTC function as is used in DEFINE_PROPERTY which change with temperature also? Last edited by emmkell; May 10, 2012 at 07:51. 

May 10, 2012, 09:05 

#2 
Member
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 10 
You cannot use Define_Profile this way. There needs to be a loop that loops over each element on the boundary/face of interest.
I ripped the udf below out of the UDF manual. You need to have something of this form (take out the velocity stuff and enter your temperature stuff). Currently I think your UDF will only apply this correction to the first element of the face! Let me know how you get on. /************************************************** ********************* vprofile.c UDF for specifying steadystate velocity profile boundary condition ************************************************** **********************/ #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, position) = 20.  y*y/(.0745*.0745)*20.; } end_f_loop(f, thread) } 

May 10, 2012, 09:27 

#3 
New Member

Thanks Dan!
I had tried some variations of this but didnt get anything to give the right ht coefficient. I will give it another try just changing the details to what I need. I read in a couple of differnet threads on this forum that fluent doesnt give accurate readings of heat transfer coefficient from its surface monitor readout and I'd need another UDF to findout what fluent is settin gthe heat transfer coefficient to. 

June 9, 2012, 00:23 

#4 
New Member
Ali
Join Date: Jun 2012
Posts: 6
Rep Power: 6 
Hi Emmkell, did you solve your problem? I mean did write a UDF which change the heat transfer coefficient on a wall in terms of the wall temperature?
if you solved your problem could you help me? I have a similar problem! this is my email: ghasemian.a@gmail.com 

August 8, 2012, 11:23 

#5 
New Member

I got this working, I forgot to post it up here, using your recommendation Daniel, thank you!
I had to change y = x[1] to y = x[0] for some reason, i didnt understand what it meant at the time but i understand now that it is picking the values in the x array in either cell 0,1 or 2, so the fact that it worked for me must be something to do with how i set up my geometry? Changing the wall thickness also helped. #include "udf.h" /* UDF Define Temperature dependant heat transfer coefficient) */ DEFINE_PROFILE(htc, thread, position) { face_t f; real x[ND_ND]; /* this will hold the position vector */ real y = F_T(f,thread); begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[0]; F_PROFILE(f, thread, position) = 0.7942 + 1.3915*log(y); } end_f_loop(f, thread) } Wohoo! Now on to the next UDF problem! 

June 19, 2013, 12:40 

#6 
New Member
Hatef Khadivinassab
Join Date: Jan 2013
Posts: 6
Rep Power: 6 
Emma,
This is wrong! regards, 

July 10, 2013, 12:49 

#7 
New Member
Join Date: Jun 2013
Posts: 2
Rep Power: 0 
Hatef,
Care to elaborate on why this is wrong? I'm about to start writing a similar UDF and would greatly appreciate an explanation on why you think this is incorrect. Cheers, 

July 11, 2013, 06:19 

#8 
New Member
Hatef Khadivinassab
Join Date: Jan 2013
Posts: 6
Rep Power: 6 
Ddmillar,
Because in Emma's code, she has defined y (the temperature of the face) outside the loop, and inside the loop the value of y is overwritten by x[0]. Although this was really helpful, but unfortunately this does not work. I have written a code for time and temperature dependent heat transfer coefficient as follows; #include "udf.h" DEFINE_PROFILE(htc, thread, position) { face_t f; real y; real t = CURRENT_TIME; begin_f_loop(f, thread) { y = F_T(f,thread); if (t<250) F_PROFILE(f, thread, position) = 0.00000026*(y*y*y)  0.00038*(y*y) + 0.25*y  38; else F_PROFILE(f, thread, position) = 0.00000014*(y*y*y)  0.00021*(y*y) + 0.14*y  20; } end_f_loop(f, thread) } Regards, 

January 4, 2015, 14:14 

#9 
New Member
Join Date: Oct 2014
Posts: 17
Rep Power: 4 
Hello Hatef,
I have similar problem in defining HTC through UDF. If I am not wrong, bulk temperature or reference temperature has to be also included in the program. But I could see only a temperature polynomial equation is defined to get HTC. Could you please expalin me, how did you arrive with this equation? I am relatively new to UDF...So please help me out in understanding the UDF written by you. 

April 7, 2015, 10:27 
Want to write UDF for heat flux on wall for a cylindrical tube change with temperatur

#10 
New Member
Geetesh Waghela
Join Date: Apr 2014
Posts: 6
Rep Power: 5 
hey guys,
I am doing analysis on a cylinder with 2D axisymmetric model in fluent. I have implemented a profile file for outer wall of cylinder but i want to implement a udf for inner wall as a function of temperature so that i could get accurate temperature on axis(fluid region). my axial length is 0.1m and longitudnal length is 0.003m from axis. I have tried using constant heat flux and coupled condition on inner wall but it does not help. i want to get temperature profile in fluid region. 

April 7, 2015, 18:52 

#11 
Senior Member
Join Date: Mar 2015
Posts: 800
Rep Power: 11 
Why not let Fluent use the energy equation to simulate the temperature profile on the inner wall?


April 7, 2015, 23:16 

#12 
New Member
Geetesh Waghela
Join Date: Apr 2014
Posts: 6
Rep Power: 5 
Hey e,
I have outer wall temperature profile from experiment using methaneair as fluid entering into the geometry. I made the temperature profile as boundary condition on outer wall using profile. If i let the inner wall as coupled then axis nor the inner wall does not get sufficient temperature as it should get. the material i use is fused silica for cylinder. If i choose inner wall as heat flux and i gave it as zero then inner wall receives proper temperature but axis remains at 300 K. According to the results my inner wall and axis both should have a temperature of 1300 K but i am getting till 800 K only at the place of highest temperature. What should i do? 

May 16, 2016, 14:04 
UDF wall heat flux

#13 
New Member
Narender Kumar
Join Date: May 2016
Posts: 1
Rep Power: 0 
Hello everyone, i am simulating turbulent flow in a rectangular duct with heat flux from one side wall (bottom). I want the heat flux vary axially (as a function of axial distance). Does anyone have any idea about how it can be done ?


September 15, 2016, 11:52 

#14 
New Member
hussein
Join Date: Aug 2016
Posts: 5
Rep Power: 2 
please help how can i define the heat flux as a function of temperature of wall q=1000*(10.014*(T298)) any one can help me in writing the UDF please


Tags 
heat transfer coefficient, udf 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Heat transfer coefficient  what is waht  Stan  FLUENT  20  March 11, 2014 11:42 
Wall Transfer Coefficien  Heat Transfer Coefficient  CFX  Gargioni  CFX  9  April 15, 2013 07:46 
UDF for Heat Exchanger model  francois louw  FLUENT  2  July 16, 2010 02:21 
Flow around pipes  heat transfer coefficient on the wall of pipe  doodek  Main CFD Forum  2  November 23, 2009 09:48 
Multicomponent fluid  Andrea  CFX  2  October 11, 2004 05:12 