- Home
- Documents
*Finite Element Methods for Partial Diï¬€erential obokhove/twente/readerv4_0.pdfFinite...*

prev

next

out of 45

View

215Download

0

Embed Size (px)

Finite Element Methods for PartialDifferential Equations

Reader 2005/Version 4.0

J.J.W. van der Vegt and O. BokhoveFaculty of Mathematical Sciences

University of Twente

April 29, 2009

Contents

1 Introduction 3

2 Finite Elements Methods for One-Dimensional Problems 5

2.1 Weak formulation for a model problem . . . . . . . . . . . . . . . . . . . . . 52.2 Finite element formulation using linear basis functions . . . . . . . . . . . . 72.3 Finite element discretization for a fourth order ordinary differential equation 112.4 Discontinuous Galerkin methods . . . . . . . . . . . . . . . . . . . . . . . . 18

2.4.1 Model hyperbolic problem . . . . . . . . . . . . . . . . . . . . . . . . 182.4.2 Finite elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4.3 Polynomial basisfunctions . . . . . . . . . . . . . . . . . . . . . . . . 182.4.4 Weak formulation and finite element discretization . . . . . . . . . . 192.4.5 Numerical flux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.4.6 Time integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3 Finite Elements Methods for Two-Dimensional Elliptical Equations 23

3.1 Model Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2 Weak Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.3 Mesh & Master Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.4 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.5 Solution Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

4 Exercises 25

1

2 Contents

Chapter 1

Introduction

In these class notes we will discuss finite element techniques for the solution of partial dif-ferential equations. The class notes should be used in combination with the book:

Introduction to Scientific Computing, by B. Lucquin and O. Pironneau, John Wiley & Sons,(1998), ISBN 0-471-97266-5.

The mark of the course is based on the students performance in the following exercisesand an oral examination.

Three exercises are set: i, v, and viii and xi in Section 4. Bonus question ix.

The oral examination occurs after making an appointment with Onno Bokhove, Room416, Applied Mathematics, Phone 053 4893412, email: o.bokhove@math.utwente.nl;or Jaap van der Vegt.

3

4 Chapter 1. Introduction

Chapter 2

Finite Elements Methods for

One-Dimensional Problems

Finite element methods provide a general solution technique for partial differential equationswith a very wide range of applicability. They are especially well suited for problems whichrequire unstructured meshes. In addition, finite element methods are based on a solidmathematical background. The basic concept of finite element methods is, however, moredifficult to understand than for finite difference methods. In order to give an outline of thebasic components of finite element methods we will discuss in this section their applicationto the solution of boundary value problems in one space dimension. We will show thebasic steps to derive a finite element discretization, which will be generalized later to moredimensions and different boundary conditions.

2.1 Weak formulation for a model problem

Consider the following model problem:

d

dx

(

a(x)du

dx

)

+d

dx

(

b(x)u(x))

+ c(x)u(x) = s(x), x (0, 1),u(0) = g0, (2.1.1)

a(1)du(1)

dx+ b(1)u(1) = g1,

with u C2(0, 1) C1([0, 1]). The functions a, b C1[0, 1] and c, s C0([0, 1]) are givenfunctions on the interval (0, 1) and g0, g1 R are given boundary data. Here, Cn([x0, x1])denotes the space of n-times continuously differentiable functions on the interval [x0, x1]with x1 > x0.

We can solve the boundary value problem (2.1.1) analytically or with a finite differencetechnique. This requires that u is at least twice continuously differentiable for the solutionto exist. Also, the coefficients a and b must be sufficiently smooth. For many applications,for instance with discontinuous coefficients, and more general boundary conditions theserequirements are too restrictive and we have to relax the smoothness requirements. This isaccomplished by considering weak solutions and transforming the boundary value probleminto a weak formulation.

5

6 Chapter 2. Finite Elements Methods for One-Dimensional Problems

In order to define the weak formulation for (2.1.1) we must first define the space:

Vg = {u C1([0, 1]) |u(0) = g}.

If we multiply (2.1.1) with arbitrary test functions w V0, and integrate over the domain[0, 1] then we obtain the weighted residual formulation of the original equation (2.1.1):

1

0w(x)

( d

dx

(

a(x)du

dx

)

+d

dx

(

b(x)u(x))

+ c(x)u(x) s(x))

dx = 0.

The weak formulation is now obtained through integration by parts:

1

0

