求助:UDF传递温度,通过编译但初始化错误
一个圆管中一端流入一端流出,壁面加热,要把出口的平均温度赋给入口udf如下:realNV_VEC(A);realavg_temp;realsum_T_A=0.0;real...
一个圆管中一端流入一端流出,壁面加热,要把出口的平均温度赋给入口
udf如下:
real NV_VEC(A);
real avg_temp;
real sum_T_A=0.0;
real sum_A=0.0;
Thread *thread_out;
face_t f;
Domain *domain;
DEFINE_PROFILE(inlet_T, t, i)
{domain=Get_Domain(2); /2是fluid的id/
thread_out=Lookup_Thread(domain,4);/4是出口面的id/
begin_f_loop(f,thread_out)
{ F_AREA(A,f,thread_out);
sum_A+=NV_MAG(A);
sum_T_A+=NV_MAG(A)*F_T(f, thread_out);
}
end_f_loop(f,thread_out)
avg_temp=sum_T_A/sum_A;
begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = avg_temp;
}
end_f_loop(f,t)
} 初始化后Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()
Help! 展开
udf如下:
real NV_VEC(A);
real avg_temp;
real sum_T_A=0.0;
real sum_A=0.0;
Thread *thread_out;
face_t f;
Domain *domain;
DEFINE_PROFILE(inlet_T, t, i)
{domain=Get_Domain(2); /2是fluid的id/
thread_out=Lookup_Thread(domain,4);/4是出口面的id/
begin_f_loop(f,thread_out)
{ F_AREA(A,f,thread_out);
sum_A+=NV_MAG(A);
sum_T_A+=NV_MAG(A)*F_T(f, thread_out);
}
end_f_loop(f,thread_out)
avg_temp=sum_T_A/sum_A;
begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = avg_temp;
}
end_f_loop(f,t)
} 初始化后Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()
Help! 展开
2个回答
2012-09-03
展开全部
你好,我也有你这个问题,能不能把你写的最终的udf分享一下
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询