24小时热门版块排行榜    

查看: 2231  |  回复: 0

日月星空

铁虫 (初入文坛)

[求助] fluent运行过程中出现错误:Divergence detected in AMG solver

我做的是密相输运床提升管内煤气化的数值模拟。发生的多个化学反应需要写UDF加入进去,没导入UDF之前反应还能进行,可是一导入UDF就不行了。
所以我判断应该是UDF写的有问题,可导入的时候显示语法什么的没错误,具体哪里不合理,我探究了很久也没找出毛病。还希望大神们能够给予指导。
fluent提示的错误如下:
# Divergence detected in AMG solver: mp-x-momentum -> Decreasing coarsening group size!
# Divergence detected in AMG solver: mp-x-momentum -> Increasing relaxation sweeps!
# Divergence detected in AMG solver: pressure correction -> Turning off correction scaling!
# Divergence detected in AMG solver: pressure correction -> Increasing relaxation sweeps!
Errorivergence detected in AMG solver:pressure correction

Errorivergence detected in AMG solver:pressure correction.
其中一个UDF如下:

#include "udf.h"
#include "stdio.h"
#include "time.h"
DEFINE_HET_RXN_RATE(c_arr,c,t,hr,mw,yi,rr,rr_t)
{
Domain **domain_reactant = hr->domain_reactant;
real *stoich_reactant = hr->stoich_reactant;
int *reactant = hr->reactant;
int i;
int sp_id;
int dindex;
Thread *t_reactant;
real pp;
real T,C;
real p1,p3,p4,p5,mi,msum,m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,ci;
/* instead of compute rr directly, compute log(rr) and then take exp */
*rr = 0;


i=0;
sp_id = reactant; /* species ID to access mw and yi */
if (sp_id == -1) sp_id = 0; /* if phase does not have species,
mw, etc. will be stored at index 0 */
dindex = DOMAIN_INDEX(domain_reactant);
/* domain index to access mw & yi */
t_reactant = THREAD_SUB_THREAD(t,dindex);
/* get conc. */
pp = 6*C_P(c,t_reactant)/101325;
m0 = yi[dindex][0]/mw[dindex][0];
m1 = yi[dindex][1]/mw[dindex][1];
m2 = yi[dindex][2]/mw[dindex][2];
m3 = yi[dindex][3]/mw[dindex][3];
m4 = yi[dindex][4]/mw[dindex][4];
m5 = yi[dindex][5]/mw[dindex][5];
m6 = yi[dindex][6]/mw[dindex][6];
m7 = yi[dindex][7]/mw[dindex][7];
m8 = yi[dindex][8]/mw[dindex][8];
m9 = yi[dindex][9]/mw[dindex][9];
msum=m0+m1+m2+m3+m4+m5+m6+m7+m8+m9;
p3=pp*yi[0][3]/mw[0][3]/msum;
p4=pp*yi[0][4]/mw[0][4]/msum;
p5=pp*yi[0][5]/mw[0][5]/msum;
ci = MAX(p3,0);
*rr+= log(ci);
ci = MAX(p4,0);
*rr+= log(ci);
ci = MAX(p5,0);
*rr+= log(ci);


i=1;
sp_id = reactant; /* species ID to access mw and yi */
if (sp_id == -1) sp_id = 0; /* if phase does not have species,
mw, etc. will be stored at index 0 */
dindex = DOMAIN_INDEX(domain_reactant);
/* domain index to access mw & yi */
t_reactant = THREAD_SUB_THREAD(t,dindex);
/* get conc. */
ci = yi[1][5]*C_R(c,t_reactant)/mw[1][5];/*获得第二相中反应物碳的质量分数*/
ci = MAX(ci,0);
*rr+= log(ci);
T =C_T(c,t_reactant);
if (T>1117) T=1117;
*rr+= log(2250)-42000/(8.314*T)-(17.29-16326/T);
/* 1.e-40 < rr < 1.e40 */
*rr = MAX(*rr,-40);
*rr = MIN(*rr,40);
*rr = exp(*rr);

}

希望大神看到后能够给予指导,多谢了。
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 日月星空 的主题更新
信息提示
请填处理意见