24小时热门版块排行榜    

查看: 1073  |  回复: 1

飞猪入梦

新虫 (初入文坛)

[求助] udf曳力相关问题求教。

写了一个曳力的UDF,但是开始计算就发现问题了。
同样的模型,加入了UDF(wen yu曳力系数)之后计算出错。利用自带的计算就没有问题
# Divergence detected in AMG solver: mp-x-momentum -> Decreasing coarsening group size!
# Divergence detected in AMG solver: mp-x-momentum -> Increasing relaxation sweeps!
# Divergence detected in AMG solver: pressure correction -> Turning off correction scaling!
# Divergence detected in AMG solver: pressure correction -> Increasing relaxation sweeps!

udf 如下:
#include "udf.h"
#define diam2 9.e-2

DEFINE_EXCHANGE_PROPERTY(LS_drag, cell, mix_thread, s_col, l_col)
{
Thread *thread_l, *thread_s;
thread_l = THREAD_SUB_THREAD(mix_thread, l_col);
thread_s = THREAD_SUB_THREAD(mix_thread, s_col);

real abs_v, slip_x, slip_y, slip_z;
real rho_l, mu_l, reyp, void_s, void_l, f_drag, k_l_s;

slip_x = C_U(cell, thread_l) - C_U(cell, thread_s);
slip_y = C_V(cell, thread_l) - C_V(cell, thread_s);
slip_z = C_W(cell, thread_l) - C_W(cell, thread_s);

rho_l = C_R(cell, thread_l);

mu_l = C_MU_L(cell, thread_l);
void_s = C_VOF(cell, thread_s);
void_l = C_VOF(cell, thread_l);

abs_v = sqrt(slip_x*slip_x + slip_y*slip_y + slip_z*slip_z);
reyp = rho_l*abs_v*diam2/mu_l;

f_drag = (reyp <= 1000) ? (24.0*(1.0 + 0.15*pow(reyp, 0.687))/reyp) :0.44;

k_l_s = 0.75*rho_l*void_s*f_drag*abs_v/diam2;

return k_l_s;
}
其中换算了单位,所以颗粒的直径单位是mm。
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snowing62

新虫 (初入文坛)

请问您的问题解决了吗,遇到了同样的问题
2楼2017-09-26 19:16:32
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 飞猪入梦 的主题更新
信息提示
请填处理意见