Fluent,UDF,比热随空间分布? 50
我写了一个fluent UDF,以实现比热Cp在不同cell zone有不同的值。尽管在运行中没有报错,但在不同区域并没有出现不同的值,而统一是一个值。代码如下:
#include "udf.h"
DEFINE_SPECIFIC_HEAT(cell_CO2_spec,T,Tref,h,yi)
{
int zone_ID1 = 3;
int zone_ID2 = 4;
Thread *thread1;
Thread *thread2;
cell_t cell;
Domain *subdomain;
real spec;
subdomain = Get_Domain(2);
thread1=Lookup_Thread(subdomain,zone_ID1);
thread2=Lookup_Thread(subdomain,zone_ID2);
begin_c_loop(cell,thread1)
{
spec = 3000;
}
end_c_loop(cell,thread1)
begin_c_loop(cell,thread2)
{
spec = 40000;
}
end_c_loop(cell,thread2)
*h = spec * (T-Tref);
return(spec);
}
全部回答 (1)
默认 最新
请问题主解决了吗,我也遇到了相同问题,求指导
2024年3月25日
评论 点赞




















