24小时热门版块排行榜    

查看: 1503  |  回复: 0

粗线条的妹纸

新虫 (初入文坛)

[求助] 求助!急!请帮忙看一下多相流质量源项的udf有什么问题?

编写了质量源项的udf,加载进fluent里面以后在初始化的时候报错
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()

以下是我的udf源文件
#include "udf.h"
#include "sg_mphase.h"
#define A1 3.92E-03
#define A2 0.16E-03
#define B1 1.27E-03
#define B2 0.14E-03
#define C1 0.55
#define C2 0.91
#define MWCaSO4 136
#define MWCaO 56
#define MWSO2 64
#define rho_s0 1000
DEFINE_SOURCE(gm_source, c, t, dS, eqn)
{
Thread **pt = THREAD_SUB_THREADS(t);
Thread *tp = pt[0];
Thread *ts = pt[1];

real con, source, rr, mw;
real con_so2, rx, X, CA0, CA;
real rho_solid = C_R(c,ts);      /*solid phase density*/
real y0=0.2;

CA0=rho_s0*y0/MWCaO;/*initail number of moles of CaO in sorbent in (kgmol)/m3*/
CA=C_R(c,ts)*C_YI(c,ts,0)/MWCaO;
con_so2=C_YI(c,tp,0)*C_R(c,tp)/MWSO2; /*concentration of SO2 in (kgmol)/m3*/
X=1-CA0/CA; /*CaO conversion*/
if(X>=0&&X<=C1)
   rx=B1-A1*pow(X,2);

else if(X>C2&&X<1)
   rx=0;

else
   rx=B2-A2*pow(X,2);
rr=rx*con_so2;

con=C_R(c,ts)*C_VOF(c,ts)*(MWCaSO4-MWCaO)*C_YI(c,ts,0);

source=-con*rr;

dS[eqn]=0;

return source;
}

谢谢各位帮助,感激不尽!
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 粗线条的妹纸 的主题更新
信息提示
请填处理意见