SIMPLE COMPUTER PROGRAM

OBJECTIVES:

BRIEF DESCRIPTION:

REFERENCES/EXPLANATIONS:











RESTRICTIONS:



HELPFUL HINTS (PROGRAM):


FORTRAN 90 PROGRAM:

PROGRAM CRASTRAN
implicit none
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! To arrange equations and to prompt the user for input data for the 
!   equation selected. Easy access to menus, straight forward input 
!   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:"
READ(*,*) NUMBER
!Case is used to catagorize the equations.
select case (NUMBER)
case (1)
!Applied stress (stapp) & crack length (a).
WRITE(*,*)"Enter stapp,a:"
READ(*,*)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(*,*)"9) Exit to main menu"
WRITE(*,*)"Enter the Number:"
READ(*,*)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:"
READ(*,*) 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)"
READ(*,*) response
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(*,*)"12) Radius of curvature (rcurv)"
WRITE(*,*)"13) Stress concentration factor (Kt)"
WRITE(*,*)"14) Exit to main menu "
WRITE(*,*)"Enter the Number:"
READ(*,*) NUMBER
    
select case (NUMBER)
case (10)
!stapp in MPA(psi)
WRITE(*,*)"Enter stapp,a,rcurv:"
READ(*,*)stapp,a,rcurv
stmax=2*stapp*SQRT(a/rcurv)
WRITE(*,*)"stmax  =",stmax,"MPa(psi)"
WRITE(*,*)
case (11)
WRITE(*,*)"Enter stapp,stmax,rcurv:"
READ(*,*)stapp,stmax,rcurv
a=rcurv*(stmax/(stapp*2))**2
WRITE(*,*)"a  =",a,"m(in)"
WRITE(*,*)
case (12)
WRITE(*,*)"Enter stapp,a,stmax:"
READ(*,*)stapp,a,stmax
rcurv=a*(2*stapp/stmax)**2
WRITE(*,*)"rcurv  =",rcurv,"m(in)"
WRITE(*,*)
case (13)
WRITE(*,*)"Enter stapp,stmax:"
READ(*,*)stapp,stmax
Kt=stmax/stapp
WRITE(*,*)"Kt  =",Kt
WRITE(*,*)
case (14)
exit
case default
END select
WRITE(*,*)"For 10-14, enter n)"
READ(*,*) response
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(*,*)"19) Exit to main menu"
WRITE(*,*)"Enter the Number:"
READ(*,*)NUMBER

select case (NUMBER)
case (15)
!Y is a dimensionless parameter.
WRITE(*,*)"Enter stapp,Y,Kc:"
READ(*,*)stapp,Y,Kc
intcr=2*(Kc/(Y*stapp))**2/PI
WRITE(*,*)"intcr  =",intcr,"m(in)"
WRITE(*,*)
case (16)
WRITE(*,*)"Enter stapp,Y,Kc:"
READ(*,*)stapp,Y,Kc
a=(Kc/(Y*stapp))**2/PI
WRITE(*,*)"a  =",a,"m(in)"
WRITE(*,*)
case (17)
WRITE(*,*)"Enter stapp,a,Y:"
READ(*,*)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:"
READ(*,*)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)"
READ(*,*) response
if (response/="n") exit
END DO
case (4)
WRITE(*,*)"Enter stapp,Y,K1c,a:"
READ(*,*)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(*,*)"23) Exit to main menu"
WRITE(*,*)"Enter the Number:"
READ(*,*)NUMBER

select case (NUMBER)
case (20)
!Yield strength (Ystr).
WRITE(*,*)"Enter Ystr:"
READ(*,*)Ystr
B=2.5*(K1c/Ystr)**2
WRITE(*,*)"B  =",B,"m(in)"
WRITE(*,*)
case (21)
WRITE(*,*)"Enter Y,a:"
READ(*,*)Y,a
stc=K1c/(Y*SQRT(PI*a))
WRITE(*,*)"stc  =",stc,"MPa(psi)"
WRITE(*,*)
case (22)
WRITE(*,*)"Enter stapp,Y:"
READ(*,*)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)"
READ(*,*) response
if (response/="n") exit
END DO
case(5)
exit
case default
WRITE(*,*)"Reenter"
end select
END DO
stop
END PROGRAM CRASTRAN


Table of Contents


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.