24小时热门版块排行榜    

查看: 2337  |  回复: 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的回帖
相关版块跳转 我要订阅楼主 日月星空 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 学科评审组评审是指会评吗? +4 瞬息宇宙 2026-08-31 4/200 2026-09-01 14:58 by jiaoxg
[基金申请] 面上函评意见出来了,像什么等级? 20+4 Tsingking1 2026-08-27 15/750 2026-09-01 12:23 by icm639
[基金申请] 为什么资助数各大高校都创新高,自己申请怎么就这么难 +13 Kittylucky 2026-08-27 14/700 2026-09-01 11:06 by feng6531
[论文投稿] 小白求助 投论文要求的highlights应该如何写 5+3 l1963982152 2026-08-29 4/200 2026-09-01 09:04 by 北京莱茵编辑
[基金申请] 怎么看青基中了没有啊 +6 叶九微 2026-08-26 6/300 2026-08-31 23:54 by yudaoqian88
[基金申请] 面上意见出来了 +12 黄鸟于飞Chao 2026-08-29 23/1150 2026-08-31 18:57 by 黄鸟于飞Chao
[基金申请] 能否申诉? +7 echo8914667 2026-08-30 8/400 2026-08-31 17:00 by yihongxu
[基金申请] 基金不中,共勉 +12 eulota 2026-08-26 12/600 2026-08-31 08:42 by ZJTJZ
[基金申请] 为什么到现在没收到通知? +5 tannykie 2026-08-29 5/250 2026-08-30 21:05 by purplejack
[基金申请] 我就是申请一个面上项目而已,这评审意见是按照杰青的条件评的吧? +6 gouxfjh 2026-08-28 11/550 2026-08-30 07:57 by gouxfjh
[基金申请] 国自然评审意见 +13 wangmingqi 2026-08-28 19/950 2026-08-29 10:22 by Poppy1104
[基金申请] 2026年叶企孙基金 +4 bud_bud 2026-08-27 7/350 2026-08-29 07:23 by foolishmani
[基金申请] 基金系统什么内容也没有 30+4 winsaint 2026-08-27 9/450 2026-08-28 11:06 by maolC
[基金申请] 怎么查啊 +6 huang1991js 2026-08-26 6/300 2026-08-28 08:42 by winsaint
[基金申请] 我不理解! +15 Edward_pc 2026-08-26 23/1150 2026-08-26 20:34 by zzuzxg
[基金申请] 出来了 +9 trojank 2026-08-26 9/450 2026-08-26 14:25 by 宝贝虫子
[基金申请] 为什么国自然不能直接公布 +4 bjdxyxy 2026-08-26 4/200 2026-08-26 13:12 by qingmu1201
[基金申请] 系统进不去 +4 yanglien 2026-08-26 5/250 2026-08-26 11:10 by wenfengw83
[基金申请] 国合可查了 +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
[基金申请] 牛来!米来!面来! +8 beefly 2026-08-26 8/400 2026-08-26 08:37 by xuzhipiao
信息提示
请填处理意见