|
新手自学fluent模拟塔板气液两相流,使用默认的曳力模型能够收敛,加载自己编写曳力UDF,能编译加载成功,也能通过初始化,但是几百次迭代后出现
# 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!
以及floating point exception
自己编写的UDF如下
#include <stdio.h>
#include <math.h>
#include"udf.h"
#define Cd 0.44
#define diam 0.006
DEFINE_EXCHANGE_PROPERTY(custom_drag,cell,mix_thread,s_col,f_col)
{
Thread*thread_g,*thread_l;
real NV_VEC(Ug),NV_VEC(Ul),NV_VEC(U),NV_VEC(fdrg);
real void_g,rho_g,rho_l,M,N,fdrg;
/*find the threads for the liquid (primary)*/
/*and gas (secondary phases) */
thread_g=THREAD_SUB_THREAD(mix_thread,s_col);/*gas phase */
thread_l=THREAD_SUB_THREAD(mix_thread,f_col);/*liquid phase */
/*find gas vol frac and properties */
void_g=C_VOF(cell,thread_g) ;
rho_g=C_R(cell,thread_g);
NV_D(Ug,=,C_U(cell,thread_g),C_V(cell,thread_g),C_W(cell,thread_g));
NV_D(Ul,=,C_U(cell,thread_l),C_V(cell,thread_l),C_W(cell,thread_l));
NV_VV(U,=,Ug,-,Ul);
M=NV_MAG(U);
/*compute drag and return drag*/
N=0.75*Cd*void_g*rho_l*M/diam;
NV_VS(fdrg,=,U,*,N);
return NV_VEC(fdrg);
}
所要编写的曳力如图所示,求有相关经验的大神能给予指导,不胜感激。
|
-
曳力模型
|