VM232 Input Listing


/COM,ANSYS MEDIA REL. 2024R2 (05/10/2024) REF. VERIF. MANUAL: REL. 2024R2
/VERIFY,VM232
/TITLE,VM232,STRESS INTENSITY FACTOR FOR A SINGLE EDGE CRACK WITH PRESSURE LOAD USING UMM METHOD
/COM,
/COM, REFERENCE: RALPH I.STEPHENS,ALI FATEMI,ROBERT R.STEPHENS,
/COM,            HENRY O.FUCHS,"METAL FATIGUE IN ENGINEERING",2ND EDITION
/COM,            2006, PG:130
/COM,

/COM, PARAMETER FOR CREATING THE CDB FILES TO STORE GEOMETRY AND MESH DATA
/COM,
_GEOMGEN = 0   ! SET TO 1 TO WRITE CDB FILES IF ANY INPUT FILE MODIFICATIONS
PARSAV

C*** USING SOLID185
CRKLEN=0.1              !--- CRACK LENGTH
WIDTH=1                 !--- WIDTH OF MODEL
HEIGHT=5                !--- HEIGHT OF MODEL
CTLHEI=2*CRKLEN         !--- CONTROL HEIGHT FOR FINER MESH
THICK=0.1               !--- THICKNESS OF MODEL
PRS=5E9                 !--- PRESSURE
MODELA=2E11             !--- MODULUS OF ELASTICITY
POIRAT=0.3              !--- POISSON'S RATIO

PI=ATAN(1)*4
AW=CRKLEN/WIDTH
A2=CRKLEN**0.5
KI=PRS*A2
C1=(1.99-0.41*AW)
C2=18.7*AW**2-38.48*AW**3
C3=53.85*AW**4
KI=KI*(C1+C2+C3)        !--- ANALYTICAL KI

/OUT,vm232_scratch

/PREP7
*IF,_GEOMGEN,EQ,1,THEN

ET,1,SOLID185

MP,EX,1,MODELA          !---YOUNG'S MODULUS
MP,PRXY,1,POIRAT        !---POISSON'S RATIO

!---CREATE GEOMETRY
!---CREATE KEYPOINTS
K,1,0,0
K,2,CRKLEN,0
K,3,WIDTH,0
K,4,0,CTLHEI
K,5,CRKLEN,CTLHEI
K,6,WIDTH,CTLHEI
K,7,0,HEIGHT
K,8,WIDTH,HEIGHT
K,9,0.5*CRKLEN,0
K,10,CRKLEN,0.5*CRKLEN
K,11,1.5*CRKLEN,0

!---CREATE LINES USING KEYPOINTS
L,1,9,8
L,9,2,8
L,2,11,8
L,11,3,18
L,1,4,16
L,2,10,8
L,10,5,12
L,3,6,16
L,4,5,16
L,5,6,26
L,4,7,40
L,6,8,40
L,7,8,42
LARC, 9,10,2,0.5*CRKLEN
LARC,10,11,2,0.5*CRKLEN

LSEL,S,LINE,,14,15,1
LESIZE,ALL,,,8
ALLSEL

!---CREATE AREAS USING LINES
AL,1,14,7,9,5
AL,2,6,14
AL,3,15,6
AL,4,8,10,7,15
AL,9,10,12,13,11

VEXT,ALL,,,,,THICK  !---EXTRUDE AREAS TO CREATE VOLUME.

!---SET NUMBER OF DIVISIONS FOR LINES
LSEL,S,LINE,,21,25,1
LSEL,A,LINE,,28,31,3
LSEL,A,LINE,,35,36,1
LESIZE,ALL,,,16
ALLSEL

LSEL,S,LINE,,40,41
LESIZE,ALL,,,16
ALLSEL

TYPE,1
REAL,1
MAT,1
MSHAP,1,3D          !--- TETRAHEDRAL MESHING, SET ELEMENT SHAPE.
VMESH,ALL           !--- TETRAHEDRAL MESHING, VOLUME MESH.

!---SELECT NODES ON CRACK TIP AND GROUP THEM IN ONE COMPONENT
NSEL,S,LOC,Y,0
NSEL,R,LOC,X,CRKLEN
CM,CRKTIP,NODES
ALLSEL

!---SELECT NODES ON CRACK SURFACE AND GROUP THEM IN ONE COMPONENT
NSEL,S,LOC,Y,0
NSEL,R,LOC,X,0,CRKLEN
CM,CRKSUR,NODES
ALLSEL

