## SIMPLE COMPUTER PROGRAM

OBJECTIVES:

• To develop an algorithm in FORTRAN 90 for the sophomores in upcoming years to learn from, using the example problems in the MSE 2034/2044 text (Callister).
• To help the student become familiar with crack stress analysis in actual applications.
• To keep the program simple enough so is not to discourage the interest in the field of Material Science and Engineering.

BRIEF DESCRIPTION:

• Program for CRAck STRess ANalysis (CRASTRAN) in FORTRAN 90 programming language.
• Used equations from Callister, Material Science and Engineering: An Introduction.
• Made comments when necessary for variable names and process of program.
• Created flexible algorithms of the equations.
• Referenced the images/figures with explanations of the logic in the program.

REFERENCES/EXPLANATIONS:

• Maximum stress at crack tip (stmax) - Eq.(8.1) - Case(2.10) in program.

• Stress intensity (K) -- (See fig.8.10) As plate thickness decreases, z=0 , this is called plain stress. Plain strain, on the other hand, increases with thickness and z=0.
• Thus giving equations (8.5a,b,c) listed below: Case(1.6,7,8), respectively in program.

• The corresponding f() functions1 are incorporated into each respective equation.:

• Conditions for brittle fracture exist when critical value of the stress intensity in the vicinity of a crack is termed fracture toughness (Kc) , Eq.(8.6) - Case(3.17) in program.

• See also Figure (8.12) in Callister for a schematic representation of the relationship.

• The relationship for thickness (B) with K1c, where y is the yield strength at a 0.002 offset of the material is as follows: Eq. (8.8) - Case(4.20) in program.

• Critical stress c is fixed because the allowable flaw size is measured or limited by detection techniques, or a corrosion factor of the environment is set , or a density factor. And only two parameters is needed for fixation. Eq.(8.9) Case (4.21) in program.

• Maximum allowable flaw size(crack length), Eq. (8.10) Case (4.22) in program.

RESTRICTIONS:

• Stress intensity(K) stress concentration(Kt), the reason, K is a function of position of the crack, the size, and the apllied stress.
• Y parameter for a infinite width plate is 1.0 and for a semi-infinite width is 1.1. Not much change in the Y variable.

• Use Control Z to get back to the DOS prompt if there is any trouble.
• Make sure to keep units consistent within the program.
• K1c denotes the critical value of K in a mode 1 plastic deformation. (See Fig.8.9)
• If plate thickness B is greater than equal to the value 2.5 times(K1c/y), then the material does not fracture.

FORTRAN 90 PROGRAM:

