www.kxcad.net Home > CAE Index > ANSYS Index > Release 11.0 Documentation for ANSYS
You can perform the example static analysis of an Allen wrench using the ANSYS commands shown below instead of GUI choices. Items prefaced with an exclamation point (!) are comments.
/FILNAME,pm02! Jobname to use for all subsequent files
/TITLE,Static analysis of an Allen wrench
/UNITS,SI ! Reminder that the SI system of units is used
/SHOW ! Specify graphics driver for interactive run; for batch
! run plots are written to pm02.grph
! Define parameters for future use
EXX=2.07E11 ! Young's modulus (2.07E11 Pa = 30E6 psi)
W_HEX=.01 ! Width of hex across flats (.01m=.39in)
*AFUN,DEG ! Units for angular parametric functions
W_FLAT=W_HEX*TAN(30) ! Width of flat
L_SHANK=.075 ! Length of shank (short end) (.075m=3.0in)
L_HANDLE=.2 ! Length of handle (long end) (.2m=7.9 in)
BENDRAD=.01 ! Bend radius of Allen wrench (.01m=.39 in)
L_ELEM=.0075 ! Element length (.0075 m = .30 in)
NO_D_HEX=2 ! Number of divisions on hex flat
TOL=25E-6 ! Tolerance for selecting nodes (25e-6 m = .001 in)
/PREP7
ET,1,SOLID45 ! Eight-node brick element
ET,2,PLANE42 ! Four-node quadrilateral (for area mesh)
MP,EX,1,EXX ! Young's modulus for material 1
MP,PRXY,1,0.3 ! Poisson's ratio for material 1
RPOLY,6,W_FLAT ! Hexagonal area
K,7 ! Keypoint at (0,0,0)
K,8,,,-L_SHANK ! Keypoint at shank-handle intersection
K,9,,L_HANDLE,-L_SHANK ! Keypoint at end of handle
L,4,1 ! Line through middle of hex shape
L,7,8 ! Line along middle of shank
L,8,9 ! Line along handle
LFILLT,8,9,BENDRAD ! Line along bend radius between shank and handle
/VIEW,,1,1,1 ! Isometric view in window 1
/ANGLE,,90,XM ! Rotates model 90 degrees about X
/PNUM,LINE,1 ! Line numbers turned on
LPLOT
/PNUM,LINE,0 ! Line numbers off
L,1,4 ! Hex section is cut into two quadrilaterals
ASBL,1,7,,,KEEP ! to satisfy mapped meshing requirements for bricks
CM,BOTAREA,AREA ! Component name BOTAREA for the two areas
! Generate area mesh for later drag
LESIZE,1,,,NO_D_HEX ! Number of divisions along line 1
LESIZE,2,,,NO_D_HEX
LESIZE,6,,,NO_D_HEX
TYPE,2 ! PLANE42 elements to be meshed first
MSHAPE,0,2D ! Mapped quad mesh
MSHKEY,1
SAVE ! Save database before meshing
AMESH,ALL
/TITLE,Meshed hex wrench end to be used in vdrag
EPLOT
! Now drag the 2-D mesh to produce 3-D elements
TYPE,1 ! Type pointer set to SOLID45
ESIZE,L_ELEM ! Element size
VDRAG,2,3,,,,,8,10,9 ! Drag operation to create 3-D mesh
/TYPE,,HIDP ! Precise hidden line display
/TITLE,Meshed hex wrench
EPLOT
CMSEL,,BOTAREA ! Select BOTAREA component and
ACLEAR,ALL ! delete the 2-D elements
ASEL,ALL
FINISH
! Apply loads and obtain the solution
/SOLU
ANTYPE,STATIC ! Static analysis (default)
/TITLE,Allen wrench -- Load step 1
! First fix all nodes around bottom of shank
CMSEL,,BOTAREA ! Bottom areas of shank
LSEL,,EXT ! Exterior lines of those areas
NSLL,,1 ! Nodes on those lines
D,ALL,ALL ! Displacement constraints
LSEL,ALL
/PBC,U,,1 ! Displacement symbols turned on
/TITLE,Boundary conditions on end of wrench
NPLOT
!Now apply pressure on handle to represent 100-N (22.5-lb) finger force
ASEL,,LOC,Y,BENDRAD,L_HANDLE ! Areas on handle
ASEL,R,LOC,X,W_FLAT/2,W_FLAT ! Two areas on one side of handle...
NSLA,,1 ! ...and all corresponding nodes
NSEL,R,LOC,Y,L_HANDLE+TOL,L_HANDLE-(3.0*L_ELEM)-TOL ! Reselects nodes at
! back end of handle (3 element lengths)
*GET,MINYVAL,NODE,,MNLOC,Y ! Get minimum Y value of selected nodes
*GET,MAXYVAL,NODE,,MXLOC,Y ! Get maximum Y value of selected nodes
PTORQ=100/(W_HEX*(MAXYVAL-MINYVAL)) ! Pressure equivalent to 100 N
SF,ALL,PRES,PTORQ ! PTORQ pressure on all selected nodes
ALLSEL ! Restores full set of all entities
/PSF,PRES,,2 ! Pressure symbols turned on
/TITLE,Boundary conditions on wrench for load step 1
NPLOT
LSWRITE ! Writes first load step
/TITLE, Allen wrench -- load step 2
! Downward pressure on top of handle, representing 20-N (4.5 -lb) force
PDOWN=20/(W_FLAT*(MAXYVAL-MINYVAL))
ASEL,,LOC,Z,-(L_SHANK+(W_HEX/2)) ! Area on top flat of handle...
NSLA,,1 ! ...and all corresponding nodes
NSEL,R,LOC,Y,L_HANDLE+TOL,L_HANDLE-(3.0*L_ELEM)-TOL ! Reselects nodes at
! back end of handle (3 element lengths)
SF,ALL,PRES,PDOWN ! PDOWN pressure at all selected nodes
ALLSEL
/TITLE,Boundary conditions on wrench for load step 2
NPLOT
LSWRITE ! Writes second load step
SAVE ! Save database before solution
LSSOLVE,1,2 ! Initiates solution for load step files 1 and 2
FINISH
!Review the results
/POST1
SET,1 ! Reads load step 1 results
PRRSOL ! Reaction solution listing
/PBC,DEFA ! No BC symbols
/PSF,DEFA ! No surface load symbols
/EDGE,,1 ! Edges only, no interior element outlines
/TITLE,Deformed allen wrench caused by torque
PLDISP,2 ! Deformed shape overlaid with undeformed edge plot
/GSAVE,pldisp,gsav ! Saves graphics specifications on pldisp.gsav
/PLOPTS,INFO,ON ! Turns on entire legend column
/PLOPTS,LEG1,OFF ! Turns off legend header
/ANGLE,,120,YM,1 ! Additional rotation about model Y (to see high stress areas)
/TITLE,Stress intensity contours caused by torque
PLNSOL,S,INT ! Stress intensity contours
/GSAVE,plnsol,gsav ! Saves graphics specifications to plnsol.gsav
SET,2 ! Reads load step 2 results
PRRSOL ! Reaction solution listing
/GRESUME,pldisp,gsav ! Resumes graphics specifications from pldisp.gsav
/TITLE,Deformed allen wrench caused by torque and force
PLDISP,2
/GRESUME,plnsol,gsav ! Resumes graphics specifications from plnsol.gsav
/TITLE,Stress intensity contours caused by torque and force
PLNSOL,S,INT
WPOF,,,-0.067 ! Offset the working plane for cross-section view
/TYPE,1,5 ! Capped hidden display
/CPLANE,1 ! Cutting plane defined to use the WP
/VIEW, 1 ,WP ! View will be normal to the WP
/DIST,1,.01 ! Zoom in on the cross section
/TITLE,Cross section of the allen wrench under torque and force loading
PLNSOL,S,INT
FINISH
/EXIT,ALL