7-bar elements in 3-d space e-mail: dr. ahmet zafer Şenalp e-mail:...

31
7-Bar Elements in 3-D Space Dr. Ahmet Zafer Şenalp e-mail: [email protected] Mechanical Engineering Department Gebze Technical University ME 520 Fundamentals of Finite Element Analysis

Upload: melissa-conley

Post on 30-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

7-Bar Elements in 3-D Space

Dr. Ahmet Zafer Şenalpe-mail: [email protected]

Mechanical Engineering DepartmentGebze Technical University

ME 520Fundamentals of Finite Element Analysis

Bar (truss) structures:

Bar Element

ME 520 Dr. Ahmet Zafer Şenalp 2Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Cross section examples forbar structures

ME 520 Dr. Ahmet Zafer Şenalp 3Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Element stiffness matrices are calculated in the localcoordinate systems and then transformed into the globalcoordinate system (X, Y, Z) where they are assembled.

FEA software packages will do this transformation automatically.

Input data for bar elements:· (X, Y, Z) for each node· E and A for each element

The space truss element is characterized by linear shape functions.

ME 520 Dr. Ahmet Zafer Şenalp 4Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

ME 520 Dr. Ahmet Zafer Şenalp 5Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Each truss element has two nodes and is inclined with anglesmeasured from the global X, Y and Z axes respectively to the local x axis as shown below;

zyx and ,

Stiffness matrix

ME 520 Dr. Ahmet Zafer Şenalp 6Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

LetIn this case the element stiffness matrix is as folllows;

zzyyxx cosC and cosC ,cosC

ME 520 Dr. Ahmet Zafer Şenalp 7Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

As space truss element has 6 degrees of freedom (3 at each node) for a structure with n nodes, the global stiffness matrix K will be of size 3nx3n.

The global stiffness matrix K is obtained by making calls to the Matlab function SpaceTrussAssemble which is written for this purpose.

Once the global stiffness matrix; K is obtained we have the following structure equation;

At this step boundary conditions are applied manually to the vectors U and F.

Then the matrix equation is solved by partioning and Gaussion elimination.

Finally once the unkown displacements and and reactions are found, the force is obtained for each element as follows:

FUK

Solution procedure with matlab

ME 520 Dr. Ahmet Zafer Şenalp 8Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

where f is the force in this element (a scalar) and u is the 6x1 element displacement vector.

The element stress is obtained by dividing the element force by the cross-sectional area A.

uCCCCCCL

EAf zyxzyx

Solution procedure with matlab

Matlab functions used

ME 520 Dr. Ahmet Zafer Şenalp 9Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

SpaceTrussElementLength(x1,y1,z1,x2,y2,z2)This function returns the length of the space truss element whose first node has coordinates (x1,y1,z1) and second node has coordinates (x2,y2,z2)Function contents:function y = SpaceTrussElementLength(x1,y1,z1,x2,y2,z2)%SpaceTrussElementLength This function returns the length of the% space truss element whose first node has % coordinates (x1,y1,z1) and second node has % coordinates (x2,y2,z2). y = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1));

Matlab functions used

ME 520 Dr. Ahmet Zafer Şenalp 10Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

SpaceTrussElementStiffness(E,A,L,thetax,thetay,thetaz)This function returns the element stiffness matrix for a space truss element with modulus of elasticity E, cross-sectional area A, length L, and angles thetax, thetay, thetaz (in degrees). The size of the element stiffness matrix is 6 x 6.Function contents:function y = SpaceTrussElementStiffness(E,A,L,thetax,thetay,thetaz)%SpaceTrussElementStiffness This function returns the element % stiffness matrix for a space truss % element with modulus of elasticity E, % cross-sectional area A, length L, and% angles thetax, thetay, thetaz % (in degrees). The size of the element % stiffness matrix is 6 x 6.x = thetax*pi/180;u = thetay*pi/180;v = thetaz*pi/180;Cx = cos(x);Cy = cos(u);Cz = cos(v);w = [Cx*Cx Cx*Cy Cx*Cz ; Cy*Cx Cy*Cy Cy*Cz ; Cz*Cx Cz*Cy Cz*Cz];y = E*A/L*[w -w ; -w w];

