在利用per phase求解湍流方程时,可以用以下语句获取各相指针。
Domain *dp = Get_Domain(2); /primary phase domain pointer/
Domain *ds = Get_Domain(3) ;/secondary phase domain pointer/
Thread *tp = Lookup_Thread(dp, 7);
Thread *ts = Lookup_Thread(ds, 7);
2,3分别是各相domain_id,7为区域ID,可以从用户图形界面获得
推
推纱望月
@推纱望月
帖子
-
per phase方法求解湍流模型,各相参数在UDF中应当如何调用 -
修正颗粒动理学参数的UDF和湍流黏度的定义各位老师,最近在研究双欧拉模型模拟液固两相流动,遇到以下两个疑惑,希望老师给予帮助
①想利用UDF对颗粒相剪切粘性系数和固相压力等参数进行修正(如 ),公式中包含颗粒拟温度项,在编写UDF的过程中不知道如何获取该参数??
是否可以利用颗粒脉动速度C表示的颗粒拟温度 该方法中如何获取颗粒脉动速度???曾尝试用速度获取宏 C_U(c,t); C_V(c,t); C_W(c,t)得到颗粒速度,所得结果明显错误
②湍流模型中的湍流黏度是否要定义
k-e湍流模型中湍流黏度定义为
在输出湍流黏度时,是默认按照该公式进行计算的吗???只有有别于改公式时才需要写UDF定义吗 -
fluent 曳力系数UDF@zousiyu 找到的错误确实是return的那一项太大,非常感谢
-
fluent 曳力系数UDF@bestucan 谢谢,按照您提供的思路找到了出错点
-
小白求助帖:关于不同形式的PBE@关伯兰在笑 我也在做PBM模型的相关模拟,希望可以私下交流,QQ:1327010187
-
求助UDF并行计算的问题你检查一下UDF里的参数
-
fluent 曳力系数UDF液固两相双流体模型中,我写了一个Huilin-Giaspow曳力系数UDF,如下:
#include "udf.h" #include "mem.h" #include "sg_mphase.h" #include "stdio.h" #define PAI 3.14159 DEFINE_EXCHANGE_PROPERTY(Huilin_Giaspow,cell,mix_thread,s_col,f_col) { real k_wenyu, k_ergun, k_l_s; real x_vel_l, x_vel_s, y_vel_l, y_vel_s, z_vel_l, z_vel_s, vel_l, vel_s, abs_v; real den_l, vis_l, vol_s; real rey, diam_s, dcef, stf; real g0, g1, g2, g3, g4;/*intermediate variable*/ Thread *thread_l, *thread_s; /*find the threads for the liquid (primary)and solids(secondary phases)*/ thread_l = THREAD_SUB_THREAD(mix_thread, s_col);/*liquid phase*/ thread_s = THREAD_SUB_THREAD(mix_thread, f_col);/*solid phase*/ /*find phase velocities*/ x_vel_l = C_U(cell, thread_l); y_vel_l = C_V(cell, thread_l); z_vel_l = C_W(cell, thread_l); x_vel_s = C_U(cell, thread_s); y_vel_s = C_V(cell, thread_s); z_vel_s = C_W(cell, thread_s); vel_l = sqrt(pow(x_vel_l,2.0)+pow(y_vel_l,2.0)+pow(z_vel_l,2.0)); vel_s = sqrt(pow(x_vel_s,2.0)+pow(y_vel_s,2.0)+pow(z_vel_s,2.0)); /*find phase properties*/ den_l = C_R(cell, thread_l);/*the density of the liquid phase*/ vis_l = C_MU_EFF(cell, thread_l);/*the viscosity of the liquid phase*/ vol_s = C_VOF(cell, thread_s);/*solid volume fraction*/ /*particle diameter*/ diam_s = C_PHASE_DIAMETER(cell,thread_s); /*compute slip**/ abs_v = fabs(vel_l-vel_s); /*compute Reynolds number*/ rey = den_l*diam_s*abs_v/vis_l; /*compute drag coeff, dcef*/ if(rey <= 1000.0) { g0 = (1-vol_s)*rey; g1 = 1.0+0.15*pow(g0,0.687); dcef = 24.0*g1/g0; } else {dcef = 0.44;} /*compute fluid-solid exchange coefficient, k_l_s*/ g2 = pow((1.0-vol_s), -2.65); k_wenyu = 0.75*dcef*(1-vol_s)*vol_s*den_l*abs_v*g2/diam_s; g3 = (1-vol_s)*pow(diam_s, 2.0); k_ergun = 150.0*vol_s*vol_s*vis_l/g3+1.75*vol_s*den_l*abs_v/diam_s; g4 = 262.5*(0.2-vol_s)/PAI; stf = 0.5+atan(g4);/*stitching function*/ k_l_s = stf*k_ergun+(1.0-stf)*k_wenyu; return k_l_s; }
不加载UDF,模型运算无误,加载UDF运算的时候会出现如下错误
Updating solution at time level N... done. iter continuity u-water u-hydrate v-water v-hydrate w-water w-hydrate k-water eps-water time/iter # 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! Error: Divergence detected in AMG solver: pressure correction Error: Divergence detected in AMG solver: pressure correction Error Object: #f
请教各位老师这是哪里出了问题。
-
求助UDF并行计算的问题你的是并行计算挂载有问题,串行计算没有问题吗?
-
per phase方法求解湍流模型,各相参数在UDF中应当如何调用不知道楼主这个问题解决没,本人现在也有同样的疑惑