CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Temperature dependent Heat flux (Peltier effect) (http://www.cfd-online.com/Forums/fluent/112939-temperature-dependent-heat-flux-peltier-effect.html)

Student3 February 8, 2013 05:12

Temperature dependent Heat flux (Peltier effect)
 
I'm a student who have to design a cooling system based on Peltier module for my final degree project.
I have tried to develop a UDF which takes the temperature for one face and applies it in the face where the UDF is applied. I am able to retrieve the information of the face where the UDF is applied but not from the other face.
IŽll post my UDF to see if anyone see where is the problem.

#include "udf.h"

DEFINE_PROFILE(peltier, thread, i)

{
real sum = 0.;
real temp_sum = 0.;
real tmin = 0.;
real tempe,media;
face_t f;

Thread *f_thread;
Domain *domain;
domain = Get_Domain(2);
thread_loop_f(f_thread, domain)
{

begin_f_loop(f, f_thread)
{
tempe=F_T(f,f_thread);
sum=sum+1;
temp_sum=temp_sum+tempe;
}
end_f_loop(f, f_thread)


}
media=temp_sum/sum;
printf("media: %d", media);
begin_f_loop(f, thread)
{
F_PROFILE(f, thread,i) = 0.;
}
end_f_loop(f, thread)
}


Any advice are welcome.


All times are GMT -4. The time now is 07:13.