Docsity

Notes on Finite Element Modelling, Monegato, Dispense di Modelli E Metodi Numerici

Anteprima parziale del testo

Scarica Notes on Finite Element Modelling, Monegato e più Dispense in PDF di Modelli E Metodi Numerici solo su Docsity!

Notes on Finite Element Modelling

Giovanni Monegato

a.a. 2014/

Chapter 1

Introduction

1.1 Some examples of PDE problems

We start by showing some examples of problems described by Partial Dierential Equations (PDE). To this end we rst dene some symbols (op- erators) that we shall use. Consider an open bounded domain Ω ⊂ R^2 , whose boundary is denoted by Γ. Let, for example, u = u(x) and w = w(x) = (w 1 (x 1 , x 2 ), w 2 (x 1 , x 2 ))T^. These symbols are:

  • the gradient vector of u(x)

∇u =

( ∂u ∂x 1

∂u ∂x 2

)T

  • the normal derivative of u at the boundary point x ∈ Γ

∂u ∂n = ∇u(x) · n(x) =

∑^2

i=

∂u ∂xi ni

where n(x) = (n 1 (x), n 2 (x))T^ denotes the unit outer (vector) normal to Γ at the point x ∈ Γ. We recall that, given two vectors a, b ∈ Rn, their scalar product a · b is dened as follows:

a · b = aT^ b =

∑^ n

i=

aibi.

  • the divergence of a vector eld w

div w = ∂w 1 ∂x 1

∂w 2 ∂x 2

= ∇ · w

  • the Laplacian of u

△u = ∇^2 u = ∂^2 u ∂x^21

∂^2 u ∂x^22

where α = α(x) > 0 , u 0 = u 0 (x) are given functions and β > 0 , γ, δ are given real numbers.

Example 5 (Wave equation initial-boundary value problem). Find the func- tion u = u(x, t) which satises the following conditions:

  

 

utt − c^2 ∆u = f, 0 < x < L, t > 0 u = u 0 , 0 < x < L, t = 0 ut = v 0 , 0 < x < L, t = 0 u = 0, x = 0, t > 0 u = 0, x = L, t > 0

where f = f (x, t), u 0 = u 0 (x), v 0 = v 0 (x) are given functions, and c is the wave speed.

Remark. When the solution u is not suciently smooth, i.e., all the required derivatives are not all continuous in the PDE domain of denition, or are even not dened as (classical) functions, these equations cannot be considered as pointwise equalities; they must be interpreted in a more general sense, called weak or distributional. This new form is the natural generalization of the classical one, in the sense that when all functions are continuous, the two representations are equivalent. The new one, however, holds in more general situations, that often appear in engineering problems. The derivation of this new formulation of the problem will describe in Chapter 2.

1.2 PDE classications

Partial Dierential Equation (PDE) can be sorted into three dierent families: elliptic, parabolic and hyperbolic equations, for each of which a theory and appropriate numerical methods have been developed. First we consider the case of a linear second order PDE, of the form Lu = f , dened in an open region D ⊂ R^2 as follows:

Lu = a ∂ (^2) u ∂x^21 +^ b^

∂^2 u ∂x 1 ∂x 2 +^ c^

∂^2 u ∂x^22 +^ d^

∂u ∂x 1 +^ e^

∂u ∂x 2 +^ gu;

where the coecients a, b, c, d, e, g depend at most on the variables x 1 , x 2. In particular, we consider the part of the equation containing the second order derivatives, and we associate with it the following second order algebraic equation: aξ^2 + bξ + c = 0.

When the two roots of this latter are real and distinct, the PDE is dened hyperbolic, when they real and coincident the PDE is called parabolic, while when the two roots are complex conjugate the equation is dened elliptic.

Thus, by examining the sign of the quantity δ = b^2 − 4 ac in D, we say that δ < 0 ⇒ elliptic δ = 0 ⇒ parabolic δ > 0 ⇒ hyperbolic Note that if the coecients a, b, c are constant then also the sign of δ is constant; otherwise it depends on x 1 , x 2. Examples:

∂^2 u ∂t^2

∂^2 u ∂x^2 = 0 (x 1 = x, x 2 = t)

a = − 1 , b = 0, c = 1 ⇒ δ = 4 > 0 ⇒ hyperbolic

−∆u = f, i.e. − ( ∂^2 u ∂x^21

∂^2 u ∂x^22 ) = f

