/COM,ANSYS MEDIA REL. 2024R2 (05/10/2024) REF. VERIF. MANUAL: REL. 2024R2
/VERIFY,VM37
/PREP7
smrt,off
/TITLE, VM37, ELONGATION OF A SOLID BAR
/COM INTROD. TO STRESS ANALYSIS, HARRIS, 1ST PRINTING, PAGE 237, PROB. 4
/COM USING 3-D STRUCTURAL SOLID45 ELEMENTS
ANTYPE,STATIC
ET,1,SOLID45
MP,EX,1,10.4E6
MP,NUXY,1,.3
K,1,1,,1 ! DEFINE KEYPOINTS
K,2,-1,,1
K,3,-1,,-1
K,4,1,,-1
K,5,.5,10,.5
K,6,-.5,10,.5
K,7,-.5,10,-.5
K,8,.5,10,-.5
V,1,2,3,4,5,6,7,8 ! DEFINE VOLUME
LSEL,S,LINE,,5,11,2 ! SELECT LINES
LESIZE,ALL,,,7 ! DEVIDE SELECTED LINES BY 7 DIVISIONS
LSEL,ALL ! SELECT ALL LINES
ESIZE,,1 ! USE 1 ELEMENT PER LINE DIVISION
/OUT,SCRATCH
VMESH,1 ! MESH THE VOLUME
/OUT
OUTPR,BASIC,ALL
NSEL,S,LOC,Y,0 ! APPLY BOUNDARY CONDITIONS AT THE BASE OF THE MODEL
D,ALL,ALL ! FIX ALL DEGREES OF FREEDOM AT SELECTED NODE SET
NSEL,ALL
NSEL,S,LOC,Y,10 ! APPLY LOAD ON FREE END OF THE MODEL
SF,,PRES,-10000
NSEL,ALL
SAVE
FINISH
/SOLU
/OUT,SCRATCH
SOLVE
/OUT,
FINISH
*CREATE,RES3D,MAC ! CREATE MACRO TO RETRIEVE RESULTS
/POST1
ETABLE,SIGY,S,Y ! RETRIEVE CENTROIDAL SY
/VIEW,1,1 ! CHANGE VIEW TO LOOKING DOWN X-AXIS
/VUP,1,-Y ! REORIENT MODEL ON SCREEN
!/CLABEL,1,1 ! LABEL CONTOUR LINES
!/CVAL,1,2700,3500,4300,5100,5900,6700,7500,8300 ! USER DEFINED CONTOURS
NSLE,S ! SELECT NODES ATTACHED TO ELEMENTS
PLNSOL,S,Y ! DISPLAY AXIAL STRESS
ESEL,S,ELEM,,4 ! SELECT MID-LENGTH ELEMENT
PRETAB,SIGY ! PRINT OUT STORED STRESS ITEM
PRNSOL,S,COMP ! PRINT NODAL STRESSES
ESEL,ALL ! SELECT ALL ELEMENTS
NSEL,S,LOC,Y,10 ! SELECT ALL NODES AT Y=10 (FREE END OF MODEL)
PRNSOL,DOF ! PRINT OUT DISPLACEMENTS OF NODES
NSEL,ALL
/NOPR
MID_NODE = NODE(0,5,0)
MID_ELM = ENEARN(MID_NODE)
BOT_NODE = NODE (0,10,0)
*GET,DEF,NODE,BOT_NODE,U,Y
*GET,STRSS,ELEM,MID_ELM,ETAB,SIGY
*DIM,LABEL,CHAR,2,2
*DIM,VALUE_C1,,2,3
LABEL(1,1) = 'MAX DEF ','SIGY MID'
LABEL(1,2) = '(in) ','_ELM psi'
*VFILL,VALUE_C1(1,1),DATA,.0048077,4444
*VFILL,VALUE_C1(1,2),DATA,DEF,STRSS
*VFILL,VALUE_C1(1,3),DATA,ABS(DEF/.0048077) ,ABS(STRSS/4444)
/GOPR
FINISH
*END
RES3D ! EXECUTE MACRO TO RETRIEVE RESULTS
SAVE,TABLE_1
/CLEAR, NOSTART ! CLEAR DATABASE FOR SECOND SOLUTION
/TITLE, VM37, ELONGATION OF A SOLID BAR
/COM USING 3-D STRUCTURAL SOLID185 ELEMENTS
/PREP7
RESUME
ET,1,SOLID185, ,2 ! ANALYZE AGAIN USING 3-D SOLID185
FINISH
/SOLU
/OUT,SCRATCH
SOLVE
FINISH
/OUT,
RES3D ! EXECUTE MACRO TO RETRIEVE RESULTS
SAVE,TABLE_2
/CLEAR, NOSTART ! CLEAR DATABASE FOR THIRD SOLUTION
/TITLE, VM37, ELONGATION OF A SOLID BAR
/COM USING 3-D STRUCTURAL SOLSH190 ELEMENTS
/PREP7
RESUME
ET,1,SOLSH190 ! ANALYZE AGAIN USING 3-D SOLSH190
FINISH
/SOLU
/OUT,SCRATCH
SOLVE
FINISH
/OUT,
RES3D ! EXECUTE MACRO TO RETRIEVE RESULTS
SAVE,TABLE_3
/NOPR
RESUME,TABLE_1
/GOPR
/COM
/OUT,vm37,vrt
/COM,------------------- VM37 RESULTS COMPARISON ---------------
/COM,
/COM, | TARGET | Mechanical APDL | RATIO
/COM,
/COM,RESULTS FOR SOLID45:
/COM,
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE_C1(1,1),VALUE_C1(1,2),VALUE_C1(1,3)
(1X,A8,A8,' ',F12.7,' ',F16.7,' ',1F15.3)
/NOPR
RESUME,TABLE_2
/GOPR
/COM,
/COM,RESULTS FOR SOLID185:
/COM,
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE_C1(1,1),VALUE_C1(1,2),VALUE_C1(1,3)
(1X,A8,A8,' ',F12.7,' ',F16.7,' ',1F15.3)
/NOPR
RESUME,TABLE_3
/GOPR
/COM,
/COM,RESULTS FOR SOLSH190:
/COM,
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE_C1(1,1),VALUE_C1(1,2),VALUE_C1(1,3)
(1X,A8,A8,' ',F12.7,' ',F16.7,' ',1F15.3)
/COM,-----------------------------------------------------------
/OUT
FINISH
*LIST,vm37,vrt
/DELETE,RES3D,MAC
FINISH