首页/文章/ 详情

【Fluent电池热仿真技巧】圆柱(电池)各向异性材料设置方法汇总

1年前浏览3724

01

说明

本文详细介绍了4种在Fluent中进行圆柱坐标系各向异性物性设置的方法,对于诸如电池行业可极大提升效率

02

实现

    /****************************************************************************** UDF for defining the anisotropic conductivity matrix for a cylindrical shell This UDF is from Ansys Help document and Dr Du Mengjie modified and tested! ******************************************************************************/#include "udf.h"#define CELL_NUM 2    //number of cellsreal origin[CELL_NUM][3];  //coordinates of every single cell axisstatic const real axis[3]  = {0, 1, 0};int id[CELL_NUM] = {144,147};  //zone id of cells, a function of assignment can be adapted if there are too many cellsstatic const real cond[3] = {1, 100, 100};  //radial, tangential and axial directionsDEFINE_ON_DEMAND(on_demand_func){  int i;  cell_t c;  Domain *d = Get_Domain(1);  Thread *t;  real xmin,xmax,ymin,ymax,zmin,zmax;  real xcent[ND_ND];  for ( i = 0; i < CELL_NUM; i++)   {    xmin = 1e30;xmax = -1e30;    ymin = 1e30;ymax = -1e30;    zmin = 1e30;zmax = -1e30;    t = Lookup_Thread(d,id[i]); //obtain cell[i] thread #if !RP_HOST  begin_c_loop(c,t) //obtain cell[i] domain x/y/z min/max coordinates  {    C_CENTROID(xcent,c,t);    if ( xcent[0] < xmin ) xmin = xcent[0];    if ( xcent[0] > xmax ) xmax = xcent[0];    if ( xcent[1] < ymin ) ymin = xcent[1];    if ( xcent[1] > ymax ) ymax = xcent[1];    if ( xcent[2] < zmin ) zmin = xcent[2];    if ( xcent[2] > zmax ) zmax = xcent[2];  }  end_c_loop(c,t)#if RP_NODE  //parallel reduction  xmin = PRF_GRLOW1(xmin);  xmax = PRF_GRHIGH1(xmax);  ymin = PRF_GRLOW1(ymin);  ymax = PRF_GRHIGH1(ymax);  zmin = PRF_GRLOW1(zmin);  zmax = PRF_GRHIGH1(zmax);#endif#endif  node_to_host_real_6(xmin,xmax,ymin,ymax,zmin,zmax);  //obtain cell[i] center coordinates value and assign them to global array origin  origin[i][0] = (xmax + xmin) / 2;  origin[i][1] = (ymax + ymin) / 2;  origin[i][2] = (zmax + zmin) / 2;  }#if !RP_NODE  for ( i = 0 ; i < CELL_NUM; i++)    Message("In zone %d, center is %lf, %lf, %lf.\n",id[i], origin[i][0],origin[i][1], origin[i][2]);#endif}DEFINE_ANISOTROPIC_CONDUCTIVITY(cyl_ortho_cond,c,t,dmatrix){   real x[3][3]; /* principal direction matrix for cell in cartesian coords. */   real xcent[ND_ND];   real R;   int i;   for ( i = 0; i < CELL_NUM; i++)     if ( id[i] == THREAD_ID(t))       break;   C_CENTROID(xcent,c,t);   //Message("In zone %d, center is %lf, %lf, %lf.\n",id[i], origin[i][0],origin[i][1], origin[i][2]);   NV_VV(x[0],=,xcent,-,origin[i]);  #if RP_3D     NV_V(x[2],=,axis);  #endif  #if RP_3D     R = NV_DOT(x[0],x[2]);     NV_VS(x[0],-=,x[2],*,R);  #endif   R = NV_MAG(x[0]);   if (R > 0.0)      NV_S(x[0],/=,R);  #if RP_3D   N3V_CROSS(x[1],x[2],x[0]);  #else     x[1][0] = -x[0][1];     x[1][1] = x[0][0];  #endif   /* dmatrix is computed as xT*cond*x */   dmatrix[0][0] = cond[0]*x[0][0]*x[0][0]      + cond[1]*x[1][0]*x[1][0]  #if RP_3D    + cond[2]*x[2][0]*x[2][0]  #endif  ;   dmatrix[1][1] = cond[0]*x[0][1]*x[0][1]    + cond[1]*x[1][1]*x[1][1]  #if RP_3D    + cond[2]*x[2][1]*x[2][1]  #endif    ;   dmatrix[1][0] = cond[0]*x[0][1]*x[0][0]    + cond[1]*x[1][1]*x[1][0]  #if RP_3D    + cond[2]*x[2][1]*x[2][0]  #endif  ;   dmatrix[0][1] = dmatrix[1][0];  #if RP_3D   dmatrix[2][2] = cond[0]*x[0][2]*x[0][2]    + cond[1]*x[1][2]*x[1][2]    + cond[2]*x[2][2]*x[2][2]    ;   dmatrix[0][2] = cond[0]*x[0][0]*x[0][2]    + cond[1]*x[1][0]*x[1][2]    + cond[2]*x[2][0]*x[2][2]    ;   dmatrix[2][0] = dmatrix[0][2];   dmatrix[1][2] = cond[0]*x[0][1]*x[0][2]    + cond[1]*x[1][1]*x[1][2]    + cond[2]*x[2][1]*x[2][2]     ;   dmatrix[2][1] = dmatrix[1][2];  #endif}
       

    编辑:井文明

    核对:郭晓东

    动力电池热管理及热流场仿真分析案例分析-基于Fluent热管理仿真33讲

    来源:新能源热管理技术
    FluentUDF新能源UM材料
    著作权归作者所有,欢迎分享,未经许可,不得转载
    首次发布时间:2022-10-27
    最近编辑:1年前
    LEVEL水平线仿真
    硕士 | 热管理工程师 公众号LEVEL电池热管理技术
    获赞 741粉丝 3545文章 323课程 7
    点赞
    收藏

    作者推荐

    未登录
    1条评论
    赵飞龙
    签名征集中
    1年前
    请问这个热导率分量云图怎么看呀
    回复

    课程
    培训
    服务
    行家

    VIP会员 学习 福利任务 兑换礼品
    下载APP
    联系我们
    帮助与反馈