|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我想做一个化学反应,a+b-p+r,用udf中的源项来定义,但是写了一个udf后发现编译没有问题,但是生成物根本就没有变化,大家能不能帮我看一下哪里出的问题,我已经想了很久了,很急,请各位帮忙!
#include "udf.h"
#define k 1.0e11
#define index_a 0
#define index_b 1
real concerna;
real concernb;
DEFINE_SOURCE(source_a,c,t,ds,eqn)
{
real x[ND_ND];
real source;
C_CENTROID(x,c,t);
concerna=C_R(c,t)*C_YI(c,t,index_a)/40.;
concernb=C_R(c,t)*C_YI(c,t,index_b)/36.5;
source=-k*concerna*concernb*40.;
ds(eqn)=0.;
return source;
}
DEFINE_SOURCE(source_b,c,t,ds,eqn)
{
real x[ND_ND];
real source;
C_CENTROID(x,c,t);
source=-k*concerna*concernb*36.5;
ds(eqn)=0.;
return source;
}
DEFINE_SOURCE(source_p,c,t,ds,eqn)
{
real x[ND_ND];
real source;
C_CENTROID(x,c,t);
source=-k*concerna*concernb*58.5;
ds(eqn)=0.;
return source;
}
DEFINE_SOURCE(source_r,c,t,ds,eqn)
{
real x[ND_ND];
real source;
C_CENTROID(x,c,t);
source=-k*concerna*concernb*18.;
ds(eqn)=0.;
return source;
} |
|