AdvAERo

download AdvAERo

of 9

Transcript of AdvAERo

  • 7/30/2019 AdvAERo

    1/9

    Jen Ming Victor Shih 994751648

    Prof C.Steeves

    1

    Advanced Aerospace Structures Project 2

    Results

    ii) Physical Coordinates of all the nodes (16 elements arranges along the length of beam)

    xg = x y

    0 0

    0.2500 0.0156

    0.5000 0.0313

    0.7500 0.0469

    1.0000 0.0625

    1.2500 0.0781

    1.5000 0.09381.7500 0.1094

    2.0000 0.1250

    2.2500 0.1406

    2.5000 0.1563

    2.7500 0.1719

    3.0000 0.1875

    3.2500 0.2031

    3.5000 0.2188

    3.7500 0.2344

    4.0000 0.2500

    4.0000 0.5000

    3.7500 0.5000

    3.5000 0.5000

    3.2500 0.5000

    3.0000 0.5000

    2.7500 0.5000

    2.5000 0.5000

    2.2500 0.5000

    2.0000 0.5000

    1.7500 0.5000

    1.5000 0.5000

    1.2500 0.5000

    1.0000 0.50000.7500 0.5000

    0.5000 0.5000

    0.2500 0.5000

    0 0.5000

    xg is the physical global coordinates of all the nodes in the

    beam, the nodal are numbered starting at the bottom left of

    the beam and are subsequently numbered along the border

    of the beam in a counter-clockwise direction

    the code uses a tailored fetch algorithm to generate element

    nodal coordinates from xg

    figure1 shows how the beam is broken down

  • 7/30/2019 AdvAERo

    2/9

    Jen Ming Victor Shih 994751648

    Prof C.Steeves

    2

    iii) Displacement of the nodes along the right edge of the beam:

    U = x y

    -0.0000 -0.0023 (bottom)

    0.0002 -0.0023 (top)

    iv) Contour Plot of the strains in the beam:

    Figure 1: x direction strain is shown to vary across the height of the beam

    Figure 2: y direction strain is shown to vary along the length of the beam

  • 7/30/2019 AdvAERo

    3/9

    Jen Ming Victor Shih 994751648

    Prof C.Steeves

    3

    Figure 3: y-direction strain mesh plot to emphasize area of greatest change

    Figure 4: xy-direction strain has an oscillatory effect along the length of the beam

    v) Contour Plot of von Mises equivalent stress:

    Figure 5: von-Mises equivalent stress varies across the length of the beam

    Figure 6: mesh plot of the von-Mises equivalent stress showing the variation along the rest of the beam

  • 7/30/2019 AdvAERo

    4/9

    Jen Ming Victor Shih 994751648

    Prof C.Steeves

    4

  • 7/30/2019 AdvAERo

    5/9

    Jen Ming Victor Shih 994751648

    Prof C.Steeves

    5

    MATLAB Code

    %% Advanced Aerospace Structures% Assignment 4: Finite Element Solution to Tapered Cantilever Beam% Isoparametric Element (15 QuadralateralElemets)% Victor Shih

    clc;clearall;closeall;

    % assume plane stresst = 0.1;E = 75e9;nu = 0.3;D = (E/(1-nu^2))*[1 nu 0;...nu 1 0;...

    0 0 (1-nu)/2];

    %% FORMING NODES xgelems = 16;nodes = 2*(elems+1);cx = 0:4/elems:4;cyt = zeros(1,elems+1) + 0.5;

    cyb = zeros(1,elems+1);fori = 1:elems+1cyb(i) = 0.25/4*cx(i);end

    xg = horzcat([cx;cyb],[cx(elems+1:-1:1);cyt])'figure(1)

    plot(xg(:,1),xg(:,2), '-ob')holdonaxis([-0.05 4.05 -0.05 0.55])gridon

    % view(2)

    %% FORM GLOBAL STIFFNESS MATRIX and GLOBAL FORCE VECTOR

    Kg = zeros(2*nodes);fg = zeros(2*nodes,1);%element loopfori = 1:elems

    x = form_x(i,elems,nodes,xg);K = form_K(D,x,t);L = form_fetch(i,nodes);

    Kg = Kg + L'*K*L;

    ifi> 12load = [0, -1e3];

    N = [1 0 0 0 0 0 1 0;...0 1 0 0 0 0 0 1];

    f = (load*N)';

    fg = fg + L'*f;endend

    %% CALCULATE DISPLACEMTN dg%remove boundary nodesK = Kg(3:2*nodes-2,3:2*nodes-2);f = fg(3:2*nodes-2);%calculate displacementd = K\f;

  • 7/30/2019 AdvAERo

    6/9

    Jen Ming Victor Shih 994751648

    Prof C.Steeves

    6

    %put back boundarydg = zeros(2*nodes,1);dg(3:2*nodes-2) = d;

    U = zeros(nodes,2);fori = 1:nodesU(i,1) = dg(i*2-1);

    U(i,2) = dg(i*2);endU(nodes/2:nodes/2+1,:)newxg = xg + U;plot(newxg(:,1),newxg(:,2), '-or')xlabel('x');ylabel('y');title('16 ISOPARAMETRIC ELEMENT FEM DEFORMATION')holdoff

    %% CALCULATE STRAIN AND STRESS%element loope_x = zeros(2,2*elems);e_y = zeros(2,2*elems);e_xy = zeros(2,2*elems);sv = zeros(2,2*elems);x_gauss = zeros(2,2*elems);

    y_gauss = zeros(2,2*elems);fori = 1:elems

    x = form_x(i,elems,nodes,xg);

    %map physical coordinate of qausspts[x_sub, y_sub] = form_x_gauss(x);

    x_gauss(:,i*2-1:i*2) = x_sub;y_gauss(:,i*2-1:i*2) = y_sub;

    %1st Point (point a')xi1 = -1/sqrt(3);xi2 = -1/sqrt(3);[H1,detJ1] = func_hesssion(xi1, xi2, x);

    %3rd Point (point b')xi1 = 1/sqrt(3);xi2 = -1/sqrt(3);

    [H2,detJ2] = func_hesssion(xi1, xi2, x);%4th Point (point c')

    xi1 = 1/sqrt(3);xi2 = 1/sqrt(3);[H3,detJ3] = func_hesssion(xi1, xi2, x);

    %2nd Point (point d')xi1 = -1/sqrt(3);xi2 = 1/sqrt(3);[H4,detJ4] = func_hesssion(xi1, xi2, x);

    L = form_fetch(i,nodes);

    d = L*dg;

    %% STRAIN at gauss pointe_a = H1*d;e_b = H2*d;

    e_c = H3*d;e_d = H4*d;

    e_x(:,i*2-1:i*2) = [e_a(1) e_d(1); e_b(1) e_c(1)];e_y(:,i*2-1:i*2) = [e_a(2) e_d(2); e_b(2) e_c(2)];e_xy(:,i*2-1:i*2) = [e_a(3) e_d(3); e_b(3) e_c(3)];

    %% STRESS at gauss points_a = D*H1*d;s_b = D*H2*d;s_c = D*H3*d;s_d = D*H4*d;

  • 7/30/2019 AdvAERo

    7/9

    Jen Ming Victor Shih 994751648

    Prof C.Steeves

    7

    s_av = sqrt( s_a(1)^2 - s_a(1)*s_a(2) + s_a(2)^2 + 3*s_a(3)^2 );s_bv = sqrt( s_b(1)^2 - s_b(1)*s_b(2) + s_b(2)^2 + 3*s_b(3)^2 );s_cv = sqrt( s_c(1)^2 - s_c(1)*s_c(2) + s_c(2)^2 + 3*s_c(3)^2 );s_dv = sqrt( s_d(1)^2 - s_d(1)*s_d(2) + s_d(2)^2 + 3*s_d(3)^2 );

    sv(:,i*2-1:i*2) = [s_avs_dv; s_bvs_cv];

    end

    %ex-gauss pt plotfigure(2)plot(xg(:,1),xg(:,2), '-ob')axis([-0.05 4.05 -0.05 0.55])xlabel('x');ylabel('y');title('\epsilon_x')holdongridon[C,h] = contour(x_gauss,y_gauss,e_x);clabel(C,h);

    holdoff

    %ey-gauss pt plotfigure(3)plot(xg(:,1),xg(:,2), '-ob')axis([-0.05 4.05 -0.05 0.55])xlabel('x');ylabel('y');title('\epsilon_y')holdongridon[C,h] = contour(x_gauss,y_gauss,e_y);clabel(C,h);holdoff

    % % %exy-gauss pt plot% figure(4)% plot(xg(:,1),xg(:,2), '-ob')% hold on

    % grid on% [C,h] = contour(x_gauss,y_gauss,e_xy);% clabel(C,h);% axis([0 4 0 0.5])% hold off

    %Von-Mise Equivalent stress - gauss pt plotfigure(5)plot(xg(:,1),xg(:,2), '-ob')xlabel('x');ylabel('y');title('\sigma_v')axis([-0.05 4.05 -0.05 0.55])holdongridon[C,h] = contour(x_gauss,y_gauss,sv);clabel(C,h);

    holdoff

    function x = form_x(i,elems,nodes,xg)

    L = zeros(4, 2*(elems+1));L(1,nodes-i+1) = 1; %fetch node aL(2,i) = 1; %fetch node bL(3,i+1) = 1; %fetch node cL(4,nodes-i) = 1; %fetch node d

    x = L*xg;

  • 7/30/2019 AdvAERo

    8/9

    Jen Ming Victor Shih 994751648

    Prof C.Steeves

    8

    end

    function [H,detJ] = func_hesssion(xi1, xi2, x)

    J = 0.25*[ xi2-1, 1-xi2, 1+xi2, -xi2-1;...

    xi1-1, -xi1-1, 1+xi1, 1-xi1]*x;

    G = 0.25*[ xi2-1, 1-xi2, 1+xi2, -xi2-1;...xi1-1, -xi1-1, 1+xi1, 1-xi1];

    detJ = J(1,1)*J(2,2)-J(1,2)*J(2,1);

    Hv = J\G;

    H = [Hv(1,1) 0 Hv(1,2) 0 Hv(1,3) 0 Hv(1,4) 0;...0 Hv(2,1) 0 Hv(2,2) 0 Hv(2,3) 0 Hv(2,4);...

    Hv(2,1) Hv(1,1) Hv(2,2) Hv(1,2) Hv(2,3) Hv(1,3) Hv(2,4) Hv(1,4)];

    function [x_gauss, y_gauss] = form_x_gauss(x)

    %point axi1 = -1/sqrt(3);xi2 = -1/sqrt(3);N = form_shape(xi1,xi2);

    xa = x(:,1)'*N;ya = x(:,2)'*N;

    %point bxi1 = 1/sqrt(3);xi2 = -1/sqrt(3);N = form_shape(xi1,xi2);

    xb = x(:,1)'*N;yb = x(:,2)'*N;

    %point cxi1 = 1/sqrt(3);xi2 = 1/sqrt(3);N = form_shape(xi1,xi2);

    xc = x(:,1)'*N;yc = x(:,2)'*N;

    %point dxi1 = -1/sqrt(3);xi2 = 1/sqrt(3);N = form_shape(xi1,xi2);

    xd = x(:,1)'*N;yd = x(:,2)'*N;

    x_gauss = [xaxd; xb xc];

    y_gauss = [yayd; ybyc];

    function K = form_K(D,x,t)

    %Gauss Quadrature%1st Point (point a')xi1 = -1/sqrt(3);xi2 = -1/sqrt(3);[H1,detJ1] = func_hesssion(xi1, xi2, x);%3rd Point (point b')xi1 = 1/sqrt(3);

  • 7/30/2019 AdvAERo

    9/9

    Jen Ming Victor Shih 994751648

    Prof C.Steeves

    9

    xi2 = -1/sqrt(3);[H2,detJ2] = func_hesssion(xi1, xi2, x);%4th Point (point c')xi1 = 1/sqrt(3);xi2 = 1/sqrt(3);[H3,detJ3] = func_hesssion(xi1, xi2, x);%2nd Point (point d')

    xi1 = -1/sqrt(3);xi2 = 1/sqrt(3);[H4,detJ4] = func_hesssion(xi1, xi2, x);

    K1 = detJ1*H1'*D*H1;K2 = detJ2*H2'*D*H2;K3 = detJ3*H3'*D*H3;K4 = detJ4*H4'*D*H4;

    K = t*(K1+K2+K3+K4);

    function N = form_shape(xi1,xi2)

    Na = 1/4*(1-xi1)*(1-xi2);Nb = 1/4*(1+xi1)*(1-xi2);

    Nc = 1/4*(1+xi1)*(1+xi2);Nd = 1/4*(1-xi1)*(1+xi2);

    N = [Na;Nb;Nc;Nd];

    function L = form_fetch(i,nodes)

    L = zeros(8, nodes*2);%fetch node aL(1,2*nodes-2*i+1) = 1;L(2,2*nodes-2*i+2) = 1;

    %fetch node bL(3,2*i-1) = 1;L(4,2*i) = 1;

    %fetch node cL(5,2*i+1) = 1;L(6,2*i+2) = 1;

    %fetch node dL(7,2*nodes-2*i-1) = 1;L(8,2*nodes-2*i) = 1;

    end