24小时热门版块排行榜    

查看: 1498  |  回复: 0

BBKtime

新虫 (小有名气)

[求助] UDF编写化学反应速率加载到fluent内出现问题

最近用udf编写化学反应速率导入到fluent内,load后一直出现Error: The UDF library you are trying to load (libudf) is not compiled for 2ddp on the current platform (win64)。UDF如下:
#include "udf.h"
#define CH4 0
#define O2 1
#define CO2 2
#define H2O 3
#define N2 4
DEFINE_VR_RATE(vol_reac_rate,c,t,r,wk,yk,rate,rr_t)
{  
    int i,zone_ID=4;
    real CH4_mole_fract,O2_mole_fract,T,P_total,P_CH4,P_O2,k1,k2,k3,k4;
    real total_mole;
    Thread *t1;
    Material *mix_mat,*sp;
    *t1=Lookup_Thread(domain,zone_ID);
    mix_mat=mixture_material(t1);
    total_mole=0;
    mixture_species_loop(mix_mat,sp,i)
    {
       wk=MATERIAL_PROP(sp,PROP_wk);
       total_mole+=C_YI(c,t,i)/wk;
     }
    CH4_mole_fract=yk[CH4]/wk[CH4])/total_mole;
    O2_mole_fract=yk[O2]/wk[O2]/total_mole;
    P_total=ABS_P(C_P(c,t),op_pres);
    P_CH4=P_total*CH4_mole_fract;
    P_O2=P_total*O2_mole_fract;
    T=C_T(c,t);
    k1=5.852e17*exp(-204000/8.314/T);
    k2=4.02e5*exp(103500/8.314/T);
    k3=5.08e5*exp(66200/8.314/T);
    k4=1+k2*P_CH4+k3*pow(P_O2,0.5);
    if (FLUID_THREAD_P(t))
      *rate = k1*P_CH4*pow(P_O2,0.5)/pow(k4,2);
    else
      *rate = 0.;
    *rr_t = *rate;
}
在帮助文档内找了一个简单的编译型UDF能成功load,初步判定是UDF程序编写有问题,还望有好心人能给看下是什么个问题,在此提前拜谢了!
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 BBKtime 的主题更新
信息提示
请填处理意见