Matlab functions used

ME 520 Dr. Ahmet Zafer Şenalp 11Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

SpaceTrussAssemble(K,k,i,j)This function assembles the element stiffness matrix k of the space truss element with nodes i and j into the global stiffness matrix K. This function returns the 3nx3n global stiffness matrix K after the element stiffness matrix k is assembled.Function contents:function y = SpaceTrussAssemble(K,k,i,j)%SpaceTrussAssemble This function assembles the element stiffness% matrix k of the space truss element with nodes% i and j into the global stiffness matrix K.% This function returns the global stiffness % matrix K after the element stiffness matrix % k is assembled.K(3*i-2,3*i-2) = K(3*i-2,3*i-2) + k(1,1);K(3*i-2,3*i-1) = K(3*i-2,3*i-1) + k(1,2);K(3*i-2,3*i) = K(3*i-2,3*i) + k(1,3);K(3*i-2,3*j-2) = K(3*i-2,3*j-2) + k(1,4);K(3*i-2,3*j-1) = K(3*i-2,3*j-1) + k(1,5);K(3*i-2,3*j) = K(3*i-2,3*j) + k(1,6);K(3*i-1,3*i-2) = K(3*i-1,3*i-2) + k(2,1);K(3*i-1,3*i-1) = K(3*i-1,3*i-1) + k(2,2);K(3*i-1,3*i) = K(3*i-1,3*i) + k(2,3);K(3*i-1,3*j-2) = K(3*i-1,3*j-2) + k(2,4);K(3*i-1,3*j-1) = K(3*i-1,3*j-1) + k(2,5);K(3*i-1,3*j) = K(3*i-1,3*j) + k(2,6);

Matlab functions used

ME 520 Dr. Ahmet Zafer Şenalp 12Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

K(3*i,3*i-2) = K(3*i,3*i-2) + k(3,1);K(3*i,3*i-1) = K(3*i,3*i-1) + k(3,2);K(3*i,3*i) = K(3*i,3*i) + k(3,3);K(3*i,3*j-2) = K(3*i,3*j-2) + k(3,4);K(3*i,3*j-1) = K(3*i,3*j-1) + k(3,5);K(3*i,3*j) = K(3*i,3*j) + k(3,6);K(3*j-2,3*i-2) = K(3*j-2,3*i-2) + k(4,1);K(3*j-2,3*i-1) = K(3*j-2,3*i-1) + k(4,2);K(3*j-2,3*i) = K(3*j-2,3*i) + k(4,3);K(3*j-2,3*j-2) = K(3*j-2,3*j-2) + k(4,4);K(3*j-2,3*j-1) = K(3*j-2,3*j-1) + k(4,5);K(3*j-2,3*j) = K(3*j-2,3*j) + k(4,6);K(3*j-1,3*i-2) = K(3*j-1,3*i-2) + k(5,1);K(3*j-1,3*i-1) = K(3*j-1,3*i-1) + k(5,2);K(3*j-1,3*i) = K(3*j-1,3*i) + k(5,3);K(3*j-1,3*j-2) = K(3*j-1,3*j-2) + k(5,4);K(3*j-1,3*j-1) = K(3*j-1,3*j-1) + k(5,5);K(3*j-1,3*j) = K(3*j-1,3*j) + k(5,6);K(3*j,3*i-2) = K(3*j,3*i-2) + k(6,1);K(3*j,3*i-1) = K(3*j,3*i-1) + k(6,2);K(3*j,3*i) = K(3*j,3*i) + k(6,3);K(3*j,3*j-2) = K(3*j,3*j-2) + k(6,4);K(3*j,3*j-1) = K(3*j,3*j-1) + k(6,5);K(3*j,3*j) = K(3*j,3*j) + k(6,6);y = K;

