|
楼主 |
发表于 2004-7-20 11:48:30
|
显示全部楼层
[求助]Fluent中流体的源相(source)是如何计算的
我参照Fluent的help用udf定义了momentum sink
具体udf如下
请问有错误吗?
/******************************************************************/
/* UDF that adds momentum source term and derivative to duct flow */
/******************************************************************/
#include "udf.h"
#define CON0.2
/*CON 就是mass sink,单位kg/m3-s*/
DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn)
{
real source;
/* source term */
source = -CON*C_U(cell,thread);
/* derivative of source term w.r.t. x-velocity. */
dS[eqn] = -CON;
return source;
}
DEFINE_SOURCE(cell_y_source, cell, thread, dS, eqn)
{
real source;
/* source term */
source = -CON*C_V(cell,thread);
/* derivative of source term w.r.t. x-velocity. */
dS[eqn] = -CON;
return source;
}
|
|