Middle East Technical University Department of Mechanical Engineering ME 413 Introduction to Finite Element Analysis. Chapter 2 Introduction to FEM

Similar documents
Chapter 3. Formulation of FEM for Two-Dimensional Problems

Chapter 6. Finite Element Method. Literature: (tiny selection from an enormous number of publications)

A Hybrid Method for the Wave Equation. beilina

Matrix Assembly in FEA

Introduction. Finite and Spectral Element Methods Using MATLAB. Second Edition. C. Pozrikidis. University of Massachusetts Amherst, USA

Chapter 5. Formulation of FEM for Unsteady Problems

A very short introduction to the Finite Element Method

Scientific Computing I

Finite-Elements Method 2

Chapter 3 Variational Formulation & the Galerkin Method

General elastic beam with an elastic foundation

Method in 1D. Introduction of the Basic Concepts and Comparison to Optimal FD Operators

Computational Fluid Dynamics Prof. Dr. Suman Chakraborty Department of Mechanical Engineering Indian Institute of Technology, Kharagpur

Steps in the Finite Element Method. Chung Hua University Department of Mechanical Engineering Dr. Ching I Chen

3. Numerical integration

Discretization of PDEs and Tools for the Parallel Solution of the Resulting Systems

Introduction to Finite Element Method

Hydroelastic vibration of a rectangular perforated plate with a simply supported boundary condition

Interpolation Functions for General Element Formulation

Finite Difference Methods for Boundary Value Problems

Outline. 1 Boundary Value Problems. 2 Numerical Methods for BVPs. Boundary Value Problems Numerical Methods for BVPs

Notes on Spatial and Temporal Discretization (when working with HYDRUS) by Jirka Simunek

The Plane Stress Problem

2. Polynomial interpolation

Content. Department of Mathematics University of Oslo

Partial Differential Equations

AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends

Method of Finite Elements I

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

MAE 323: Chapter 6. Structural Models

Lehrstuhl Informatik V. Lehrstuhl Informatik V. 1. solve weak form of PDE to reduce regularity properties. Lehrstuhl Informatik V

Preprocessor Geometry Properties )Nodes, Elements(, Material Properties Boundary Conditions(displacements, Forces )

The Closed Form Reproducing Polynomial Particle Shape Functions for Meshfree Particle Methods

INTRODUCTION TO FINITE ELEMENT METHODS

Notes for CS542G (Iterative Solvers for Linear Systems)

Numerical Solutions to Partial Differential Equations

CIV-E1060 Engineering Computation and Simulation Examination, December 12, 2017 / Niiranen

Finite Element Methods with Linear B-Splines

An Adaptive Mixed Finite Element Method using the Lagrange Multiplier Technique

Analysis of Steady State Heat Conduction Problem Using EFGM

Finite Element Methods

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

PREPRINT 2010:23. A nonconforming rotated Q 1 approximation on tetrahedra PETER HANSBO

MECh300H Introduction to Finite Element Methods. Finite Element Analysis (F.E.A.) of 1-D Problems

Interpolation and Approximation

Theoretical Manual Theoretical background to the Strand7 finite element analysis system

Applied'&'Computa/onal'Electromagne/cs (ACE) Part/III Introduc8on/to/the/Finite/Element/Technique/for/ Electromagne8c/Modelling

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

Finite Difference and Finite Element Methods

du(l) 5 dl = U(0) = 1 and 1.) Substitute for U an unspecified trial function into governing equation, i.e. dx + = =

Building a finite element program in MATLAB Linear elements in 1d and 2d

Iterative Methods for Linear Systems

Introduction to PDEs: Assignment 9: Finite elements in 1D

Back Matter Index The McGraw Hill Companies, 2004

Convergence and optimality of an adaptive FEM for controlling L 2 errors

Quintic beam closed form matrices (revised 2/21, 2/23/12) General elastic beam with an elastic foundation

1 Lecture 8: Interpolating polynomials.

Generalized Finite Element Methods for Three Dimensional Structural Mechanics Problems. C. A. Duarte. I. Babuška and J. T. Oden

Concepts. 3.1 Numerical Analysis. Chapter Numerical Analysis Scheme

[2] (a) Develop and describe the piecewise linear Galerkin finite element approximation of,

On angle conditions in the finite element method. Institute of Mathematics, Academy of Sciences Prague, Czech Republic

Contents as of 12/8/2017. Preface. 1. Overview...1

