of 22

• date post

04-Jun-2018
• Category

## Documents

• view

231

0

Embed Size (px)

### Transcript of Finite element method - TU kuzmin/cfdintro/   Finite element method Origins: structural

• Finite element method

Origins: structural mechanics, calculus of variations for elliptic BVPs

Boundary value problem

Lu = f in

u = g0 on 0

n u = g1 on 1

n u+ u = g2 on 2

?

Minimization problem

Given a functional J : V R

find u V such that

J(u) J(w), w V

subject to the imposed BC

the functional contains derivatives of lower order

boundary conditions for complex domains can be handled easily

sometimes there is no functional associated with the original BVP

Modern FEM: weighted residuals formulation (weak form of the PDE)

• Theory: 1D minimization problem

Minimize J(w) = x1x0

(x,w, dw

dx

)dx over w V = C2([x0, x1])

subject to the boundary condition w(x0) = g0

Find u V such that J(u) J(w) for all admissible w

w(x) = u(x) + v(x), R, v V0 = {v V : v(x0) = 0}

J(u+ v) =

x1

x0

(

x, u+ v,du

dx+

dv

dx

)

dx = I()

vu +

x 0

x 1

w

gu

By construction w(x) = u(x) for = 0 so that

I(0) I(), R dI

d

=0

= 0, v V0

Necessary condition of an extremum

J(u, v)def

=d

dJ(u+ v)

=0

= 0, v V0the first variation of the

functional must vanish

• Necessary condition of an extremum

Chain rule for the function = (x,w,w), w = dwdx

dd

= x

dxd

+ w

dwd

+ w

dw

d, where dx

d= 0, dw

d= v, dw

d= dv

dx

First variation of the functional

d

dJ(u+ v)

=0

=

x1

x0

[

wv +

wdv

dx

]

dx = 0, v V0

Integration by parts using the boundary condition v(x0) = 0 yields

x1

x0

[

w

d

dx

(

w

)]

v dx+

w(x1)v(x1) = 0, v V0

including v V = {v V0 : v(x1) = 0} w

ddx

(w

)

= 0

Substitution w

(x1) v(x1)

arbitrary

= 0, v V0 w

(x1) = 0

• Du Bois Reymond lemma

Lemma. Let f C([a, b]) be a continuous function and assume that

b

a

f(x)v(x) dx = 0, v V = {v C2([a, b]) : v(a) = v(b) = 0}

Then f(x) = 0, x [a, b].

Proof. Suppose x0 (a, b) such that f(x0) 6= 0, e.g. f(x0) > 0

f is continuous f(x) > 0, x (x0 , x0 + ) (a, b)

Let v(x) =