Matlab functions used

ME 520 Dr. Ahmet Zafer Şenalp 13Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

SpaceTrussElementForce(E,A,L,thetax,thetay,thetaz,u)This function returns the element force given the modulus of elasticity E, the cross-sectional area A, the length L, the angle theta (in degrees), and the element nodal displacement vector u.Function contents:function y = SpaceTrussElementForce(E,A,L,thetax,thetay,thetaz,u)%SpaceTrussElementForce This function returns the element force% given the modulus of elasticity E, the % cross-sectional area A, the length L, % the angles thetax, thetay, thetaz% (in degrees), and the element nodal % displacement vector u.x = thetax * pi/180;w = thetay * pi/180;v = thetaz * pi/180;Cx = cos(x);Cy = cos(w);Cz = cos(v);y = E*A/L*[-Cx -Cy -Cz Cx Cy Cz]*u;

Matlab functions used

ME 520 Dr. Ahmet Zafer Şenalp 14Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

SpaceTrussElementStress(E,L,thetax,thetay,thetaz,u)This function returns the element stress given the modulus of elasticity E, the the length L, the angle theta (in degrees), and the element nodal displacement vector u.Function contents:function y = SpaceTrussElementStress(E,L,thetax,thetay,thetaz,u)%SpaceTrussElementStress This function returns the element stress% given the modulus of elasticity E, the % length L, the angles thetax, thetay, % thetaz (in degrees), and the element % nodal displacement vector u.x = thetax * pi/180;w = thetay * pi/180;v = thetaz * pi/180;Cx = cos(x);Cy = cos(w);Cz = cos(v);y = E/L*[-Cx -Cy -Cz Cx Cy Cz]*u;

ME 520 Dr. Ahmet Zafer Şenalp 15Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Consider the space truss shown below.The supports at nodes 1, 2, and 3 are ball-and-socket joints allowing rotation but no translation.Given E=200 GPaA14=0.001 m2

A24=0.002 m2

A34=0.001 m2

P=12 kNDetermine:a) The global stiffness matrix for the structureb) the displacement at node 4c) the reactions at nodes 1, 2, and 3d) the stress in each element

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 16Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Solution:Use the 7 steps to solve the problem using space truss element.

Step 1-Discretizing the domain:This problem is already discretized. The domain is subdivided into three elements and four nodes. The units used in Matlab calculations are KN and meter. The element connectivity is:

E# N1 N2

1 1 4

2 2 4

3 3 4

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 17Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Step 2-Copying relevant files and starting MatlabCreate a directory

Copy SpaceTrussElementLength.mSpaceTrussElementStiffness.mSpaceTrussAssemble.mSpaceTrussElementForce.mSpaceTrussElementStress.mfiles under the created directory

Open Matlab;Open ‘Set Path’ command and by using ‘Add Folder’ command add the current directory.

Start solving the problem in Command Window:>>clearvars>>clc

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 18Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Step 3-Writing the element stiffness matrices:Enter the data>>E=200e6>>A1=0.001>>A2=0.002>>A3=0.001>>L1=SpaceTrussElementLength(0,0,-4,0,5,0)L1 =

6.4031

>>L2=SpaceTrussElementLength(-3,0,0,0,5,0)L2 =

5.8310>>L3=SpaceTrussElementLength(0,0,4,0,5,0)L3 =

6.4031

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 19Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

>>theta1x=acos(0/L1)*180/pitheta1x =

90>>theta1y=acos(5/L1)*180/pitheta1y =

38.6598>>theta1z=acos(4/L1)*180/pitheta1z =

51.3402>>theta2x=acos(3/L2)*180/pitheta2x =

59.0362

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 20Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

