24小时热门版块排行榜    

查看: 1404  |  回复: 2
【悬赏金币】回答本帖问题,作者Kellyshuo将赠送您 35 个金币

Kellyshuo

新虫 (初入文坛)

[求助] fluent UDF源项编译通过后,初始化闪退,求大佬指点一二 已有1人参与

源项文件编译通过后,fluent初始化闪退代码见下:
#include "udf.h"
#include "math.h"
#define pre_exp 1.12e-05
#define active 29.16e+03
#define r 8.314
#define l 30e-06
#define mh2 2
define_source(h2_membrane_mass,c,t,ds,eqn)
{
        real a[nd_nd];
        real source;
        real pr,pm,t;
        real vol0,area0;
        real vol1,area1;
        face_t f;
        real id = 3.0 ;
        domain *d = get_domain(1);
        thread *thread_mem_f = lookup_thread(d,id);

                cell_t c0 = f_c0(f,thread_mem_f);
                cell_t c1 = f_c1(f,thread_mem_f);
                thread *tc0 = thread_t0(thread_mem_f);
                thread *tc1 = thread_t1(thread_mem_f);
                vol0 = c_volume(c0,tc0);
                f_area(a,f,tc0);
                area0 = nv_mag(a);
                t = c_t(c0,tc0);
                pr = c_p(c0,tc0) + 101325;
                pm = c_p(c1,tc1) + 101325;
                source = - area0*mh2*pre_exp*exp(-active/t)/(vol0*l)*(sqrt(pr)-sqrt(pm));
                return source;

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

lbj007

新虫 (小有名气)

【答案】应助回帖

这个ID值只能为整数吧,为啥赋予real类型
2楼2021-06-19 18:39:17
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

Kellyshuo

新虫 (初入文坛)

引用回帖:
2楼: Originally posted by lbj007 at 2021-06-19 18:39:17
这个ID值只能为整数吧,为啥赋予real类型

int我也试过 还是一样的问题
3楼2021-06-21 11:58:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 Kellyshuo 的主题更新
不应助 确定回帖应助 (注意:应助才可能被奖励,但不允许灌水,必须填写15个字符以上)
信息提示
请填处理意见