Project Description (pdf file) - Engineering Class Home Pages

7 downloads 65 Views 259KB Size Report
The project will involve a computer iniplenientation of the finite element ... The general ABAQUS program has the capability of incorporating user-dehned.
CE .)29a Fall 20(18 L. C. Welliord

Course Project Date Assigned: September 30, 2008 Date Due: at the final exam Computer Usage: to reach the USC computer from outside dial (213) 740-9500. To reach the consultant dial (213) 740-5555. On campus you may want to use the computers in SAL 125. The project will involve a computer iniplenientation of the finite element method.

Our implementation will be defined so as to nnnuc a working environment commonly

used in industry and available in the ABAQUS program.

The general ABAQUS program has the capability of incorporating

user-dehned

These routines are programs written by the user to introduce special procedures. These procedures could he employed, for example. to define advanced routines’

.

material models, stiffness matrices for special elements, and stresses. Unfortunately. the Student Edition of ABAQUS does riot allow the incorporation of these userdefined routines. No matter, in this project, we will still adopt the user-defined procedures approach. However, the user-defined procedures will he associated with a series of programs which I will provide you. You will be the creator of the userdefined routines and your routines will be used in test calculations to be carried out.

The ABAQUS program will still come into play in our work. We will use ABAQUS to construct finite element models using mesh generation procedures. We will then create a module to form an interface between ABAQUS and our programs. This interface module will transfer the ABAQUS model into our programs.

I

In tins project. we will consider particular class of hiijte element models. This class iHvolves the 2—D isoparinietric elements which can be mapped from a square. However, in the end we must solve a particular problem. This problem is defamed as follows:

Consider the following 2—D elasticity problem va]l:

involving an irregular concrete shear

J 8 0 I

/7

“1 ,1

V

/

/

7,)’

Ii

/1

V//JA 4A /4

/



The material properties are as follows: E3.3XlO 6 lbf./in. . v=.29, p=;i000. 2 . pr.DOD3l lbf.-sec. 2 lbf./in. /in. 1, n=4.7X1O6 in./in./deg. F. 2

Consider the following load cases: 1. Applied pressure p on the left wall. 2. Self weight of the structure (due to gray. aced. g). 3. Temperature change 8.5 Deg. Fahr. 4. Settlement of boundary A-B by 8. in. vertically

This problems can he modeled using a particular finite element. This element is the 1 imode 2—D Lagrange isoparametric element pictured below: 9

The element can be used to model 2—D elasticity problems. The element is a nii— merically integrated element using Gaussian Quadrature. Please take a look at the “3 matrix method” on P. 206—208 iii the book by Cook (with program flowchart on P. 212). Use this method in your work.

‘you may carry out this assignment in several ways. You could define a program from scratch. This would be difficult unless you have prior knowledge of the sub ject. I think most students would prefer to start with a given program. With this assigmnent I have included a basic FORTRAN program FEA.f set. up to solve this problem. It is different from the prograni FEM2D.f (for 2-D truss structures) pre sented in class. In i.ising FEA.f. you will simply have to introduce two “user—defined routines You should not modify the rest. of the program. You may download this program from the class homepage. I have created C and MATLAB versions of FEA also and they are available on the Project page (see FEA.c, FEA.h, and FEA.in). Because of the power of MATLAB in displaying graphics images and in allowing interfacing with other programs (such as ABAQUS). it is advantageous if you work with MATLAB. However you will not be penalized if you use FORTRAN or C languages. You may copy any of these programs from the Project” section of the class home.



page.

You can use the “clFEA” batch file to automatically compile and link your Fortran program. Of course you can work at home or at your workplace. You will need to off—load the program from the class homepage to do so. Note t hat you must have a compiler on your computer to work this way. You must carry out the following tasks: 1. Go over the FEA program you intend to use. Try to it works.

understand how

