ansys结果输出

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Ansys计算结果输出到Tecplot(zz)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!/post1file,Jobname,rst!指明从哪一个结果文件中读取数据*get,NodeNum,NODE,0,COUNT!得到模型的所有节点数*get,nd,NODE,0,NUM,MIN!得到模型的最小节点编号*dim,nodes,array,NodeNum!定义一个存储节点的数组*dim,xyz,array,NodeNum,3!定义一个存储节点坐标的数组*dim,NodeTemp,array,NodeNum!定义一个存储节点的数组set,4,1!读入第四载荷步、第一个子步的结果*do,i,1,NodeNum,1nodes(i)=nd!将节点编号存储在nodes数组中xyz(i,1)=NX(nd)!在xyz(i,1)中存储节点的X坐标xyz(i,2)=NY(nd)!在xyz(i,1)中存储节点的Y坐标xyz(i,3)=NZ(nd)!在xyz(i,1)中存储节点的Z坐标*Get,NodeTemp(i),NODE,nodes(i),TEMPnd=NDNEXT(nd)!取得下一个节点编号*enddo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*get,ElementNum,ELEM,0,COUNT!得到模型的所有单元数*get,el,ELEM,0,NUM,MIN!得到模型的最小单元编号*dim,elems,array,ElementNum!定义一个存储单元的数组*dim,ndlst,array,ElementNum,8!定义一个存储节点坐标的数组*do,i,1,ElementNum,1elems(i)=el!将单元编号存储在elems数组中*do,j,1,8,1ndlst(i,j)=NELEM(el,j)!将单元对应的节点编号存储在ndlst数组中*enddoel=ELNEXT(el)!取得下一个单元编号*enddo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*cfopen,mesh,dat!输出的文件名为:mesh.dat!写TecPlot文件的文件头*vwrite('TITLE=AnsysTemperatureAnalysis')!写变量名*vwrite('VARIABLES=X,Y,Z,Temp')!写节点数和单元数*vwrite,NodeNum,ElementNum('ZONEn='f6.1,'e='f6.1,'f=fepoint','et=brick')!写节点的坐标和温度值*vwrite,xyz(1,1),xyz(1,2),xyz(1,3),NodeTemp(1)(4f12.6)!写一个空行*vwrite('')!写各单元对应的节点号*vwrite,ndlst(1,1),ndlst(1,2),ndlst(1,3),ndlst(1,4),ndlst(1,5),ndlst(1,6),ndlst(1,7),ndlst(1,8)(8f6.0)!关闭文件*CFCLOSEfinish!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!将上述命令流拷贝到记事本中,然后以文件名“Ansys2Tecplot.inp”另存到Ansys的工作路径下。在Ansys中输入如下命令即可:/input,Ansys2Tecplot,inp希望能对大家有帮助!本文介绍了ANSYS用*get命令获得无规律节点编号的相关方法。!确定节点群和起始节点(由用户确定,即先把需要的节点选出来)------------N0=1!起始节点号为1NMAX=NDINQR(0,13)!获取节点总数*DIM,P1NODE,,NMAX!定义节点群数组,存放节点号*DIM,NODEX,,NMAX!定义节点群X坐标数组,存放与节点号对应的X坐标P1NODE(1)=N0!将起始节点号赋予节点群数组P1NODE(1)NODEX(1)=NX(N0)!将N0节点的X坐标赋予数组NODEX(1)*DO,I,2,NMAX!循环,从2~NMAX(节点总数)NI=NNEAR(N0)!获取距离N0节点最近的节点号,并赋予NIP1NODE(I)=NI!将NI存入数组P1NODE(I),注意下标为节点群序号NODEX(I)=NX(NI)!将NI节点的X坐标存入数组NODEX(I)NSEL,U,,,N0!从当前节点集体中去掉N0节点,以单向获取节点号N0=NI!将NI节点号赋予变量N0,实现循环中节点号的变化*ENDDO当然直接list就可以查看这些编号了,这里只是为了某些特别的需求才使用的介绍下里面用到的几个ansys内嵌函数NODE—ndinqr(node,key)node—节点号,对于key=12,13,14为0key—标识关于node的返回信息=1,选择状态=12,定义的数目=13,选择的数目=14,定义的最大数=-2,超单元标记=-3,主自由度=-4,激活的自由度=-5,附着的实体模型NDINQR(0,13)--获得节点总数,NDINQR(0,14)——获得节点的最大编号等等NNEAR(N)SelectednodenearestnodeN.更多的内嵌函数可以参看帮助文档,路径是:两种方法,区别:方法一输出文件格式中含有ANSYS的些文字信息,不能直接调入MATLAB。方法二输出文件格式基本可按自己需要定。纯数字。(一)简单命令/output,diaosuo4,txt,,appendnlist/output,nlist,txt,-,appengnlist/output,dlist,txtdlist(二)复杂命令*get,nodenum,node,,num,max!获得节点的数目*dim,nodepos,array,nodenum,3!nodepos存放节点的坐标*do,i,1,nodenum,1*get,nodepos(i,1),node,i,loc,x!获得节点的X坐标*get,nodepos(i,2),node,i,loc,y*get,nodepos(i,3),node,i,loc,z*enddo*get,elemnum,elem,,num,max!得到单元的总数目*dim,elemlist,array,elemnum,6!单元包含的节点列表,指定每个单元包含6个节点,根据情况修改*do,i,1,elemnum,1*do,ii,1,6,1*get,elemlist(i,ii),elem,i,node,ii!获得节点编号*enddo*enddo*cfopen,geomfile,txt!打开文件,写入数据*vwrite,0(F8.0,'Coordinatesofeachnode')*vwrite,sequ,nodepos(1,1),nodepos(1,2),nodepos(1,3)(F8.0,3e16.8)*vwrite,0(F8.0,'NodesNo.ofeachelement')*vwrite,sequ,elemlist(1,1),elemlist(1,2),elemlist(1,3),elemlist(1,4),elemlist(1,5),elemlist(1,6)(F8.0,6f8.0)*vwrite,0(F8.0)*cfclos===========================方法一输出文件格式样式如下:====================================================================LISTALLSELECTEDNODES.DSYS=01*****ANSYS-ENGINEERINGANALYSISSYSTEMRELEASE11.0SP1*****ANSYSMultiphysics00235603VERSION=INTELNT12:35:26NOV17,2010CP=0.437NODEXYZTHXYTHYZTHZX10.00000.00000.00000.000.000.0020.500000.00000.00000.000.000.0031.00000.00000.00000.000.000.0040.500000.500000.00000.000.000.0050.00000.00000.500000.000.000.0060.500000.500000.500000.000.000.0070.500000.00000.500000.000.000.0081.00000.00000.500000.000.000.0091.50000.00000.500000.000.000.00101.50000.00000.00000.000.000.00112.00000.00000.00000.000.000.00122.00000.00000.500000.000.000.00132.50000.00000.00000.000.000.00=========================================================================================LISTCONSTRAINTSFORSELECTEDNODES1TO24BY1CURRENTLYSELECTEDDOFSET=UXUYUZROTXROTYROTZ1*****ANSYS-ENGINEERINGANALYSISSYSTEMRELEASE11.0SP1*****ANSYSMultiphysics00235603VERSION=INTELNT12:35:26NOV17,2010CP=0.468NODELABELREALIMAG1UX0.000000000.000000001UY0.000000000.000000001UZ0.000000000.000000005UX0.000000000.000000005UY0.000000000.000000005UZ0.000000000.0000000023UY0.000000000.0000000023UZ0.000000000.0000000024UY0.000000000.0000000024UZ0.000000000.00000000*****ENDOFINPUTENCOUNTERED*****NUMBEROFWARNINGMESSAGESENCOUNTERED=0NUMBEROFERRORMESSAGESENCOUNTERED=0==============================================================================方法二输出文件样式如下:==============================================================================0.Coordinatesofeachnode1.0.00000000E+000.00000000E+000.00000000E+002.0.50000000E+000.00000000E+000.00000000E+003.0.10000000E+010.00000000E+000.00000000E+004.0.50000000E+000.50000000E+000.00000000E+005.0.00000000E+000.00000000E+000.50000000E+006.0.50000000E+000.50000000E+000.50000000E+007.0.50000000E+000.00000000E+000.50000000E+008.0.10000000E+010.0000000

1 / 9
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功