wlphappy 发表于 2008-2-29 11:22

请教 dS[eqn]怎么写?


望高手指教
如果我在UDF中这样编写源项
source=-CON*C_MU_L(cell, thread)*C_U(cell, thread);    con是一常数
那么dS怎么写?

[ 本帖最后由 wlphappy 于 2008-2-29 11:28 编辑 ]

chaobo1982 发表于 2008-3-4 13:55

如果你写的是x方向的动量方程的源项的话,就是把你的source对x方向的速度求导

wlphappy 发表于 2008-3-5 11:17

回复 2楼 的帖子

谢谢
但是在interpret时,显示
#include "udf.h"line 5: Real: undeclared variable
而第5行 我仅仅定义了变量 source啊

下面是我的源项自定义
#define CON 1.0e12
DEFINE_SOURCE(cell_x_source,cell,thread,dS,eqn)
{
Real source;
/*source term*/
source=-CON*C_MU_L(cell,thread)*C_U(cell,thread);
/*derivative of source term w.r.t.x-velocity.*/
dS=-CON*C_MU_L(cell,thread);
return source;
}
页: [1]
查看完整版本: 请教 dS[eqn]怎么写?