finite element method iimage.diku.dk/ganz/lectures/fem_slides_mel.pdf · 2011-02-10 · (see also...

22
Finite Element Method I Getting Started Melanie Ganz [email protected] Department of Computer Science University of Copenhagen 11. Januar 2010

Upload: vudung

Post on 17-Sep-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

Finite Element Method IGetting Started

Melanie [email protected]

Department of Computer ScienceUniversity of Copenhagen

11. Januar 2010

Page 2: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

Getting Started

Before we start on FEM, we should be clear on what you need toknow a bit about

Ordinary Differential Equations (ODEs),

Stress and

Strain.

The basics of ODEs you can find in any math text book and anintroductory lecture to stress and strain from last year’s course,Physics Based Animation, is uploaded on Absalon.

2

Page 3: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

What Is FEM?

FEM is a procedure for obtaining numerical approximations to thesolution of boundary value problems.

3

Page 4: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

So What Are Boundary Value Problems?

If we e.g. have two ordinary differential equations (ODEs)

xi = vi

vi =Fimi

(that could e.g. results from the second law of motion, Fi = mi xi ),then given xi (0), vi (0) we call it an

Initial Value Problem (IVP)

and given xi (0), xi (T ), we call it a

Boundary Value Problem (BVP)

4

Page 5: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

Back To What Is FEM?

So FEM is a procedure for obtaining numerical approximations tothe solution of boundary value problems, which are sets of ordinarydifferential equations whose solution is subject to certain boundary

conditions.

5

Page 6: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

What Is FEM In Detail?

The general idea is to formulate a deformation of a solid or fluid asa matrix equation of the following form:

Ka = f

Here K is a symmetric, positive definite stiffness matrix, a is avector of nodewise displacements and f is a vector of external

forces. The goal of FEM is to solve for a.

6

Page 7: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

How do we get there?

How can we get to this mysterious matrix equation?

Ka = f

By e.g. applying the Principle of Virtual Work.

7

Page 8: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

Back to the Basics: Work

The definition of mechanical work is given by

W =

∫CF · ds,

where C is the curve transversed by the object, F is the force vectoracting on the object and s is the position vector of the object.

8

Page 9: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

Back to the Basics: Principle of Virtual Work

The Principle of Virtual Work establishes a relation betweenvariations in internal and external work due to infinitesimal

displacement variations for a deformable body.

Internal work =

∫ΩδεTσdΩ (1)

External work =

∫ΩδuTbdΩ +

∫ΓδuT tdΓ (2)

Here σ are internal stresses, b are external body forces and t arethe external surface forces, while δε are strains and δu are

displacements. Ω is the volume or area and Γ the boundary of theelements we consider.

9

Page 10: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

Back to the Basics: Principle of Virtual Work

For a general deformable body the Principle of Virtual Work canthen be written as∫

ΩδεTσdΩ =

∫ΩδuTbdΩ +

∫ΓδuT tdΓ

(see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47)This means that arbitrary virtual displacements must lead to

identical variations in internal and external work.

10

Page 11: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

From there on

We make the following substitutions in our virtual work equations(see Zienkiewicz and Taylor, Appendix C):

We approximate the overall displacement by the sum of smalldisplacements at each node u =

∑i Niai = Na

We use the definition of strain ε = SNa = Ba and

stress σ = D(ε− ε0) + σ0, but set ε0 = σ0 = 0.

We remember that (ab)T = bTaT .

11

Page 12: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

From there on

This way we get∫ΩδaBTDBadΩ =

∫ΩδaNTbdΩ +

∫ΓδaNT tdΓ

which can be written as

δa

(∫ΩBTDBdΩa−

∫ΩNTbdΩ −

∫ΓNT tdΓ

)= 0

12

Page 13: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

From there on

Since this has to hold for all arbitrary displacements δa we end upwith the solution if∫

ΩBTDBdΩa−

∫ΩNTbdΩ −

∫ΓNT tdΓ = 0

This can also be written as

Ka = f,

if we define K =∫

Ω BTDBdΩ and f =∫

Ω NTbdΩ +∫

Γ NT tdΓ.

13

Page 14: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

How do we do this in practice?

We’ll learn how to do that by a simple example now and in theexercise this week!

14

Page 15: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

A Simple Example

In Zienkiewicz and Taylor we can find a nice example on page 88:

We see a triangle element as itcould also appear in a deformablebody. So let’s try to assemble anequation like

Ka = f,

for it.

15

Page 16: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

A Simple Example

We first need to define the displacements u and how to calculatethem as given in u =

∑i Niai = Na. You can follow on page 88 of

Zienkiewicz and Taylor how he derives the Ni .

For our example they look likethis:

Ni =ai + bix + ciy

2AtriI

where ai = xjym − xmyj ,bi =yj − ym,ci = xm − xj , Atri is thearea of the triangle ijm and I is atwo by two identity matrix.

16

Page 17: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

A Simple Example

Next we need to find a way of expressing K.

It is defined as K =∫

Ω BTDBdΩ, but since we only have oneelement we can drop the integral and get

K = BTDB

Let’s start with B: It is defined as B = SN or per node i asBi = SNi . We already know Ni from above. S is according tothe definition of total strain given as

S =

∂∂x 0

0 ∂∂y

∂∂y

∂∂x

17

Page 18: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

A Simple Example

Next we look for D: For planar stress in an isotropic materialyou can find the elasticity matrix to be

D =E

1 − ν2

1 ν 0ν 1 00 0 1−ν

2

,

where E is the elastic modulus and ν is Poisson’s ratio.

18

Page 19: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

A Simple Example

To get the right hand side of our matrix equation, we need tocalculate f =

∫Ω NTbdΩ +

∫Γ N

T tdΓ.

We already know N.

What we need is b. For plane stress that will simply look like

b = (bx , by )T .

The tricky part is now to carry out the integrationf1 =

∫Ω NTbdΩ. (You can see the details on page 96 in

Zienkiewicz and Taylor.) Important is that one ends up with

fe = (f ei , fej , f

em)T = −Atri

3(bx , by , bx , by , bx , by )T ,

which means that the total forces acting in the x and ydirections are distributed to the three nodes in equal parts.

19

Page 20: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

A Simple Example

The last missing piece is t in f2 =∫

Γ NT tdΓ. t are the

external surface forces, like pressure, and they will depend onthe problem we are given. If one e.g. gets the application of aforce acting like gravity on all nodes i, then

t = (0,−ty ).

If we have a force pulling just on e.g. the third node, we canengineer f2 to sth. like

f2 = (0, 0, 0, 0, 0,−ty )T .

20

Page 21: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

A Simple Example

If you now plug in numbers for the coordinates and the forces, youend up with a matrix equation

Ka = f,

that you can solve with MatLab.

21

Page 22: Finite Element Method Iimage.diku.dk/ganz/Lectures/fem_slides_mel.pdf · 2011-02-10 · (see also Zienkiewicz and Taylor, chapter 3, page 55, eq. 3.47) This means that arbitrary virtual

That is It!

Questions?

22