a = c = − 1 , b = 0 ⇒ δ = − 4 < 0 ⇒ elliptic

∂u ∂t

∂^2 u ∂x^2

(x 1 = x, x 2 = t)

a = − 1 , b = c = 0 ⇒ δ = 0 ⇒ parabolic

y

∂^2 u ∂x^2

∂^2 u ∂y^2 = 0 (a = y, b = 0, c = 1)

δ = − 4 y ⇒

  

elliptic for y > 0 parabolic for y = 0 hyperbolic for y < 0 But what about the equation −∆u = f , when it is dened in Ω ⊂ R^3? Or equations of the type ∂^2 u ∂t^2

− ∆u = f, (1.1)

or

∂u ∂t

− μ∆u + ∇ · (βu) = 0, μ > 0

for the unknown u = u(x, t), x ∈ Ω ⊂ Rn, n = 2, 3 , t > 0 , where in the last one μ > 0 is a given coecient and β is a given vector eld? We recall that

Chapter 2

Elliptic equations

This rst part of the course is devoted to an introduction of the denition and application of the nite element method to elliptic problems. We will rst consider one-dimensional problems (1D), and then their two-dimensional (2D) analogues; the generalization to three-dimensional problems should not pose any diculty. For each of these problems we will derive the associated weak formulation, to which, later, in Section 2.4, we will apply the FEM method. This latter is nothing but a nite dimensional discretization of the problem weak formulation.

2.1 Poisson equation in the 1D case

2.1.1 A 1D homogeneous Dirichlet problem

Let's consider:   

−u′′(x) = f (x), 0 < x < 1 u(0) = 0 u(1) = 0

in the one-dimensional domain Ω = (0, 1), with boundary Γ = { 0 , 1 }. The known term f is assumed square-integrable in (0, 1) (f ∈ L^2 (0, 1)), that is

∫ (^1)

0

|f (x)|^2 dx < ∞.

Under this assumption on the known term f , we can only claim that u(x) and u′(x) are certainly continuous functions, while u′′(x) may very well be non continuous on the whole interval (0, 1). However, since we have assumed f ∈ L^2 (0, 1), we certainly have u′′^ ∈ L^2 (0, 1). The equation (2.1) is called the strong formulation of the 1D Poisson equation; it is dened in a classical sense, i.e., at each point of (0, 1), only if f ∈ C(0, 1), otherwise it must be interpreted in a weak sense. We recall that

C(0, 1) denotes the linear space of all functions which are continuous in the interval (0, 1). If, for example, f (x) is given by a Dirac δ function, the problem is still well dened in the weak or distributional sense. In this case, the solution of the problem exists and it is continuous, but its rst derivative is not a continuous function, and it is not dierentiable in the classical sense. Here are some examples.

(i)

f (x) =

