CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Transient Temperature Profile (http://www.cfd-online.com/Forums/fluent/87329-transient-temperature-profile.html)

alven299 April 18, 2011 02:21

Transient Temperature Profile
 
Dear all,

I wish to impose a transient temperature profile to my inlet boundary condition. I have liquid entering a system at 300K and after 40s, I would like the liquid to enter at 340K, in brief:

when 0<t<40s, T=300K
when t>=40s, T=340K

I know that this is manageable by using UDF, but since I'm very new to UDF and to C programming language, I'd appreciate if anybody could provide me with a sample code to define the said profile.

many thanks.

alven299 April 18, 2011 22:18

Have figured it out. Here is the script, hope it might be of help to others:

#include "udf.h"

DEFINE_PROFILE(inlet_temperature,t,i)
{
real x[ND_ND];
real time;
face_t f;

begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
time=CURRENT_TIME;
if(time<40)
F_PROFILE(f,t,i)=300;

else

F_PROFILE(f,t,i)=340;
}
end_f_loop(f,t)
}

Bharadwaj B S February 23, 2015 06:33

Thank you.
 
Hi Alven,

Thanks a lot for your UDF. This will help me for sure.:)


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