吾生有涯 学海无涯
析模有界 知识无界

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

内容纲要

本文共199字,15图片,大概需要5分钟阅读完。

点击蓝字|关注我们

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 directions
DEFINE_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】多物理场红外信号仿真

【客户案例】清华锂电池热失控和热蔓延模型

【Fluent】人生苦短,我用PyFluent-V2

【客户案例】基于ANSYS Fluent的仿真技术在锂电池热管理系统及工艺制造过程方面的应用

【Discovery】Discovery Model 的CFD几何前处理功能

【客户案例】脱油沥青气化炉烧嘴与炉膛耦合模拟及优化

【Fluent】Ansys Fluent在隧道通风机中的成功应用案例

【Fluent】基于Fluent的某型商用重卡热管理快速仿真

【Fluent Meshing】Fluent Meshing网格教程(密闭几何流程)

【Fluent Meshing】Fluent Meshing网格教程(密闭几何流程)

【Ensight】基于Ansys Ensight 的流固耦合仿真后处理

Fluent Meshing基于质量准则显示局部网格

曲线坐标系在固体各向异性导热特性定义中的应用

【八一节快乐】使用Expression制作节日祝福视频教程

在Fluent Meshing中连接结构化体网格(1)

在Fluent Meshing中连接结构化体网格(2)

【Fluent】人生苦短,我用PyFluent

Ansys 2022R2 Fluid-Structure 安装软件及本地帮助文件

【仿真技巧】最全面判断Fluent算例设置一致的方法

【仿真技巧】Fluent Meshing网格替换方法-电脑版

【仿真技巧】Spaceclaim对影响网格划分质量的区域检查-电脑版

【仿真技巧】Fluent Meshing网格替换方法-手机版

【仿真技巧】Spaceclaim对影响网格划分质量的区域检查-手机版

【仿真技巧】Fluent并行速度慢的解决方案

【仿真技巧】Fluent Mesh Adaption在外气动中的应用-电脑版

【仿真技巧】Fluent Mesh Adaption在燃烧中的应用-电脑版

【仿真技巧】Fluent Mesh Adaption在多相流中的应用-电脑版

【仿真技巧】Fluent Overset Mesh Adaption-电脑版

【仿真技巧】Fluent Mesh Adaption在外气动中的应用-手机版

【仿真技巧】Fluent Mesh Adaption在燃烧中的应用-手机版

【仿真技巧】Fluent Mesh Adaption在多相流中的应用-手机版

【仿真技巧】Fluent Overset Mesh Adaption-手机版


求分享

求点赞

求在看


本篇文章来源于微信公众号: Ansys 流体大本营

赞(0) 打赏
版权声明:未经允许,请勿随意用于商业用途。
文章名称:《【Fluent】圆柱(电池)各向异性材料设置方法汇总》
文章链接:https://www.topcfd.cn/22914/
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
分享到

说两句 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者吧

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

登录

找回密码

注册