24小时热门版块排行榜    

查看: 983  |  回复: 3

aaalancelot

新虫 (初入文坛)

[求助] UDF指针问题

新手刚接触UDF,在模拟汽液两相流中,设置第二相颗粒直径,编写的UDF可以编译但是出现 Error:  received a fatal signal (Segmentation fault).

怀疑是不是指针错误,编写的指针如下:

   int phase_domain_index=0;
   Thread *mix_t;
   Thread *subthread=THREAD_SUB_THREAD(mix_t,phase_domain_index);

望多多指导和交流!!!
回复此楼

» 猜你喜欢

呵呵
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

aaalancelot

新虫 (初入文坛)

呵呵
2楼2016-12-06 09:45:33
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

幸运兴

新虫 (正式写手)

3楼2016-12-08 23:27:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

aaalancelot

新虫 (初入文坛)

引用回帖:
3楼: Originally posted by 幸运兴 at 2016-12-08 23:27:04
所有程序给出来看看

#include "udf.h"

#define d_bw_min 0.00035
#define d_bw_max 0.0007
#define subcool_ref1 -13.0
#define subcool_ref2 5.0
#define T_SAT 360.0

DEFINE_PROPERTY(bubble_dia,cell,subthread)
{
   real diam_b,subcool;

   int phase_domain_index=0;
   Thread *mix_t;
   Thread *subthread=THREAD_SUB_THREAD(mix_t,phase_domain_index);
   real T_liq = C_T(cell,subthread);

   subcool = T_SAT - T_liq;
   diam_b = (d_bw_min*(subcool-subcool_ref2)+d_bw_max*(subcool-subcool_ref1))/(subcool_ref2-subcool_ref1);

   return diam_b;
}
呵呵
4楼2016-12-14 10:50:11
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 aaalancelot 的主题更新
信息提示
请填处理意见