命令流我也复制过来
R = 200 ! RADIUS OF CYLINDER (mm)
/PREP7
SMRT,OFF
ET,1,PLANE182, , ,2 ! 2-D PLANE-STRAIN 4-NODE STRUCTURAL SOLID
KEYOPT,1,6,1 ! Mixed U-P FORMULATION
ET,2,TARGE169 ! 2-D TARGET ELEMENT
ET,3,CONTA171 ! 2-D CONTACT ELEMENT
KEYOPT,3,5,4
KEYOPT,3,10,1
MP,EX,1,2.82 ! YOUNG'S MODULUS [MPA]
MP,NUXY,1,0.49967 ! POISSON'S RATIO
C10 = 0.293
C01 = 0.177
NU1 = 0.49967
DD = 2*(1-2*NU1)/(C10+C01)
TB,HYPER,1,1,2,MOONEY
TBDATA,1,C10,C01,DD
CSYS,1 ! SWITCH TO CYLINDRICAL C.S.
K,1 ! DEFINE KEYPOINTS
K,2,R,-90
K,3,R
K,4,(0.5*R),-90
K,5,(0.6*R),-45
K,6,(0.5*R)
K,7,R,-45
L,2,7
L,7,3
CSYS,0 ! SWITCH TO CARTESIAN C.S.
A,2,7,5,4
A,7,3,6,5
A,4,5,6,1
TSHAPE,LINE
K,1001,-2*R,-R
K,1002,2*R,-R
L,1002,1001
SAVE,temp,db ! SAVE MODEL FOR SECOND ANALYSIS
TYPE,1
AMESH,ALL ! MESH ALL AREAS
REAL,2
TYPE,2
LMESH,10
LSEL,S,LINE,,1,2,1
TYPE,3
LMESH,ALL
save,cont171,db
FINI
*CREATE,SOLV2D,MAC ! MACRO TO SOLVE MODEL
/SOLU
!SOLCONTROL,0
ANTYPE,STATIC
NSEL,S,LOC,X
D,ALL,UX
NSEL,S,LOC,Y
CP,1,UY,ALL
*GET,NCEN,NODE,,NUM,MIN
ALLSEL
!CNVTOL,F,,,,-1
NLGEOM,ON ! INCLUDE LARGE DEFORMATION EFFECTS
NSUBST,6 ! SPECIFY NUMBER OF SUBSTEPS IN LOAD STEP
OUTRES,,1 ! WRITE SOLUTION FOR EVERY SUBSTEP
D,NCEN,UY,-100 ! APPLY DISPLACEMENT UY = -100 TO COUPLED NODES
!NROPT,FULL,,OFF
SOLVE
FINISH
*END
SOLV2D ! USE MACRO SOLVE2D
*CREATE,PLOTS,MAC ! MACRO FOR POST-PROCESSING
/POST1
/DSCALE,1,1
PLDISP,1 ! PLOT DISPLACED SHAPE
FINISH
/POST26
/AXLAB,Y,FORCE
/AXLAB,X,DISPLACEMENT
NSOL,2,NCEN,U,Y
RFORCE,3,NCEN,F,Y
PROD,2,2,,,,,,-2
PROD,3,3,,,,,,-2
XVAR,2
PLVAR,3 ! PLOT DISPLACEMENT VS FORCE
PRVAR,2,3 ! PRINT DISPLACEMENT, FORCE
*GET,F1,VARI,3,RTIME,.5
*GET,F2,VARI,3,RTIME,1
*DIM,LABEL,CHAR,2,2
*DIM,VALUE,,2,3
LABEL(1,1) = 'F (N) @ ','F (N) @ '
LABEL(1,2) = '.1','.2'
*VFILL,VALUE(1,1),DATA,250,1400
*VFILL,VALUE(1,2),DATA,F1,F2
*VFILL,VALUE(1,3),DATA,ABS(F1/250),ABS(F2/1400)
FINISH
*END
PLOTS ! USE MACRO PLOTS
SAVE,TABLE_1
RESUME,temp,db
/PREP7
ALLSEL
ET,1,PLANE183, , ,2 ! 2-D PLANE-STRAIN 8-NODE STRUCTURAL SOLID
KEYOPT,1,6,1 ! Mixed U-P FORMULATION
ET,2,TARGE169 ! 2-D TARGET ELEMENT
ET,3,CONTA172 ! 2-D CONTACT ELEMENT
KEYOPT,3,5,4
KEYOPT,3,10,1
TYPE,1
AMESH,ALL
REAL,2
TYPE,2
LMESH,10
LSEL,S,LINE,,1,2,1
TYPE,3
LMESH,ALL
save,cont172,db
FINISH
SOLV2D ! USE MACRO TO OBTAIN SOLUTION
PLOTS ! USE MACRO TO POSTPROCESS
SAVE,TABLE_2
/PREP7
RESUME,temp,db
ET,5,SOLID185 ! 3-D 8-NODE STRUCTURAL SOLID
KEYOPT,5,6,1 ! Mixed U-P FORMULATION
ET,2,TARGE170
ET,3,CONTA173 ! 3-D 4 NODE CONTACT ELEMENT
KEYOPT,3,10,1
KEYOPT,3,5,4
ET,4,200,6 ! 2-D 4 NODED MESH200
LDELETE,10,,,1
ALLSEL
CSYS,0
K,1001,-.1*R,-R,-.1*R
K,1002,2*R,-R,-.1*R
K,1003,2*R,-R,8*R
K,1004,-.1*R,-R,8*R
A,1004,1003,1002,1001
TSHAPE,TRI
SAVE,temp3d,db
ESIZE,,1
REAL,2
TYPE,2
AMESH,4
REAL,1
TYPE,4
ESIZE,,4
AMESH,1,3,1
TYPE,1
ESIZE,,4
VEXT,1,3,1,,,1
CSYS,1
ASEL,S,LOC,X,R
TYPE,3
REAL,2
AMESH,ALL
LSEL,ALL
NSEL,ALL
CSYS,0
save,cont173,db
FINISH
*CREATE,SOLV3D,MAC ! MACRO TO SOLVE MODEL
/SOLUTION
ANTYPE,STATIC
D,ALL,UZ ! CONSTRAIN ALL IN Z (PLANE STRAIN)
NSEL,S,LOC,X
D,ALL,UX
NSEL,S,LOC,Y
CP,1,UY,ALL
*GET,NCEN,NODE,,NUM,MIN
NSEL,ALL
!CNVTOL,F,1
NLGEOM,ON ! INCLUDE LARGE DEFORMATION EFFECTS
NSUBST,6 ! SPECIFY NUMBER OF SUBSTEPS IN LOAD STEP
!NROPT,FULL,,OFF
OUTRES,,1 ! WRITE SOLUTION FOR EVERY SUBSTEP
D,NCEN,UY,-100 ! APPLY DISPLACEMENT UY = -100 TO COUPLED NODES
SOLVE
FINISH
*END
SOLV3D ! USE MACRO TO OBTAIN SOLUTION
PLOTS ! USE MACRO TO POSTPROCESS
SAVE,TABLE_3
/PREP7
RESUME,temp3d,db
ET,1,SOLID186 ! 3-D 20-NODE STRUCTURAL SOLID
KEYOPT,1,6,1 ! Mixed U-P FORMULATION
ET,2,TARGE170
ET,3,CONTA174
KEYOPT,3,10,1
KEYOPT,3,5,4
KEYOPT,3,7,1
VEXT,1,3,1,,,1
TYPE,1
VMESH,ALL
REAL,2
TYPE,3
CSYS,1
ASEL,S,LOC,X,R
AMESH,ALL
ESIZE,,1
TYPE,2
ASEL,ALL
AMESH,4
ALLSEL
CSYS,0
save,cont174,db
FINI
SOLV3D
PLOTS
SAVE,TABLE_4
!* THE INPUT BELOW IS SAME AS INPUT ABOVE BUT WITH K(2)=3 OF CONTAC171-174 ELEMENTS...
RESUME,cont171,db
/PREP7
KEYOPT,3,4,2 ! ON NODAL POINT - NORMAL TO TARGET SURFACE
KEYOPT,3,2,3 ! LAGRANGE MULTIPLIER ON CONTACT NORMAL AND PENALTY ON TANGENT
FINISH
SOLV2D ! USE MACRO TO OBTAIN SOLUTION
PLOTS ! USE MACRO TO POSTPROCESS
SAVE,TABLE_5
RESUME,cont172,db
/PREP7
KEYOPT,3,4,2 ! ON NODAL POINT - NORMAL TO TARGET SURFACE
KEYOPT,3,2,3 ! LAGRANGE MULTIPLIER ON CONTACT NORMAL AND PENALTY ON TANGENT
FINISH
SOLV2D ! USE MACRO TO OBTAIN SOLUTION
PLOTS ! USE MACRO TO POSTPROCESS
SAVE,TABLE_6
RESUME,cont173,db
/PREP7
KEYOPT,3,4,2 ! ON NODAL POINT - NORMAL TO TARGET SURFACE
KEYOPT,3,2,3 ! LAGRANGE MULTIPLIER ON CONTACT NORMAL AND PENALTY ON TANGENT
FINISH
SOLV3D ! USE MACRO TO OBTAIN SOLUTION
PLOTS ! USE MACRO TO POSTPROCESS
SAVE,TABLE_7
RESUME,cont174,db
/PREP7
KEYOPT,3,4,2 ! ON NODAL POINT - NORMAL TO TARGET SURFACE
KEYOPT,3,2,3 ! LAGRANGE MULTIPLIER ON CONTACT NORMAL AND PENALTY ON TANGENT
FINISH
SOLV3D
PLOTS
SAVE,TABLE_8
/COM
/OUT,vm211,vrt
RESUME,TABLE_1
/COM,------------------- VM211 RESULTS COMPARISON --------------
/COM,
/COM, | TARGET | ANSYS | RATIO
/COM,
/COM,RESULTS USING PLANE182:
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.2,' ',F10.2,' ',1F5.3)
/NOPR
RESUME,TABLE_2
/GOPR
/COM,
/COM,RESULTS USING PLANE183:
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.2,' ',F10.2,' ',1F5.3)
/NOPR
RESUME,TABLE_3
/GOPR
/COM,
/COM,RESULTS USING SOLID185:
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.2,' ',F10.2,' ',1F5.3)
/NOPR
RESUME,TABLE_4
/GOPR
/COM,
/COM,RESULTS USING SOLID186:
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.2,' ',F10.2,' ',1F5.3)
/NOPR
RESUME,TABLE_5
/GOPR
/COM,
/COM,RESULTS USING PLANE182 WITH KEYOPT(2)=3 OF CONTAC171:
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.2,' ',F10.2,' ',1F5.3)
/NOPR
RESUME,TABLE_6
/GOPR
/COM,
/COM,RESULTS USING PLANE183 WITH KEYOPT(2)=3 OF CONTAC172:
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.2,' ',F10.2,' ',1F5.3)
/NOPR
RESUME,TABLE_7
/GOPR
/COM,
/COM,RESULTS USING SOLID185 WITH KEYOPT(2)=3 OF CONTAC173:
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.2,' ',F10.2,' ',1F5.3)
/NOPR
RESUME,TABLE_8
/GOPR
/COM,
/COM,RESULTS USING SOLID186 WITH KEYOPT(2)=3 OF CONTAC174:
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.2,' ',F10.2,' ',1F5.3)
/COM,-----------------------------------------------------------
/COM,
/OUT
FINISH
*LIST,vm211,vrt
/DELETE,PLOTS,MAC
/DELETE,SOLV2D,MAC
/DELETE,SOLV3D,MAC
/DELETE,TABLE_1
/DELETE,TABLE_2
/DELETE,TABLE_3
/DELETE,TABLE_4
/DELETE,TABLE_5
/DELETE,TABLE_6
/DELETE,TABLE_7
/DELETE,TABLE_8
/DELETE,temp,db
/DELETE,temp3d,db
/DELETE,cont171,db
/DELETE,cont172,db
/DELETE,cont173,db
/DELETE,cont174,db |