Divergence Formulation of Source Term

University of Illinois at Urbana-Champaign College of Engineering

Wave Theory II (6) Finite Element Method

Institute of Structural Engineering Page 1. Method of Finite Elements I. Chapter 2. The Direct Stiffness Method. Method of Finite Elements I

Law of Trichotomy and Boundary Equations

The Finite Volume Mesh

Key Point. The nth order linear homogeneous equation with constant coefficients

Efficient hp-finite elements

TMA4220: Programming project - part 1

Multi-Point Constraints

FEniCS Course. Lecture 0: Introduction to FEM. Contributors Anders Logg, Kent-Andre Mardal


MEEN 673 ********************************* NONLINEAR FINITE ELEMENT ANALYSIS ********************************* J. N. Reddy

Boundary Value Problems and Iterative Methods for Linear Systems

Time-dependent variational forms

NUMERICAL MATHEMATICS & COMPUTING 6th Edition

Nonconservative Loading: Overview

Finite Element Method (FEM)

ELECO'2001. Paper Submission Form

FINITE ELEMENT SOLUTION OF POISSON S EQUATION IN A HOMOGENEOUS MEDIUM

Numerical Analysis of Electromagnetic Fields

LibMesh Experience and Usage

8.5 Taylor Polynomials and Taylor Series

Numerical methods for PDEs FEM convergence, error estimates, piecewise polynomials

Using MATLAB and. Abaqus. Finite Element Analysis. Introduction to. Amar Khennane. Taylor & Francis Croup. Taylor & Francis Croup,

ME 1401 FINITE ELEMENT ANALYSIS UNIT I PART -A. 2. Why polynomial type of interpolation functions is mostly used in FEM?

FINITE-VOLUME SOLUTION OF DIFFUSION EQUATION AND APPLICATION TO MODEL PROBLEMS

Sparse Linear Systems. Iterative Methods for Sparse Linear Systems. Motivation for Studying Sparse Linear Systems. Partial Differential Equations

MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF MECHANICAL ENGINEERING CAMBRIDGE, MASSACHUSETTS NUMERICAL FLUID MECHANICS FALL 2011

Nodal O(h 4 )-superconvergence of piecewise trilinear FE approximations

Pattern Recognition Prof. P. S. Sastry Department of Electronics and Communication Engineering Indian Institute of Science, Bangalore

Numerical Programming I (for CSE)

Institute of Structural Engineering Page 1. Method of Finite Elements I. Chapter 2. The Direct Stiffness Method. Method of Finite Elements I

Math 660-Lecture 15: Finite element spaces (I)

Finite Element Method-Part II Isoparametric FE Formulation and some numerical examples Lecture 29 Smart and Micro Systems

Solution Methods. Steady State Diffusion Equation. Lecture 04

Chapter 4: Interpolation and Approximation. October 28, 2005

NUMERICAL MATHEMATICS & COMPUTING 7th Edition

Transcription:

Middle East Technical University Department of Mechanical Engineering ME 43 Introction to Finite Element Analysis Chapter 2 Introction to FEM These notes are prepared by Dr. Cüneyt Sert http://www.me.metu.e.tr/people/cuneyt csert@metu.e.tr These notes are prepared with the hope to be useful to those who want to learn and teach FEM. You are free to use them. Please send feedbacks to the above email address. 2-

Disadvantages of Ritz and MWR They provide global solutions, i.e. a single approximate solution is valid over the whole problem domain. Difficult to capture complicated 2D and 3D solutions on complex domains. Not suitable to solve problems with multiple materials. Approximation function selection is problem (DE, BC, domain size) dependent. Difficult to automate. practically impossible for complex 2D and 3D geometries. See the problem below. NOT unique. y Top : Convection heat loss with h, T Materials with two different conctivities Left: 2 o C T(x, y) =? Bottom: Heat coming in Right: Insulated x 2-2

FEM vs. Ritz Finite Element Method (FEM) does NOT seek a global solution divides the problem domain into elements of simple shapes works with simple polynomial type approximate solutions over each element y Simple, low-order polynomial solution over each element T y x x FEM is similar to Ritz method uses weak form weight function selection is the same Simple shaped elements 2-3

Our First FE Solution e.g. Example 2. Solve the following problem using FEM d2 u 2 u = x2, < x < u =, u = This was already solved in Chapter. Exact solution is Exact solution of Example 2. u exact = sin x + 2sin( x) sin() + x 2 2 -. -.2 -.3 -.4 -.5.2.4.6.8 2-4

