• Non ci sono risultati.

A Variational Multiscale Approach for the Finite Element Discretization of Navier-Stokes Equations

N/A
N/A
Protected

Academic year: 2021

Condividi "A Variational Multiscale Approach for the Finite Element Discretization of Navier-Stokes Equations"

Copied!
214
0
0

Testo completo

(1)
(2)
(3)

Attempting to solve Navier-Stokes equations with a finite element ap-proach has always been a big issue, since a simple use of the standard Galerkin method does not produce, in practical cases, good results: in order to obtain stable solutions it is necessary to add some stabilization terms to the formulation. The present thesis focuses on the possible methodologies able to overcome the typical difficulties related with the finite element resolution of unsteady Navier-Stokes equations in case of incompressible flow; particular attention will be given to a general, pow-erful approach that nowadays is becoming more and more important: the Variational Multiscale Method. The performances of said procedures will be then tested in classic testcases typical in literature: these cases are of fundamental importance, since representing a benchmark capable to investigate the validity of the employed finite element formulation.

(4)
(5)

Introduction 1

I

Theoretical Aspects

5

1 The Finite Element Method 7

1.1 Strong form of the problem . . . 8

1.2 Weak form of the problem . . . 8

1.3 Equivalency of strong and weak forms . . . 10

1.4 Galerkin method . . . 12

1.5 Matrix form of the problem . . . 13

1.6 Remarks . . . 16

1.7 Notations . . . 17

1.7.1 Finite-dimensional vector spaces . . . 18

1.7.2 Infinite-dimensional vector spaces: function spaces 19 2 Finite element method for Advection-Di↵usion 23 2.1 Generalities . . . 23

2.1.1 Strong form . . . 23

2.1.2 Weak form . . . 24

2.1.3 Galerkin Method . . . 25

(6)

2.2.1 Analytical solution . . . 29

2.2.2 Numerical approximations: Finite Di↵erences . . 29

2.2.3 The Finite Element Method . . . 33

2.3 Advection-Di↵usion: multiD case . . . 51

2.3.1 Problem statement . . . 51

2.3.2 Variational Formulation . . . 54

2.3.3 Finite Element Formulations . . . 56

2.4 The Variational Multiscale Method . . . 63

2.4.1 Abstract Dirichlet problem . . . 63

2.4.2 Variational formulation . . . 64

2.4.3 Variational Multiscale Method . . . 64

2.4.4 Example: Advection-Di↵usion equation in 1D . . 73

3 Finite element method for Navier-Stokes 75 3.1 Introduction . . . 76

3.1.1 Rate of deformation and vorticity tensors . . . 76

3.1.2 The stress tensor . . . 77

3.1.3 The Navier-Stokes equations . . . 79

3.2 Numerical resolution . . . 82

3.2.1 Main issues of the incompressible flow problems . 82 3.2.2 Trial solutions and weighting functions . . . 83

3.3 Stationary Stokes problem . . . 84

3.3.1 Strong form . . . 85

3.3.2 Weak form . . . 85

3.3.3 Galerkin formulation . . . 88

3.3.4 Matrix formulation . . . 89

3.3.5 The LBB compatibility condition . . . 90

3.3.6 Stable Methods . . . 92

3.3.7 Stabilized Methods . . . 92

3.3.8 Penalty method . . . 100

3.3.9 The Variational Multiscale Method . . . 102

(7)

3.4.1 Strong forms . . . 106 3.4.2 Initial conditions . . . 109 3.4.3 Boundary conditions . . . 109 3.4.4 Weak forms . . . 114 3.4.5 Galerkin formulation . . . 119 3.4.6 Matrix formulation . . . 120 3.4.7 Stabilized Methods . . . 124

3.4.8 The Variational Multiscale Method . . . 128

3.4.9 Definition of stabilizing parameters . . . 135

II

Preliminary Results

139

4 Numerical results 141 4.1 In-house computational tool . . . 141

4.2 Advection-Di↵usion . . . 142

4.2.1 1D Testcase . . . 143

4.2.2 2D Testcase: Advection skew to the mesh . . . . 148

4.3 Stokes Problem Testcases . . . 149

4.3.1 Analytical Testcases . . . 151

4.3.2 Leaky Cavity . . . 152

4.4 Navier Stokes Testcases . . . 155

4.4.1 Leaky Cavity . . . 158

4.4.2 The Unsteady Leaky Cavity . . . 171

4.4.3 The backward facing step flow . . . 178

5 Conclusions 183 A Newton’s Method 187 B The Generalized-↵ Method 191 B.1 Predictor stage . . . 193

(8)
(9)

1.1 Example of the domain partition into elements: n = 4. . . 13

2.1 Examples of analytical solutions of Advection/Di↵usion equation. . . 30

2.2 Generic node of an equispaced mesh. . . 30

2.3 Comparison between FD and analytical solution for ↵ > 1. . . 31

2.4 Comparison between FD and analytical solution for ↵ < 1. . . 31

2.5 Comparison between FD and analytical solution (upwind di↵erences). 32 2.6 Trend of ⇠ with respect to ↵. . . 34

2.7 Linear shape function of a generic node A, in which the function is cA. 35 2.8 Five-element equispaced mesh. . . 36

2.9 Trend of the stabilization parameter ⌧e with respect to ↵e. . . 42

2.10 Asymptotic definition of ⌧e. . . 43

2.11 Domain definition for the multidimensional advection-di↵usion problem. 52 2.12 Boundary partition according to the boundary condition. . . 52

2.13 Boundary partition according to inlet or outlet flow. . . 53

2.14 Final boundary partition. . . 53

2.15 Geometry of a four-node quadrilateral finite element. . . 58

2.16 Mapping between real and isoparametic domain. . . 59

2.17 Asymptotical choice of ⇠. . . 62

2.18 Domain of the abstract Dirichlet problem. . . 64

2.19 Qualitative behavior of coarse and fine scales. . . 65

2.20 Qualitative example of composition of ¯u and u0 (smooth case). . . . 66

2.21 Finite element discretization of the domain ⌦. . . 68

2.22 Qualitative example of composition of ¯u and u0 (rough case). . . 69

2.23 Definition of unit outward normal n+ and n . . . . . 70

4.1 Almost exact solutions for 1D Advection-Di↵usion no external sources problem. . . 144

(10)

4.2 Galerkin, Galerkin+EAD and SUPG with a = 1 for the 1D Advection-Di↵usion no external sources problem. . . 145 4.3 Galerkin, Galerkin+EAD and SUPG with a = 10 for the 1D

Advection-Di↵usion no external sources problem. . . 145 4.4 Galerkin, Galerkin+EAD and SUPG with a = 100 for the 1D

Advection-Di↵usion no external sources problem. . . 146 4.5 Galerkin, Galerkin+EAD and SUPG with a = 1 for the 1D pure

advective with external sources problem. . . 148 4.6 Advection-Di↵usion skew to the mesh problem. . . 149 4.7 Advection-Di↵usion skew to the mesh problem. Elevation of u for

di↵erent angles. Both inflow and outflow view are given.. . . 150 4.8 Analytical Stokes problem. Kinematic viscosity is 1. . . 152 4.9 Analytical Stokes problem. Analytical and numerical solutions. . . . 153 4.10 Leaky Cavity testcase. . . 154 4.11 Leaky Cavity testcase for Stokes problem. Velocity field and

(kine-matic) pressure elevation. . . 155 4.12 Typical linear system outcome of the FEM discretization for mixed

methods. . . 157 4.13 Leaky Cavity, Re = 500, PSPG: streamlines and contour of velocity,

contour of the kinematic pressure, horizontal velocity at x = 1/2, number of iterations needed for convergence of the GMRES method at each Newton iteration. . . 159 4.14 Leaky Cavity, Re = 500, PSPG+LSIC: streamlines and contour of

velocity, contour of the kinematic pressure, horizontal velocity at x = 1/2, number of iterations needed for convergence of the GM-RES method at each Newton iteration.. . . 160 4.15 Leaky Cavity, Re = 1250, PSPG+LSIC+SUPG,

Divergence/Conven-tional form, full integration of the stabilizing terms: streamlines and contour of velocity, contour of the kinematic pressure, horizontal ve-locity at x = 1/2, number of iterations needed for convergence of GMRES method at each Newton iteration.. . . 162 4.16 Leaky Cavity, Re = 1250, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration of the stabilizing terms: stream-lines and contour of velocity, contour of the kinematic pressure, hor-izontal velocity at x = 1/2, number of iterations needed for conver-gence of GMRES method at each Newton iteration. . . 163 4.17 Leaky Cavity with Re = 1250: e↵ect of considering or not the VMS