>>theta2y=acos(5/L2)*180/pitheta2y =

30.9638>>theta2z=acos(0/L2)*180/pitheta2z =

90>>theta3x=acos(0/L3)*180/pitheta3x =

90>>theta3y=acos(5/L3)*180/pitheta3y =

38.6598>>theta3z=acos(-4/L3)*180/pitheta3z =

128.6598

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 21Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

>>k1=SpaceTrussElementStiffness(E,A1,L1,theta1x,theta1y,theta1z)k1 = 1.0e+04 *

0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 0.0000 1.9046 1.5236 -0.0000 -1.9046 -1.5236 0.0000 1.5236 1.2189 -0.0000 -1.5236 -1.2189 -0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 -1.9046 -1.5236 0.0000 1.9046 1.5236 -0.0000 -1.5236 -1.2189 0.0000 1.5236 1.2189>>k2=SpaceTrussElementStiffness(E,A2,L2,theta2x,theta2y,theta2z)k2 = 1.0e+04 *

1.8159 3.0264 0.0000 -1.8159 -3.0264 -0.0000 3.0264 5.0441 0.0000 -3.0264 -5.0441 -0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -1.8159 -3.0264 -0.0000 1.8159 3.0264 0.0000 -3.0264 -5.0441 -0.0000 3.0264 5.0441 0.0000 -0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 22Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

>>k3=SpaceTrussElementStiffness(E,A3,L3,theta3x,theta3y,theta3z)k3 =

1.0e+04 *

0.0000 0.0000 -0.0000 -0.0000 -0.0000 0.0000 0.0000 1.9046 -1.5236 -0.0000 -1.9046 1.5236 -0.0000 -1.5236 1.2189 0.0000 1.5236 -1.2189 -0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -1.9046 1.5236 0.0000 1.9046 -1.5236 0.0000 1.5236 -1.2189 -0.0000 -1.5236 1.2189Step 4-Assembling the global stiffness matrix:Since the structure has 4 nodes, the size of the golbal stiffness matrix is 12x12.>>K=zeros(12,12)K = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 23Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

>>K=SpaceTrussAssemble(K,k1,1,4)>>K=SpaceTrussAssemble(K,k2,2,4)>>K=SpaceTrussAssemble(K,k3,3,4)yields;K =

1.0e+04 *

0.0000 0.0000 0.0000 0 0 0 0 0 0 -0.0000 -0.0000 -0.0000 0.0000 1.9046 1.5236 0 0 0 0 0 0 -0.0000 -1.9046 -1.5236 0.0000 1.5236 1.2189 0 0 0 0 0 0 -0.0000 -1.5236 -1.2189 0 0 0 1.8159 3.0264 0.0000 0 0 0 -1.8159 -3.0264 -0.0000 0 0 0 3.0264 5.0441 0.0000 0 0 0 -3.0264 -5.0441 -0.0000 0 0 0 0.0000 0.0000 0.0000 0 0 0 -0.0000 -0.0000 -0.0000 0 0 0 0 0 0 0.0000 0.0000 -0.0000 -0.0000 -0.0000 0.0000 0 0 0 0 0 0 0.0000 1.9046 -1.5236 -0.0000 -1.9046 1.5236 0 0 0 0 0 0 -0.0000 -1.5236 1.2189 0.0000 1.5236 -1.2189 -0.0000 -0.0000 -0.0000 -1.8159 -3.0264 -0.0000 -0.0000 -0.0000 0.0000 1.8159 3.0264 0.0000 -0.0000 -1.9046 -1.5236 -3.0264 -5.0441 -0.0000 -0.0000 -1.9046 1.5236 3.0264 8.8532 0 -0.0000 -1.5236 -1.2189 -0.0000 -0.0000 -0.0000 0.0000 1.5236 -1.2189 0.0000 0 2.4378

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 24Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Step 5-Applying the boundary conditions:Finite element equation for the problem is;