Our First FE Solution (Example 2.) (cont d) This solution will be very similar to previous Ritz solutions. In Chapter 3 we'll make it more algorithmic and easy to program. This will allow us to write our first FE code. Following 5 node (NN = 5) and 4 element (NE = 4) mesh (grid) will be used. e = e = 2 e = 3 e = 4 2 3 4 5 x h e Element Node Global node number This is a mesh of linear elements (elements that are defined by 2 nodes). This mesh is uniform, i.e. element length h e =.25 is constant. 2-5

Our First FE Solution (Example 2.) (cont d) With linear elements we ll obtain a piecewise linear solution u 2 u 3 u 4 u h : Approximate FE solution u = u 5 = x x 2 x 3 x 4 x 5 x e = e = 2 e = 3 e = 4 FE solution is linear over each linear element. This solution is C continuous, i.e. it is continuous at element interfaces, but its st derivative is not. u j s are the nodal unknown values. The ultimate task is to calculate them. u and u 5 are specified as EBCs. They are actually known. 2-6

Our First FE Solution (Example 2.) (cont d) FE solution of the previous slide can be written as NN NN : Number of nodes u h = u j φ j u j : Nodal unknowns j= φ j (x) : Approximation functions Same form as Ritz. But now unknowns are not just arbitrary numbers. They have a physical meaning, they are the unknown values (e.g. temperatures) at the mesh nodes. In FEM φ is not necessary. To have a piecewise linear u h each φ j should be linear. The above sum should provide nodal unknown values at the nodes. This is satisfied if the following Kronecker-Delta property holds φ j x i = if i = j if i j, i, j =,2,, NN 2-7

Our First FE Solution (Example 2.) (cont d) Following approximation functions will work φ e= e=2 e=3 e=4 x φ φ 2 φ 3 φ 4 φ 5 φ 2 e= e=2 e=3 e=4 x φ 3 These are Lagrange type approximation functions. φ 4 They make sure that the solution is continuous across elements, but not its first derivative. They have Kronecker-Delta property. φ 5 They have local support, i.e. nonzero only over at most two elements. 2-8

Our First FE Solution (Example 2.) (cont d) u 3 u 3 φ 3 u 4 φ 4 Each φ j is multiplied by u j u 4 u 2 φ 2 u 2 u = u 5 u φ u 5 φ 5 e= e=2 e=3 e=4 x NN u h = u j φ j j= u 3 u 4 u 2 u u 5 x 2-9

Our First FE Solution (Example 2.) (cont d) FEM uses weak form of the DE (same as Ritz) (u is used instead of u h for clarity) R = d2 u u + x2 2 wr = w d2 u 2 wu + wx2 x= dw IBP w = Weak form : dw wu + wx2 w = 2-

Our First FE Solution (Example 2.) (cont d) We need to write the weak form NN times with NN different w s. In Galerkin FEM (GFEM) weight function selection is the same as Ritz w i = φ i, i =,2,, NN st eqn (w = φ ) : dφ φ u + φ x 2 φ x= + φ x= = 2 nd eqn (w = φ 2 ) : dφ 2 φ 2u + φ 2 x 2 φ 2 x= + φ 2 x= = 3 rd eqn (w = φ 3 ) : dφ 3 φ 3u + φ 3 x 2 φ 3 x= + φ 3 x= = 4 th eqn (w = φ 4 ) : dφ 4 φ 4u + φ 4 x 2 φ 4 x= + φ 4 x= = 5 th eqn (w = φ 5 ) : dφ 5 φ 5u + φ 5 x 2 φ 5 x= + φ 5 x= = 2-

Our First FE Solution (Example 2.) (cont d) Integrals are easier to evaluate over each element separately. are nonzero only over certain elements For example 3 rd eqn s integral is I 3 = dφ 3 φ 3u + φ 3 x 2 2 4x 4x 3 4x 4x 2 which is nonzero only over e=2 and e=3 because φ 3 is nonzero only over e=2 and e=3. I 3 = + Ω 2 Ω 3 e= e=2 e=3 e=4 x w = φ 3 = 4x u = u j φ j = u 2 (2 4x) + u 3 (4x ) w = φ 3 = 3 4x u = u j φ j = u 3 (3 4x) + u 4 (4x 2) Simplified sum over e=2 Simplified sum over e=3 2-2