contribution. Horizontal velocity (Vx) evaluated at x = 1/2 and x =

7/8 is compared. The number of iterations for the GMRES solver at each Newton step are also shown for each strategy. . . 164

(11)

4.18 Leaky Cavity, Re = 1500, PSPG+LSIC+SUPG+VMS, Divergence/-Conventional form, reduced vs full integration of the SUPG/VMS stabilizing terms: horizontal velocity at x = 1/2 and x = 7/8 and number of iterations needed for convergence of GMRES method at each Newton iteration. . . 165 4.19 Process of obtaining a triangular (P1) elements mesh starting from a

quadratic (Q1) mesh. . . 166 4.20 Leaky Cavity, Re = 500, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration of the SUPG/VMS stabilizing terms: horizontal velocity at x = 1/2 and x = 7/8 for the quad mesh (Q1) and the two triangular meshes (P1). . . 167 4.21 Leaky Cavity, Re = 500, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration of the SUPG/VMS stabilizing terms: horizontal velocity at x = 1/2 and x = 7/8 for the refined quad mesh (Q1) and the two refined triangular meshes (P1). . . 168 4.22 Leaky Cavity, Re = 500, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration of the SUPG/VMS stabilizing terms: streamlines and contour of velocity for the refined quad mesh (Q1) and the two refined triangular meshes (P1). . . 168 4.23 Leaky Cavity, uniform and graded refined grids. The mesh is