{

exp(

12(xx0)2

)

if |x x0| <

0 if |x x0| x0x0 x0 +

v V but b

af(x)v(x) dx =

x0+

x0f(x) exp

(

12(xx0)2

)

dx > 0

f(x) = 0, x (a, b) f C([a, b]) f 0 in [a, b]

• Example: 1D Poisson equation

Constraints imposed on the solution w = u of the minimization problem

w

ddx

(w

)

= 0 Euler-Lagrange equation

u(x0) = g0 essential boundary condition

w

(x1) = 0 natural boundary condition

Poisson equation: the solution u Vg = {v C2([0, 1]) : v(0) = g0}

minimizes the functional J(w) =

1

0

[

1

2

(dw

dx

)2

fw

]

dx, w Vg

(x,w,w) =1

2

(dw

dx

)2

fw,

w= f

w=dw

dx,

d

dx

(

w

)

=d2w

dx2

d2udx2

= f in (0, 1)

u(0) = g0 Dirichlet BC

dudx

(1) = 0 Neumann BC

• Example: 2D Poisson equation

Find u Vg = {v C2() C() : v|0 = g0} that minimizes the functional

J(w) =

[1

2|w|2 fw

]

dx

1

g1w ds

2

g2w ds+

2

2

w2 ds, w Vg

where f = f(x), g0 = g0(x), g1 = g1(x), g2 = g2(x), 0

Admissible functions w = u+ v, v V0 = {v C2() C() : v|0 = 0}

Necessary condition of an extremum ddJ(u+ v)

=0

= 0, v V0

|w|2 =

[(wx

)2+

(wy

)2]

= 2[wx

vx

+ wy

vy

]

= 2w v

[u v fv] dx

1

g1v ds

2

g2v ds+

2

uv ds = 0, v V0

• Example: 2D Poisson equation

Integration by parts using Greens formula

[u f ]v dx +

12

(n u)v ds

1

g1v ds

2

g2v ds+

2

uv ds = 0

v V0 including v C2() C() : v| = 0

[u f ]v dx = 0

Du Bois Reymond lemma: u = f in Euler-Lagrange equation

1

[n u g1]v ds+

2

[n u+ u g2]v ds = 0, v V0

Consider v C2() C() : v|01 = 0

2= 0, n u+ u = g2

Substitution yields

1= 0, n u = g1 and the following BVP

u = f in 2D Poisson equation

u = g0 on 0 Dirichlet BC (essential)

n u = g1 on 1 Neumann BC (natural)

n u+ u = g2 on 2 Robin BC (natural)

• Rayleigh-Ritz method

Exact solution

u V : u = 0 +

j=1

cjj

Approximate solution

uh Vh : uh = 0 +N

j=1

cjj

0 an arbitrary function satisfying 0 = g0 on 0

j basis functions vanishing on the boundary part 0

Continuous problem

Find u V such that

J(u) J(w), w V

Discrete problem

Find uh Vh such that

J(uh) J(wh), wh Vh

J(c1, . . . , cN ) = minwhVh

J(wh) J

ci= 0, i = 1, . . . , N

Linear system: Ac = b, A RNN , b RN , c = [c1, . . . , cN ]T

• Example: 1D Poisson equation

Find the coefficients c1, . . . , cN that minimize the functional

J(wh) =

1

0

[

1

2

(dwhdx

)2

fwh

]

dx, wh =

N

j=1

cjj

Necessary condition of an extremum

J

ci=

ci

1

2

1

0

N

j=1

cjdjdx

2

dx

1

0

f

N

j=1

cjj

dx

= 0

1

0

didx

N

j=1

cjdjdx

dx =

1

0

fi dx, i = 1, . . . , N

This is a linear system of the form Ac = b with coefficients

aij =

1

0

didx

djdx

dx, bi =

1

0

fi dx, c = [c1, . . . , cN ]T

• Example: poor choice of the basis functions

Consider the polynomial basis 0 = 0, i = xi, i = 1, . . . , N

uh(x) =

N

j=1

cjxj , aij =

1

0

ij xi+j2 dx =ij

i+ j 1, bi =

1

0

fxi dx

A =

1 1 1 1 1

1 4/3 6/4 8/5 2N/(N + 1)

1 6/4 9/5 12/6 3N/(N + 2)

1 8/5 12/6 16/7 4N/(N + 3)

1 N2/(2N 1)

, b =

b1

b2

b3

b4

bN

, c =

c1

c2

c3

c4

cN

A is known as the Hilbert matrix which is SPD but full and ill-conditioned

so that the solution is expensive and corrupted by round-off errors.

for A to be sparse, the basis functions should have a compact support

• Fundamentals of the FEM

The Finite Element Method is a systematic approach to generating

piecewise-polynomial basis functions with favorable properties

The computational domain is subdivided into many

small subdomains K called elements: =

KThK.

The triangulation Th is admissible if the intersection of

any two elements is either an empty set or a common

vertex / edge / face of the mesh.Figure 4: Two nodal basis functions for the polygonal domain examplecomprising the right hand side as well as the entriesai;j = a(j; i) = Zri rj dx; i; j = 1; : : : N; (12)of the nite element system matrix A. This is where the advantage of the nodal basisfunction becomes apparent: the above integrals reduce to integrals over supp(i) in therst case and supp(i)\supp(j) in the second. The supports of two nodal basis functionsfor linear triangles consists of all those triangles of which the corresponding node is avertex. The supports of two basis functions in our example are shown in Figure 5.

Figure 5: Supports of 22 (left) and 27 (middle) and their common support (right)Thus, whenever basis functions with small support are used, all integrations need onlybe performed over a small number of elements. Rather than computing the integrals (11)and (12) successively, it is common practice in nite element software to traverse the gridelement by element and, for each element, to compute the partial sums of all integralsinvolving this element. These partial sums are then added to the appropriate componentsof A and f .The basis functions whose supports lie in a given element are termed the local basisfunctions belonging to this element. In our example using linear triangles, there are threelocal basis functions on each triangle K, say p; q and r, and we denote their restrictionto K by 'K1 = (p)jK; 'K2 = (q)jK and 'K3 = (r)jK:This introduces a local numbering of these basis functions on each element, i.e. on el-ement K, the (global) basis functions p; q and r are assigned the local numbers 1,2 and 3, respectively. We denote the mapping assigning local indices to p on elementK by i = GL(p;K) and the local to global mapping by p = LG(i; K). The quantities

The finite element subspace Vh consists of piecewise-polynomial functions.

Typically, Vh = {v Cm() : v|K Pk, K Th}.

Any function v Vh is uniquely determined by a finite number of degrees

of freedom (function values or derivatives at certain points called nodes).

Each basis function i accommodates exactly one degree of freedom and

has a small support so that the resulting matrices are sparse.

• Finite element approximation

The finite element is a triple (K,P,), where

K is a closed subset of

P is the polynomial space for the shape functions

is the set of local de