Our First FE Solution (Example 2.) (cont d) I 3 can be evaluated in MATLAB as syms x u u2 u3 u4 u5; Part of Example2_.m code % First calculate the part of the integral over the 2nd element. w = 4*x-; % w = Phi3 and it is equal to 4x- over e=2. dw = diff(w, x); u = u2*(2-4*x) + u3*(4*x-); % This is what u is over e=2 = diff(u, x); part = int(dw* - w*u + w*x^2, x,.25,.5); % Now calculate the part over the 3rd element. w = 3-4*x; % w = Phi3 and it is equal to 3-4x over e=3. dw = diff(w, x); u = u3*(3-4*x) + u4*(4*x-2); % This is what u is over e=3 = diff(u, x); part2 = int(dw* - w*u + w*x^2, x,.5,.75); % Add two parts to get the integral of the 3rd equation. I3 = part + part2 2-3

The result for I 3 is : Our First FE Solution (Example 2.) (cont d) Other integrals are calculated in Example2.v2.m MATLAB code (see the next slide). The resultant 5 equations are 47 2 97 24 97 24 47 6 97 24 97 24 u 2 + 47 6 u 3 97 24 u 4 + 25 384 97 24 47 6 97 24 97 24 47 6 97 24 97 24 47 2 u u 2 u 3 u 4 u 5 = 768 7 384 25 384 55 384 27 256 + [K] {u} {F} {Q} x= x= Q Q 5 2-4

Our First FE Solution (Example 2.) (cont d) syms x u u2 u3 u4 u5 Phi I; % Phi(i,j) is the i-th approx. funct. over element j Phi(,) = -4*x; Phi(2,) = 4*x; Phi(2,2) = 2-4*x; Phi(3,2) = 4*x-; Phi(3,3) = 3-4*x; Phi(4,3) = 4*x-2; Phi(4,4) = 4-4*x; Phi(5,4) = 4*x-3; Example2_v2.m code (2 nd & simpler version) coord = [,.25,.5,.75, ]; for i=:5 % Integral loop I(i) = ; % Initialize the i-th integral to zero. for e=:4 % Element loop w = Phi(i,e); dw = diff(w, x); u = u*phi(,e) + u2*phi(2,e) + u3*phi(3,e) + u4*phi(4,e) + u5*phi(5,e); = diff(u, x); I(i) = I(i) + int(dw* - w*u + w*x^2, x, coord(e), coord(e+)); end end 2-5

Our First FE Solution (Example 2.) (cont d) Stiffness matrix NN NN Nodal unknown vector NN K u = F + Q Force vector NN Boundary term vector NN This system has 5 equations for 5 unknowns. u and u 5 are known, but Q and Q 5 are unknown. As a rule, if the PV is known at a boundary, corresponding SV is unknown, and vice versa. Note that Q includes a minus sign, which can be thought as an indicator for boundary normal direction. At x =, boundary outward normal is in x direction Q = At x =, boundary outward normal is in +x direction Q 5 = + x= x= 2-6

Our First FE Solution (Example 2.) (cont d) In practice we first want to solve for the unknown u s, but not Q s. For this we apply rection to the NN NN system and drop the st and 5 th equations, because u and u 5 are known. K K 2 K 3 K 4 K 5 K 2 K 22 K 23 K 24 K 25 K 3 K 32 K 33 K 34 K 25 K 4 K 42 K 43 K 44 K 45 K 5 K 52 K 53 K 54 K 55 u u 2 u 3 u 4 u 5 = F F 2 F 3 F 4 F 5 + Q Q 2 Q 3 Q 4 Q 5 The reced system is 3x3 K 22 K 23 K 24 K 32 K 33 K 34 K 42 K 43 K 44 u 2 u 3 u 4 = F 2 K 2 u K 25 u 5 F 3 K 3 u K 35 u 5 F 4 K 4 u K 45 u 5 + Q 2 Q 3 Q 4 2-7

Our First FE Solution (Example 2.) (cont d) Reced system for this problem is 47 6 97 24 97 24 47 6 97 24 97 24 47 6 u 2 u 3 u 4 = 7 384 25 384 55 384 + Solving this system gives u 2 u 3 u 4 =.232.45.392 Because u = u 5 = Exact values are u 2 u 3 u 4 exact =.234.48.394 2-8