NSEL,S,LOC,Y,0
NSEL,R,LOC,X,CRKLEN,WIDTH
DSYM,SYMM,Y
ALLSEL

cdwrite,db,vm232-1,cdb
FINISH
*ELSE
cdread,db,vm232-1,cdb
*ENDIF
FINISH

!--- DO THE SIMULATION WITH UMM,ON
/SOLUTION
ANTYPE,STATIC       !---SET ANALYSIS TYPE TO STATIC.

!---GET NODE NUMBERS AT GIVEN COORDINATES
NODE1=NODE(CRKLEN,0,0)
NODE2=NODE(WIDTH,0,0)

!---ASSIGN BC TO THE NODES TO PREVENT RIGID BODY MOTION
D,NODE1,UX,0
D,NODE1,UY,0
D,NODE2,ALL,0

NSEL,S,LOC,Z,0
NSEL,A,LOC,Z,THICK
D,ALL,UZ,0          !---RESTRICT MOTION IN Z DIRECTION.
ALLSEL

SF,CRKSUR,PRES, PRS !---APPLY PRESSURE ON CRACK SURFACE
ALLSEL

!--- DEFINE CRACK ID TO CALCULATE SIF
CINT,NEW,1          !---INITIATE CRACK ID 1.
CINT,CTNC,CRKTIP,1  !---NODE 1 IS THE CRACK TIP GUIDE NODE FOR THIS CRACK ID.
CINT,UMM,ON         !---TURN UMM ON.
CINT,TYPE,SIFS      !---COMPUTE STRESS INTENSITY FACTOR FOR CRACK ID 1.
CINT,SYMM,ON        !---SYMMETRY ON CRACK PLANE.
CINT,NORM,0,2       !---SET CRACK SURFACE NORMAL COORDINATE TO Y DIRECTION.
CINT,NCON,6         !---DEFINE 6 CONTOURS FOR CRACK TIP CALCULATIONS.

SOLVE               !---SOLVE THE MODEL.
FINISH

/POST1
SET,LAST,LAST       !---READ THE LAST STEP ANS SUBSTEP OF THE RESULTS.

!---SELECT THE NODE ON THE CRACK TIP IN THE MIDDLE OF THE MODEL.
CRKNOD=NODE(CRKLEN,0,THICK/2)
K1S1=0

!--- CALCULATE AVERAGE SIF AND J-INT FROM THE DO LOOP FOR ONE NODE ON CRACK TIP.
*DO,I,2,5
*GET,SIF1,CINT,1,CTIP,CRKNOD,CONTOUR,I,DTYPE,K1

K1S1=K1S1+SIF1

*ENDDO
/OUT,

K1S1=K1S1/4     !--- AVERAGE SIF1 FOR 4 CONTOURS

/OUT,vm232_scratch,,,APPEND

*DIM,LABEL,CHAR,1,2
*DIM,VALUE,,1,3

LABEL(1,1)='SOLID185'

*VFILL,VALUE(1,1),DATA,KI
*VFILL,VALUE(1,2),DATA,K1S1
*VFILL,VALUE(1,3),DATA,KI/K1S1

SAVE,TABLE_1
FINISH
/CLEAR,NOSTART
/OUT,


C*** USING SOLID186


CRKLEN=0.1              !--- CRACK LENGTH
WIDTH=1                 !--- WIDTH OF MODEL
HEIGHT=5                !--- HEIGHT OF MODEL
CTLHEI=2*CRKLEN         !--- CONTROL HEIGHT FOR FINER MESH
THICK=0.1               !--- THICKNESS OF MODEL
PRS=5E9                 !--- PRESSURE
MODELA=2E11             !--- MODULUS OF ELASTICITY
POIRAT=0.3              !--- POISSON'S RATIO

!--- CALCULATE EXPECTED KI FROM IRWIN SOLUTION AND J-INTEGRAL
PI=ATAN(1)*4
AW=CRKLEN/WIDTH
A2=CRKLEN**0.5
KI=PRS*A2
C1=(1.99-0.41*AW)
C2=18.7*AW**2-38.48*AW**3
C3=53.85*AW**4
KI=KI*(C1+C2+C3)        !--- ANALYTICAL KI

/OUT,vm232_scratch,,,APPEND
PARRES,CHANGE

/PREP7
*IF,_GEOMGEN,EQ,1,THEN

ET,1,SOLID186

MP,EX,1,MODELA          !---YOUNG'S MODULUS
MP,PRXY,1,POIRAT        !---POISSON'S RATIO

