|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本人要做一个电除尘的FLUENT算例,用的是DPM模型,加入电场力的UDF也已经找到,可以在编译到fluent中后,不知道如何设置电场力参数,望高手指教。谢谢!
另附程序代码如下:
/* Usage */
/*DEFINE_DPM_BODY_FORCE( name, p, i) */
/* Argument Type Description */
/* symbol name UDF name. */
/* Tracked_Particle *p Pointer to the Tracked_Particle data structure which */
/* contains data related to the particle being tracked. */
/* int i An index ( 0, 1, or 2) that identifies the Cartesian */
/* component of the body force that is to be returned by the function */
/* Function returns */
/* real */
/* UDF for computing the ic force on a charged particle */
#include "udf.h"
#define Q 1.0 /* particle electric charge */
#define BZ 3.0 /* z component of ic field */
#define TSTART 18.0 /* field applied at t = tstart */
/* Calculate ic force on charged particle. ic */
/* force is particle charge times cross product of particle */
/* velocity with ic field: Fx= q*bz*Vy, Fy= -q*bz*Vx */
DEFINE_DPM_BODY_FORCE(particle_body_force,p,i)
{
real bforce;
if(P_TIME(p)>=TSTART)
{
if(i==0) bforce=Q*BZ*P_VEL(p)[1];
else if(i==1) bforce=-Q*BZ*P_VEL(p)[0];
}
else
bforce=0.0;
/* an acceleration should be returned */
return (bforce/P_MASS(p));
} |
|