Our First FE Solution (Example 2.) (cont d) coord = [.25.5.75 ]; u = [ -.232 -.45 -.392 ]; plot(coord, u, 'o-b', 'LineWidth', 2) hold x = :.:; uexact = (sin(x) + 2*sin(-x)) / sin() + x.*x - 2; plot(x, uexact, 'r', 'LineWidth', 2) grid on -. FEM Exact -.2 -.3 4 element FE solution vs. exact solution -.4 -.5.25.5.75 2-9

Our First FE Solution (Example 2.) (cont d) Q and Q 5 values generally have physical meaning, such as heat flux or reaction force. After calculating PVs, these SVs can be calculated in two ways. First way : Use the st and 5 th eqns of slide 2-4 Q = 47 2 u 97 24 u 2 + 768 =.95 Good match Q 5 = 97 24 u 4 + 47 2 u 5 + 27 256 =.2639 Second way : Use the derivatives of the FE solution at the boundaries Q = h x= = u 2 u h e =.232.25 =.928 Q 5 = h x= = u 5 u 4 h e = (.392).25 =.568 No match Why? Which one is better? 2-2

Our First FE Solution (Example 2.) (cont d) FEM provides very good nodal values, but what about the first derivative? coord = [.25.5.75 ]; u = [ -.232 -.45 -.392 ]; for i = :4 end slope(i) = (u(i+)-u(i)) /.25; figure; hold for i = :4 end plot([coord(i) coord(i+)],... syms x; [slope(i) slope(i)],... '-b', 'LineWidth', 2) Exact = diff((sin(x) + 2*sin(-x)) / sin() + x.*x - 2, x); X = :.:; plot(x, subs(exact,x,x), 'r', 'LineWidth', 2) grid on.3.2. st derivative comparison -..2.4.6.8 2-2

Remarks About Our First FEM Solution The procere is not suitable to computer programming. Approximation function selection must be made mesh independent. Symbolic integration is costly and not readily available for many prog. languages. Numerical integration is used in FEM codes. For real problems non-uniform meshes are preferred. Generating a good mesh is not easy. Adaptive Mesh Refinement (AMR) is helpful here. u exact Larger elements (coarser mesh) in low gradient regions Smaller elements (finer mesh) in high gradient regions x 2-22

Remarks (cont d) 2D elements can be triangular or quadrilateral. In 3D they can be tetrahedral, triangular prism (wedge) or hexahedral (brick). Triangular Quadrilateral Tetrahedron Triangular prism Hexahedron (Pyramid) (Wedge) (Brick) 2-23

Remarks (cont d) In our first FE solution we used linear (2-node) elements. It is possible to use higher order elements, which make use of more nodes. When we use quadratic (3-node) elements we can have quadratic polynomial solutions over each element. The following sample solution makes use of 3 quadratic elements (NE = 3) with a total node number of 7 (NN = 7). u 6 u 5 u 2 u 3 u 4 u 7 u e= e=2 e=3 x 2-24

Remarks (cont d) Our first FE solution was piecewise continuous. It was continuous across element interfaces, however its first deriative was not. This is known as a C continuous solution, i.e. only the th derivative of the unknown (which is the unknown itself) is continuous. For 2 nd order DEs, the weak form contains first derivative of the unknown and the use of C continuous solution is enough. For higher order DEs, for example the 4 th order one used for beam bending, C continuity is not enough and a C continuous solution is necessary. FEM results in a sparse stiffness matrix, i.e. a matrix with lots of zero entries. This is e to the compact support property of the approximation functions. For 2D and especially for 3D problems this feature is important to decrease memory usage of the code. 2-25

Remarks (cont d) The structure of the final linear algebraic equation system depends on how we number the mesh nodes globally. When we do a different numbering, the final equation system does NOT change mathematically, however the [K] matrix changes. In certain linear system solution techniques [K] is stored as a banded matrix and bandwidth of [K] is tried to be minimized to decrease memory usage. Bandwith of K is directly related to how we number the mesh nodes. Commercial FE software use bandwidth rection algorithms to minimize the bandwidth of [K]. In the problem we solved, [K] turns out to be symmetric. This is a e to the solved DE and the use of GFEM. The following DE with the additional st derivative will not result in a symmetric [K]. d2 u 2 + u = x2 2-26

The DE we solved was linear. Remarks (cont d) For a nonlinear DE, such as the following one, an extra linearization step is necessary to obtain the system of linear algebraic equations. u d2 u u = x2 2 2-27