!---CREATE GEOMETRY
!---CREATE KEYPOINTS
K,1,0,0
K,2,CRKLEN,0
K,3,WIDTH,0
K,4,0,CTLHEI
K,5,CRKLEN,CTLHEI
K,6,WIDTH,CTLHEI
K,7,0,HEIGHT
K,8,WIDTH,HEIGHT
K,9,0.5*CRKLEN,0
K,10,CRKLEN,0.5*CRKLEN
K,11,1.5*CRKLEN,0

!---CREAT LINES USING KEYPOINTS
L,1,9,8
L,9,2,8
L,2,11,8
L,11,3,18
L,1,4,16
L,2,10,8
L,10,5,12
L,3,6,16
L,4,5,16
L,5,6,26
L,4,7,40
L,6,8,40
L,7,8,42
LARC, 9,10,2,0.5*CRKLEN
LARC,10,11,2,0.5*CRKLEN

LSEL,S,LINE,,14,15,1
LESIZE,ALL,,,8
ALLSEL

!---CREATE AREAS USING LINES
AL,1,14,7,9,5
AL,2,6,14
AL,3,15,6
AL,4,8,10,7,15
AL,9,10,12,13,11

VEXT,ALL,,,,,THICK  !---EXTRUDE AREAS TO CREATE VOLUME.

!---SET NUMBER OF DIVISIONS FOR LINES
LSEL,S,LINE,,21,25,1
LSEL,A,LINE,,28,31,3
LSEL,A,LINE,,35,36,1
LESIZE,ALL,,,16
ALLSEL

LSEL,S,LINE,,40,41
LESIZE,ALL,,,16
ALLSEL

TYPE,1
REAL,1
MAT,1
MSHAP,1,3D          !--- TETRAHEDRAL MESHING, SET ELEMENT SHAPE.
VMESH,ALL           !--- TETRAHEDRAL MESHING, VOLUME MESH.

!---SELECT NODES ON CRACK TIP AND GROUP THEM IN ONE COMPONENT
NSEL,S,LOC,Y,0
NSEL,R,LOC,X,CRKLEN
CM,CRKTIP,NODES
ALLSEL

!---SELECT NODES ON CRACK SURFACE AND GROUP THEM IN ONE COMPONENT
NSEL,S,LOC,Y,0
NSEL,R,LOC,X,0,CRKLEN
CM,CRKSUR,NODES
ALLSEL

NSEL,S,LOC,Y,0
NSEL,R,LOC,X,CRKLEN,WIDTH
DSYM,SYMM,Y
ALLSEL
cdwrite,db,vm232-2,cdb
FINISH
*ELSE
cdread,db,vm232-2,cdb
*ENDIF
FINISH

!--- DO THE SIMULATION WITH UMM,ON
/SOLUTION
ANTYPE,STATIC       !---SET ANALYSIS TYPE TO STATIC.

!---GET NODE NUMBERS AT GIVEN COORDINATES
NODE1=NODE(CRKLEN,0,0)
NODE2=NODE(WIDTH,0,0)

!---ASSIGN BC TO THE NODES TO PREVENT RIGID BODY MOTION
D,NODE1,UX,0
D,NODE1,UY,0
D,NODE2,ALL,0

NSEL,S,LOC,Z,0
NSEL,A,LOC,Z,THICK
D,ALL,UZ,0          !---RESTRICT MOTION IN Z DIRECTION.
ALLSEL

SF,CRKSUR,PRES, PRS !---APPLY PRESSURE ON CRACK SURFACE
ALLSEL

!--- DEFINE CRACK ID TO CALCULATE SIF
CINT,NEW,1          !---INITIATE CRACK ID 1.
CINT,CTNC,CRKTIP,1  !---NODE 1 IS THE CRACK TIP GUIDE NODE FOR THIS CRACK ID.
CINT,UMM,ON         !---TURN UMM ON.
CINT,TYPE,SIFS      !---COMPUTE STRESS INTENSITY FACTOR FOR CRACK ID 1.
CINT,SYMM,ON        !---SYMMETRY ON CRACK PLANE.
CINT,NORM,0,2       !---SET CRACK SURFACE NORMAL COORDINATE TO Y DIRECTION.
CINT,NCON,6         !---DEFINE 6 CONTOURS FOR CRACK TIP CALCULATIONS.

SOLVE               !---SOLVE THE MODEL.
FINISH

/POST1
SET,LAST,LAST       !---READ THE LAST STEP ANS SUBSTEP OF THE RESULTS.

