24小时热门版块排行榜    

查看: 428  |  回复: 2

liuyuan1119

新虫 (初入文坛)

[求助] VOF气液逆流UDF请教

#include "udf.h"
#include "sg_mphase.h"

# define pi 4.*atan(1.)
#define diam2 2.8

DEFINE_SOURCE(drag,c,t,dS,eqn)
{
Thread *thread_g, *thread_l;
real x_vel_g, x_vel_l, y_vel_g, y_vel_l, abs_v, slip_x, slip_y,
      rho_g, rho_l, mu_g, reyp, fsc,flg
      void_g, drag ;

/* find the threads for the gas (primary) and solids (secondary phases).
These phases appear in columns 2 and 1 in the Interphase panel respectively*/

thread_g = THREAD_SUB_THREAD(mix_thread, s_col);/*gas phase*/
thread_l = THREAD_SUB_THREAD(mix_thread, f_col);/* liquid phase*/

/* find phase velocities and properties*/

x_vel_g = C_U(cell, thread_g);
y_vel_g = C_V(cell, thread_g);

x_vel_l = C_U(cell, thread_l);
y_vel_l = C_V(cell, thread_l);

slip_x = x_vel_g - x_vel_s;

slip_y = y_vel_g - y_vel_s;

rho_g = C_R(cell, thread_g);
rho_l = C_R(cell, thread_s);

mu_g = C_MU_L(cell, thread_g);

/*compute slip*/
abs_v = sqrt(slip_x*slip_x + slip_y*slip_y);

/*compute reynolds number*/

reyp = rho_g*abs_v*diam2/mu_g;

if(y_vel_g=0)
  fsc = 16./reyp;
else
  1/sqrt(fsc) = 4.*log(reyp*sqrt(fsc))-0.4;

flg = fsc(1.+24*pow(rho_l/rho_g,1/3)*/diam2);

void_g = C_VOF(cell, thread_g);/* gas vol frac*/
if(void_g=0.5)
  drag = 0.5*rho_g*flg*diam2*fabs(abs_v)*abs_v;
  dS(eqn) = -1.*rho_g*flg*diam2*fabs(abs_v);
else
  drag = 0

return drag
}

为什么一直提示 38行
thread_g = THREAD_SUB_THREAD(mix_thread, s_col);/*gas phase*/
thread_l = THREAD_SUB_THREAD(mix_thread, f_col);/* liquid phase*/
non-interger subscript expression :float 错误  麻烦大师帮忙看看这段
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

liuyuan1119

新虫 (初入文坛)

2楼2013-05-06 16:07:52
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

tsaipu

铜虫 (初入文坛)

★ ★
xiegangmai: 金币+2, 谢谢参与! 2013-05-07 00:15:21
thread_g = THREAD_SUB_THREAD(mix_thread, 0);
thread_l = THREAD_SUB_THREAD(mix_thread, 1);/这样试试看可以吗
3楼2013-05-06 19:13:06
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 liuyuan1119 的主题更新
信息提示
请填处理意见