yfyjiaxian 发表于 2016-4-5 10:50:43

fluent出现错误 received a fatal signal (Segmentation fault).

哪位大神知道fluent UDF 中出现这种错误怎么解决吗?我的程序是用来求取流体对壁面的压力。程序如下:
#include "udf.h"
#include "stdio.h"
FILE*fp;
static int last_ts=1;

    real force_1 = 0.0;
    real NV_VEC(A);
    face_t f;
    int ID = 6;
    int curr_ts;
   Thread *thread;

DEFINE_ADJUST(get_force, domain)
{
    thread = Lookup_Thread(domain, ID);
   
begin_f_loop(f,thread)
      {
         F_AREA(A,f,thread);
         force_1 += F_P(f,thread) * NV_MAG(A);
      }
    end_f_loop(f,thread)

curr_ts=RP_Get_Integer("time-step");

    if (last_ts!=curr_ts)
{
last_ts=curr_ts;
fp=fopen("data.txt","a");
fprintf(fp,"%f",curr_ts);
fprintf(fp,"%f\n",force_1);
fclose(fp);
}

}

我试了下,如果把begin那段循环删掉就不会出错了。跪求解决方法!谢谢!

yydreamlove 发表于 2016-11-1 15:22:02

楼主,解决了吗 ?遇到了同样的问题!求指教!
页: [1]
查看完整版本: fluent出现错误 received a fatal signal (Segmentation fault).