!---SELECT THE NODE ON THE CRACK TIP IN THE MIDDLE OF THE MODEL.
CRKNOD=NODE(CRKLEN,0,THICK/2)
K1S2=0

!--- CALCULATE AVERAGE SIF AND J-INT FROM THE DO LOOP FOR ONE NODE ON CRACK TIP.
*DO,I,2,5
*GET,SIF1,CINT,1,CTIP,CRKNOD,CONTOUR,I,DTYPE,K1

K1S2=K1S2+SIF1

*ENDDO

/OUT,
K1S2=K1S2/4     !--- AVERAGE SIF1 FOR 4 CONTOURS
/OUT,vm232_scratch,,,APPEND

*DIM,LABEL,CHAR,1,2
*DIM,VALUE,,1,3

LABEL(1,1)='SOLID186'

*VFILL,VALUE(1,1),DATA,KI
*VFILL,VALUE(1,2),DATA,K1S2
*VFILL,VALUE(1,3),DATA,KI/K1S2

SAVE,TABLE_2
FINISH
/CLEAR,NOSTART

/OUT,

C*** USING SOLID187

CRKLEN=0.1              !--- CRACK LENGTH
WIDTH=1                 !--- WIDTH OF MODEL
HEIGHT=5                !--- HEIGHT OF MODEL
CTLHEI=2*CRKLEN             !--- CONTROL HEIGHT FOR FINER MESH
THICK=0.1               !--- THICKNESS OF MODEL
PRS=5E9                 !--- PRESSURE
MODELA=2E11             !--- MODULUS OF ELASTICITY
POIRAT=0.3              !--- POISSON'S RATIO

!--- CALCULATE EXPECTED KI FROM IRWIN SOLUTION AND J-INTEGRAL
PI=ATAN(1)*4
AW=CRKLEN/WIDTH
A2=CRKLEN**0.5
KI=PRS*A2
C1=(1.99-0.41*AW)
C2=18.7*AW**2-38.48*AW**3
C3=53.85*AW**4
KI=KI*(C1+C2+C3)        !--- ANALYTICAL KI

/OUT,vm232_scratch,,,APPEND
PARRES,CHANGE

/PREP7
*IF,_GEOMGEN,EQ,1,THEN

ET,1,SOLID187

MP,EX,1,MODELA          !---YOUNG'S MODULUS
MP,PRXY,1,POIRAT        !---POISSON'S RATIO

!---CREATE GEOMETRY
!---CREATE KEYPOINTS
K,1,0,0
K,2,CRKLEN,0
K,3,WIDTH,0
K,4,0,CTLHEI
K,5,CRKLEN,CTLHEI
K,6,WIDTH,CTLHEI
K,7,0,HEIGHT
K,8,WIDTH,HEIGHT
K,9,0.5*CRKLEN,0
K,10,CRKLEN,0.5*CRKLEN
K,11,1.5*CRKLEN,0

!---CREAT LINES USING KEYPOINTS
L,1,9,8
L,9,2,8
L,2,11,8
L,11,3,18
L,1,4,16
L,2,10,8
L,10,5,12
L,3,6,16
L,4,5,16
L,5,6,26
L,4,7,40
L,6,8,40
L,7,8,42
LARC, 9,10,2,0.5*CRKLEN
LARC,10,11,2,0.5*CRKLEN

LSEL,S,LINE,,14,15,1
LESIZE,ALL,,,8
ALLSEL

!---CREATE AREAS USING LINES
AL,1,14,7,9,5
AL,2,6,14
AL,3,15,6
AL,4,8,10,7,15
AL,9,10,12,13,11

VEXT,ALL,,,,,THICK  !---EXTRUDE AREAS TO CREATE VOLUME.

!---SET NUMBER OF DIVISIONS FOR LINES
LSEL,S,LINE,,21,25,1
LSEL,A,LINE,,28,31,3
LSEL,A,LINE,,35,36,1
LESIZE,ALL,,,16
ALLSEL

LSEL,S,LINE,,40,41
LESIZE,ALL,,,16
ALLSEL

TYPE,1
REAL,1
MAT,1
VMESH,ALL           !--- TETRAHEDRAL MESHING, VOLUME MESH.

!---SELECT NODES ON CRACK TIP AND GROUP THEM IN ONE COMPONENT
NSEL,S,LOC,Y,0
NSEL,R,LOC,X,CRKLEN
CM,CRKTIP,NODES
ALLSEL