```PROGRAM CRASTRAN
implicit none
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! To arrange equations and to prompt the user for input data for the
!   prompts, and usage of equations to solve example problems from
!   Callister are for the benefit of the sophomore class enrolled in
!   MSE 2034/2044.
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

!Cv is the conversion from degrees to radians.
REAL,PARAMETER :: PI=3.141593, Cv=3.141593/180.0
!Initialize the variables.
REAL:: stapp=0.0,a=0.0,K=0.0,r=0.0,thet=0.0,stx=0.0,sty=0.0,stxy=0.0
REAL:: rcurv=0.0,Kt=0.0,Kc=0.0,Y=0.0,intcr=0.0,ac=0.0,B=0.0,stc=0.0
REAL:: stmax=0.0,K1c=0.0,Ystr=0.0
INTEGER:: NUMBER=0
CHARACTER(1):: response
!Do loop used throughout for continuous usage of the case constructs.
DO
WRITE(*,*)"Choose one of the following:"
WRITE(*,*)
WRITE(*,*)"1) Stress Intensity Factor (K)"
WRITE(*,*)"2) Stress Concentration Factor (Kt)"
WRITE(*,*)"3) Fracture Toughness (Kc)"
WRITE(*,*)"4) Plane Strain Fracture Toughness(K1c)"
WRITE(*,*)"5) Exit program"
WRITE(*,*)"Enter the Number:"
!Case is used to catagorize the equations.
select case (NUMBER)
case (1)
!Applied stress (stapp) & crack length (a).
WRITE(*,*)"Enter stapp,a:"
K=stapp*SQRT(PI*a)
WRITE(*,*)"K  =",K
WRITE(*,*)

DO
WRITE(*,*)"Choose one of the following:"
WRITE(*,*)"6) x-axis stress (stx)"
WRITE(*,*)"7) y-axis stress (sty)"
WRITE(*,*)"8) x- & y-axis shear stress (stxy)"
WRITE(*,*)"Enter the Number:"

select case (NUMBER)
case (6)
!Radial distance from crack tip (r) in m(in)  & angle
! between x-axis and r (thet) in degrees.
WRITE(*,*)"Enter r,thet:"
thet=thet*Cv
stx=(K/SQRT(2*PI*r))*COS(thet/2.0)*(1-SIN(thet/2.0)*SIN(3*thet/2.0))
WRITE(*,*)"stx  =",stx,"MPa(psi)"
case (7)
sty=(K/SQRT(2*PI*r))*COS(thet/2.0)*(1+SIN(thet/2.0)*SIN(3*thet/2.0))
WRITE(*,*)"sty  =",sty,"MPa(psi)"
case (8)
stxy=(K/SQRT(2*PI*r))*SIN(thet/2.0)*COS(thet/2.0)*COS(3*thet/2.0)
WRITE(*,*)"stxy  =",stxy,"MPa(psi)"
case (9)
exit
case default
WRITE(*,*)"Reenter number"
END select
WRITE(*,*)"For 1-5, enter y :: For 6-9, enter n)"
if (response/="n") exit
END DO

case (2)
DO
WRITE(*,*)"Choose one of the following:"
WRITE(*,*)
WRITE(*,*)"10) Maximum stress (stmax)"
WRITE(*,*)"11) Surface crack length (a)"
WRITE(*,*)"13) Stress concentration factor (Kt)"
WRITE(*,*)"14) Exit to main menu "
WRITE(*,*)"Enter the Number:"

select case (NUMBER)
case (10)
!stapp in MPA(psi)
WRITE(*,*)"Enter stapp,a,rcurv:"
stmax=2*stapp*SQRT(a/rcurv)
WRITE(*,*)"stmax  =",stmax,"MPa(psi)"
WRITE(*,*)
case (11)
WRITE(*,*)"Enter stapp,stmax,rcurv:"
a=rcurv*(stmax/(stapp*2))**2
WRITE(*,*)"a  =",a,"m(in)"
WRITE(*,*)
case (12)
WRITE(*,*)"Enter stapp,a,stmax:"
rcurv=a*(2*stapp/stmax)**2
WRITE(*,*)"rcurv  =",rcurv,"m(in)"
WRITE(*,*)
case (13)
WRITE(*,*)"Enter stapp,stmax:"
Kt=stmax/stapp
WRITE(*,*)"Kt  =",Kt
WRITE(*,*)
case (14)
exit
case default
END select
WRITE(*,*)"For 10-14, enter n)"
if (response/="n") exit
END DO

case (3)
DO
WRITE(*,*)"Choose one of the following:"
WRITE(*,*)"15) Internal crack length (intcr) "
WRITE(*,*)"16) Surface crack length (a)"
WRITE(*,*)"17) Fracture toughness (Kc for intcr)"
WRITE(*,*)"18) Fracture toughness (Kc for a)"
WRITE(*,*)"Enter the Number:"

select case (NUMBER)
case (15)
!Y is a dimensionless parameter.
WRITE(*,*)"Enter stapp,Y,Kc:"
intcr=2*(Kc/(Y*stapp))**2/PI
WRITE(*,*)"intcr  =",intcr,"m(in)"
WRITE(*,*)
case (16)
WRITE(*,*)"Enter stapp,Y,Kc:"
a=(Kc/(Y*stapp))**2/PI
WRITE(*,*)"a  =",a,"m(in)"
WRITE(*,*)
case (17)
WRITE(*,*)"Enter stapp,a,Y:"
Kc=SQRT(PI*a)*Y*stapp
WRITE(*,*)"Kc  =",Kc,"MPa sqrt(m) (psi sqrt(in))"
WRITE(*,*)
case (18)
WRITE(*,*)"Enter stapp,intcr,Y:"
Kc=Y*stapp*SQRT(PI*intcr/2.0)
WRITE(*,*)"Kc  =",Kc,"MPa sqrt(m) (psi sqrt(in))"
WRITE(*,*)
case (19)
exit
case default
WRITE(*,*)"Reenter Number"
END select

WRITE(*,*)"For 15-19, enter n)"
if (response/="n") exit
END DO
case (4)
WRITE(*,*)"Enter stapp,Y,K1c,a:"
K1c=Y*stapp*SQRT(PI*a)
WRITE(*,*)"K1c  =",K1c,"MPa sqrt(m) (psi sqrt(in))"
WRITE(*,*)

DO
WRITE(*,*)"Choose one of the following:"
WRITE(*,*)"20) Plate thickness (B) "
WRITE(*,*)"21) Critical stress (stc)"
WRITE(*,*)"22) Maximum allowable flaw size (ac)"
WRITE(*,*)"Enter the Number:"

select case (NUMBER)
case (20)
!Yield strength (Ystr).
WRITE(*,*)"Enter Ystr:"
B=2.5*(K1c/Ystr)**2
WRITE(*,*)"B  =",B,"m(in)"
WRITE(*,*)
case (21)
WRITE(*,*)"Enter Y,a:"
stc=K1c/(Y*SQRT(PI*a))
WRITE(*,*)"stc  =",stc,"MPa(psi)"
WRITE(*,*)
case (22)
WRITE(*,*)"Enter stapp,Y:"
ac=(K1c/(stapp*Y))**2/PI
WRITE(*,*)"ac  =",ac,"m(in)"
WRITE(*,*)
case (23)
exit
case default
WRITE(*,*)"Reenter number"
END select
WRITE(*,*)"For 20-23, enter n)"
if (response/="n") exit
END DO
case(5)
exit
case default
WRITE(*,*)"Reenter"
end select
END DO
stop
END PROGRAM CRASTRAN

```

Written by Kevin Tingler

All images scanned and figures referenced in this document are from :

Materials Science and Engineering: An Introduction, William D. Callister, Jr.

1994, by John Wiley & Sons, Inc., New York.