Target (late: Oct. 11th 2. Introduce the 4 node 2-D Lagrange isoparametric element in a stiffness matrix routine. Target date: Oct. 28th (turn in a copy

of

your program in class)

3. Solve the load case involving pressure p. Apply concentrated forces which are equivalent to p. Corripute these forces by 3

hand calculation. Prior to this run a few simple test cases involving bars and beams. Target (late: Nov. Itli 4. introduce a stress calculation subroutine. Target Date: Nov. 11th a. Include the effects of specified acceleration. teniperature change and enforced displacement iii an element force subroutine. Run the load cases involving these effects. Target (late: Nov. 18th 6. Provide a written report detailing the theory and assumptions used in your program. Provide a discussion of results as well as a listing of your program and selected results. Target Date: Due date, Nov. 25th 7. In your final report include plots of displacement and stress profiles along lines C-D and E-F. These plots can he prepared by hand.

It should he noted that I do riot want von to make use of any existing program for this problem. Also. I want you to work alone. You may discuss the theory of the project with others. but do riot compare programs or copy programs.

The solution procedure involves an active column solver called COLSOL. You can use this solver like a black box.

Getting Started

Considering that the term is short. we iiiust get going imrriediately on this project. No problem: there is plenty to rio. We can still work on the structure and testing of the program. I want you to mtroduce stiffness effects in a seperate stiffness subroutine. I want you to introduce element forces in a seperate force subroutine. We will temporarily assume a simple form for these matrices in these subroutines. The assumed forms will have the same size as the final versions. You can then go 1

on and write Hud test your program. Thus tasks. Later you can fill in the stiffness and

you

with Step 1 in my list of subroutines with the final versions.

can

force

proceed

111115. proceed to write your program assurnnig the following stiffness and element force vectors:

[Kj

{&}

{GF.}

10 0 1

[K]sxs

U} Simple Test Cases

lo test

your

program.

it is useful to solve simple problems. Consider the following

problems:

Solid Mechanics Problem

Consider the following two problems. Both problems have the solution D=1.0 o, with all other stress components being zero. The Jacobian matrix for the 1 r first case is equal to the identity matrix. ii

II

0

I)

V

1’

V

0)

N Dii

V

I’

II

FEM2D[1] .f C *

PROGRAM FEM2D

****************** ******************************************************

C.E

529A

2D FINITE ELEMENT PROGRAM * * * *

THIS IS AN EXAMPLE PROGRAM FOR THE CLASS PROJECT. YOU MAY SIMPLY MODIFY THIS PROGRAM TO REACH THE PROJECT OBJECTIVES. TO COPY THE PROGRAM FROM MY DIRECTORY, USE THE COMMAND: cp /home/chaph3/ce409/ce529a/FEM2D. f FEM2D. f TO COMPILE THIS FORTRAN PROGRAM (WITH FEM2Df AS FILE NAME), USE THE FOLLOWING COMMAND: FOR SUN

3/50 and 3/60 SYSTEMS AND SPARCSTATIONS USE: f77 GKSCAD.f -o GKSCAD -im

YOU MAY WANT TO SET UP A BATCH FILE TO AVOID RETYPING THIS COMMAND. SET UP THE FILE. THEN USE THIS COMMAND(ONCE): chmod +x batch-filename THEN YOU CAN EXECUTE THIS COMMAND BY SIMPLY TYPING batch-filename. SEE ME FOR A DEMONSTRATION. YOU CAN COPY MY BATCH FILE clf FROM MY DIRECTORY USING THE FOLLOWING COMMAND: cp /home/chaph3/ce409/ce529a/clf clf * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **** * * *

DIMENSION X(100) ,Y(100) ,JJ(100,2), 1LOTOGO(100,2) ,A(100) ,D(50), 2F(50) ,AKLOC(4,4) ,AKGLOB(4,4) ,AREA(100), 3E(100) ,MAXA(1000) , FEL(4) C C C C 1

111 2

3 112

4

OPEN INPUT AND OUTPUT UNITS. OPEN (UNIT=21, FILE=’ INPUT. DAT’) OPEN (UNrr=22 , FILE= ‘OUTPUT. DAT’) READ INPUT DATA. READ(21,*) NJOINT,NEL WRITE(22, 1) NJOINT, NEL FORMAT(1X, ‘NJOINT,NEL=’ ,2I5) DO 111 I=1,NJOINT READ(21,*) x(I),Y(I) WRITE(22,2) x(I),Y(I) CONTINUE FORMAT(1X,’X,Y=’,2E11.4) DO 112 I=1,NJOINT READ(21,*) (JJ(I,J),J=1,2) WRITE(22,3) (JJ(I,J) ,J=1,2) FORMAT(1X,’JJ=’,2I5) CONTINUE DO 113 I=1,NEL READ(21, *) (L0TOG0(I, J) , J=1, 2) WRITE(22,4) (L0TOG0(I,J) ,J=1,2) FORMAT(1X, ‘LOTOGO=’ ,215) Page 1

FEM2D[1] .f 113

5 114 C C C C

6 115 C C C

10 11 C C C

C C C 15 C C C C 17 C C

CONTINUE DO 114 I=1,NEL READ(21,*) AREA(I),E(I) WRITE(22, 5) AREA(I) , E(I) FORMAT(1X, ‘AREA,E=’ ,2E11.4) CONTINUE COMPUTE EQ. NUMBERS. CALL EQNUM(JJ ,NJOINT,2,NDF) READ THE CONCENTRATED FORCE VECTOR. DO 115 I=1,NDF READ(21,*) F(I) WRITE(22,6) F(I) FORMAT(1X, ‘F=’ ,E11.4) CONTINUE COMPUTE THE COLUMN HEIGHTS. CALL COLHT(LOTOGO,JJ ,NEL,NDF,NBIG,MAXA) ZERO THE TOTAL STIFF. MATRIX. DO 10 I=1,NBIG A(I)=O.O NDFP=NDF+1 DO 11 I=1,NDF D(I)=0.0 LOOP ON THE NUMBER OF ELEMENTS. DO 15 IEL=1,NEL COMPUTE ELEMENT GEOMETRY. X1=X(LOTOGO(IEL, 1)) X2=X(LOTOGO(IEL, 2)) Y1=Y(LOTOGO(IEL, 1)) Y2=Y(LoToGo(IEL , 2)) AL=((X2_X1)**2+(Y2Y1)**2)**0. 5 STHETA= (Y2 -Yl) /AL CTHETA=(X2-X1)/AL COMPUT THE LOCAL STIFFNESS MATRIX. CALL STIFF(AREA(IEL) , E(IEL) ,AKLOC,AL) TRANSFORM THE LOC. STIFF. MATRIX TO GLOB. MATRIX. CALL CTRAN (STHETA, CTHETA , AKLOC , AKGLOB) ASSEMBLE THE STIFF. MATRIX. CALL ASSEM(IEL,LOTOGO,JJ,A,F,MAXA,AKGLOB,FEL) CONTINUE SOLVE THE EQUATIONS. CALL COLSOL(NDF,NDFP,1,A, F,D,MAXA) CALL COLSOL(NDF,NDFP,2,A, F,D,MAXA) OUTPUT THE DISPLACEMENTS. WRITE(22,17) (D(I) ,I=1,NDF) FORMAT(1X, ‘D=’ ,4E11.4) CLOSE THE INPUT AND OUTPUT UNITS. CLOSE(21) CLOSE(22)

C END C SUBROUTINE EQNUM(JJ ,NJOINT,NV,NDF) * ********** **************************************** *

*

CREATES EQUATION NUMBERS

*

***** ** *** *************** ****** ******** *************

DIMENSION JJ (100,2) Page 2

FEM2D[1]

1

.f

NDF=O DO 1 I=1,NJOINT DO 1 K=1,NV IF (JJ(I,K).NE.O) NDF=NDF+1 IF (JJ(I,K).NE.O) JJ(I,K)=NDF CONTINUE RETURN END

C SUBROUTINE STIFF(A, E,AKLOC,AL) ****************************************************

*

FORMS THE ELEMENT STIFFNESS MATRIX

*

****************************************************

DIMENSION AKLOC(4 , 4) DO 1 1=1,4

DO 1 J=1,4 1

AKLOC(I,J)=O.O CON=(A*E)/AL AKLOC(1, 1)=C0N AKLOC(1, 3)=-CON AKLOC(3 , 1)=-coN AKLOC(3 , 3)=CON RETURN END

C SUBROUTINE CTRAN(STHETA, CTHETA , AKLOC , AKGLOB) ****************************************************

*

FORMS COORDINATE TRANSFORMATION

*

****************************************************

1

2

3

DIMENSION AKLOC(4,4) ,AKGL0B(4,4) DIMENSION TRAN(4,4) DO 1 1=1,4 DO 1 J=1,4 TRAN(I , J)=O.O AKGLOB(I , J)=AKL0C(I, J) TRAN(1, 1)=CTHETA TRAN(1, 2)=SmETA TRAN(2 , 1)=-STHETA TRAN(2, 2)=CTHETA TRAN(3 , 3)=CTHETA TRAN(3 ,4)=STHETA TRAN(4, 3)=-STHETA TRAN(4 , 4)=CTHETA DO 2 1=1,4 DO 2 J=1,4 AKLOC(I , J)=O.O DO 2 K=1,4 AKLOC(I, J)=AKL0C(I , J)+AKGLOB(I,K)*TRAN(K, J) DO 3 1=1,4 DO 3 J=1,4 AKGLOB(I, J)=O.O DO 3 K=1,4 AKGLOB(I, J)=AKGLOB(I, J)+TRAN(K, I) *AKL0c(K, J) RETURN END

C SUBROUTINE ASSEM(IEL,LOTOGO,JJ ,A,F,MAXA,AKGLOB,FEL) ****************************************************

*

ASSEMBLES STIFF. MATRIX AND FORCE VECTOR.

*

****************************************************

DIMENSION LOTOGO(100,2),JJ(100,2),A(1000),F(50) DIMENSION MAXA(1000) ,AKGLOB(4,4) ,FEL(4)

DO 10 1=1,2 Page 3

40

50 20 10 C

FEM2D[1] DO 10 K1,2 ICON=LOTOGO(IEL, I) KCON=LOTOGO(IEL, K) DO 20 11=1,2 DO 20 KK=1,2 IICON=J J (ICON,II) KKCON=J J (KcON , KK) III=(I-1) *2+11 KKK=(K-1) *2+KK IF (ncoN.EQ.0oR.KKcoN.EQ0) GO TO 40 IF (IIcoN.GT.KKc0N) GO TO 40 ILP=MAXA(KKCON) +KKCON-IICON A(ILP)=A(ILP)+AKGLOB(III , KKK) CONTINUE IF (KEQ.1.AND.KK.EQ.1) THEN IF (ncoN.EQ0) GO TO 50 F(IICON)=F(IICON)+FEL (III) CONTINUE ENDIF CONTINUE CONTINUE

.f

RETURN END C C SUBROUTINE COLSOL(NN,NNM,KKK,A,F,D,MAXA) ************* **************** ***********************

*

ACTIVE COLUMN EQUATION SOLVER

*

DIMENSION A(1000) ,F(5O) ,D(50) ,MAXA(1000) C 40

50

IF (KKK-2) 40,150,150 DO 140 N=1,NN KN=MAXA(N) KL=KN+1 KU=MAXA(N+1) -1 KH=KU-KL IF (KH) 110,90,50 K=N-KH IC=O KLT=KU DO 80 J=1,KH IC=IC+1 KLT=KLT-1 KI=MAXA (K) ND=MAXA(K+1) -KI-1

IF (ND) 80,80,60 60

KK=IC IF (KKGT.ND) KK=ND C=O. 0 DO 70 L=1,KK DUM1=A(KI+L) IF (DUM1.NE.00) THEN DUM2=A(KLT+L) IF (DUM2NE.O,O) THEN

C=C+DUM1*DUM2 70 80 90

ENDIF ENDIF CONTINUE A(KLT)=A(KLT) -C K=K+1 K=N Page 4

100 110 120 2000 140 150

160

170 180 200

210 220 230 240

FEM2D[1] f B=O.O DO 100 KK=KL,KU K=K -1 KI=MAXA (K) IF (A(KK).NE.0.O) THEN C=A(KK)/A(KI) B=B+C*A(KK) ELSE C=O.O ENDIF A(KK)=C A(KN)=A(KN)—B IF (A(KN)) 140,120,140 WRITE(22,2000) N,A(KN) FORMAT(1X, ‘STOP-N,A(KN)=’ ,I5,E114) STOP CONTINUE RETURN DO 180 N=1,NN KL=MAXA(N)+1 KU=MAXA(N+1) -1 IF (KU-KL) 180,160,160 K=N C=00 DO 170 KK=KL,KU K=K- 1 C=C+A(KK) *F(K) F(N)=F(N)-C CONTINUE DO 200 N=1,NN K=MAXA(N) F(N)=F(N)/A(K) IF (NN.EQ.1) RETURN N=NN DO 230 L=2,NN KL=MAXA(N)÷1 KU=MAXA(N+1)-1 IF (KU-KL) 230,210,210 K=N DO 220 KK=KL,KU K=K- 1 F(K)=F(K)_A(KK)*F(N) N=N-1 DO 240 IEQN=1,NN D(IEQN)=F(IEQN) RETURN END

C SUBROUTINE COLHT(LOTOGO,JJ ,NEL,NDF,NBIG,MAXA) ****************************************************

*

DEFINES COLUMN HEIGHTS

*

*** *************************************************

DIMENSION LOTOGO(100,2) , JJ(100,2) ,MAxA(1000) DIMENSION IHC(1000) C DO 50 I=1,NDF IHC(I)=1 DO 60 IEL=1,NEL DO 70 K=1,2 ICON=LOTOGO(IEL, K) DO 70 KK=1,2 IICON=JJ (ICON, KK) IF (I.EQnCoN) GO TO 80 Page 5

FEM2D[1] .f 70 80

90 60 50

CONTINUE GO TO 60 DO 90 L=1,2 IAN=LOTOGO(IEL, L) DO 90 LL=1,2 IIAN=JJ (IAN, LL) IF (IIAN.EQO) GO TO 90 IF (IIANGT.IICoN) GO TO 90 ISP=IABS(IICON-IIAN)+1 IF (IsP.GT.IHC(I)) IHC(I)=ISP CONTINUE CONTINUE CONTINUE

C

100

MAXA(fl=1 NDFP=NDF+1 DO 100 I=2,NDFP III-1 MAXA(I)=MAXA(II)+IHC(II) NBIG=MAXA(NDF+1) RETURN END

C

Page 6