!---SELECT NODES ON CRACK SURFACE AND GROUP THEM IN ONE COMPONENT
NSEL,S,LOC,Y,0
NSEL,R,LOC,X,0,CRKLEN
CM,CRKSUR,NODES
ALLSEL

NSEL,S,LOC,Y,0
NSEL,R,LOC,X,CRKLEN,WIDTH
DSYM,SYMM,Y
ALLSEL
cdwrite,db,vm232-3,cdb
FINISH
*ELSE
cdread,db,vm232-3,cdb
*ENDIF
FINISH

!--- DO THE SIMULATION WITH UMM,ON
/SOLUTION
ANTYPE,STATIC       !---SET ANALYSIS TYPE TO STATIC.

!---GET NODE NUMBERS AT GIVEN COORDINATES
NODE1=NODE(CRKLEN,0,0)
NODE2=NODE(WIDTH,0,0)

!---ASSIGN BC TO THE NODES TO PREVENT RIGID BODY MOTION
D,NODE1,UX,0
D,NODE1,UY,0
D,NODE2,ALL,0

NSEL,S,LOC,Z,0
NSEL,A,LOC,Z,THICK
D,ALL,UZ,0          !---RESTRICT MOTION IN Z DIRECTION.
ALLSEL

SF,CRKSUR,PRES, PRS !---APPLY PRESSURE ON CRACK SURFACE
ALLSEL

!--- DEFINE CRACK ID TO CALCULATE SIF
CINT,NEW,1          !---INITIATE CRACK ID 1.
CINT,CTNC,CRKTIP,1  !---NODE 1 IS THE CRACK TIP GUIDE NODE FOR THIS CRACK ID.
CINT,UMM,ON         !---TURN UMM ON.
CINT,TYPE,SIFS      !---COMPUTE STRESS INTENSITY FACTOR FOR CRACK ID 1.
CINT,SYMM,ON        !---SYMMETRY ON CRACK PLANE.
CINT,NORM,0,2       !---SET CRACK SURFACE NORMAL COORDINATE TO Y DIRECTION.
CINT,NCON,6         !---DEFINE 6 CONTOURS FOR CRACK TIP CALCULATIONS.

SOLVE               !---SOLVE THE MODEL.
FINISH

/POST1
SET,LAST,LAST       !---READ THE LAST STEP ANS SUBSTEP OF THE RESULTS.

!---SELECT THE NODE ON THE CRACK TIP IN THE MIDDLE OF THE MODEL.
CRKNOD=NODE(CRKLEN,0,THICK/2)
K1S3=0

!--- CALCULATE AVERAGE SIF AND J-INT FROM THE DO LOOP FOR ONE NODE ON CRACK TIP.
*DO,I,2,5
*GET,SIF1,CINT,1,CTIP,CRKNOD,CONTOUR,I,DTYPE,K1

K1S3=K1S3+SIF1

*ENDDO

/OUT,
K1S3=K1S3/4     !--- AVERAGE SIF1 FOR 4 CONTOURS

/OUT,vm232_scratch,,,APPEND

*DIM,LABEL,CHAR,1,2
*DIM,VALUE,,1,3

LABEL(1,1)='SOLID187'

*VFILL,VALUE(1,1),DATA,KI
*VFILL,VALUE(1,2),DATA,K1S3
*VFILL,VALUE(1,3),DATA,KI/K1S3

SAVE,TABLE_3
FINISH

RESUME,TABLE_1
/out,vm232,vrt
/COM,
/COM, ----------------------------VM232 RESULT COMPARISON-------------------
/COM,
/COM,                      | TARGET | Mechanical APDL | RATIO
/COM,
/COM,  USING SOLID185 ELEMENTS
/COM,
*VWRITE,LABEL(1,1),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A14,'   ',E12.3,'    ',E12.3,'    ',F12.3)
/COM,
/COM,
/NOPR,
RESUME,TABLE_2
/GOPR,
/COM,
/COM,
/COM,  USING SOLID186 ELEMENTS
/COM,
*VWRITE,LABEL(1,1),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A14,'   ',E12.3,'    ',E12.3,'    ',F12.3)
/COM,
/COM,
/NOPR,
RESUME,TABLE_3
/GOPR,
/COM,
/COM,
/COM,  USING SOLID187 ELEMENTS
/COM,
*VWRITE,LABEL(1,1),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A14,'   ',E12.3,'    ',E12.3,'    ',F12.3)
/COM,
/COM,
/COM, --------------------------------------------------------------------------
/out,
*list,vm232,vrt
/DELETE,TABLE_1
/DELETE,TABLE_2
/DELETE,TABLE_3