找回密码
 注册
查看: 2035|回复: 3

刚迭代就出现下面的错误,是程序的问题,还是网格画的不够好

[复制链接]
发表于 2014-11-1 14:57:34 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
刚迭代就出现下面的错误,是程序的问题,还是网格画的不够好

iter continuity x-velocity y-velocity     energy          k    epsilon     time/iter

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: ()


 楼主| 发表于 2014-11-1 18:14:35 | 显示全部楼层
/*迭代时间不同,入口速度也不同*/

#include "udf.h"
int kount=0;
real m;
DEFINE_ADJUST(demo_calc,domain)
{
kount++;
printf("kount=%d\n",kount);
}
DEFINE_ADJUST(my_adjust,d)
{
Thread *t;
real r=350;
real kp=0.01,ki=0.01;
  real temp_last,temp=0;
cell_t c;
if(kount>50)
{
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
   m=1;
  temp_last=r-C_T_M1(c,t);
  temp=r-C_T(c,t);
  m+=kp*(temp-temp_last)+ki*temp;
}
end_c_loop(c,t)
}
}
else if (kount<=100.&&kount>=50.)
{
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
   m=2;
  temp_last=r-C_T_M1(c,t);
  temp=r-C_T(c,t);
  m+=kp*(temp-temp_last)+ki*temp;
}
end_c_loop(c,t)
}
}
else
{
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
   m=4;
  temp_last=r-C_T_M1(c,t);
  temp=r-C_T(c,t);
  m+=kp*(temp-temp_last)+ki*temp;
}
end_c_loop(c,t)
}
}

}
DEFINE_PROFILE(x_velocity,thread,nv)
{
float x[2];
  float y;
  face_t f;
begin_f_loop(f,thread)
{
y=x[1];            /* x[0]=x; x[1]=y; x[2]=z */


        F_PROFILE(f,thread,nv)=m;
}
end_f_loop(f,thread)
}
原程序附上
 楼主| 发表于 2014-11-1 18:15:00 | 显示全部楼层
求大神门看看
 楼主| 发表于 2014-11-1 18:19:11 | 显示全部楼层
是不是因为刚开始迭代adjust没有值所以会出错
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表