24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1634  |  回复: 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)
     
  }
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

heartbute

新虫 (初入文坛)

2楼2021-09-12 00:03:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

朴勋医生

新虫 (小有名气)

最后一个面热源,前面都是体热源,你也做激光加工吗

发自小木虫Android客户端
3楼2021-10-25 09:00:32
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 无敌小张! 的主题更新
不应助 确定回帖应助 (注意:应助才可能被奖励,但不允许灌水,必须填写15个字符以上)
信息提示
请填处理意见