|
|
发表于 2010-9-8 11:12:02
|
显示全部楼层
#include "udf.h"
#define WALL1_ID 3 //根据壁面1的实际id修改
real avg_temp=300.0;
DEFINE_ADJUST(wall1_avg_temp, domain)
{
real NV_VEC(A);
real sum_T_A=0.0,sum_A=0.0;
face_t f;
Thread*f_thread;
f_thread = Lookup_Thread(domain, WALL1_ID);
begin_f_loop(f, f_thread)
{
F_AREA(A,f,f_thread);
sum_A+=NV_MAG(A); // NV_MAG(A) computes the magnitude of the vector A
sum_T_A+=NV_MAG(A)*F_T(f, f_thread);
}
end_f_loop(f, f_thread)
avg_temp=sum_T_A/sum_A; // 温度的面积平均;
}
DEFINE_PROFILE(Wall2_T,t,position)
{
face_t f;
begin_f_loop(f,t)
{
F_PROFILE(f,t,position) = avg_temp;
}
end_f_loop(f,t)
}
别人编的
参考一下,希望对你有用 |
|