24小时热门版块排行榜    

Znn3bq.jpeg
查看: 1992  |  回复: 9
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

飘扬的雪

银虫 (正式写手)

[求助] Fluent 中气液两相流曳力UDF 已有1人参与

各位大神,
能指导一下如何编写下边这个方程中曳力的UDF吗?感谢各位了。

Fluent 中气液两相流曳力UDF
1512012162(1).png


Fluent 中气液两相流曳力UDF-1
1512012192(1).png


Fluent 中气液两相流曳力UDF-2
1512012212(1).png
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

目晴嘉懿

铜虫 (小有名气)

10楼2018-11-13 19:59:28
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 10 个回答

gyctju

金虫 (正式写手)

【答案】应助回帖

感谢参与,应助指数 +1
使用宏 DEFINE_EXCHANGE_PROPERTY,可以参考fluent自带案例。
/***************************************************************
   UDF for customizing the default Syamlal drag law in Fluent  
****************************************************************/
   
#include "udf.h"

#define pi 4.*atan(1.)
#define diam2 3.e-4

DEFINE_EXCHANGE_PROPERTY(custom_drag,cell,mix_thread,s_col,f_col)
{
Thread *thread_g, *thread_s;
real x_vel_g, x_vel_s, y_vel_g, y_vel_s, abs_v, slip_x, slip_y,
      rho_g, rho_s, mu_g, reyp, afac,
      bfac, void_g, vfac, fdrgs, taup, k_g_s;

/* find the threads for the gas (primary) */
/* and solids (secondary phases)          */

thread_g = THREAD_SUB_THREAD(mix_thread, s_col);/* gas phase  */
thread_s = THREAD_SUB_THREAD(mix_thread, f_col);/* solid phase*/

/* find phase velocities and properties*/

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

x_vel_s = C_U(cell, thread_s);
y_vel_s = C_V(cell, thread_s);

slip_x = x_vel_g - x_vel_s;
slip_y = y_vel_g - y_vel_s;

rho_g = C_R(cell, thread_g);
rho_s = 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 Reynold's number*/

reyp = rho_g*abs_v*diam2/mu_g;

/* compute particle relaxation time */

taup = rho_s*diam2*diam2/18./mu_g;

void_g = C_VOF(cell, thread_g);/* gas vol frac*/

/*compute drag and return drag coeff, k_g_s*/

afac = pow(void_g,4.14);

if(void_g<=0.85)
  bfac = 0.281632*pow(void_g, 1.28);
else
  bfac = pow(void_g, 9.076960);

vfac = 0.5*(afac-0.06*reyp+sqrt(0.0036*reyp*reyp+0.12*reyp*(2.*bfac-
              afac)+afac*afac));
fdrgs = void_g*(pow((0.63*sqrt(reyp)/
                            vfac+4.8*sqrt(vfac)/vfac),2))/24.0;

k_g_s = (1.-void_g)*rho_s*fdrgs/taup;

return k_g_s;
}

» 本帖已获得的红花(最新10朵)

2楼2017-11-30 15:47:14
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hitzhwan

禁虫 (著名写手)

本帖内容被屏蔽

3楼2017-12-01 07:28:13
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

飘扬的雪

银虫 (正式写手)

送红花一朵
引用回帖:
2楼: Originally posted by gyctju at 2017-11-30 15:47:14
使用宏 DEFINE_EXCHANGE_PROPERTY,可以参考fluent自带案例。
/***************************************************************
   UDF for customizing the default Syamlal drag law in Fluent  
********* ...

哇,太感谢了……万分感谢

发自小木虫Android客户端
4楼2017-12-01 09:07:20
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
信息提示
请填处理意见