(

a(x)dwdx

du

dx b(x)dw

dxu(x) + c(x)w(x)u(x) s(x)w(x)

)

dx

+[

w(x)(

a(x)du

dx+ b(x)u(x)

)

]1

x=0= 0.

The integration by parts results in boundary contributions, which can be replaced by eitherusing the boundary conditions or using the restrictions imposed on the test functions w.

At x = 0 we have the boundary condition u(0) = g0 and we impose the restrictionw(0) = 0 on the test functions w because this eliminates the boundary contributiona(0)du(0)/dx+ b(0)u(0) from the weak formulation, which we do not want to imposeat x = 0. The boundary condition u(0) = g0 is called an essential boundary condition.

At x = 1 we can introduce the condition a(1)du(1)/dx+ b(1)u(1) = g1 into the weakformulation and there is no restriction on the test functions w at x = 1. This boundarycondition is called a natural boundary condition because it is directly provided by theweak formulation.

The boundary value problem (2.1.1) can now be formulated in terms of the equivalent weakformulation:

Find a u Vg0, such that for all w V0, the equation: 1

0

(

a(x)dwdx

du

dx b(x)dw

dxu(x) + c(x)w(x)u(x) s(x)w(x)

)

dx+ w(1)g1 = 0

is satisfied.

An important benefit of the weak formulation is that we now only have to require thatu is one time differentiable instead of two times. Also, the functions a, b, c and d only haveto be integrable and bounded. The weak formulation provides now the basis for the finiteelement discretization.

If we introduce the bilinear form a(u,w) : Vg V0 R, and the linear form l(w) : V0 R, which are defined as:

a(u,w) =

1

0

(

a(x)dudx

dw

dx b(x)u(x)dw

dx+ c(x)u(x)w(x)

)

dx

l(w) =

1

0s(x)w(x)dx w(1)g1,

Chapter 2. Finite Elements Methods for One-Dimensional Problems 7

then we can express the weak formulation as:

Find a u Vg0, such that for all w V0, the equation:

a(u,w) = l(w)

is satisfied.

This abstract formulation is very useful, since many properties of the weak solution andthe finite element discretization, such as existence and uniqueness, can be proved withoutknowing the specific details of the weak formulation.

2.2 Finite element formulation using linear basis functions

The weak formulation is the starting point for the numerical discretization. This is accom-plished by introducing discrete spaces Vg,h, which approximate functions in Vg sufficientlyaccurate. This can be done with global basis functions, such as Fourier series and severaltypes of orthogonal polynomials, and results in spectral methods. Spectral methods arevery accurate with the proper choice of basis functions and when the problem has smoothsolutions, but are difficult to apply in domains with a complicated shape and for generalboundary conditions.

It is much easier to split the domain into open domains Kj , which are called elements,such that Nj=1Kj = and Kj Kj for j 6= j, (j, j {1, , N}) is only a vertex. Herethe closure of the domain is defined as , that is, the domain and its boundary. Hence, the elements cover the domain and they do not overlap. The key feature ofa finite element method is now the use of local basis functions, which are only non-zero ina small number of elements.

Subdivide the interval (0, 1) into a finite number of N non-overlapping intervals Kj =(xj1, xj), (j = 1, , N). Let V kg,h = {u C0 |u P k(Kj), Kj , u(0) = g} Vg,with P k(0, 1) the space of polynomials of degree k on the interval (0, 1). This implies thatin each element we use polynomial basis functions of degree k, but we only require that thefunctions are continuous at the element boundaries. The basis functions j are defined as:j(x) P k(Kj) if x Kj, and satisfy the condition i(xj) = ij , with ij the Kronckerdelta symbol, which is defined as ij = 1 if i = j, and zero otherwise. This implies that:

j(x) =

{

1, if x = xj ,0, if x = xk, k 6= j.

An example of linear basis functions, see Fig. 2.1a, are:

j(x) =

(x xj1)/(xj xj1), if xj1 x xj,(xj+1 x)/(xj+1 xj), if xj x xj+1,

0, otherwise.

The trial functions u V kg,h and test functions w V k0,h can now be defined as:

u(x) = g00(x) +

N

j=1

ujj(x) and w(x) =

N

j=1

wjj(x).

8 Chapter 2. Finite Elements Methods for One-Dimensional Problems

The contribution g0 0(x) is added to satisfy the boundary condition u(0) = g0, since allother basis functions j are zero at the boundary. Since each of the global basis functions jis only non-zero in the two elements connectin