The boundary conditions for the problem are;

z4

y4

x4

z3

y3

x3

z2

y2

x2

z1

y1

x1

4

4

4

3

3

3

2

2

2

1

1

1

F

F

F

F

F

F

F

F

F

F

F

F

w

v

u

w

v

u

w

v

u

w

v

u

K

0wvuwvuwvu 333222111

0F,0F,12F

0F,0F,0F,0F,0F,0F,0F,0F,0F

z4y4x4

z3y3x3z2y2x2z1y1x1

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 25Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Inserting the above conditions into finite element equation

Step 6-Solving the equations:Solving the above system of equations will be performed by partitioning (manually) and Gaussian elimination (with Matlab)First we partition the above equation by extracting the submatrix in rows 10 to 12and columns 10 to 12.

0

0

12

F

F

F

F

F

F

F

F

F

w

v

u

0

0

0

0

0

0

0

0

0

K

z3

y3

x3

z2

y2

x2

z1

y1

x1

4

4

4

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 26Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Therefore we obtain;

The solution of the above system is obtained using Matlab as follows.Note that the ‘\’ operator is used for Gaussian elimination.

>>k=K(10:12,10:12)k =

1.0e+04 *

1.8159 3.0264 0.0000 3.0264 8.8532 0 0.0000 0 2.4378>>f=[12; 0; 0]f = 12 0 0

0

0

12

w

v

u

4.200

09.80.3

0.00.38.1

10

4

4

44

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 27Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

u=k\fu =

0.0015 -0.0005 -0.0000Step 7-Post-processing:In this step we obtain the reactions at nodes 1, 2, and 3 and the stress in each element using Matlab as follows.First we set up the global nodal displacement vector U, then we calculate the nodal force vector F.>>U=[ 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; u]U =

0 0 0 0 0 0 0 0 0 0.0015 -0.0005 -0.0000

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 28Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

>>F=K*UF =

0.0000 10.0000 8.0000 -12.0000 -20.0000 -0.0000 0.0000 10.0000 -8.0000 12.0000 -0.0000 -0.0000so the recation forces are;at node 1: (0,10,8) Nat node 2: (-12,-20,0) Nat node 3: (0,10,-8) NObviously force equilibrium is satisfied for this problem.

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 29Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

Next we set up the element nodal displacement vectors u1, u2 and u3 then we calculate the element stresses sigma1, sigma2 and sigma3 by making calls to the Matlab function SpaceTrussElementStress.>> u1=[U(1) ; U(2) ; U(3) ; U(10) ; U(11); U(12)]u1 =

0 0 0 0.0015 -0.0005 -0.0000>> u2=[U(4) ; U(5) ; U(6) ; U(10) ; U(11); U(12)]u2 =

0 0 0 0.0015 -0.0005 -0.0000

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 30Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

>> u3=[U(7) ; U(8) ; U(9) ; U(10) ; U(11); U(12)]u3 =

0 0 0 0.0015 -0.0005 -0.0000

>>sigma1=SpaceTrussElementStress(E,L1,theta1x,theta1y,theta1z,u1)sigma1 =

-1.2806e+04

>>sigma2=SpaceTrussElementStress(E,L2,theta2x,theta2y,theta2z,u2)sigma2 =

1.1662e+04

Solution of Example 1 with Matlab

Solution of Example 1 with Matlab

ME 520 Dr. Ahmet Zafer Şenalp 31Mechanical Engineering Department, GTU

7-Bar Elements in 3-D Space

>>sigma3=SpaceTrussElementStress(E,L3,theta3x,theta3y,theta3z,u3)sigma3 =

-1.2806e+04

Thus it is clear that the stresses:In element 1=12.806 MPa (compressive)In element 2=11.662 MPa (tensile)In element 3=12.806 MPa (compressive)

The symmetry in the results regarding elements 1 and 3 is obvious.