{ 0 0 < x < 0. 4 ; 0. 6 < x < 1 − 1 0. 4 ≤ x ≤ 0. 6

In this case f is a piecewise constant function, hence a L^2 function. The corresponding solution is only in C^1 ([0, 1]), not in C^2 ([0, 1]):

u(x) =

  

− 10 x 0 < x < 0. 4

  • x 2 2 −^

x 2 +^

2 25 0.^4 ≤^ x^ ≤^0.^6 − 101 (1 − x) 0. 6 ≤ x ≤ 1

The notation Ck([0, 1]), k ≥ 1 denotes the linear space of all functions which are continuous in the interval [0, 1], together with their derivatives of order ≤ k. But we can even consider the case where f /∈ L^2 is a delta Dirac function:

(ii) f (x) = −δ(x − 12 ) (which in general represents a unit charge or force concentrated at x = 1/ 2 ). The (weak) solution of our problem is:

u(x) =

{ − 12 x 0 ≤ x ≤ (^12) 1 2 (x^ −^ 1)^

1 2 ≤^ x^ ≤^1

It is continuous in [0, 1], but u′(x) has a jump at x = 1/ 2.

(iii) f (x) = P δ(x − 0 .4) + P δ(x − 0 .6), where P is a given constant. Also in this case the corresponding u(x) obviously cannot be a classical (strong) solution of (2.1), as this latter would require the solution to have a continuous second derivative.

Thus, a formulation of the problem alternative to the strong one, which includes cases like those reported above without requiring the use of "distri- butional calculus", is therefore necessary. To this end, starting from the strong formulation, we derive an associated integral formulation, called variational formulation or weak formulation. The two formulations turn out to be equivalent, as long as the derivative u′′^ and the equality in the rst one are interpreted in the distributional sense. They are equivalent even when the strong formulation has a classical solution, that is, u ∈ C^2 (0, 1).

where [u′v]^10 = u′(1)v(1) − u′(0)v(0). Under the assumptions we have made, we also have u′, v ∈ C[0, 1] (which means that u′(0), u′(1) are nite numbers) and v(0) = v(1) = 0. Therefore [u′v]^10 = 0 and

∫^1

0

u′v′dx =

∫^1

0

f vdx (2.6)

holds for all v ∈ H 01. We observe that both integrals are well dened, i.e., they exist as Riemann integrals. Indeed, it is sucient to recall that given two functions φ, ψ ∈ L^2 (0, 1) we have φψ ∈ L^1 (0, 1). This result is a conse- quence of the Cauchy-Schwartz inequality:

∫^1

0

φψdx |≤ ∥φ∥L 2 ∥ψ∥L 2 (2.7)

Thus the integrals in (2.6) exist by assuming only u ∈ H^1 , v ∈ H 01. All elements of H^1 , hence also those of H^10 , since H^10 ⊂ H^1 , are continuous functions in∫ [0, 1]. Note also that since now v ∈ H 01 , we could not replace 1 0 u ′′vdx by ∫^1 0 uv ′′dx, since the latter integral in general would not be de-

ned, since for innite many elements v ∈ H 01 their second order derivative v′′^ is not square integrable.

Weak formulation of problem (2.1):

Given f ∈ L^2 (0, 1), nd u ∈ V = H 01 (0, 1) such that:

∫^1

0

u′v′dx =

∫^1

0

f vdx, ∀v ∈ V (2.8)

In other terms, introducing the expression (called bilinear form)

a(u, v) =

∫^1

0

u′v′dx

and the linear form (or linear functional)

F (v) =

∫^1

0

f (x)v(x)dx

the above weak formulation (2.8) takes the following canonical representa- tion: Find u ∈ V such that

a(u, v) = F (v), ∀v ∈ V.

In the jargon of weak formulations, the function v tests the equation that is satised by u. Instead of looking at the equation as something that it is satised point-by-point in the domain Ω, we consider an averaged version of the equation. The test function v plays the role of a weight function. Note that although we know that the solution u of our problem is an element of H^2 , vanishing at the endpoints x = 0, 1 , to (uniquely) identify u we search for it in the larger space H 01 (0, 1). In spite of this, since we have assumed f ∈ L^2 , the solution of our problem (2.1) will certainly belong to the subspace H 02 ⊂ H 01 , with H 02 (0, 1) = {u ∈ H^2 : u(0) = u(1) = 0}.

We recall that a linear form F is an application that associates with each element of v ∈ V a real number denoted by F (v), such that

F (αv + βw) = αF (v) + βF (w), ∀v, w ∈ V, ∀α, β ∈ R

A bilinear form is an application a which associates with each pair of elements of V a real number denoted by a(u, v), having the following prop- erties: a(αu + βv, w) = αa(u, w) + βa(v, w) a(u, αv + βw) = αa(u, v) + βa(u, w)

for all u, v, w ∈ V and all α, β ∈ R; that is, a(u, v) is linear with respect to both its arguments.

It can be proved that this new formulation has a unique solution, which coincides with that of (2.1), after interpreting this latter in the distributional sense. However using (2.8) we do not need to enter into the mathematical world of the generalized functions called distributions.

2.1.2 The non-homogeneous Dirichlet problem

When the boundary conditions are of the type: { u(0) = g 0 u(1) = g 1

where g 0 , g 1 are given real numbers, the Dirichlet problem is dened non- homogeneous. In this case, to derive the corresponding weak formulation, we proceed exactly as we did for the homogeneous case. The space of test functions is still V = H 01 (0, 1). Thus we obtain:

∫^1

0

u′v′dx =

∫^1

0

f vdx, ∀v ∈ V (2.9)

However, to this equation we have to add the new boundary conditions: u(0) = g 0 and u(1) = g 1. These are well dened since all elements of the

where f ∈ L^2 (0, 1), σ ∈ L∞^ is bounded below by a positive constant, i.e. σ(x) ≥ σ 0 > 0 for x ∈ [0, 1], and h 0 , h 1 are two given real numbers. Since in this case we do not require the solution u(x) to take prescribed values at the end points x = 0, 1 , the test function space, as well as the space where we will look for the solution u, is V = H^1 (0, 1). Thus, by applying the same procedure followed in the Dirichlet case, we obtain:

∫^1

0

u′v′dx +

∫^1

0

σuvdx − [u′v]^10 =

∫^1

0

f vdx, ∀v ∈ V

i.e.

∫^1

0

u′v′dx +

∫^1

0

σuvdx =

∫^1

0

f vdx + h 1 v(1) − h 0 v(0), ∀v ∈ V (2.12)

Thus the weak formulation of problem (2.11) becomes: nd u ∈ V = H^1 (0, 1) such that (2.12) holds. The solution exists, is unique and coincides with that of the original strong formulation. Note that the Neumann boundary conditions have not been explicitly imposed to the function u we have been looking for, as we did in the Dirichlet case. They have been trivially inserted in the weak formulation; nevertheless, they will be satised by the solution of this latter. In this case we have

a(u, v) =

∫^1

0

u′v′dx +

∫^1

0

σuvdx (2.13)

F (v) =

∫^1

0

f vdx + h 1 v(1) − h 0 v(0)

If in (2.11) we take σ = o, then we have the following problem for the 1D Poisson equation:   

−u′′(x) = f (x) 0 < x < 1 u′(0) = h 0 u′(1) = h 1

We note however that to have a solution, the following compatibility condi- tion must be satised:

h 0 − h 1 =

∫ (^1)

0

f (x)dx

To obtain this, it is sucient to integrate on (0, 1) both members of the dierential equation. But even so, the solution is not unique, since it is

dened up to an additive constant, that is, if u is a solution then also u + c, where c is an arbitrary constant, is a solution. Thus, the problem is not well-posed. To have a unique solution, an extra condition must be imposed; for example, we may require that its average in (0, 1) is zero, that is, ∫ (^1)

0

u(x)dx = 0.

2.1.4 Problems with mixed type boundary conditions

In this section we consider a more general type of boundary conditions:   

−u′′(x) + σ(x)u(x) = f (x), 0 < x < 1 u(0) = h 0 u′(1) + γu(1) = h 1

with f ∈ L^2 , σ ∈ L∞, 0 < σ 0 ≤ σ(x), and γ, h 0 , h 1 are given real numbers. The condition u′(1) + γu(1) = h 1 is called "Robin condition". The space of test function is V = H^1 ΓD = {v ∈ H^1 (0, 1) : v(0) = 0}. In general, the space of test functions is the subspace of H^1 containing only the functions which are vanishing at the endpoints where a Dirichlet condition is imposed. The space where we look for our solution is always H^1 (0, 1), no matter what are the boundary conditions, except for the case where one or two homogeneous Dirichlet boundary conditions are imposed; in such a case, the space H^1 is replaced by the space of test functions V. As usual, to derive the weak formulation, we perform integration by parts:

∫^1

0

u′v′dx +

∫^1

0

σuvdx − [u′v]^10 =

∫^1

0

f vdx, ∀v ∈ V

where now (taking into account the condition: u′(1) + γu(1) = h 1 )

[u′v]^10 = u′(1)v(1) = [h 1 − γu(1)]v(1).

The weak formulation of the problem then takes the following form: nd u ∈ H^1 (0, 1) such that

  

 

∫^1

0

u′v′dx +

∫^1

0

σuvdx + γu(1)v(1) | {z } a(u,v)

∫^1

0

f vdx + h 1 v(1) | {z } F (v)

, ∀v ∈ V

u(0) = h 0

By multiplying the PDE by an arbitrary function v ∈ H 01 (Ω), and integrating over Ω the resulting equation, we obtain:

−

∫

Ω

(∆u)vdx =

∫

Ω

f vdx

with all integrals well dened. Then we apply the Green's formula for the Laplacian: ∫

Ω

(∆u)vdx = −

∫

Ω

(∇u · ∇v)dx +

∫

Γ

v ∂u ∂n

dΓ

Since v|Γ = 0 and ∂u∂n ∈ L^2 (Γ) we have:

∫

Γ

v ∂u ∂n

dΓ = 0

Therefore we have the following weak formulation of problem (2.14): Given f ∈ L^2 (Ω), nd u ∈ V = H 01 (Ω) such that: ∫

Ω

(∇u · ∇v) dx =

∫

Ω

f vdx, ∀v ∈ V (2.15)

It is possible to show that formulation (2.14) is equivalent to the asso- ciated weak formulation we have derived above. Furthermore, this has a unique solution u ∈ V. As in the 1D case, equation (2.15) can be written in the form

a(u, v) = F (v), ∀v ∈ V.

2.2.2 The non homogeneous Dirichlet problem

When the Dirichlet boundary condition is not homogeneous, that is, { −∆u = f in Ω u = g on Γ (2.16)

with g ̸= o, for the unknown solution we still obtain the following integral relationship: ∫

Ω

(∇u · ∇v) dx =

∫

Ω

f vdx, ∀v ∈ V = H 01 (Ω).

Therefore, the problem weak formulation takes the following form: Given f ∈ L^2 (Ω), nd u ∈ H^1 (Ω) such that   

∫ Ω(∇u^ · ∇v)^ dx^ =^

∫ Ω f vdx,^ ∀v^ ∈^ V

u|Γ = g

2.2.3 More general elliptic problems with mixed type bound-

ary conditions

Let's consider a more general case:   

−div(μ∇u) + σu = f in Ω u = g on ΓD μ ∂u∂n = φ on ΓN

where we assume f ∈ L^2 (Ω), μ, σ ∈ L∞(Ω), g ∈ C(ΓD) and φ ∈ L^2 (ΓN ). The expression μ ∂u∂n is called co-normal derivative (when μ = 1 this reduces to the normal derivative) and Γ = ΓD ∪ ΓN , with ΓD ∩ ΓN =Ø. We further assume (^) { μ(x) ≥ μ 0 > 0 σ(x) ≥ 0

Remark. When σ = 0 we require ΓD to be non empty, otherwise the problem is not well-posed.

Proceeding as usual, after having chosen V = H^1 ΓD (Ω) = {v ∈ H^1 (Ω) : v|ΓD = 0}, we write ∫

Ω

[−div(μ∇u) + σu]vdx =

∫

Ω

f vdx ∀v ∈ V

from which, by applying the Green's formula for the divergence operator ∫

Ω

(div u)v dx =

∫

Γ

(u · n)v dΓ −

∫

Ω

(u · ∇v) dx

it follows: ∫

Ω

μ∇u · ∇vdx +

∫

Ω

σuvdx −

∫

ΓN

μ ∂u ∂n

vdΓ =

∫

Ω

f vdx, ∀v ∈ V

that is, ∫

Ω

μ∇u · ∇vdx +

∫

Ω

σuvdx =

∫

Ω

f vdx +

∫

ΓN

φvdΓ, ∀v ∈ V

Finally we have the weak formulation for our problem: nd u ∈ H^1 (Ω) such that   

∫ Ω μ∇u^ · ∇vdx^ +^

∫ Ω σuvdx^ =^

∫ Ω f vdx^ +^

∫ ΓN φvdΓ,^ ∀v^ ∈^ V

u|ΓD = g

Let's now assume that ΓD =Ø, and that on ΓN ≡ Γ we have the following more general boundary condition:

μ ∂u ∂n

  • γu = 0

holds for some real constant α > 0 (ellipticity property of the operator L), σ ∈ L∞, σ(x) ≥ σ 0 > 0 ,

∂u ∂nL = (A∇u) · n =

∑^2

i,j=

aij ∂u ∂xj ni

is the conormal derivative associated with the operator L, and

n =

( n 1 n 2

)

is the normal (to the boundary Γ) unit vector. The associated bilinear form is:

a(u, v) =

∫

Ω

[(A∇u) · ∇v + σuv] dx =

∫

Ω

  ∑^2

i,j=

aij ∂u ∂xj

∂v ∂xi

  • σuv

  (^) dx

Final remark. In all the weak formulations we have derived, the Dirichlet conditions have been explicitly imposed to the problem solutions. That is, for each problem, we have been looking for its solution among all H^1 functions satisfying the given Dirichlet condition. For this reason this type of condition is called essential. The Neumann and Robin type conditions have been naturally inserted in the weak formulations we have obtained; we have not imposed them explicitly to the problem solution. Nevertheless, the solutions of the weak formulations will satises them. They are called natural conditions.