CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF: temperature profile (

dolores March 29, 2004 03:28

UDF: temperature profile
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?

thomas March 29, 2004 05:20

Re: UDF: temperature profile
you should post your udf !

dolores March 29, 2004 07:12

Re: UDF: temperature profile
#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;


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

Ajay March 29, 2004 17:43

Re: UDF: temperature profile
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

dolores March 29, 2004 23:27

Re: UDF: temperature profile
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

Andrew Garrard March 30, 2004 05:53

Re: UDF: temperature profile
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. :)

All times are GMT -4. The time now is 01:50.