
[Sponsors] 
February 15, 2007, 06:15 
UDF for a horizontal temperature profile

#1 
Guest
Posts: n/a

Hello,
I'm trying to write an UDF for a temperature profile to use as an boundary condition on a horizontal wall (2D). I used the following UDF, but when I plot an xyplot of the wall surface temperature it is just a constant. Can anybody tell me what I'm doing wrong? Kind regards, CD /* test.c UDF for specifying temperature profile boundary condition on the bottom */ #include "udf.h" DEFINE_PROFILE(test,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) = ... */ here stands the profile function as a function of y /* } end_f_loop(f,thread) } 

February 15, 2007, 16:36 
Re: UDF for a horizontal temperature profile

#2 
Guest
Posts: n/a

this should be proper. dint chek it (as simulation running on my system) but thsi my understnading that temperature is varying along horizontal (along x) i guess .
#include "udf.h" DEFINE_PROFILE(test,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[0]; F_PROFILE(f, thread, position) = ... */ here stands the profile function as a function of y /* } end_f_loop(f,thread) } 

February 16, 2007, 05:10 
Re: UDF for a horizontal temperature profile

#3 
Guest
Posts: n/a

Thank you for your time and help Rizwan!
Ted 

February 16, 2007, 07:30 
Re: UDF for a horizontal temperature profile

#4 
Guest
Posts: n/a

I wish you could hav told whether its working according to what u needed or not. Regards waiting for ur input.


February 17, 2007, 15:02 
Re: UDF for a horizontal temperature profile

#5 
Guest
Posts: n/a

I was using the ycoordinate of a horizontal walll instead of the xcoordinate, so logically the result of my profile function was a constant. With your correction the UDF is now working just as I hoped. Thanks again!
Greetings Ted 

July 20, 2013, 11:51 

#6 
Member
sooraj
Join Date: Dec 2012
Posts: 38
Rep Power: 12 
hi guys
i need a udf for a work. i'll explain what i need . I want to provide a linear varying temperature boundary condition on the circular side of a cylinder . can you help me?? My idea about udf is very small. 

December 15, 2013, 16:07 
tempereture udf for wall BC

#7 
New Member
Join Date: Apr 2013
Posts: 6
Rep Power: 11 
I am trying to write UDF for wall of vertical pipe temperature that increase with increasing depth (Z). UDF is as follow
#include "udf.h" DEFINE_PROFILE (gradient_temp,thread,nv) { face_t f; real x[ND_ND]; /*loop over each of the face of this zone*/ begin_f_loop (f,thread) { F_CENTROID(x,f,thread); F_PROFILE(F,THREAD,NV)=25.*z[0]+80 } end_f_loop (f,thread) } but fluent gets some error as below: ..\..\src\tempgrad.c(10) : error C2065: 'THREAD' : undeclared identifier ..\..\src\tempgrad.c(10) : error C2223: left of '>storage' must point to struct/union ..\..\src\tempgrad.c(10) : error C2065: 'NV' : undeclared identifier ..\..\src\tempgrad.c(10) : error C2065: 'F' : undeclared identifier ..\..\src\tempgrad.c(10) : error C2065: 'z' : undeclared identifier ..\..\src\tempgrad.c(10) : error C2109: subscript requires array or pointer type ..\..\src\tempgrad.c(11) : error C2143: syntax error : missing ';' before '}' could any one can help me what is the problem????? 

December 15, 2013, 17:07 

#8 
Senior Member
Join Date: Jan 2010
Location: Germany
Posts: 268
Rep Power: 16 
theYour problem not defined z and the wrong THREAD instead of thread C is uppercase sensitive


August 5, 2016, 21:13 
UDF for temperature variation with time and space

#9 
New Member
mm
Join Date: May 2016
Posts: 24
Rep Power: 7 
Respected members
I have to write a UDF for temperature variation along with time and flow domain. actually temperature is varying with time at four points in flow domain, (different relation for time and temperature at these points. for example at x=0.20m i have following code: DEFINE_PROFILE(solid_temperature,thread,position ) { face_t f; begin_f_loop(f,thread) { real t = RP_Get_Real("flowtime"); if ( t <= 100.0 ) { F_PROFILE(f,thread,position) = 379.48 + 0.0004*t; } else if (100.0 < t && t <= 180.0 ) { F_PROFILE(f,thread,position) = 8.34641*pow(10,6)*pow(t,4.0)+ 5.49800*pow(10,3)*pow(t,3.0) 1.35243*pow(t,2.0)+ 1.47648*pow(10,2.0)*t  5.51650*pow(10,3.0); } else { F_PROFILE(f,thread,position) = 727.82; } } end_f_loop(f,thread) } at x=0.40m (second point) i have following relations: if ( t <= 100.0 ) { F_PROFILE(f,thread,position) = 379.48 + 0.0004*t; } else if (100.0 < t && t <= 180.0 ) { F_PROFILE(f,thread,position) = 0.2716*t + 494.4; } else { F_PROFILE(f,thread,position) = 727.82; } } end_f_loop(f,thread) } and similarly for other 2 points can any body pl guide me how to include these points in code. i just know how to write variation of temperature with time but i could not find way to write above relations at different points. Please guide me. thanks. 

May 6, 2018, 13:13 
Varying temperature in vertical direction

#10 
New Member
Pramod Bagade
Join Date: May 2018
Posts: 1
Rep Power: 0 
Hi
I'm new fluent user. I want to impose a linear temperature gradient on a vertical pipe wall with temp. on top=340 and at the bottom 300. The bottom edge again is a bent pipe horizontally. On horizontal pipe the temp is 300. How can I put these as boundary conditions? Can anyone please help to apply this? Step by step instructions would be a great help. Thanks 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
UDF inlet velocity profile mismatch with Fluent  ChristineL  Fluent UDF and Scheme Programming  15  November 25, 2016 07:45 
Define profile inlet_temperature in UDF  mohammadkm  Fluent UDF and Scheme Programming  19  December 24, 2013 23:42 
udf variable for wall temperature  Kiran  FLUENT  0  July 31, 2008 09:31 
UDF temp. profile BC  Shashikant  FLUENT  0  June 24, 2006 04:16 
temperature profile on boundary  sivakumar  FLUENT  5  November 24, 2002 01:58 