repre-sented by 60x60 Q1 elements. . . 169 4.24 Leaky Cavity, Re = 500, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration of the SUPG/VMS stabilizing terms: horizontal velocity at x = 1/2 for di↵erent grids and Q1 elements.169 4.25 Leaky Cavity, Re = 500, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration of the SUPG/VMS stabilizing terms: streamlines and contour of velocity for di↵erent grids and Q1 elements. . . 170 4.26 Leaky Cavity, Re = 1250, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration: streamlines and contour of veloc-ity at di↵erent times. PartI. . . 172 4.27 Leaky Cavity, Re = 1250, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration: streamlines and contour of veloc-ity at di↵erent times. Part II. . . 173 4.28 Leaky Cavity, Re = 1250, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration. Horizontal velocity at x = 1/8, 1/2 and 7/8 for solutions obtained with the steady and unsteady solver (t=30. . . 174 4.29 Leaky Cavity, Re = 5200, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration: streamlines and contour of veloc-ity at di↵erent times. PartI. . . 175

(12)

4.30 Leaky Cavity, Re = 5200, PSPG+LSIC+SUPG+VMS, Divergence/-Conventional form, full integration: streamlines and contour of veloc-ity at di↵erent times. PartII. . . 176 4.31 Leaky Cavity, Re = 5200, PSPG+LSIC+SUPG+VMS,

Divergence/-Conventional form, full integration: streamlines and contour of veloc-ity at di↵erent times. PartIII. . . 177 4.32 The backward facing step flow problem. . . 178 4.33 Backward facing step, Re = 25, PSPG+LSIC+SUPG+VMS, full

in-tegration of the stabilizing terms. Divergence/Conventional form. Streamlines and contour of velocity. . . 179 4.34 Backward facing step, Re = 25, PSPG+LSIC+SUPG+VMS, full

in-tegration of the stabilizing terms. Convective/Conventional form. Streamlines and contour of velocity. . . 180 4.35 Backward facing step, Re = 150, PSPG+LSIC+SUPG+VMS, full

integration of the stabilizing terms. Convective/Stress Divergence form. Pressure contour (top); streamlines and contour of velocity (bottom).. . . 181

(13)

2.1 LM array for a five elements 1D case. . . 36

3.1 Conventional and Divergence forms (convective term). . . 107 3.2 Conventional and Stress Divergence forms (viscous term). . . . 107

(14)
(15)

The present work has the objective to build a finite element method able to solve the Navier-Stokes equations for unsteady, incompressible flow. Approaching this problem with the standard Galerkin method presents two sources of numerical issues, the first due to the convective term and appearing at high Reynolds numbers, the second linked to the presence of the pressure term and arising if the so-called ”inf-sup condition” for the velocity and pressure approximation spaces is not satisfied. These two problems will be separately considered, in order to isolate and overcome both sources of instability: thus, at the beginning the pressure term will not be taken into account, obtaining the Advection-Di↵usion equation; then neglecting the convective term will lead to the Stokes problem.

The general approach used is called Variational Multiscale Method, which is based on the decomposition of the solution in coarse and fine scales: in fact, both problems arising with the standard Galerkin method are viewed as a matter of missing scales, and they may be overcome if more scales are included in the model. Actually, this approach allows one to obtain a stable solution of the problem without refining the mesh employed, but rather taking into account the e↵ect of the fine scales, which are usually neglected, in the coarse-scale equation. Moreover, this method is able to theoretically legitimate the so-called stabilized meth-ods, which historically appeared as a generalization of procedures for obtaining a stable and accurate solution for one-dimensional

(16)

Advection-Di↵usion problems: said procedures were simple to obtain since an ana-lytical solution was available.

In the present work both stabilized and variational multiscale meth-ods will be analyzed, showing their analogies and pointing out their dif-ferences: as already touched on, it may be stated that the Variational Multiscale approach is more general, and it thus appears to have much more potentialities; it will also be obtained that their performances are strictly linked to the value set for the stabilization parameters, which may be chosen after considerations based on the experience or referring to a stability and error analysis of the method.

The structure of the present thesis is the following.

In the first part a deep bibliography research will be performed in order to organize the main (at least, in author’s opinion) theoretical results present in literature and to be able to build a solid theory to approach the numerical resolution of Navier-Stokes equations with; in Chapter 1 the Finite Element Method will be presented in a very simple one-dimensional case, which is however able to show the main properties of the procedure, necessary for the prosecution of the work: the notations that will be employed throughout the dissertation are also introduced. Chapter 2 focuses on Advection-Di↵usion equation: this problem is very useful because, as already pointed out, its finite element resolution al-lows one to face the first numerical issue, namely the instability due to the convective term in cases in which it is dominant over the di↵usive one; in other words, in convention dominated flows (i.e., for high val-ues of P´eclet number) employing a standard Galerkin formulation will lead to spurious oscillation in the solution. It will be shown that first considering the one-dimensional case is illustrative, since the availability of an analytical solution allows one to find a procedure to gain stability and accuracy; this formulation will be then generalized to the multi-dimensional case, giving rise to stabilized methods. The chapter ends introducing the Variational Multiscale Method, a completely di↵erent

(17)

approach that is able to obtain pretty naturally a similar formulation as stabilized methods one. In Chapter 3, Navier-Stokes equations for incompressible flow are considered: first, in order to isolate the other main source of instability for their numerical resolution, the stationary Stokes problem (namely, the limit of the general equations for Reynolds number approaching zero) will be dealt with; the presence of the pres-sure term will lead to a mixed formulation, so that employing a basic Galerkin method is only useful when the interpolation spaces for ve-locity and pressure satisfy the famous compatibility condition, due to Ladyzhenskaya, Babuˇska and Brezzi. Since this approach does not al-low one to use shape functions of the same order (which would be very convenient from an implementation point of view), a formulation able to circumvent said condition will be searched for; again, first consistent stabilized methods will be considered, then a multiscale approach will be performed. The results obtained for Advection-Di↵usion and Stokes problems will be then used for the general case of unsteady Navier-Stokes equations.

The second part deals with the implementation of the theory before exposed in a finite element code: preliminary results regarding classic testcases found in literature will be obtained. The performed cases are: 1D Advection-Di↵usion, 2D Advection-Di↵usion with velocity skew to the mesh, an analytical testcase and the Leaky Cavity for Stokes problem, Leaky Cavity and Backward Facing Step at di↵erent Reynolds numbers for Navier-Stokes formulation (the first case performed also for unsteady flows).

(18)
(19)
(20)
(21)

Chapter

1

The Finite Element Method

In this chapter the Finite Element Method will be introduced, and in order to do so what follows refers to [1], in which Hughes proposed a schematical approach to the standard Galerkin formulation.

Since the purpose is just to fix the main ideas of the method that will be employed in the following chapters, a simple 1D example will be considered, which consists of solving the following scalar di↵erential equation in the variable u (x), where x belongs to the unit interval [0, 1]:

u,xx+ f = 0 (1.1)

In eq.(1.1) f represents a given smooth, scalar valued function, defined as follows

f : [0, 1]! R (1.2)

where R stands for the set of the real numbers; f is smooth in the sense that is of class C1, with at least one derivative existing and being

(22)

1.1

Strong form of the problem

The strong, or classical, form of the problem introduced consists of con-sidering eq.(1.1) completed by the necessary boundary conditions: in this case u is required to satisfy

u (1) = g u,x(0) = h

(1.3)

where h and g are given constants. This means that the first boundary condition involves the value of the variable itself, thus being a condition of Dirichlet type, while the second imposes the value of the derivative of u, thus belonging to the Neumann type. It is now possible to state the strong form of the boundary-value problem, (S), as follows:

given f : [0, 1] ! R and the constants g and h, find u : [0, 1] ! R such that

u,xx+ f = 0

u (1) = g u,x(0) = h

(1.4)

Notice that the aim is to employ an approximation method able to be used in much more complex cases in which exact solutions are not avail-able: for this reason the exact solution of eq.(1.4) will not be considered. Even though some methods of approximation directly begin with this strong statement of the problem, e.g. the finite di↵erence method, for the finite element method a di↵erence formulation is needed, the so-called weak formulation.

1.2

Weak form of the problem

Before proceeding to the weak form of the problem, for integrability properties it is important to introduce the Sobolev spaces of functions: the Sobolev space of degree k consists of all those functions (defined in the domain ⌦) that possess square integrable derivatives through order

(23)

k, namely Hk = Hk(⌦) = ( w/w 2 L2; w,x2 L2;· · · ; w,x· · · x | {z } k times 2 L2 ) (1.5) where L2 = L2(⌦)⌘ H0 = ⇢ w/ Z 1 0 w2dx <1 (1.6)

Notice that from the previous definition it is clear that Hk+1 ⇢ Hk;

moreover, Sobolev’s theorem states that, in one dimension, Hk+1 ⇢ Ck b:

so a function of class Hk+1 has actually continuity of order k and it is

bounded.

The weak, or variational, counterpart of (S) arises after the charac-terization of two classes of functions:

I. the candidate, or trial, solutions are the possible solutions of the problem, required to satisfy the Dirichlet part of the boundary conditions, i.e. in this case u (1) = g; moreover, they are required to belong to H1, which means

Z 1 0

(u,x)2dx <1 (1.7)

The set of trial solutions, denoted by S, can be thus written as follows:

S = u/u 2 H1, u (1) = g (1.8)

II. the weighting functions, or variations, required to be of class H1 and to satisfy the homogeneous counterpart of the Dirichlet

boundary conditions, i.e. in this case w (1) = 0. The collection of weighting functions, denoted by V, is thus defined as

V = w/w 2 H1, w (1) = 0 (1.9)

Taking into account what above defined, the following variational form of the problem, (W), may be stated:

(24)

given f , g, and h as before, find u2 S such that for all w 2 V Z 1 0 w,xu,xdx = Z 1 0 wf dx + w (0) h (1.10)

The w’s are also known as virtual displacements, and the variational equation (1.10) is then called the equation of virtual work as well.

1.3

Equivalency of strong and weak forms

In this section the equivalency between the strong and the weak formu-lations will be shown.

First, it has to be proved that a solution of (S) is also necessarily a solution of (W): being u a solution of (S), recalling the first relation in eq.(1.4), for any w2 V it may be written

0 = Z 1

0

w (u,xx+ f ) dx (1.11)

which integrated by parts becomes

0 = Z 1 0 w,xu,xdx Z 1 0 wf dx wu,x|10 (1.12)

Recalling that w = 0 in the Dirichlet part of the boundary (namely, w (1) = 0) and that u,x = h yields

Z 1 0 w,xu,xdx = Z 1 0 wf dx + w (0) h (1.13)

Furthermore, since u is a solution of (S) it obviously satisfies u (1) = g and, thus, it belongs toS, which completes the proof.

Then, it has to be demonstrated that a solution of (W) must also be a solution of (S): being u a solution of (W), it belongs to S and thus satisfies the boundary condition u (1) = g. For any w 2 V it may be

written Z 1 0 w,xu,xdx = Z 1 0 wf dx + w (0) h (1.14)

(25)

which integrated by parts becomes

0 = Z 1

0

w (u,xx+ f ) dx + w (0) [u,x(0) + h] (1.15)

Now it is simple to prove that u is a solution of (S) as well, for which it is necessary to show that

u,xx+ f = 0 in (0, 1) (1.16)

and

u,x(0) + h = 0 (1.17)

Since eq.(1.15) is valid for all w 2 V, the following particular weighting function can be considered:

w = x (1 x) (u,xx+ f ) (1.18)

which obviously belongs to V since w (1) = 0. Substituting eq.(1.18) in eq.(1.15) results in

0 = Z 1

0

x (1 x) (u,xx+ f )2dx (1.19)

Look at eq.(1.19): since each of the three terms is positive in (0, 1), the only possibility is that

u,xx+ f = 0 in (0, 1) (1.20)

Then taking into account eq.(1.20), eq.(1.15) becomes

0 = w (0) [u,x(0) + h] (1.21)

It now suffices to consider a w such that w (0)6= 0 to conclude that

u,x(0) + h = 0 (1.22)

(26)

It is possible now to point out the di↵erent role of the two types of boundary conditions: the Dirichlet type boundary conditions are the ones that the trial solutions are required to satisfy, thus being referred to as essential boundary conditions; Neumann boundary conditions in-stead, although not explicitly demanded to u, are implied naturally by the satisfaction of the variational equation: they are therefore also known as natural boundary conditions.

As touched on in Section 1.1, finite element methods are based upon the weak formulation presented in eq.(1.10); introducing for reasons of simplicity the following symmetric bilinear forms

a (w, u) = Z 1 0 w,xu,xdx (w, f ) = Z 1 0 wf dx (1.23)

the variational form assumes the simple notation

a (w, u) = (w, f ) + w (0) h (1.24)

1.4

Galerkin method

The basic idea is to approximate S and V, which consists of infinitely many functions, with convenient finite-dimensional set of functions, i.e. Sh and Vh: notice that the superscript is related to the process of

dis-cretization of the domain, whose characteristic length is h. It holds:

Sh ⇢ S

Vh ⇢ V (1.25)

Galerkin’s approximation method now intends to associate to each member vh 2 Vh a function uh 2 Sh in the following way:

(27)

where gh is a given function whose objective is to satisfy the essential

boundary condition, namely

gh(1) = g (1.27)

In this way,Sh and Vh are composed of identical collections of functions.

The variational formulation (1.24) thus takes the form

a wh, uh = wh, f + wh(0) h (1.28)

which, with the use of eq.(1.26) yields the Galerkin formulation of the problem, (G):

find uh = vh+ gh where vh 2 Vh such that for all wh 2 Vh

a wh, vh = wh, f + wh(0) h a wh, gh (1.29)

1.5

Matrix form of the problem

The equations that arise when using the Galerkin method can be written in matrix form, as will be now shown.

Let the domain [0, 1] be partitioned into n non-overlapping subinter-vals: the extremities of these subintervals (or elements) are called nodes, and they are A = 1, ..., n + 1. For example, the situation for n = 4 is depicted in Figure 1.1: the length of the maximum element is taken as the mesh parameter h.

1 2 3 4 5

1 2 3 4

x = 0 x = 1

Figure 1.1: Example of the domain partition into elements: n = 4.

Introducing now the shape or basis functions NA’s, which take on

the value 1 at the respective node and are 0 at all other nodes (their behavior could be linear, quadratic, cubic etc.), every wh 2 Vh can be

expressed in the following way:

wh = X

A2⌘ ⌘g

(28)

where cA’s are constants; furthermore, ⌘ is the set of global node numbers,

while ⌘g is referred to the nodes in which there is an essential boundary

condition. Since in the case considered this collection is only composed of the node n + 1, ⌘g ={n + 1} and eq.(1.30) may be written as

wh =

n

X

A=1

cANA (1.31)

Notice that Nn+1 has not be taken into account because it does not

belong to Vh, since at the last node every weighting function must be

zero (i.e. wh(1) = 0): the same considerations could be made in case of

other Dirichlet nodes possibly present. Then defining:

gh = gNn+1 (1.32)

which allows the satisfaction of the boundary condition in x = 1, i.e. gh(1) = g, every uh 2 Sh may be written as

uh =

n

X

A=1

dANA+ gNn+1 (1.33)

where dA’s are constants.

Substituting the expressions obtained in eqs.(1.31) and (1.33) in (1.29), the following relation is obtained

a n X A=1 cANA, n X B=1 dBNB ! = n X A=1 cANA, f ! + n X A=1 cANA(0) h a n X A=1 cANA, gNn+1 ! (1.34)

which thanks to the bilinearity of a (·, ·) and (·, ·) becomes 0 = n X A=1 cA " n X B=1 a (NA, NB) dB ((NA, f ) + NA(0) h a (NA, Nn+1) g) # (1.35)

(29)

Noting now that eq.(1.35) must be valid for arbitrary values of cA, A =

1, ..., n, the following system of n equations in n unknowns is obtained:

n

X

B=1

a (NA, NB) dB = (NA, f ) + NA(0) h a (NA, Nn+1) g (1.36)

which can be written in matrix form1 , (M),

K.d = F (1.37) where K = [KAB] d ={dB} F ={FA} (1.38) and KAB = a (NA, NB) FA= (NA, f ) + NA(0) h a (NA, Nn+1) g (1.39)

In eq.(1.37) K represents the sti↵ness matrix, F the force vector, and d the displacement vector: once obtained d, it is possible to reconstruct the solution uh of the Galerkin problem with the following relation, see

eq.(1.33), uh(x) = n X A=1 dANA(x) + gNn+1(x) (1.40)

As will be better explained in Section 2.2.3, due to the local sup-port of the basis functions the global sti↵ness matrix and force vector are obtained after the computation of the respective local contributions, concerning the single elements: these quantities will then be taken into account in the assembly process, which obviously needs to know the cor-respondence between global and local nodes:

K =nAel

e=1(Ke)

F =nAel

e=1(Fe)

(1.41)

1Regarding the definition of the operation ”.”, as well as the others that will be

(30)

whereA stands for the assembly algorithm.

It is convenient to relate the global and local descriptions by a trans-formation ⇠ : [xA, xA+1] ! [⇠1, ⇠2] such that ⇠ (xA) = ⇠1 and ⇠ (xA+1) =

⇠2: a common choice consists in taking for the natural coordinate ⇠1 = 1

and ⇠2 = +1.

Notice that the real coordinate x may be expressed with the use of the basis functions employed: in local terms, taking into account that every element has two nodes, its behavior is the following

xe(⇠) = 2

X

a=1

Na(⇠) xea (1.42)

in which the superscript e refers to the element domain. Similar con-siderations can be made in multidimensional cases, where obviously the number of the element nodes becomes larger and what previously stated, e.g. eq.(1.42), holds for each component of the real and natural coordi-nates. An exhaustive analysis of isoparametric elements is outside the scope of this work; the reader that wishes to take a deeper look into the subject may refer to [1].

1.6

Remarks

The procedure of spatial discretization presented in the previous sections may be schematically summarized in the following four steps:

(S) , (W ) ⇡ (G) , (M) (1.43)

The only apparent approximation in eq.(1.43) consists in the introduction of Galerkin finite element functions (G) into the weak form, which allows one to obtain a discrete matrix system of algebraic equations, (M).

Notice that in the considered case the matrix K defined in eqs.(1.38) and (1.39) is symmetric, due to the symmetry of the bilinear form a (·, ·); another important aspect is that since the shape functions have a local support, i.e they are zero outside a neighborhood of the node they

(31)

refers to, many of the entries of K are zero, with the nonzero entries located in a band about the main diagonal: the matrix is thus banded, lending itself to economical formation and solution, due to the fact that the zeros have not to be stored.

Furthermore, it is easy to prove that K is positive definite, i.e.

c· (K.c) 0 for all n-vectors c

c· (K.c) = 0 implies c = 0 (1.44) This is relevant from an implementation point of view because a general property is that a symmetric positive-definite matrix possesses a unique inverse; the characteristics above stated yields that a very efficient com-puter solution of the system K.d = F may be employed, see [1].

It is important to immediately point out that the numerical solution of the Navier-Stokes equations, objective of this work, cannot be done with the merely use of the standard Galerkin method, because of the arising of two major problems: the first is linked to preponderance of the convective term with respect to the viscous one, the second is related to the mixed character of the problem, and it is actually set up by the relationship between the employed approximations of the velocity and the pressure. These two sources of instabilities will be separately considered, first focusing on the convective term in the Advection-Di↵usion equation (see Chapter 2), then analyzing the consequences due to the appearance of the pressure term in the Stokes problem (see Section 3.3); all the considerations made for these two particular cases will be necessary once attempting to solve the complete equations, Section 3.4.

1.7

Notations

In this section, the notation that will be employed throughout this work is summarized.

(32)

1.7.1

Finite-dimensional vector spaces

Let a = {a1, ..., an} and b = {b1, ..., bn} (with n either 2 or 3) be two

coordinate vectors belonging to the Euclidean space; the dot product, sometimes called also scalar product, between a and b is the following scalar quantity

a· b = aibi (1.45)

in which the usual Einstein summation convention on the repeated in-dices is assumed. The dot product referred to the same vector induces the definition of norm, i.e. in symbols

kak = (a · a)1/2 (1.46)

Notice that the inner product, denoted by ha , bi, generalizes the dot product above defined to the case of abstract vector spaces.

Let A and B be two real matrices having the same size; a generaliza-tion of the concept of inner product to this case is the Frobenius inner product, or contraction, namely

A : B = tr ATB = tr ABT = AijBij (1.47)

where ”tr” denotes the trace of the matrix, i.e.

tr A = Aii (1.48)

and AB represents the matrix product: it holds

(AB)ij = AirBrj (1.49)

The definition of inner product in eq.(1.47) induces the Frobenius norm, as follows

kAk = (A : A)1/2 (1.50)

A special case of matrix multiplication is the one regarding a matrix and a vector, namely

(A.a)i = Aijaj

(a.A)i = ajAji

(33)

Notice that the operation introduced in eq.(1.51) may be generalized to the case of dealing with a matrix with more than two indices: if, for instance, C has three indices, the relations holding are the following:

(C.a)ij = Cijkak

(a.C)ij = akCkij

(1.52)

1.7.2

Infinite-dimensional vector spaces: function

spaces

While vectors have a discrete number of entries, functions may be consid-ered the continuous analogue, in the sense that their entries are uncount-ably infinite: for this reason, the function spaces are infinite dimensional. The purpose here is to show how the operations introduced for the finite-dimensional vector spaces may be generalized to the infinite-finite-dimensional case.

Scalar-valued functions

Let w and u be two functions belonging to the vector space H1([0, 1]),

defined in Section 1.2; the L2-inner product is

(w, u)L2 = (w, u) = Z 1

0

wu dx (1.53)

and thus the L2-norm of w is defined as

kwkL2 =kwk = (w, w)

1/2

(1.54)

Notice that the subscript L2 is usually omitted.

Since w and u are of class H1 it is also possible to define a H1-inner

product, namely

(w, u)H1 =

Z 1 0

(wu + w,xu,x) dx (1.55)

and thus a H1-norm of w, defined as

kwkH1 = (w, w)

1/2

(34)

or, in other words, to introduce the L2-inner product and norm of their

derivatives, i.e. w,x and u,x, as follows

(w,x, u,x) = Z 1 0 w,xu,xdx (1.57) and kw,xk = (w,x, w,x)1/2 (1.58)

Notice that the above relations may be easily generalized to a multidi-mensional case, with functions w (x, y) and u (x, y) defined in the domain ⌦, for instance: in this case the Sobolev’s space H1 becomes

H1 = H1(⌦) ={w/w 2 L2; w,x 2 L2; w,y 2 L2} (1.59)

Eqs.(1.53) to (1.58) now become

(w, u) = Z ⌦ wu d⌦ (1.60) kwk = (w, w)1/2 (1.61) (w, u)H1 = Z ⌦ (wu +rw · ru) d⌦ (1.62) kwkH1 = (w, w) 1/2 H1 (1.63) (rw, ru) = Z ⌦ rw · rud⌦ (1.64) krwk = (rw, rw)1/2 (1.65) Vector-valued functions

The generalization of the concepts above to vector functions is straight-forward: it only suffices to apply the previous definitions components by components.

Let w and u be two vector functions defined in the domain ⌦ and belonging to H1: notice that this means that each component of both w and u is in H1.

(35)

The L2-inner product between the two functions is:

(w, u) = Z

w· u d⌦ (1.66)

and the L2-norm of w becomes

kwk = (w, w)1/2 (1.67)

Similarly, the L2-inner product between the tensors rw and ru is

(rw, ru) = Z

rw : ru d⌦ (1.68)

which thus induces the L2-norm ofrw, namely

krwk = (rw, rw)1/2 (1.69)

Finally, it is possible to introduce the H1-inner product for w and u, i.e.

(w, u)H1 =

Z

(w· u + rw : ru) d⌦ (1.70) as well as the relative norm for w:

kwkH1 = (w, w)

1/2

H1 (1.71)

Notice how the operation inside the integral in (·, ·) may be a regular product, a dot product, or a Frobenius inner product, depending on the arguments which said operator is applied to.

(36)
(37)

Chapter

2

Finite element method for

Advection-Di↵usion

In this section the Advection-Di↵usion problem will be considered, show-ing how to build a numerical finite element method able to solve this kind of equation. After introducing the general problem we will focus our attention on the 1D case; then we will extend our considerations to its multidimensional version.

Notice that this problem is illustrative, since it allows to isolate one of the sources of difficulties for the finite element resolution of Navier-Stokes equations, i.e. the convective transport.

2.1

Generalities

2.1.1

Strong form

Let ⌦ be an open, bounded region in Rd, where d is the number of space

dimensions; the boundary of ⌦ is denoted by , and it is assumed smooth. The Advection-Di↵usion model of transport and propagation of species in the flow can be stated in the strong form as follows: it consists of

(38)

finding u = u (x)8x 2 ¯⌦1, such that

a· ru r · (k .ru) = f in ⌦ u = g on

(2.1a) (2.1b) where u is a scalar quantity (for instance, the temperature), a is the convective velocity, k is the di↵usivity tensor (which is assumed definite positive), f : ⌦ ! R is the source term and g: ⌦ ! R represents the prescribed boundary data.

The eq.(2.1a) holds because we are considering a divergence-free ve-locity field, namely

r · a = 0 (2.2)

Note that all boundary conditions imposed by eq.(2.1b) are of Dirichlet type.

2.1.2

Weak form

As already seen in Section 1.2, we can define the weak, or variational, counterpart of the problem (2.1) characterizing two classes of functions. The first is composed of the candidate, or trial, solutions: these are required to satisfy the Dirichlet boundary condition (thus, in this case, the whole boundary conditions), namely

u = g on (2.3)

The second set is called weighting functions or variations: this col-lection is very similar to the trial solutions, except for the requirement of the homogeneous counterpart of the g-boundary condition. So we require for the functions w

w = 0 on (2.4)

In addition, both the types of functions defined above are required to have square integrable derivatives, thus belonging to the Sobolev Space (this concept has been introduced in Section 1.2).

(39)

So, in terms of the preceding definitions, and defining S = u/u 2 H1, u = g on

V = w/w 2 H1, w = 0 on (2.5)

we may now state a suitable weak form of the boundary-value problem as follows:

find u2 S such that 8w 2 V Z ⌦ w (a· ru r · (k .ru)) d⌦ = Z ⌦ wf d⌦ (2.6)

that we can write, using integration-by-parts formulas and noting that the boundary term is zero (w = 0 for definition),

Z ⌦ w a· rud⌦ + Z ⌦rw · (k .ru) d⌦ = Z ⌦ wf d⌦ (2.7) Defining a (w, u) = Z ⌦ w a· rud⌦ + Z ⌦rw · (k .ru) d⌦ (w, f ) = Z ⌦ wf d⌦ (2.8)

the variational equation takes the form

a (w, u) = (w, f ) (2.9)

Proceeding as done in Section 1.3, it can be proved that the two formu-lations are equivalent.

2.1.3

Galerkin Method

Considering approximate solutions, in the sense that we approximate the infinite-dimensional spacesS and V with the finite-dimensional counter-partsSh and Vh, the Galerkin Method is obtained: the problem becomes

finding uh 2 Sh such that

(40)

In this method the solution uh is constructed for each member vh 2 Vh

as

uh = vh+ gh (2.11)

where gh is a given function satisfying the boundary condition, i.e,

gh = g on (2.12)

So, gh 2 Sh. Using the bilinearity of a (·, ·) the variational problem

assumes the form

a wh, vh = wh, f a wh, gh (2.13)

We can express wh and vh in terms of the shape or basis functions

wh = X A2⌘ ⌘g cANA vh = X B2⌘ ⌘g dBNB (2.14) gh = X B2⌘ ⌘g gBNB (2.15)

thus obtaining, for A2 ⌘ ⌘g,

X B2⌘ ⌘g a (NA, NB) dB = (NA, f ) X B2⌘g a (NA, NB) gB (2.16)

which can be written in the matrix form (indicial notation is used)

KABuB = FA for A2 ⌘ ⌘g (2.17)

Defining

K = [KAB]

F = {FA}

(2.18)

we finally have the form

K.d = F (2.19)

Note that in eq.(2.14), (2.15), (2.16) and (2.17) ⌘ represents the set of global node numbers, while ⌘g the set of g-nodes.

(41)

So, to resolve the problem the computation of the matrix K is needed: it may be split in two contributions, associated to its advective and dif-fusive part (see eq.(2.8)), respectively

KABadv = Z ⌦ NA a· rNBd⌦ KABdif f = Z ⌦ rNA· (k .rNB) d⌦ (2.20)

It can be proved that Kdif f is symmetric, while Kadv is skew-symmetric:

so a first di↵erence with respect to the case seen in Chapter 1 is that the global matrix K is not symmetric anymore.

The stability properties of the method, related to the evaluation of the positive definiteness of K, are now considered; since a (·, ·) is a bilinear form, the following relation holds2 :

a wh, wh = cAKABcB = c· (K.c) (2.21)

where c is the vector representing wh in Vh: in other words, c

A are the

components of whwith respect to the basis formed by the shape functions

{NA}, A = 1, ..., N.

Eq.(2.21) thus means that in order to evaluate the positive definite-ness of K it is possible to evaluate the sign of a wh, wh , i.e.,

a wh, wh = Z ⌦ wh a· rwhd⌦ + Z ⌦rw h · k .rwh d⌦ = Z ⌦rw h· k .rwh d⌦ (2.22)

in which we have taken into account the general result that, since the velocity field is divergence free and w = 0 on the whole boundary,

Z ⌦ wh a· rvhd⌦ = Z ⌦ vh a· rwhd⌦ 8wh, vh 2 Vh (2.23)

2In order to simplify the notation, Einstein’s summation convention is used; thus

the second term stands for P

B2⌘ ⌘g

cAKAB P B2⌘ ⌘g

(42)

and, thus, Z ⌦ wh a· rwhd⌦ = Z ⌦ wh a· rwhd⌦ = 0 (2.24)

So, recalling the positive definiteness of the di↵usivity tensor k, we can conclude that the matrix is positive definite, that is

a wh, wh = Z ⌦rw h · k .rwh d⌦ 0 = 0 only when rwh = 0 ! wh = 0 (2.25)

but the stability is only given by the di↵usivity term, since the advective one is neutral; this will be a problem in the cases (common in practice) in which we have a predominant role of the advection over di↵usion: the solution is then characterized by oscillations. So, as will be evident in the next sections, the Galerkin method is accurate if dealing with a di↵usion dominated flow, but has problems of stability and has to be stabilized in case of advection predominance.

Neumann boundary conditions

It is easy to prove that if Neumann boundary conditions appear the result found in eq.(2.22) modifies in the following:

a wh, wh = Z ⌦rw h · k .rwh d⌦ + Z h 1 2 w 2a n d (2.26)

where h is the Neumann part of the boundary: thus in this case the

convective term appears but it plays a limited role, and its contribution is even negative when an < 0, i.e. in the inflow part of the boundary

where natural boundary conditions apply. In order to avoid this negative behavior, a possibility will be proposed in Section 2.3, di↵erentiating the prescribed natural conditions in the inflow and in the outflow.

(43)

2.2

Advection-Di↵usion: 1D case

In this section our attention is focused on the 1D case, in which the problem can be stated as follows

au,x ku,xx = f in [0, L]

u = g0 at x = 0

u = gL at x = L

(2.27)

Note the whole Dirichlet type boundary condition; let us start considering the case in which the source term f is zero.

2.2.1

Analytical solution

For this problem, the exact solution is known. Defining as P´eclet number the following dimensionless number

Pe = aL/k (2.28)

the analyitical solution may be written as follows

u(x) = C1 + C2e aL k x L = C1+ C2ePe x L (2.29)

Setting, as boundary conditions, g0 = 0 and gL= 1 we obtain

u(x) = e

Pex L 1

ePe (2.30)

which is shown in Figure 2.1 in dependence of the P´eclet number of the problem.

2.2.2

Numerical approximations: Finite Di↵erences

In this section we will analyze some numerical methods that can be used to solve the problem, starting from finite di↵erences and then considering finite element methods.

(44)

a diffusion-dominated flow advection-dominated flow x = 0 x = L u = 0 u = 1 Pe

Figure 2.1: Examples of analytical solutions of Advection/Di↵usion equation.

A A + 1

A - 1

h h

Figure 2.2: Generic node of an equispaced mesh.

The concept of a Finite Di↵erence Method is to approximate the derivatives of the variable (i.e., in our case, u ) using Taylor expansions. Referring to Figure 2.2, in central di↵erences we have:

u,x|A=

uA+1 uA 1

2h (2.31)

where h is the length of the mesh; the order of the approximation is O(h2).

The advection-di↵usion equation assumes the form:

auA+1 uA 1

2h = k

uA+1 2uA+ uA+1

h2 (2.32)

The solution in a generic node A (with A = 1, ..., nen, nen being the

number of nodes) can be expressed as

uA= c3+ c4 ✓ 1 + ↵ 1 ↵ ◆A (2.33)

in which a local, element P´eclet number has been defined as follows:

↵ = ah

(45)

As can be seen from eq.(2.33), the central di↵erence method becomes unstable, giving rise to oscillations, for ↵ > 1, i.e. in the advection dominated cases; in the stable cases, i.e. ↵ < 1, the solution is under-di↵usive with respect to the exact one. The two situations descripted are sketched in Figures 2.3 and 2.4.

Analytical solution

Finite Differences solution

x = 0 x = L

u = 0

u = 1

Figure 2.3: Comparison between FD and analytical solution for ↵ > 1.

Analytical solution

Finite Differences solution

x = 0 x = L

u = 0

u = 1

Figure 2.4: Comparison between FD and analytical solution for ↵ < 1. If one instead employs upwind di↵erences, the results are the following

u,x|A = uA+1 uA h (2.35) auA+1 uA h = k uA+1 2uA+ uA+1 h2 (2.36)

(46)

uA= c3 + c4(1 + 2↵)A (2.37)

where the reader should notice that the evaluation of u,x|A depends on

the value of u in the nodes A and A + 1. In this case, the solution is stable, but it is less accurate: the order of approximation, in fact, is only O(h); moreover, it is over-di↵usive with respect to the analytical one, as shown in Figure 2.5.

Analytical solution Finite Differences solution

x = 0 x = L

u = 0

u = 1

Figure 2.5: Comparison between FD and analytical solution (upwind di↵erences).

Because of these considerations, it is sensible to conclude that one formulation may be obtained from the other, adding a suitable artificial di↵usivity term, ˜k. In particular, as can be easily verified, the value of ˜

k to obtain the Upwind Di↵erence Method from the Central Di↵erence Method is

˜ k = ah

2 (2.38)

In fact, see [2] for reference, the upwind derivative of the convective term introduces a numerical dissipation in addition to the physical di↵usion k, as can be seen from the Taylor series development of the convective term around xA: u,x|xA ⇠= u (xA) u (xA 1) h + h 2u,xx|xA (2.39) au (xA) u (xA 1) h ⇠= au,x|xA a h 2u,xx|xA (2.40)

(47)

from which it is clear that the Upwind Di↵erence method is equivalent to introducing an added di↵usion of magnitude ah

2 to the Central Di↵erence

Method.

Since the exact solution of the problem is known, it is also possible to calculate the Exact Artificial Di↵usion, in order to obtain the correct results: supposing a uniform mesh, eq.(2.29) yields

u(xA) = C1+ C2ePe

xA

L = C1+ C2ePeAhL = C1+ C2e2↵A (2.41)

Defining a new local P´eclet number, which takes into account the e↵ect of the artificial di↵usion

˜

↵ = ah

2⇣k + ˜k⌘

(2.42)

we can now rewrite the central di↵erence solution at node A as

u(xA) = C3+ C4 ✓ 1 + ˜↵ 1 ↵˜ ◆A (2.43)

By comparison, to obtain the same exact solution we set 1 + ˜↵ 1 ↵˜ = e 2↵ (2.44) finally obtaining ˜k ˜ k = ah 2 (coth(↵) 1/↵) = ah 2 ⇠(↵) (2.45)

In Figure 2.6 the trend of ⇠ with respect to ↵ is shown. Note that for ↵ ! 1 we have ⇠(↵) ! 1 and ˜k ! ah

2 , which means that in the case

of negligible di↵usion (with respect to advection) the Upwind Di↵erence Method gives the correct result.

2.2.3

The Finite Element Method

Galerkin Method

We introduce the sets of weighting and trial functions for the 1D case, as follows

S = u/u 2 H1(0, L), u(0) = g0, u(L) = gL

(48)

ξ

α 1

Figure 2.6: Trend of ⇠ with respect to ↵.

As already seen, belonging to the Sobolev space means

v 2 H1(0, L) = ⇢ v : Z L 0 v2+ v,x2 dx <1 (2.47) or, equivalently, kvk2 H1(0,L) <1 (2.48)

The weak form associated to eq.(2.27) can be written as

B(w, u) = F (w) with: B(w, u) = Z L 0 ( w,xau + w,xku,x) dx F (w) = Z L 0 wf dx (2.49)

Notice that this weak form is di↵erent with respect to the one presented in eq.(2.8): in this case also the advective term has been integrated by parts, obtaining an expression that is called conservative, while eq.(2.8) is referred to as convective form.

As in the general case, Galerkin Method consists in approximating the infinite-dimensional spacesS and V with finite-dimensional counterparts, namely Sh and Vh: using this approach the problem can be written as

(49)

which, with the usual decomposition of uh in terms of vh and gh, becomes

B(wh, vh) = F (wh) B(wh, gh) (2.51)

The shape function referred to a generic node A, in case of linear FEM3,

is provided in Figure 2.7.

A A + 1

A - 1

NA

cA

Figure 2.7: Linear shape function of a generic node A, in which the function is cA.

From eq.(2.51) we can easily obtain the matrix form (as done in Sec-tion 2.1.3), that is X B2⌘ ⌘g B(NA, NB)dB = F (NA) X B2⌘g B(NA, Nb)gB 8A 2 ⌘ ⌘g (2.52) and thus define the sti↵ness matrix as follows

KAB = B(NA, NB) (2.53)

The global sti↵ness matrix can be obtained in terms of the local matrices, i.e. the ones computed within the single elements: these contributions will then be taken into account in the procedure of assembly; so, calling nel the total number of elements our mesh is composed of, we have

K =nAel e=1(Ke) = nel A e=1 Ke adv + K edif f (2.54)

where againA refers to the assembly algorithm.

(50)

Note that the two contributions, advective and di↵usive, to the sti↵-ness matrix are due to the bilinear form B(NA, NB), introduced in eq.(2.49).

As can be easily verified, employing a linear FEM the advective and dif-fusive parts are the following

Keadv =  + a/2 + a/2 a/2 a/2 (2.55) Kedif f =  + k/he k/he k/he + k/he (2.56)

where he is the element length.

It also should be noted that even if the element advective matrix is not skew symmetric, this feature is instead gained by the advective contribution to the global matrix, after the process of assembly.

In order to understand how this process works, let us consider a simple case in which there are five elements, everyone having the same charac-teristic length h, as shown in Figure 2.8.

1 2 3 4 5

0 h 1 h 2 h 3 h 4 h 5

Figure 2.8: Five-element equispaced mesh.

For every element, it is written which global equations are involved: number 0 means that the correspondent node deals with a Dirichlet boundary condition; this matrix storing the assembly information is called LM array and appears as in Table 2.1.

1 2 3 4 5 1 0 1 2 3 4 2 1 2 3 4 0

Table 2.1: LM array for a five elements 1D case.

The column represents which element is being considered, the row which of the two local nodes: 1 is referred to the left node, 2 instead to

(51)

the right one. So we can build the global sti↵ness matrix in the following way: ELEMENT 1 LM (1, 1) = 0 ! K11 K11+ K22(1) LM (2, 1) = 1 (2.57) ELEMENT 2 K11 K11+ K11(2) LM (1, 2) = 1 K12 K12+ K12(2) ! LM (2, 2) = 2 K21 K21+ K21(2) K22 K22+ K22(2) (2.58) ELEMENT 3 K22 K22+ K11(3) LM (1, 3) = 2 K23 K23+ K12(3) ! LM (2, 3) = 3 K32 K32+ K21(3) K33 K33+ K22(3) (2.59)

In the previous expression the symbol means ”is replaced by”: for the last two elements the process is exactly the same; at the end of the procedure the following global sti↵ness matrix is obtained:

K = 2 6 6 6 4 K22(1)+ K11(2) K12(2) K21(2) K22(2)+ K11(3) K12(3) K21(3) K22(3)+ K11(4) K12(4) K21(4) K22(4)+ K11(5) 3 7 7 7 5 (2.60) It should be noted that the procedure is similar also in multidimen-sional cases, even if the global equations involved by each element are in

(52)

general no more consecutive, and this gives rise to some difficulties from the point of view of the assembly.

Going back to 1D case, considering the equation that arises for the arbitrary node A, if an equally spaced mesh is employed we have the following expression 2 4 a/2 k/h 2k/h a/2 k/h 3 5 2 4uuA 1A uA+1 3 5 (2.61)

eventually obtaining the same equation found in the case of Central Dif-ferences (see Section 2.2.2, eq.(2.32)), that is

a ✓ uA+1 uA 1 2h ◆ k ✓ uA+1 2uA+ uA 1 h2 ◆ (2.62)

So, we can state that in this case Galerkin Method and Central Di↵erence Method are exactly equivalent: for this reason it is possible to conclude that the Galerkin FEM is:

• stable if ↵ < 1 (di↵usion dominated cases); • unstable if ↵ > 1 (advection dominated cases).

This behaviour is explained in [3]: the exact advection-di↵usion so-lution can exhibit boundary and internal layers, i.e. very narrow regions where the solution and its derivative change abruptly. For this reason, if the discretization scale h is to big to resolve these layers, then a classical FEM will yield a solution with large numerical oscillation spreading all over the domain. In order to properly resolve the layers, h must be

h ' k

a (2.63)

but in many problems this lead to a huge numbers of degrees of freedom, which makes this approach impracticable.

Another feature is that the numerical solution is under-di↵usive with respect to the exact one, so that it could be reasonable to add a suitable amount of artificial di↵usivity.

(53)

It must be emphasized that the equivalence between the Galerkin FEM and the Central Di↵erences method is only valid in the case above, i.e. without source terms; in other words the two methodologies are significantly di↵erent in the treatment of the source term, as can be seen in [2].

Exact Artificial Di↵usion Method

Using the previous idea of adding artificial di↵usivity to the standard Galerkin method, the problem becomes

BEAD(wh, uh) = F (wh) (2.64) with BEAD(wh, uh) = wh,x, auh + nel X e=1 ⇣ wh ,x, ⇣ k + ˜ke ⌘ uh ,x ⌘ ⌦e ˜ ke= ahe 2 ⇠(↵e) (2.65)

in which ˜ke represents the element artificial di↵usivity.

In [2] it is shown that, supposing an equispaced mesh and calling ˜k =

ah

2 ⇠ (↵), the Galerkin method actually solves exactly (i.e., it obtains exact

nodal values) a modified equation, which possesses a reduced di↵usion coefficient, namely au,x  k ˜ksinh 2(↵) ↵2 u,xx= 0 (2.66)

Notice that as the P´eclet number increases, the di↵usion coefficient in eq.(2.66) becomes smaller and smaller; if it becomes negative, and this holds for ↵ > 1, no stable solution is guaranteed, causing the numerical difficulties in the simulation of highly convective transport problems.

The form in eq.(2.65) is correct in the particular case with absence of sources and linear shape functions, but it is in general inconsistent: in fact, in presence of forcing terms the method fails to produce good results.

(54)

In order to verify the inconsistency of the method, again referring to the domain of Figure 2.8, let us consider the following simple example, in which the di↵usion is negligible with respect to the convection:

au,x = f = x

u(0) = 0 (2.67)

The analytical solution can be obtained with a simple integration

u(x) = u(0) + Z x 0 x adx = x2 2a (2.68)

thus assuming the value u = h2a2 on the first node, at x = h.

If instead we use the Galerkin method with exact artificial di↵usivity, since considering an advective dominated flow, we obtain the upwind equation (i.e., ⇠ ! 1), namely

a (u(1) u(0)) = Z L 0 N1f = Z h 0 ⇣x hf ⌘ dx + Z 2h h ⇣ 2 x hf ⌘ dx = h2 (2.69) In the eq.(2.69) u(1) represents the value of u at the first node, placed at x = h, while N1 is the first shape function; as can be seen, the two results

are di↵erent, since according to the Galerkin method u (1) = h2/a.

In order to understand the reasons that give rise to this wrong be-haviour, let us consider the artificial viscosity term, that has been added to the standard Galerkin form:

X e ⇣ w,xh , ˜keuh,x ⌘ ⌦e =X e a wh,x⌧e, a uh,x ⌦e (2.70)

in which we have defined the stabilization parameter ⌧e as

⌧e =

he

2a⇠(↵e) (2.71)

Rearranging eq.(2.64), we obtain a new form in which the inconsistency of the method becomes clear: a new weighting term (which would be

(55)

typical of a Petrov-Galerkin method) is employed only for the convective part, while standard Galerkin is used for all the rest.

X e wh+ awh,x⌧e, auh,x ⌦e + X e wh,x, kuh,x ⌦ e X e wh, f e = 0 (2.72)

In order to recover the lost consistence, we can multiply all the terms for the new weight, thus obtaining the Streamline Upwind Petrov Galerkin Method (SUPG).

SUPG Method

The problem becomes as follows: find uh 2 Sh :8wh 2 Vh BSU P G wh, uh = FSU P G(w) (2.73) with: BSU P G wh, uh = B(wh, uh) + X e ⇣ awh,x⌧e, auh,x kuh,x ,x ⌘ ⌦e FSU P G(wh) = F (wh) + X e awh,x⌧e, f e (2.74)

SUPG form is usually termed ”consistent perturbed Galerkin form” as it adds to the original Galerkin expression a term which is residual based (it vanishes as the numerical solution approaches the exact analytical value): in other words, the perturbation introduced is able to maintain the consistence of the formulation.

We can also state that SUPG Method is an extension (or generaliza-tion) of EAD: in fact in case of

I. linear FEM, k = const! kuh

,x |e= kuh,xx|e = o! BSU P G = BEAD

II. f = 0! FSU P G wh = F wh = 0

the two methods are equivalent: that’s why in the case previously ana-lyzed both were working.

(56)

SUPG is therefore a stabilized method, in the sense that its purpose is to stabilize the (otherwise in general unstable) standard Galerkin FEM: so, it is extremely important to find a suitable expression of ⌧e. In 1D

case, as already seen in eq.(2.45), the exact amount of artificial di↵usivity which has to be added to obtain the nodal exactness of the solution is known: so the expression of ⌧e is the following

⌧e=

he

2a⇠(↵e) = he

2a(coth (↵e) 1/↵e) (2.75) and its behaviour is represented in Figure 2.9. It is clear that the

stabi-α τ

Advective limit (Upwind Method)

e

e

h /(2a)e

Figure 2.9: Trend of the stabilization parameter ⌧e with respect to ↵e.

lization parameter ⌧e depends on the local character of the discretization:

in elements whose diameter is not small enough to resolve all the scales ⌧e ' 2ah, while elsewhere its value is much smaller.

Since recalling every time the function coth is expensive, and also because of reasons of generalization to multidimensional cases, let us see two other possible definitions of ⌧e:

I. we can use the asymptotic definition (see Figure 2.10), namely

⌧e= he 2amin ✓ 1 3↵e, 1 ◆ (2.76)

(57)

α τe

e

h /(2a)e

Figure 2.10: Asymptotic definition of ⌧e.

which can be rewritten as ⌧e = ⌧adve = he 2a for ↵ > 3 ⌧e = ⌧dif fe = h2 e 12k for ↵ < 3 (2.77)

II. a further, less expensive possibility is the following

⌧e =

(⌧adve ) 2+ ⌧dif fe 2⌘ 1/2 (2.78) This expression comes out from the general result that the max-imum component of a vector b constitutes its infinity norm, in symbols

kbke1 = max

i=1,...,nbi (2.79)

and using the following property for the infinity norm

kbke1 = lim

p!1kbkep (2.80)

So, if p is a finite number, we can approximate

kbke1 ' kbkep (2.81)

Applying these results with p = 2 to ⌧ 1

e , that is

⌧e = min ⌧adve , ⌧dif fe

(58)

the expression written in eq.(2.78) is obtained.

As can be seen in [2, 4], in order to avoid spurious oscillation the absolute value of ⌧ should be larger than a critical value, that is

⌧ ⌧crit = h 2a ✓ 1 1 |↵| ◆ (2.83)

This condition is verified by both the optimal value given in (2.75) and the approximations introduced in (2.76) and (2.78).

It should be noted that all the results obtained in this section will be useful later, when we will try to generalize the 1D case to the multidi-mensional situation.

Stability and Error Analysis

As mentioned previously, for Galerkin Method the di↵usivity constant k drives the stability properties; in fact

B wh, wh =X e Z ⌦e whawh ,xdx + X e Z ⌦e wh ,xkwh,xdx (2.84)

where the first term in the right-hand side is zero, in case of solenoidal field of velocity (in 1D a is a constant, and this condition is thus verified); so we have B wh, wh =X e Z ⌦e wh,xkw,xhdx = k wh,x 2 L2(⌦) 0 (2.85)

Regarding the error analysis, it is useful the following simple result, known as Galerkin orthogonality

B wh, u uh = 0 8wh 2 Vh (2.86)

which is obtained from the subtraction of the following two equations: the first originates using whas particular weighting functions in the weak

formulation presented in eq.(2.49), while the second is the well-known Galerkin formulation, namely

B wh, u = F wh 8wh 2 Vh

(59)

Notice that eq.(2.86) states that the error is orthogonal to the subspace Vh ⇢ V through B.

The error can be split into two components, ⌘ and eh:

e = u uh = u hu + ⇧hu uh = ⌘ + eh (2.88)

in which we have introduced ⇧hu, that is the best approximation of u

inside the set Sh; therefore, ⌘ is the interpolation error, which does not

depend on the particular shape functions chosen and goes to zero as the mesh becomes finer, while eh is the error of the FEM, which belongs to

Vh. Starting from the stability estimate, eq.(2.85), we have

kke,xk2L2  B (e, e) = B eh, e + B (⌘, e) =

= (⌘, ae,x)L2 + (⌘,x, ke,x)L2 (2.89)

Note that in the previous equation it has been used eq.(2.86) and that eh 2 Vh.

Then, using the Cauchy-Schwarz inequality (i.e., (f, g)A kfkAkgkA

where kfkA= (f, f )1/2A ) we obtain

kke,xk2L2  |a| k⌘kL2ke,xkL2 + kk⌘,xkL2ke,xkL2 (2.90)

then resulting

ke,xkL2 = |a|

k k⌘kL2 +k⌘,xkL2 (2.91)

This means that as the mesh becomes finer, the norm of the derivative of the error goes to zero: it decays as h. Noting that also the following estimate applies, see [1],

k⌘kHk  chp+1 kk⌘kHp+1  chp+1 kkukHp+1 (2.92)

which for linear FEM (i.e. p = 1) and choosing one time k = 1 and the other one k = 0 becomes

k⌘kH1  ch kukH2 ! k⌘,xkL2  ch kukH2

k⌘kL2  ch

2

kukH2

(60)

Putting the results of eq.(2.93) in eq.(2.91) and rearranging the terms, we finally obtain

ke,xk  (2↵ + 1) ch kukH2 (2.94)

This result applies if using linear FEM, otherwise the general expression is

ke,xk  (2↵ + 1) chpkukHp+1 (2.95)

So, as previously mentioned, with linear FEM the derivative of the error goes to zero as h; eq.(2.94) and eq.(2.95) also tell that the bounding constant, as depending on ↵, in case of advection dominated flows can be very high.

Let us consider now the properties of SUPG Method, starting from the stability: BSU P G wh, wh = B wh, wh + X e aw,xh⌧e, aw,xh kw,xxh k w,xh 2L 2 + X e ⇣ a2⌧e wh,x 2 ⌦e |a|⌧ek w h ,xx ⌦e w h ,x ⌦e ⌘ (2.96)

in which the Cauchy-Schwarz inequality has been used again, together with eq.(2.85); then, since the following inverse estimate holds

wh,xx ⌦

e  cIh

1

e wh,x ⌦e (2.97)

where cI is a suitable constant, we obtain (considering an equally spaced

mesh, i.e. h = he) BSU P G wh, wh ⇣ k + ˜k a⌧ kcIh 1 ⌘ w,xh 2L 2 k + ˜k 2 ! wh,x 2L 2 (2.98)

The last step of eq.(2.98) is obtained setting

⌧ = h 2|a|min ✓ 1, 4↵ c2 I ◆ (2.99)

(61)

In the general case in which ⌧e is di↵erent for each element, the result will be k+⌧e|a|2 |a|⌧ekcIhe1 k + ⌧ea2 2 BSU P G wh, wh X e ✓ k + ⌧e|a|2 2 ◆ kwh ,xk2L2(⌦e)=|||w h|||2 SU P G (2.100)

Note that in eq.(2.100), since clearly having the characteristic properties, it was convenient to define a new norm, the SUPG trinorm, which will also be useful in the error analysis; it should also be noted that, with the choices before discussed, we obtain a gain of the stability with respect to the Galerkin case: in particular, now the artificial di↵usivity helps the natural one, dominating the stability properties of the method.

Let us consider now the error analysis: since the previously defined trinorm has all the properties of a norm, it is possible to estimate|||eh|||

SU P G

as follows

|||eh|||2SU P G  BSU P G eh, eh =

BSU P G eh, e BSU P G eh, ⌘ = BSU P G eh, ⌘ (2.101)

in which the first step is due to the stability estimate, i.e., eq.(2.100), while the last takes into account the Galerkin orthogonality. Moving for-ward, using eq.(2.74), eq.(2.49) and one more time the Cauchy-Schwarz inequality, we obtain |||eh|||2SU P G BSU P G eh, ⌘ = B eh, ⌘ X e a eh,x⌧e, a⌘,x k⌘,xx ⌦e  X e n |a| eh ,x ⌦ek⌘k⌦e + k e h ,x ⌦ek⌘,xk⌦e o + X e n |a|2 e eh,x ⌦ ek⌘,xk⌦e +|a|⌧ek e h ,x ⌦ek⌘,xxk⌦e o (2.102) where all the norms and inner products are defined in L2(⌦e): in order

(62)

Rearranging the terms in the following way |||eh|||2 SU P G  X e |a|⌧e1/2keh,xk⌦e ⌧ 1/2 e k⌘k⌦e + X e k1/2keh,xk⌦e k 1/2 k⌘,xk⌦e + X e |a|⌧1/2 e keh,xk⌦e |a|⌧ 1/2 e k⌘,xk⌦e + X e |a|⌧1/2 e keh,xk⌦e ⌧ 1/2 e kk⌘,xxk⌦e (2.103)

and then using the property for which, given two vectors a and b,

a· b  kak kbk (2.104) or equivalently in component X i aibi  X i a2 i !1/2 X i b2 i !1/2 (2.105) we finally have: |||eh|||2SU P G  AB (2.106) where A = X e k + 3|a|2⌧e eh,x 2 ⌦e !1/2 B = X e ⌧e 1k⌘k2e + k +|a|2⌧e k⌘,xk2e + ⌧ek2k⌘,xxk2e !1/2 = X e ⌧e 1k⌘k2e + 2|||⌘|||SU P G2 + ⌧ek2k⌘,xxk2e !1/2 (2.107) From eq.(2.106), noting that last term is in all respects a norm we can introduce the quadrinorm as

||||⌘|||| = X e ⌧ 1 e k⌘k2⌦e + ⌧ek 2k⌘ ,xxk2⌦e !1/2 (2.108)

Figura

Figure 2.1: Examples of analytical solutions of Advection/Di↵usion equation.
Figure 2.4: Comparison between FD and analytical solution for ↵ &lt; 1.
Figure 2.5: Comparison between FD and analytical solution (upwind di↵erences).
Figure 2.7: Linear shape function of a generic node A, in which the function is c A .
+7

Riferimenti

Documenti correlati

1 Il libro Piazze d’Italia. La piazza come centro di vita, come composizione architettonica spaziale e scenografica, illu- strata attraverso le più belle e significative d’Italia

Platone sottolinea a chiare lettere questa delimitazione di campo: ciò cui Trasimaco si riferisce non è quel modo di considerazione degli enti per il quale essi vengono

degradation in HS-AD of OFMSW due both to mass transfer effects and NH 3

In Bologna and Modena provinces, by means of key informants and snowball sampling, we detected 20 old- growth orchards, and we assessed: condition of the old-growth trees

Clearly, this is due to the fact that (unless products are close substitutes) the wage chosen by the union is lower when firms adopt S contracts. Furthermore, part ii) of

Other genetic causes of high ferritin levels in a child include juvenile hemochromatosis, an autosomal reces- sive disorder caused by the mutation of HJV (HFE2) gene [11], or,

Among the Sardinian endemic species, five taxa belonging to Asteraceae (Helichrysum italicum subsp. tyrrhenicum, Plagius flosculosus, Santolina corsica and Santolina insularis)

Alexander Baumgarten's works in logic and aesthetics, where he makes it clear that there is a logical critique as well as an aesthetic critique and that both of them have an