倾城文少 发表于 2018-1-22 15:38:08

求教FLUENT上运行UDF在Initialize时出现 (Segmentation fault)代码问题在哪里

想根据模型一部分的液相体积占比调节出口速度边界条件,编写如下程序,可是出现 (Segmentation fault),实在搞不懂代码问题在哪里?:'(:'(,
#include "udf.h"
#include "sg_mphase.h"
DEFINE_PROFILE(x_velocity, thread, index)
{
face_t f;   /* f is a face thread index */
cell_t c;
int ID = 20;
Thread *tj = Lookup_Thread(Get_Domain(1),ID);
begin_f_loop(f,thread)
{
   if (C_VOF(c,tj)>0.3)
      F_PROFILE(f, thread, index) = 0 ;
   else
      F_PROFILE(f, thread, index) = 0.5;
}
end_f_loop(f,thread)
}
页: [1]
查看完整版本: 求教FLUENT上运行UDF在Initialize时出现 (Segmentation fault)代码问题在哪里