|
楼主 |
发表于 2009-12-1 19:48
|
显示全部楼层
从论坛找了些从ansys将模态文件导入sysnoise的方法,改了一下午,还有毛病,大家帮我看下:
!用于将Ansys计算的模态结果转换为Sysnoise能够读取的FRE文件
/POST1
*GET,NODE_COUNT,NODE,,COUNT !节点数
*GET,ELEM_COUNT,ELEM,,COUNT !单元数
*SET,MODE_COUNT,5 !指定模态的阶数
!打开文件,向里面写数据
*CFOPEN,MODEFILE_ANSYS,FRE
! 1 写入头文件
*VWRITE
('SYSNOISE MODES STRUCTURE FILE') !头文件
*VWRITE
(' ')
*VWRITE
(' ')
*VWRITE
(' ')
! 2 按模态数循环
*Do,I,1,MODE_COUNT,1
! 2.1 写入每一子步的头文件、频率及特征值
*VWRITE
('REAL MODE FREQUENCY EIGENVALUE')
*Get,MODEFQ,MODE,I,FREQ
MODE_NUM_C='%I%'
LAMBDA = (2*3.141593*MODEFQ)**2 !特征值
*Vwrite,MODE_NUM_C,MODEFQ,LAMBDA
(A10,2E20.8)
*VWRITE
('DISPLACEMENT VALUES')
! 2.2 按照节点号循环,写入每一节点的振型值
SET,1,I
*GET,NODE_NUM,NODE,,NUM,MIND
*Do,II,1,NODE_COUNT,1
*GET,MODESHPX,NODE,NODE_NUM,U,X
*GET,MODESHPY,NODE,NODE_NUM,U,Y
*GET,MODESHPZ,NODE,NODE_NUM,U,Z
*GET,MODESHPRX,NODE,NODE_NUM,ROT,X
*GET,MODESHPRY,NODE,NODE_NUM,ROT,Y
*GET,MODESHPRZ,NODE,NODE_NUM,ROT,Z
NODE_NUM_C='%NODE_NUM%'
C =' '
*VWRITE,NODE_NUM_C,NODE_NUM_C,MODESHPX,MODESHPY,MODESHPZ
(2A10,3E20.8)
*VWRITE,C,MODESHPRX,MODESHPRY,MODESHPRZ
(A20,3E20.8)
*GET,NODE_NUM,NODE,NODE_NUM,NXTH
*ENDDO
*ENDDO
以上程序写出来的数据如下:
SYSNOISE MODES STRUCTURE FILE
REAL MODE FREQUENCY EIGENVALUE
1 0.12127672E-03 0.58065042E-06
DISPLACEMENT VALUES
87382 87382 -0.20702324E-16 -0.20702324E-16 0.33810578E+00
-0.54035059E-13 0.67779011E-12 -0.10765457E-13
87383 87383 -0.18734488E-16 -0.20608587E-16 0.33810578E+00
-0.61181083E-13 0.67067934E-12 -0.95031098E-14
而fre文件的数据应该是:
SYSNOISE MODES STRUCTURE FILE
REAL MODE FREQUENCY EIGENVALUE
1 .48140018E+02 .91489707E+05
DISPLACEMENT VALUES
1 1 .00000000E+00 .00000000E+00 .00000000E+00
.00000000E+00 .00000000E+00 .00000000E+00
2 2 .00000000E+00 .00000000E+00 .00000000E+00
.00000000E+00 .00000000E+00 .00000000E+00
请教fortran高手怎么修改程序中的格式控制符 |
|