| 查看: 1749 | 回复: 2 | |||
| 【悬赏金币】回答本帖问题,作者无敌小张!将赠送您 5 个金币 | |||
[求助]
fluent的udf
|
|||
|
大神们,有段fluent的udf,但是看不懂,有没有大神能给解答一下是什么意思 研一萌新没啥金币,直接分享,大家有需要就拿去用 #include "udf.h" #define U 18 #define I 200 #define PI 3.1415928 #define R 0.003 #define n 0.8 #define v 0.003 #define L 0.005 #define u0 1.26e-6 DEFINE_SOURCE(S_X,cell,thread,dS,eqn) { real xc[ND_ND]; real t; real source; real x,y,z; real r; C_CENTROID(xc,cell,thread); x=xc[0]; y=xc[1]; z=xc[2]; t=RP_Get_Real("flow-time" ;r=sqrt((x-v*t)*(x-v*t)+y*y); if(r<R) { source=-1*u0*I*I/(4*PI*PI*R*R*r)*exp(-1*r*r/(2*R*R)) *(1-exp(-1*r*r/(2*R*R)))*(1-z/L)*(1-z/L)*x/L; dS[eqn]=0; } else source=dS[eqn]=0; return source; } DEFINE_SOURCE(S_Y,cell,thread,dS,eqn) { real xc[ND_ND]; real t; real source; real x,y,z; real r; C_CENTROID(xc,cell,thread); x=xc[0]; y=xc[1]; z=xc[2]; t=RP_Get_Real("flow-time" ;r=sqrt((x-v*t)*(x-v*t)+y*y); if(r<R) { source=-1*u0*I*I/(4*PI*PI*R*R*r)*exp(-1*r*r/(2*R*R)) *(1-exp(-1*r*r/(2*R*R)))*(1-z/L)*(1-z/L)*y/L; dS[eqn]=0; } else source=dS[eqn]=0; return source; } DEFINE_SOURCE(S_Z,cell,thread,dS,eqn) { real xc[ND_ND]; real t; real source; real x,y,z; real r; C_CENTROID(xc,cell,thread); x=xc[0]; y=xc[1]; z=xc[2]; t=RP_Get_Real("flow-time" ;r=sqrt((x-v*t)*(x-v*t)+y*y); if(r<R) { source=-1*u0*I*I/(4*PI*PI*L*r*r) *(1-exp(-1*r*r/(2*R*R)))*(1-z/L)*(1-z/L); dS[eqn]=0; } else source=dS[eqn]=0; return source; } DEFINE_PROFILE(heat_flux,thread,index) { real xc[ND_ND]; face_t f; real t; real heat,T0=300; real x,y,z; real r; real hc = 80, sigmab = 5.67e-8, epsilon = 0.06; t=RP_Get_Real("flow-time" ;begin_f_loop(f,thread) { F_CENTROID(xc,f,thread); x=xc[0]; y=xc[1]; z=xc[2]; r=sqrt((x-v*t)*(x-v*t)+y*y); if(r<sqrt(6)*R) heat=n*I*U/(2*PI*R*R)*exp(-1*r*r/(2*R*R)); else heat=0; F_PROFILE(f, thread, index) = heat - hc*(F_T(f,thread), - T0) - sigmab*epsilon*(pow(F_T(f,thread), 4.) - pow(T0, 4.)); } end_f_loop(f,thread) } |
» 猜你喜欢
生物学296求调剂
已经有10人回复
288资源与环境专硕求调剂,不限专业,有学上就行
已经有19人回复
086000生物与医药 初试274求调剂
已经有4人回复
315求调剂
已经有7人回复
288求调剂 一志愿哈工大 材料与化工
已经有11人回复
求调剂
已经有9人回复
309求调剂
已经有16人回复
322求调剂:一志愿湖南大学 材料与化工(085600),已过六级。
已经有10人回复
330分求调剂
已经有6人回复
317求调剂
已经有13人回复
2楼2021-09-12 00:03:46
3楼2021-10-25 09:00:32














;
回复此楼