/COM,ANSYS MEDIA REL. 2024R2 (05/10/2024) REF. VERIF. MANUAL: REL. 2024R2
/VERIFY,VM143
/TITLE, VM143, FRACTURE MECHANICS STRESS INTENSITY FOR CRACK IN A FINITE WIDTH PLATE
*CREATE,FRACT,MAC
! MACRO TO CREATE 3D SOLID95 CRACK TIP ELEMENTS FROM 3D SOLID45 ELEMENTS
! MAKE A COMPONENT CONTAINING THE CRACK TIP NODES (CRACKTIP)
! THE CRACK TIP IS BETWEEN NODES K AND O
! SET ELEMENT TYPE TO POINT TO SOLID95
! SET ARG1 TO N (THE TYPE OF THE ELEMENTS AROUND THE CRACK TIP)
!
/NOPR
NSEL,ALL
*GET,N,NODE,,NUM,MAX ! CURRENT MAXIMUM NODE NUMBER
CMSEL,S,CRACKTIP ! SELECT THE TIP NODES
ESLN ! ANY ELEMENTS ATTACHED
*GET,ELMAX,ELEM,,NUM,MAX ! CURRENT MAXIMUM ELEMENT NUMBER
*DO,IEL,1,ELMAX ! LOOP ON MAX ELEMENT
ELMI=IEL
*IF,ELMI,LE,0,EXIT ! NO MORE SELECTED
*GET,ELTYPE,ELEM,ELMI,ATTR,TYPE ! GET ELEMENT TYPE
*IF,ELTYPE,NE,ARG1,CYCLE ! CHECK FOR SELECTED ELEMENT
N3 = NELEM(ELMI,3) ! GET NODE 3 (K)
*IF,NSEL(N3),LE,0,CYCLE ! IT MUST BE SELECTED
N7 = NELEM(ELMI,7) ! GET NODE 7 (L)
*IF,NSEL(N7),LE,0,CYCLE ! IT MUST ALSO BE SELECTED
N1 = NELEM(ELMI,1) ! GET NODE 1 (I)
N2 = NELEM(ELMI,2) ! GET NODE 2 (J)
N5 = NELEM(ELMI,5) ! GET NODE 5 (M)
N6 = NELEM(ELMI,6) ! GET NODE 6 (N)
X3 = 0.75*NX(N3) ! WEIGHTED POSITION OF N3
Y3 = 0.75*NY(N3)
Z3 = 0.75*NZ(N3)
X = 0.25*NX(N2) + X3 ! QUARTER POINT LOCATION ( NODE (R) )
Y = 0.25*NY(N2) + Y3
Z = 0.25*NZ(N2) + Z3
N = N + 1 ! NEXT NODE
N10 = N
N,N10,X,Y,Z ! MIDSIDE NODE LOCATION
X = 0.25*NX(N1) + X3
Y = 0.25*NY(N1) + Y3
Z = 0.25*NZ(N1) + Z3
N = N + 1
N12= N
N,N12,X,Y,Z
X7 = 0.75*NX(N7)
Y7 = 0.75*NY(N7)
Z7 = 0.75*NZ(N7)
X = 0.25*NX(N6) + X7
Y = 0.25*NY(N6) + Y7
Z = 0.25*NZ(N6) + Z7
N = N + 1
N14 = N
N,N14,X,Y,Z
X = 0.25*NX(N5) + X7
Y = 0.25*NY(N5) + Y7
Z = 0.25*NZ(N5) + Z7
N = N + 1
N16 = N
N,N16,X,Y,Z
N4=N3
N8=N7
NSEL,ALL
TYPE,3
EN,ELMI,N1,N2,N3,N4,N5,N6,N7,N8 ! REDEFINE THE ELEMENT
EMORE,0,N10,0,N12,0,N14,0,N16
EMORE,
*ENDDO
CMSEL,U,CRACKTIP ! UNSELECT THE TIP NODES
NUMMRG,NODE ! MERGE MIDSIDE NODES
NSEL,ALL ! SELECT ALL ELEMENTS
ESEL,ALL ! SELECT ALL ELEMENTS
/GOPR
*END
/PREP7
SMRT,OFF
C*** BROWN AND SRAWLEY, ASTM SPECIAL TECHNICAL PUBLICATION NO. 410.
/COM, ****** CRACK IN 3-DIMENSIONS USING SOLID45 AND SOLID95
ANTYPE,STATIC ! STATIC ANALYSIS
ET,1,SOLID45
ET,2,SOLID45 ! ELEMENTS AROUND THE CRACK TIP
ET,3,SOLID95 ! CRACK TIP ELEMENTS CREATED USING MACRO FRACT
MP,EX,1,3E7
MP,NUXY,1,.3
CSYS,1 ! CYLINDRICAL COORDINATE SYSTEM
N,1
NGEN,9,20,1
N,11,.8
N,171,.8,180
FILL,11,171,7,31,20
CSYS,0 ! CARTESIAN COORDINATE SYSTEM
FILL,1,11,9,2,1,9,20,3
N,15,4
N,75,4,5
FILL,15,75,2,35,20
N,155,-1,5
FILL,75,155,3,95,20
N,172,-1
FILL,155,172,5,177,-1,,,.15
FILL,11,15,3,,,7,20,3
NGEN,2,200,1,177,,,,.25
E,2,22,1,1,202,222,201,201
EGEN,8,20,-1
E,2,3,23,22,202,203,223,222
EGEN,8,20,-1
EGEN,9,1,-8
EGEN,5,1,73,78
E,171,151,173,172,371,351,373,372
E,151,131,174,173,351,331,374,373
E,131,132,175,174,331,332,375,374
EGEN,3,1,-1
E,134,135,155,177,334,335,355,377
TYPE,2
EMODIF,1 ! MODIFY ELEMENTS 1 TO 8 FROM TYPE,1 TO TYPE,2
*REPEAT,8,1
NUMMRG,NODE ! MERGE COINCIDENT NODES
NSEL,S,LOC,X,0
NSEL,R,LOC,Y,0
CM,CRACKTIP,NODE
/NERR,0 ! TEMPORARILY NO WARNINGS OR ERRORS PRINTOUT
! (IN ORDER TO AVOID WARNING MESSAGES DUE TO
! MIDSIDE NODES LOCATION)
FRACT,2 ! CONVERSION MACRO, TYPE 2 IS SOLID45
! ELEMENTS AROUND THE CRACK TIP
/NERR,DEFA ! TURN ON THE WARNINGS OR ERRORS PRINTOUT
/OUTPUT
OUTPR,,ALL
OUTPR,VENG,ALL ! STORE STRAIN ENERGY FOR J-INTEGRAL EVALUATION
NSEL,S,LOC,X,-1
DSYM,SYMM,X ! SYMMETRIC B.C.'S AT X = -1
NSEL,S,LOC,X,0,4
NSEL,R,LOC,Y,0
DSYM,SYMM,Y ! SYMMETRIC B.C.'S AT Y = 0 EXCEPT CRACK NODES
NSEL,ALL
D,ALL,UZ ! Z CONSTRAINTS FOR PLANE STRAIN PROBLEM
NSEL,S,LOC,Y,5
SF,ALL,PRES,-.5641895
NSEL,ALL
ESEL,ALL
FINISH
/OUTPUT,SCRATCH
/SOLU
SOLVE
FINISH
/OUTPUT
/POST1
ETABLE,SENE,SENE ! RETRIEVE STRAIN ENERGY PER ELEMENT
ETABLE,VOLU,VOLU ! RETRIEVE VOLUME PER ELEMENT
C*** IN POST1 DETERMINE KI (STRESS INTENSITY FACTOR) USING KCALC !**
PATH,KI1,3,,48 ! DEFINE PATH WITH NAME = "KI1"
PPATH,1,1 ! DEFINE PATH POINTS BY NODE
PPATH,2,406
PPATH,3,162
KCALC,,,1 ! COMPUTE KI FOR A HALF-MODEL WITH SYMM. B.C.
*GET,KI1,KCALC,,K,1 ! GET KI AS PARAMETER KI1
!********************************************************************************
!************************** J-INTEGRAL USER FILE *****************************
!*******************************************************************************
! ****NOTE:- IN GENERAL USAGE, THE USER FILE WOULD BE AVAILABLE IN THE
! LOCAL DIRECTORY RATHER THAN BEING CREATED IN THE INPUT
!*******************************************************************************
*CREATE,JIN1
STINFC ! DATA BLOCK NAME
SEXP,W,SENE,VOLU,1,-1 ! CALCULATE STRAIN ENERGY DENSITY
PATH,JINT,4,50,48 ! DEFINE PATH WITH NAME = "JINT"
PPATH,1,ARG1 ! DEFINE PATH POINTS BY NODE
PPATH,2,ARG2
PPATH,3,ARG3
PPATH,4,ARG4
PDEF,W,ETAB,W ! PUT STRAIN ENERGY DENSITY ON THE PATH
PCALC,INTG,J,W,YG ! INTEGRATE ENERGY W.R.T. GLOBAL Y
*GET,JA,PATH,,LAST,J ! GET FINAL VALUE OF INTEGRAL FOR 1ST TERM OF J
PDEF,CLEAR ! CLEAR OLD PATH VARIABLES
PVECT,NORM,NX,NY,NZ ! DEFINE THE PATH UNIT NORMAL VECTOR
PDEF,INTR,SX,SX ! PUT STRESS SX ON THE PATH
PDEF,INTR,SY,SY ! PUT STRESS SY ON THE PATH
PDEF,INTR,SXY,SXY ! PUT STRESS SXY ON THE PATH
PCALC,MULT,TX,SX,NX ! CALCULATE TRACTION TX
PCALC,MULT,C1,SXY,NY ! TX = SX*NX + SXY*NY
PCALC,ADD,TX,TX,C1
PCALC,MULT,TY,SXY,NX ! CALCULATE TRACTION TY
PCALC,MULT,C1,SY,NY ! TY = SXY*NX + SY*NY
PCALC,ADD,TY,TY,C1
*GET,DX,PATH,,LAST,S ! DEFINE PATH SHIFT AS 1% OF PATH LENGTH
DX=DX/100
PCALC,ADD,XG,XG,,,,-DX/2 ! SHIFT PATH FROM X TO X-DX/2 (GLOBAL X DIR.)
PDEF,INTR,UX1,UX ! DEFINE UX AT X-DX
PDEF,INTR,UY1,UY ! DEFINE UY AT X-DX
PCALC,ADD,XG,XG,,,,DX ! SHIFT PATH FROM X-DX/2 TO X+DX/2
PDEF,INTR,UX2,UX ! DEFINE UX AT X+DX
PDEF,INTR,UY2,UY ! DEFINE UY AT X+DX
PCALC,ADD,XG,XG,,,,-DX/2 ! SHIFT PATH BACK TO ORIGINAL POSITION
C=(1/DX)
PCALC,ADD,C1,UX2,UX1,C,-C ! CALCULATE DERIVATIVE DUX/DX
PCALC,ADD,C2,UY2,UY1,C,-C ! CALCULATE DERIVATIVE DUY/DX
PCALC,MULT,C1,TX,C1 ! DEFINE INTEGRAND
PCALC,MULT,C2,TY,C2 ! = TX*DUX/DX + TY*DUY/DX
PCALC,ADD,C1,C1,C2
PCALC,INTG,J,C1,S ! FORM SECOND INTEGRAL (W.R.T. PATH LENGTH S)
*GET,JB,PATH,,LAST,J ! GET FINAL VALUE OF INTEGRAL FOR 2ND TERM OF J
JINT=2*(JA-JB) ! ADD BOTH TERMS AND DOUBLE FOR HALF MODELS
PDEF,CLEAR ! CLEAR PATH VARIABLES
*END
C**************** IN POST1 DETERMINE KI FROM J-INTEGRAL !***********************
CON1=30E6/(1-(0.3*0.3)) ! J-TO-KI CONVERSION FACTOR
*ULIB,JIN1 ! ASSIGN LOCAL FILE JIN1 AS USER FILE
*USE,STINFC,4,45,125,164 ! USE DATA BLOCK STINFC AND GIVE PATH NODES
KI2=SQRT(CON1*JINT) ! CALCULATE KI FROM J
*STATUS,KI1 ! VIEW RESULTS
*STATUS,KI2
*DIM,LABEL,CHAR,2,2
*DIM,VALUE,,2,3
LABEL(1,1) = 'BY DISP ','BY J-'
LABEL(1,2) = 'EXTRP ','INT'
*VFILL,VALUE(1,1),DATA,1.0249,1.0249
*VFILL,VALUE(1,2),DATA,KI1,KI2
*VFILL,VALUE(1,3),DATA,ABS(KI1/1.0249),ABS(KI2/1.0249)
SAVE,TABLE_1
FINISH
/CLEAR, NOSTART ! CLEAR DATABASE FOR 2ND SOLUTION
/PREP7
SMRT,OFF
/TITLE, VM143, FRACTURE MECHANIC STRESS INTENSITY - CRACK IN A FINITE WIDTH PLATE
/COM, ****** CRACK IN 2-DIMENSIONS USING 2-D PLANE183 ******
ET,1,PLANE183,,,2 ! PLANE183 (PLANE STRAIN)
MP,EX,1,30E6
MP,NUXY,1,0.3
K,1 ! DEFINE KEYPOINTS AND LINE SEGMENTS
K,2,4
K,3,4,5
K,4,-1,5
K,5,-1
L,1,2
L,2,3
LESIZE,2,,,4
L,3,4
LESIZE,3,,,4
L,4,5,
LESIZE,4,,,6,.2
L,5,1
ESIZE,,5
KSCON,1,.15,1,8 ! DEFINE CRACK TIP ELEMENT SIZE
AL,1,2,3,4,5
DL,1,1,SYMM ! APPLY SOLID MODEL BOUNDARY CONDITIONS
DL,4,1,SYMM
SFL,3,PRES,-.5641895
AMESH,1
OUTPR,ALL
FINISH
/COM
/OUTPUT,SCRATCH
/SOLU
SOLVE
FINISH
/OUTPUT
/POST1
ETABLE,SENE,SENE ! RETRIEVE STRAIN ENERGY PER ELEMENT
ETABLE,VOLU,VOLU ! RETRIEVE VOLUME PER ELEMENT
C*** IN POST1 DETERMINE KI (STRESS INTENSITY FACTOR) USING KCALC !**
NSEL,S,LOC,Y,0 ! SELECT NODES FOR LPATH COMMAND
NSEL,R,LOC,X,0
*GET,NOD1,NODE,,NUM,MIN
NSEL,A,LOC,Y
NSEL,R,LOC,X,-.005,-.145
*GET,NOD2,NODE,,NUM,MIN
NSEL,A,LOC,Y
NSEL,R,LOC,X,-.145,-.155
*GET,NOD3,NODE,,NUM,MIN
NSEL,ALL
PATH,KI2,3,,48 ! DEFINE PATH WITH NAME = "KI2"
PPATH,1,NOD1 ! DEFINE PATH POINTS BY NODE
PPATH,2,NOD2
PPATH,3,NOD3
KCALC,,,1 ! COMPUTE KI FOR A HALF-MODEL WITH SYMM. B.C.
*GET,KI1,KCALC,,K,1 ! GET KI AS A PARAMETER KI1
C**************** IN POST1 DETERMINE KI FROM J-INTEGRAL !***********************
CSYS,1
NSEL,S,LOC,X,.5,.8 ! SELECT NODES FOR LPATH COMMAND IN STINFC
NSEL,R,LOC,Y,-1,1
*GET,NOD4,NODE,,NUM,MAX
NSEL,S,LOC,X,.5,.8
NSEL,R,LOC,Y,35,55
*GET,NOD5,NODE,,NUM,MAX
NSEL,S,LOC,X,.5,.8
NSEL,R,LOC,Y,120,145
*GET,NOD6,NODE,,NUM,MAX
NSEL,S,LOC,X,.5,.8
NSEL,R,LOC,Y,179,181
*GET,NOD7,NODE,,NUM,MIN
NSEL,ALL
CSYS,0
*USE,STINFC,NOD4,NOD5,NOD6,NOD7 ! USE DATA BLOCK STINFC AND GIVE PATH NODES
CON1=30E6/(1-(0.3*0.3)) ! J-TO-KI CONVERSION FACTOR
KI2=SQRT(CON1*JINT) ! CALCULATE KI FROM J
*STATUS,KI1 ! VIEW RESULTS
*STATUS,KI2
*DIM,LABEL,CHAR,2,2
*DIM,VALUE,,2,3
LABEL(1,1) = 'BY DISP ','BY J-'
LABEL(1,2) = 'EXTRP ','INT'
*VFILL,VALUE(1,1),DATA,1.0249,1.0249
*VFILL,VALUE(1,2),DATA,KI1,KI2
*VFILL,VALUE(1,3),DATA,ABS(KI1/1.0249),ABS(KI2/1.0249)
SAVE,TABLE_2
FINISH
/CLEAR, NOSTART ! CLEAR DATABASE FOR 3ND SOLUTION
/PREP7
SMRT,OFF
/TITLE, VM143, FRACTURE MECHANICS STRESS INTENSITY - CRACK IN A FINITE WIDTH PLATE
/COM, ****** CRACK IN 3-DIMENSIONS USING SOLID185 AND SOLID186
ET,1,SOLID185
ET,2,SOLID185 ! ELEMENTS AROUND THE CRACK TIP
ET,3,SOLID186 ! CRACK TIP ELEMENTS CREATED USING MACRO FRACT
MP,EX,1,3E7
MP,NUXY,1,.3
CSYS,1 ! CYLINDRICAL COORDINATE SYSTEM
N,1
NGEN,9,20,1
N,11,.8
N,171,.8,180
FILL,11,171,7,31,20
CSYS,0 ! CARTESIAN COORDINATE SYSTEM
FILL,1,11,9,2,1,9,20,3
N,15,4
N,75,4,5
FILL,15,75,2,35,20
N,155,-1,5
FILL,75,155,3,95,20
N,172,-1
FILL,155,172,5,177,-1,,,.15
FILL,11,15,3,,,7,20,3
NGEN,2,200,1,177,,,,.25
E,2,22,1,1,202,222,201,201
EGEN,8,20,-1
E,2,3,23,22,202,203,223,222
EGEN,8,20,-1
EGEN,9,1,-8
EGEN,5,1,73,78
E,171,151,173,172,371,351,373,372
E,151,131,174,173,351,331,374,373
E,131,132,175,174,331,332,375,374
EGEN,3,1,-1
E,134,135,155,177,334,335,355,377
TYPE,2
EMODIF,1 ! MODIFY ELEMENTS 1 TO 8 FROM TYPE,1 TO TYPE,2
*REPEAT,8,1
NUMMRG,NODE ! MERGE COINCIDENT NODES
NSEL,S,LOC,X,0
NSEL,R,LOC,Y,0
CM,CRACKTIP,NODE
/NERR,0 ! TEMPORARILY NO WARNINGS OR ERRORS PRINTOUT
! (IN ORDER TO AVOID WARNING MESSAGES DUE TO
! MIDSIDE NODES LOCATION)
FRACT,2 ! CONVERSION MACRO, TYPE 2 IS SOLID185
! ELEMENTS AROUND THE CRACK TIP
/NERR,DEFA ! TURN ON THE WARNINGS OR ERRORS PRINTOUT
/OUTPUT
OUTPR,,ALL
OUTPR,VENG,ALL ! STORE STRAIN ENERGY FOR J-INTEGRAL EVALUATION
NSEL,S,LOC,X,-1
DSYM,SYMM,X ! SYMMETRIC B.C.'S AT X = -1
NSEL,S,LOC,X,0,4
NSEL,R,LOC,Y,0
DSYM,SYMM,Y ! SYMMETRIC B.C.'S AT Y = 0 EXCEPT CRACK NODES
NSEL,ALL
D,ALL,UZ ! Z CONSTRAINTS FOR PLANE STRAIN PROBLEM
NSEL,S,LOC,Y,5
SF,ALL,PRES,-.5641895
NSEL,ALL
ESEL,ALL
FINISH
/OUTPUT,SCRATCH
/SOLU
SOLVE
FINISH
/OUTPUT
/POST1
ETABLE,SENE,SENE ! RETRIEVE STRAIN ENERGY PER ELEMENT
ETABLE,VOLU,VOLU ! RETRIEVE VOLUME PER ELEMENT
C*** IN POST1 DETERMINE KI (STRESS INTENSITY FACTOR) USING KCALC !**
PATH,KI1,3,,48 ! DEFINE PATH WITH NAME = "KI1"
PPATH,1,1 ! DEFINE PATH POINTS BY NODE
PPATH,2,406
PPATH,3,162
KCALC,,,1 ! COMPUTE KI FOR A HALF-MODEL WITH SYMM. B.C.
*GET,KI1,KCALC,,K,1 ! GET KI AS PARAMETER KI1
C**************** IN POST1 DETERMINE KI FROM J-INTEGRAL !***********************
CON1=30E6/(1-(0.3*0.3)) ! J-TO-KI CONVERSION FACTOR
*ULIB,JIN1 ! ASSIGN LOCAL FILE JIN1 AS USER FILE
*USE,STINFC,4,45,125,164 ! USE DATA BLOCK STINFC AND GIVE PATH NODES
KI2=SQRT(CON1*JINT) ! CALCULATE KI FROM J
*STATUS,KI1 ! VIEW RESULTS
*STATUS,KI2
*DIM,LABEL,CHAR,2,2
*DIM,VALUE,,2,3
LABEL(1,1) = 'BY DISP ','BY J-'
LABEL(1,2) = 'EXTRP ','INT'
*VFILL,VALUE(1,1),DATA,1.0249,1.0249
*VFILL,VALUE(1,2),DATA,KI1,KI2
*VFILL,VALUE(1,3),DATA,ABS(KI1/1.0249),ABS(KI2/1.0249)
SAVE,TABLE_3
FINISH
RESUME,TABLE_1
/COM
/OUT,vm143,vrt
/COM,------------------- VM143 RESULTS COMPARISON --------------
/COM,
/COM, | TARGET | Mechanical APDL | RATIO
/COM,
/COM,USING SOLID95 AND SOLID45 (3-D ANALYSIS)
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.4,' ',F12.4,' ',1F15.3)
/NOPR
RESUME,TABLE_2
/GOPR
/COM,
/COM,USING PLANE183 (2-D ANALYSIS)
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.4,' ',F12.4,' ',1F15.3)
/NOPR
RESUME,TABLE_3
/GOPR
/COM,
/COM,USING SOLID186 AND SOLID185 (3-D ANALYSIS)
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.4,' ',F12.4,' ',1F15.3)
/COM,-----------------------------------------------------------
/OUT
FINISH
*LIST,vm143,vrt
/DELETE,FRACT,MAC