CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF: temperature profile

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2004, 03:28
Default UDF: temperature profile
  #1
dolores
Guest
 
Posts: n/a
I am modeling an industrial oven using 2d, segregated, laminar, unsteady solver. At some period of time, the temperature of the heater coil is linearly increasing. The next period, the temperature is just constant. I tried DEFINE_PROFILE, can't compile it. How do I make the flow time as a trigger to switch from linear to constant temperature?
  Reply With Quote

Old   March 29, 2004, 05:20
Default Re: UDF: temperature profile
  #2
thomas
Guest
 
Posts: n/a
you should post your udf !
  Reply With Quote

Old   March 29, 2004, 07:12
Default Re: UDF: temperature profile
  #3
dolores
Guest
 
Posts: n/a
#include "udf.h"

DEFINE_ADJUST(heater_temp, d) { Thread *t; face_t f; int time=RP_Get_Integer("time-step"); thread_loop_f(t,d) { begin_f_loop (f,t)

{

if (time<50)

F_PROFILE(f,t,0) = 2*time + 273;

else

F_PROFILE(f,t,0) = 373;

} end_f_loop (f,t) } }

sorry, here's the UDF, this one I tried DEFINE_ADJUST since DEFINE_PROFILE doesn't seem to recognize "time element" FLUENT reports syntax error on line 6( Thread *t; line 8 (int time = RP_Get....) line 9 (thread_loop_f...). FLUENT reports "f:undeclared variable" on line 11 (begin_f_loop...) the heater temperature profile should be like this: heats up from room temp to 100 degree Celcius in 50 minutes, then stays at 100 degree Celcius for an hour
  Reply With Quote

Old   March 29, 2004, 17:43
Default Re: UDF: temperature profile
  #4
Ajay
Guest
 
Posts: n/a
Should'nt you be using RP_Get_Real("flow-time") ? your UDF looks coorect wonder why the error. I have used RP_Get_Real("flow-time") with define_profile it worked fne. -Ajay
  Reply With Quote

Old   March 29, 2004, 23:27
Default Re: UDF: temperature profile
  #5
dolores
Guest
 
Posts: n/a
thanks for the replies. another question, how would you use the if/else statement inside the DEFINE_PROFILE function. I somehow always get a "syntax error" on if/else statement. many thanks
  Reply With Quote

Old   March 30, 2004, 05:53
Default Re: UDF: temperature profile
  #6
Andrew Garrard
Guest
 
Posts: n/a
Right, for a start you are not defining your thread, you will need something like Thread *thread = Lookup_Thread(d, ID), otherwise the face loop will not know what to loop over.

Secondly, I don't think there is anything wrong with your if/else statments, I think the problem is in you F_PROFILE. You are setting the F_PROFILE(f, t, 0), What is 0? You want to set the temperature, if I understood correctly. If you are trying to set the temperature on a boundary you should use a DEFINE_PROFILE and hook it in the boundary conditions panel within the fluent GUI.

Hope some of this helps.
  Reply With Quote

Old   August 5, 2016, 20:16
Question UDF for temperature variation with time and space
  #7
New Member
 
mm
Join Date: May 2016
Posts: 24
Rep Power: 9
mmunige is an unknown quantity at this point
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("flow-time");
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.
mmunige is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
please help UDF for velocity profile in y-directio raju Fluent UDF and Scheme Programming 6 April 12, 2019 23:21
UDF error - parabolic velocity profile - 3D turbine Zaqie Fluent UDF and Scheme Programming 9 June 25, 2016 19:08
defining temperature profile with UDF mohammadkm Fluent UDF and Scheme Programming 11 July 3, 2013 00:15
UDF temp. profile BC Shashikant FLUENT 0 June 24, 2006 03:16
temperature profile on boundary sivakumar FLUENT 5 November 24, 2002 00:58


All times are GMT -4. The time now is 16:57.