声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2813|回复: 1

[结构分析] ANSYS_结构稳态(静力)分析之经典实例-扳手

[复制链接]
发表于 2011-3-13 09:14 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
本帖最后由 Chelsea 于 2011-3-13 09:15 编辑
  1. /FILNAME,Allen-wrench,1     !     Jobname to use for all subsequent files
  2. /TITLE,Static analysis of an Allen wrench
  3. /UNITS,SI        ! Reminder that the SI system of units is used
  4. /SHOW            ! Specify graphics driver for interactive run; for batch
  5.                  ! run plots are written to pm02.grph

  6.                  ! Define parameters for future use

  7. EXX=2.07E11      ! Young's modulus (2.07E11 Pa = 30E6 psi)
  8. W_HEX=.01        ! Width of hex across flats (.01m=.39in)
  9. *AFUN,DEG        ! Units for angular parametric functions定义弧度单位
  10. W_FLAT=W_HEX*TAN(30)        ! Width of flat
  11. L_SHANK=.075     ! Length of shank (short end) (.075m=3.0in)
  12. L_HANDLE=.2      ! Length of handle (long end) (.2m=7.9 in)
  13. BENDRAD=.01      ! Bend radius of Allen wrench (.01m=.39 in)
  14. L_ELEM=.0075     ! Element length (.0075 m = .30 in)
  15. NO_D_HEX=2       ! Number of divisions on hex flat
  16. TOL=25E-6        ! Tolerance for selecting nodes (25e-6 m = .001 in)

  17. /PREP7
  18. ET,1,SOLID45     ! 3维实体结构单元;Eight-node brick element
  19. ET,2,PLANE42     ! 2维平面结构;Four-node quadrilateral (for area mesh)
  20. MP,EX,1,EXX      ! Young's modulus for material 1;杨氏模量
  21. MP,PRXY,1,0.3    ! Poisson's ratio for material 1;泊松比

  22. RPOLY,6,W_FLAT   ! Hexagonal area创建规则的多边形

  23. K,7              ! Keypoint at (0,0,0)
  24. K,8,,,-L_SHANK   ! Keypoint at shank-handle intersection
  25. K,9,,L_HANDLE,-L_SHANK    ! Keypoint at end of handle

  26. L,4,1            ! Line through middle of hex shape
  27. L,7,8            ! Line along middle of shank
  28. L,8,9            ! Line along handle
  29. LFILLT,8,9,BENDRAD        ! Line along bend radius between shank and handle! 产生一个倒角圆,并生成三个点

  30. /VIEW,,1,1,1     ! Isometric view in window 1
  31. /ANGLE,,90,XM    ! Rotates model 90 degrees about X! 不用累积的旋转
  32. /TRIAD,ltop
  33. /PNUM,LINE,1     ! Line numbers turned on
  34. LPLOT
  35.                  ! Line numbers off
  36.                  !
  37. /PNUM,KP,1
  38. KPLOT
  39. L,1,4            ! Hex section is cut into two quadrilaterals
  40. ASBL,1,7,,,KEEP  !  to satisfy mapped meshing requirements for bricks! 减线从面中
  41. CM,BOTAREA,AREA  ! Component name BOTAREA for the two areas

  42.                        ! Generate area mesh for later drag

  43. /PNUM,KP,0
  44. LPLOT
  45. LESIZE,1,,,NO_D_HEX    ! Number of divisions along line 1 为线指定网格尺寸
  46. LESIZE,2,,,NO_D_HEX
  47. LESIZE,6,,,NO_D_HEX
  48. TYPE,2                 ! PLANE42 elements to be meshed first
  49. MSHAPE,0,2D            ! Mapped quad mesh 指定单元要划分的形状和维数
  50. MSHKEY,1               ! 指定了映射网格划分
  51. SAVE                   ! Save database before meshing
  52. AMESH,ALL


  53. /TITLE,Meshed hex wrench end to be used in vdrag
  54. EPLOT
  55.                        ! Now drag the 2-D mesh to produce 3-D elements
  56. TYPE,1                 ! Type pointer set to SOLID45
  57. ESIZE,L_ELEM           ! Element size  
  58. VDRAG,2,3,,,,,8,10,9   ! Drag operation to create 3-D mesh面掠生成体

  59. /TYPE,,HIDP            ! Precise hidden line display  显示要求是精确
  60. /TITLE,Meshed hex wrench
  61. EPLOT

  62. CMSEL,,BOTAREA         ! Select BOTAREA component and! 选择一个子集
  63. ACLEAR,ALL             !    delete the 2-D elements! 清楚选择单元的几点和单元
  64. ASEL,ALL
  65.                        
  66. FINISH                 ! Apply loads and obtain the solution
  67. /SOLU
  68. ANTYPE,STATIC          ! Static analysis (default)

  69. /TITLE,Allen wrench -- Load step 1
  70.                        ! First fix all nodes around bottom of shank
  71. CMSEL,,BOTAREA         ! Bottom areas of shank 选择以前建立的一个单元面积的组合
  72. LSEL,,EXT              ! Exterior lines of those areas 显示线
  73. NSLL,,1                ! Nodes on those lines
  74. D,ALL,ALL              ! Displacement constraints

  75. LSEL,ALL
  76. /PBC,U,,2              ! Displacement symbols turned on 显示位移约束的符号
  77. /TITLE,Boundary conditions on end of wrench
  78. NPLOT

  79.                                 !Now apply pressure on handle to represent 100-N (22.5-lb) finger force
  80. ASEL,,LOC,Y,BENDRAD,L_HANDLE    ! Areas on handle
  81. ASEL,R,LOC,X,W_FLAT/2,W_FLAT    ! Two areas on one side of handle...
  82. NSLA,,1                         !  ...and all corresponding nodes
  83. NSEL,R,LOC,Y,L_HANDLE+TOL,L_HANDLE-(3.0*L_ELEM)-TOL   ! Reselects nodes at  位置
  84.                                 ! back end of handle (3 element lengths)
  85. *GET,MINYVAL,NODE,,MNLOC,Y      ! Get minimum Y value of selected nodes预处理中的结点项;问题是得到一个什么样的值,结点的什么?
  86. *GET,MAXYVAL,NODE,,MXLOC,Y      ! Get maximum Y value of selected nodes是中心位置的值吗?
  87. PTORQ=100/(W_HEX*(MAXYVAL-MINYVAL))   ! Pressure equivalent to 100 N
  88. SF,ALL,PRES,PTORQ               ! PTORQ pressure on all selected nodes 指定节点上的表面力的载荷

  89. ALLSEL                          ! Restores full set of all entities
  90. /PSF,PRES,,2                    ! Pressure symbols turned on 以箭头显示载荷
  91. /TITLE,Boundary conditions on wrench for load step 1
  92. NPLOT
  93. LSWRITE                         ! Writes first load step



  94. /TITLE, Allen wrench -- load step 2
  95.                                 ! Downward pressure on top of handle, representing 20-N (4.5 -lb) force
  96. PDOWN=20/(W_FLAT*(MAXYVAL-MINYVAL))

  97. ASEL,,LOC,Z,-(L_SHANK+(W_HEX/2))   ! Area on top flat of handle...
  98. NSLA,,1                            !  ...and all corresponding nodes
  99. NSEL,R,LOC,Y,L_HANDLE+TOL,L_HANDLE-(3.0*L_ELEM)-TOL   ! Reselects nodes at
  100.                                 ! back end of handle (3 element lengths)
  101. SF,ALL,PRES,PDOWN               ! PDOWN pressure at all selected nodes
  102. ALLSEL
  103. /TITLE,Boundary conditions on wrench for load step 2
  104. NPLOT
  105. LSWRITE                         ! Writes second load step

  106. SAVE                            ! Save database before solution
  107. LSSOLVE,1,2                     ! Initiates solution for load step files 1 and 2

  108.                         !Review the results
  109. FINISH
  110. /POST1
  111. SET,1                   ! Reads load step 1 results
  112. PRRSOL                  ! Reaction solution listing
  113. /PBC,DEFA               ! No BC symbols  重新安排规格说明
  114. /PSF,DEFA               ! No surface load symbols 重新安排载荷的显示
  115. /EDGE,,1                ! Edges only, no interior element outlines 只显示边缘单元的显示
  116. /TITLE,Deformed allen wrench caused by torque
  117. PLDISP,2                ! Deformed shape overlaid with undeformed edge plot 显示结构转移

  118. /GSAVE,pldisp,gsav      ! Saves graphics specifications on pldisp.gsav 保存为此图形文件,稍后再用

  119. /PLOPTS,INFO,ON         ! Turns on entire legend column 打开边框形式;开启全部的图形圆柱
  120. /PLOPTS,LEG1,OFF        ! Turns off legend header 关闭图形轮廓线的标题(头部)
  121. /ANGLE,,120,YM,1        ! Additional rotation about model Y (to see high stress areas)
  122. /TITLE,Stress intensity contours caused by torque
  123. PLNSOL,S,INT            ! Stress intensity(应力强度) contours 组元应力

  124. /GSAVE,plnsol,gsav      ! Saves graphics specifications to plnsol.gsav


  125. SET,2                   ! Reads load step 2 results
  126. PRRSOL                  ! Reaction solution listing

  127. /GRESUME,pldisp,gsav    ! 恢复pldisp文件;Resumes graphics specifications from pldisp.gsav
  128. /TITLE,Deformed allen wrench caused by torque and force
  129. PLDISP,2

  130. /GRESUME,plnsol,gsav    ! Resumes graphics specifications from plnsol.gsav

  131. /TITLE,Stress intensity contours caused by torque and force
  132. PLNSOL,S,INT

  133. WPOF,,,-0.067           ! 把工作平面在Z方向偏移,达到后面要的截面的位置Offset the working plane for cross-section view从Z轴方向偏移工作平面
  134. /TYPE,1,5               ! Capped hidden display 显示剖面
  135. /CPLANE,1               ! 以共工作平面来剪切截面 Cutting plane defined to use the WP 把平面切开

  136. /VIEW, 1 ,WP            ! View will be normal to the WP正切于当前的工作平面
  137. /DIST,1,.01             ! Zoom in on the cross section 指定详细的扩大倍数进行查看

  138. /TITLE,Cross section of the allen wrench under torque and force loading
  139. PLNSOL,S,INT








  140. ! ***********************************GUI操作后的一些log文件命令流的解释说明 ***********************************

  141. /BATCH  
  142. /COM,ANSYS RELEASE 11.0SP1 UP20070830       15:05:16    02/20/2009
  143. /TITLE,Static Analysis of an Allen Wrench   
  144. *AFUN,DEG   
  145. *SET,EXX,       2.07E11
  146. *SET,W_HEX,     .01  
  147. *SET,W_FLAT,    W_HEX*TAN(30)   
  148. *SET,L_SHANK,   .075   
  149. *SET,L_HANDLE,  .2   
  150. *SET,L_ELEM,    .0075   
  151. *SET,NO_D_HEX,  2
  152. *SET,TOL,       25E-6  
  153. *SET,BENDRAD,   .01

  154. /PREP7  

  155. ET,1,SOLID45
  156. ET,2,PLANE42


  157. MPTEMP,,,,,,,,  
  158. MPTEMP,1,0  
  159. MPDATA,EX,1,,EXX             ! 与温度相对应的材料属性
  160. MPDATA,PRXY,1,,0.3  

  161. RPOLY,6,W_FLAT,              ! 创建规则的多边形
  162.   
  163. K,7,,,,
  164. K,8,,,-L_SHANK,
  165. K,9,,L_HANDLE,-L_SHANK,

  166. !*  
  167. /VIEW, 1 ,1,1,1
  168. /ANG, 1
  169. /REP,FAST   
  170. !*  
  171. /ANGLE,1,90,XS,0         ! 不用累积的旋转  

  172. LSTR,       4,       1   ! 两点定义一条直线  
  173. LSTR,       7,       8  
  174. LSTR,       8,       9  
  175. LFILLT,8,9,BENDRAD, ,   ! 产生一个倒角圆,并生成三个点
  176. SAVE

  177. APLOT   
  178. FLST,2,1,5,ORDE,1   
  179. FITEM,2,1   
  180. LPLOT   

  181. FLST,3,1,4,ORDE,1   
  182. FITEM,3,7   
  183. ASBL,P51X,P51X, , ,KEEP          ! 减线从面中
  184. CM,BOTAREA,AREA                  ! 创建一个面的组合
  185. FLST,5,3,4,ORDE,3   
  186. FITEM,5,1   
  187. FITEM,5,-2  
  188. FITEM,5,6   
  189. CM,_Y,LINE  
  190. LSEL, , , ,P51X
  191. CM,_Y1,LINE
  192. CMSEL,,_Y   

  193. LESIZE,_Y1, , ,NO_D_HEX, , , , ,1   

  194. TYPE,   2   
  195. MAT,       1
  196. REAL,   
  197. ESYS,       0   
  198. SECNUM,
  199. TSHAP,LINE  
  200. !*  
  201. MOPT,AMESH,DEFA
  202. MOPT,QMESH,DEFA
  203. MOPT,VMESH,DEFA
  204. MOPT,TIMP,1
  205. MOPT,PYRA,ON
  206. MOPT,AORD,0
  207. MOPT,SPLIT,1
  208. MSHKEY,1
  209. MSHMID,0
  210. MSHPATTERN,0
  211. KEYW,ACCEPT,0   
  212. !*  
  213. MSHAPE,0,2D
  214. MSHAPE,0,3D
  215. !*  
  216. SAVE
  217. FLST,5,2,5,ORDE,2   
  218. FITEM,5,2   
  219. FITEM,5,-3  
  220. CM,_Y,AREA  
  221. ASEL, , , ,P51X
  222. CM,_Y1,AREA
  223. CHKMSH,'AREA'   
  224. CMSEL,S,_Y  
  225. !*  
  226. AMESH,_Y1   
  227. !*  
  228. CMDELE,_Y   
  229. CMDELE,_Y1  
  230. CMDELE,_Y2  
  231. !*  

  232. EPLOT   
  233. TYPE,   1   
  234. MAT,       1
  235. REAL,   
  236. ESYS,       0   
  237. SECNUM,
  238. TSHAP,LINE  
  239. !*  
  240. ESIZE,L_ELEM,0,     ! 指定线的份数
  241.   
  242. LPLOT   
  243. FLST,2,2,5,ORDE,2   
  244. FITEM,2,2   
  245. FITEM,2,-3  
  246. FLST,8,2,4  
  247. FITEM,8,8   
  248. FITEM,8,10  
  249. VDRAG,P51X, , , , , ,P51X   
  250. /AUTO,1
  251. /REP,FAST   
  252. EPLOT   
  253. SAVE
  254. CMSEL,S,BOTAREA           ! 选择一个子集
  255. FLST,2,2,5,ORDE,2   
  256. FITEM,2,2   
  257. FITEM,2,-3  
  258. ACLEAR,P51X               ! 清楚选择单元的几点和单元
  259. ALLSEL,ALL  
  260. EPLOT   
  261. CMSEL,S,BOTAREA
  262. LSEL,S,EXT  
  263. NSLL,S,1
  264. FINISH  


  265. FLST,2,18,1,ORDE,4  
  266. FITEM,2,1   
  267. FITEM,2,-10
  268. FITEM,2,17  
  269. FITEM,2,-24
  270. /solu

  271. D,P51X, , , , , ,ALL, , , , ,   
  272. LSEL,ALL



  273. ASEL,S,LOC,Y,BENDRAD,L_HANDLE   
  274. ASEL,R,LOC,X,W_FLAT/2,W_FLAT
  275. NSLA,S,1
  276. NSEL,R,LOC,Y,L_HANDLE+TOL,L_HANDLE-(3.0*L_ELEM)-TOL
  277. !*  
  278. *GET,minyval,NODE,,MNLOC,Y, , , ,   

  279. *GET,maxyval,NODE,,MXLOC,X, , ,,   

  280. *SET,PTORQ,100/(W_HEX*(MAXYVAL-MINYVAL))
  281. ALLSEL,ALL  
  282. FLST,2,364,1,ORDE,2
  283. FITEM,2,1   
  284. FITEM,2,-364

  285. SF,P51X,PRES,PTORQ  
  286. ALLSEL,ALL  
  287. NPLOT   
  288. SAVE
  289. LSWRITE,1,  

  290. *SET,PDOWN,20/(W_FLAT*(MAXYVAL-MINYVAL))

  291. ASEL,S,LOC,Z,-(L_SHANK+(W_HEX/2))   
  292. NSLA,S,1
  293. NSEL,R,LOC,Y,L_HANDLE+TOL,L_HANDLE-(3.0*L_ELEM)-TOL
  294. ALLSEL,ALL  
  295. FLST,2,364,1,ORDE,2
  296. FITEM,2,1   
  297. FITEM,2,-364

  298. SF,P51X,PRES,PDOWN  
  299. ALLSEL,ALL  
  300. NPLOT   
  301. LSWRITE,2,  
  302. SAVE
  303. LSSOLVE,1,2,1,  
  304. FINISH  
  305. /POST1  
  306. SET,FIRST   
  307. PRRSOL,


  308. /PBC,ALL, ,0
  309. /REP
  310.   
  311. /EDGE,1,1,45
  312. /GLINE,1,0  

  313. PLDISP,1
  314. /GSAVE,'pldisp','gsa',' '   
  315. !*  
  316. /ANGLE,1,120,YM,1   
  317. /REPLOT

  318. /EFACET,1   
  319. PLNSOL, S,INT, 0,1.0
  320. /GSAVE,'plnsol','gsa',' '   

  321. SET,NEXT
  322. PRRSOL,
  323. /GRESUME,'pldisp','gsa',' '
  324. PLDISP,1
  325. /GRESUME,'plnsol','gsa',' '
  326. !*  
  327. /EFACET,1   
  328. PLNSOL, S,INT, 0,1.0
  329. wprot,0,0,-0.067
  330. /GRAPHICS,POWER
  331. !*  
  332. /TYPE,1,5   
  333. /CPLANE,1   
  334. /SHADE,1,1  
  335. /HBC,1,0
  336. /REPLOT
  337. !*  
  338. /VIEW, 1 ,WP
  339. /REP,FAST   
  340. /REPLOT,RESIZE  
  341. /VIEW,1,1,2,3   
  342. /ANG,1  
  343. /REP,FAST   
  344. FINISH  
  345. ! /EXIT,NOSAV
复制代码
回复
分享到:

使用道具 举报

发表于 2013-8-31 15:29 | 显示全部楼层
很好的例子,就是没有注释,看起来有点费劲
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-13 14:14 , Processed in 0.062987 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表