“常用公式”在线计算,“设计手册”在线查询
回帖奖励 50 学分 回复本帖可获得 50 学分奖励! 每人限 1 次
各位老师,我的模型是一段长方形的管子,中间是多孔介质,里面没有设置reaction,模拟化学反应,反应方程为:4nh3+6NO=5N2+6h20
进口设置:NO:0.0989
                  NH3:0.0989
                  h2o(l):0
出口设置:为设置,全为0
开了能量方程和组分运输模型,组分运输模型里面没有勾选Volumetric,udf编写如下,反应用源相来表示,请问这段程序哪里有问题呢,有氮气生成,就是没有水,还有反应过程不太正常,瞬间就反应完了。谢谢各位老师!
#include "udf.h"

#define PRE_EXP 1.8e+08
#define ACTIVE  1.3e+08   
#define BETA 0.0         
real arrhenius_rate(real temp)
{
   return PRE_EXP*pow(temp,BETA)*exp(-ACTIVE/(UNIVERSAL_GAS_CONSTANT*temp));
}
#define NO   0
#define NH3  1
#define H20  2
#define N2   3
#define NUM_SPECS 4
DEFINE_SOURCE(energy_source,c,t,dS,eqn)
{
        real delt_h, source;
        delt_h = -7.489518e+07;
        source = -delt_h*(-arrhenius_rate(C_T(c,t)))*C_R(c,t)*C_YI(c,t,0)/30;
        ds[eqn]= delt_h*PRE_EXP*exp(-ACTIVE/(UNIVERSAL_GAS_CONSTANT*temp)) *ACTIVE*(1/temp) *(1/temp) *(1/UNIVERSAL_GAS_CONSTANT)*C_R(c,t)*C_YI(c,t,0)/30;
        return source;
}

DEFINE_SOURCE(no_source,c,t,dS,eqn)
{
        real source;
        source = 6*(-arrhenius_rate(C_T(c,t)))*C_R(c,t)*C_YI(c,t,0)/30;
        ds[eqn]= -6*PRE_EXP*exp(-ACTIVE/(UNIVERSAL_GAS_CONSTANT*temp)) *ACTIVE*(1/temp) *(1/temp) *(1/UNIVERSAL_GAS_CONSTANT)*C_R(c,t)*C_YI(c,t,0)/30;
        return source;
}

DEFINE_SOURCE(nh3_source,c,t,dS,eqn)
{
        real source;
        source = 4*(-arrhenius_rate(C_T(c,t)))*C_R(c,t)*C_YI(c,t,1)/17;
        ds[eqn]= -4*PRE_EXP*exp(-ACTIVE/(UNIVERSAL_GAS_CONSTANT*temp)) *ACTIVE*(1/temp) *(1/temp) *(1/UNIVERSAL_GAS_CONSTANT)*C_R(c,t)*C_YI(c,t,0)/17;
        return source;
}

DEFINE_SOURCE(h20_source,c,t,dS,eqn)
{
        real source;
        source = 6*(arrhenius_rate(C_T(c,t)))*C_R(c,t)*C_YI(c,t,2)/18;
        ds[eqn]= 6*PRE_EXP*exp(-ACTIVE/(UNIVERSAL_GAS_CONSTANT*temp)) *ACTIVE*(1/temp) *(1/temp) *(1/UNIVERSAL_GAS_CONSTANT)*C_R(c,t)*C_YI(c,t,0)/18;
        return source;
}
DEFINE_SOURCE(n2_source,c,t,dS,eqn)
{
        real source;
        source = 5*(arrhenius_rate(C_T(c,t)))*C_R(c,t)*C_YI(c,t,3)/28;
        ds[eqn]= 5*PRE_EXP*exp(-ACTIVE/(UNIVERSAL_GAS_CONSTANT*temp)) *ACTIVE*(1/temp) *(1/temp) *(1/UNIVERSAL_GAS_CONSTANT)*C_R(c,t)*C_YI(c,t,0)/28;
        return source;
}
活性炭模型.png
H2O云图.png
N2氮气云图.png
NH3云图.png
NO云图.png
反应不正常.png

共 1 个关于本帖的回复 最后回复于 2018-3-19 10:05

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注我们

360网站安全检测平台