|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我用udm存储uds变量的函数值,udf在解释进fluent时没错儿,但是在初始化前,用define-ececute-on-demond时出错,错误如下:
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: ()
程序贴在下面:
# include "udf.h"
# define domain_ID 2
DEFINE_DIFFUSIVITY(electrical_conductivity,c,t,i)/*扩散系数*/
{
real ele_c;
real x[ND_ND];
C_CENTROID(x,c,t);
if(x[0]>-0.09&&x[0]<0.09)
{
if(x[1]>0&&x[1]<0.05)
ele_c=12000.0;
}
else
ele_c=0.001;
return ele_c;
}
DEFINE_ON_DEMAND(store_gradient)
{
Domain *domain;
cell_t c;
Thread *t;
real ele;
ele=C_UDSI_DIFF(c,t,0);
domain=Get_Domain(domain_ID);
/* Fill the UDM with magnitude of gradient. */
thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{
C_UDMI(c,t,0) =-ele*C_UDSI_G(c,t,0)[1];
C_UDMI(c,t,1) =-ele*C_UDSI_G(c,t,0)[0];
}
end_c_loop (c,t)
}
}
请哪位大侠帮帮忙!谢谢! |
|