Hp-DGFEM Book Small

137
A. Konrad Juethner hp-DGFEM and Transient Heat Diffusion { } ( ) { } ( ) ( ) (,) [ ] () c q c T c c c Buv Dv D u dxdydz h uvdS Fv Qvdxdydz q n v dS h u v dS Γ Γ Γ = Λ + = + ∫∫∫ ∫∫ ∫∫∫ ∫∫ ∫∫ f f

description

master thesis on hp discontinuous galerkin finite element method

Transcript of Hp-DGFEM Book Small

Page 1: Hp-DGFEM Book Small

A. Konrad Juethner

hp-DGFEM and Transient Heat Diffusion

( ) (

)( )

(,

)

[]

()

c

q

c

T

c

cc

Buv

Dv

Dudxdydz

huvdS

Fv

Qvdxdydz

qnvdS

huvdS

Ω

Γ

Ω

Γ

Γ

=

Λ

+

=

−⋅

+

∫∫∫

∫∫

∫∫∫∫∫

∫∫f

f

Page 2: Hp-DGFEM Book Small

hp-DGFEM and Transient Heat Diffusion Juethner

Page 3: Hp-DGFEM Book Small

WASHINGTON UNIVERSITY

SEVER INSTITUTE OF TECHNOLOGY

DEPARTMENT OF MECHANICAL ENGINEERING

THE hp-DISCONTINUOUS GALERKIN FEM APPLIED

TO TRANSIENT HEAT DIFFUSION PROBLEMS

by

A. Konrad Juethner

Prepared under the direction of Professor Barna A. Szabó

A thesis presented to the Sever Institute of

Washington University in partial fulfillment

of the requirements for the degree of

MASTER OF SCIENCE

December, 2001

Saint Louis, Missouri

Page 4: Hp-DGFEM Book Small

WASHINGTON UNIVERSITY SEVER INSTITUTE OF TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE

ABSTRACT

THE hp-DISCONTINUOUS GALERKIN FEM APPLIED TO TRANSIENT HEAT DIFFUSION PROBLEMS

by A. Konrad Juethner

ADVISOR: Professor Barna A. Szabó

December, 2001

Saint Louis, Missouri

This work addresses the application of the hp-Discontinuous Galerkin algorithm to

transient heat diffusion problems. Strong and weak formulations of the heat diffusion

equation are established first. Then, approximation spaces and convergence

characteristics are discussed. Model problems, for which exact solutions are available,

are used for investigating convergence behavior and efficiency of finite difference and

finite element methods. Separately, spatial and temporal error control methodologies

are investigated and demonstrated. For this purpose, a finite element software code was

written with h- and p-extension capabilities in one- and two- spatial dimensions and the

time dimension. It is shown that the rate of convergence of the hp-Discontinuous

Galerkin method is faster than algebraic.

Page 5: Hp-DGFEM Book Small

copyright by

A. Konrad Juethner

2001

Page 6: Hp-DGFEM Book Small

to my grandfather,

Dr. Ing. Konrad Jüthner

Page 7: Hp-DGFEM Book Small

iv

Contents Tables................................................................................................................................vi

Figures .............................................................................................................................vii

Acknowledgments............................................................................................................xii

Thesis Acceptance ..........................................................................................................xiii

Defense Announcement ..................................................................................................xiv

Copyright TXu 658-006................................................................................................... xv

1. Mathematical Derivations of Heat Conduction ...................................................... 1

1.1 Strong Formulation ....................................................................................... 2

1.2 Boundary Conditions .................................................................................... 3

1.3 Generalized Formulation .............................................................................. 3

2. Numerical Approximation of the Generalized Formulation in Steady State....... 8

2.1 Approximation Spaces .................................................................................. 8

2.2 Spatial Error Control................................................................................... 10

2.3 Convergence Characteristics....................................................................... 10

2.3.1 Natural Norm ............................................................................... 11

3. Control of Spatial Errors in the Presence of Singularities................................... 12

3.1 Spatial Error in 1D by hp-Refinement ........................................................ 12

3.2 Singularity in 2D ........................................................................................ 18

4. Spatial and Temporal Error Control in 1D Diffusion Problems......................... 30

4.1 The Finite Difference Method, 1D ............................................................ 30

4.2 The Discontinuous Galerkin Method, 1D .................................................. 33

4.3 L2 Projection of Initial Conditions at t = 0+................................................ 37

4.3.1 L2 Projection of the Initial Solution f(x) = sin(πx) ...................... 40

4.3.2 L2 Projection of the Initial Solution f(x) = x(1-x)........................ 45

4.4 Temporal Error Control .............................................................................. 45

4.4.1 Adaptive Time Solvers ................................................................ 46

4.4.2 p-DGFEM and hp-DGFEM in 1D-Space and Time .................... 66

4.4.3 hp-DGFEM with Temporal Grading ........................................... 73

Page 8: Hp-DGFEM Book Small

v

4.5 The Influence of the Spatial Grading Factor on the Temporal Error.......... 76

5. Temporal Error Control in 2D Time Dependent Problems ................................ 77

5.1 The Finite Difference Method, Two Spatial Dimensions........................... 78

5.2 The Discontinuous Galerkin Method, 2D................................................... 82

5.3 L2 Projection of Initial Conditions at t = 0+ ............................................... 82

5.4 Model Problems in 2D................................................................................ 87

5.4.1 Model Problem 4.......................................................................... 88

5.4.2 Model Problem 5.......................................................................... 88

5.5 The Initial Solution f(x,y,0) = sin(πx)sin(πy)............................................. 88

5.5.1 The Finite Difference Time Solver .............................................. 91

5.5.2 The Discontinuous Galerkin Time Solvers.................................. 91

5.6 The Initial Solution f(x,y,0) = x(1-x)y(1-y)................................................ 95

5.6.1 The Finite Difference Time Solver .............................................. 97

5.6.2 The Discontinuous Galerkin Time Solvers.................................. 98

6. Conclusions............................................................................................................. 101

Appendix A - Conventions ............................................................................................ 104

Appendix B - Shape Functions in 2D for Quadrilateral Elements with p = 8 ............... 105

Appendix C - Appropriate Spatial Discretizations for Model Problems 1, 2, and 3 ..... 106

Appendix D - MATLAB®

ODE Solver: ode15s............................................................ 113

References...................................................................................................................... 114

Vita................................................................................................................................. 116

Page 9: Hp-DGFEM Book Small

vi

Tables 3-1. Mesh Refinement Strategy; Left Column: Overview of Solution Domain with

Increased Element Count from Top To Bottom; Right Column: Close-Up of

Singularity with Increased Refinement................................................................ 25

3-2. Convergence of p-Refinement of L-Shaped Domain, 1 Refinement,

Polynomial Orders 1 through 8............................................................................ 27

3-3. Convergence of hp Refinement of L-Shaped Domain, 8 Refinements and

Polynomial Orders 1 through 8............................................................................ 28

4-1. L2 Projection of the Polynomial Function f(x) = sin(πx)..................................... 41

4-2. Refined L2-Projection of the Polynomial Function f(x) = sin(πx)....................... 43

A-1. Physical Quantities and their Units as Used in this Paper ................................. 104

Page 10: Hp-DGFEM Book Small

vii

Figures

3-1. Projection of Incompatible Solution onto Finite Element Solution Space: 1

Element, p=8, Error in L2 Norm = 14.9%............................................................ 14

3-2. Projection of Incompatible Solution onto Finite Element Solution Space, 1

Element, p=16, Error in L2 Norm = 8.1%............................................................ 14

3-3. Projection of Incompatible Solution onto Finite Element Solution Space, 3

Elements, Graded Mesh 10%, p=8, Error in L2 Norm = 5.0% ............................ 16

3-4. Projection of Incompatible Solution onto Finite Element Solution Space, 3

Elements, Graded Mesh 5%, p=8, Error in L2 Norm = 3.5% .............................. 16

3-5. Projection of Incompatible Solution onto Finite Element Solution Space, 3

Elements, Grading = 0.1^g, p=8, Error in L2 Can Be Made Arbitrarily Small ... 17

3-6. L-shaped Domain. Nodes are Numbered in Black; Elements are Numbered

in Red; Zero Temperature is Prescribed between Nodes 2 and 1; Zero Flux is

Prescribed between Nodes 1 and 8 ...................................................................... 18

3-7. Domain with Re-entrant Corner .......................................................................... 19

3-8. Exact Solution of uEX, i=1 ...................................................................................... 20

3-9. Exact Solution (Black Circles on Cyan Stems) Superimposed on the L-

shaped Domain; qn and ∇uΓ Displayed by Red and Blue Arrows,

Respectively......................................................................................................... 21

3-10. Finite Element Solution uFE , 3 Elements, Polynomial Degree 3 ........................ 22

3-11. Convergence of p-Refinement of L-Shaped Domain, 1 Refinement,

Polynomial Orders 1 through 8............................................................................ 27

3-12. Convergence of hp Refinement of L-Shaped Domain......................................... 28

3-13. Finite Element Solution of 8 Grading Refinements at Polynomial Order 8;

the Relative Error with Respect to the Exact Solution is 0.2682% ..................... 29

4-1. Comparison between Exact Function and its L2 Projection ................................ 41

4-2. Error Plot in the Range of ±4*10-8

....................................................................... 42

4-3. Comparison between Exact Function and its Projection ..................................... 43

4-4. Relative Error Plotted in the Range of ±2*10-15

.................................................. 44

Page 11: Hp-DGFEM Book Small

viii

4-5. Relative Error Plotted in the Range of ±4*10-15

.................................................. 45

4-6. Time Integral of Relative Error in Energy Norm, Model Problem 1; 1

Element, p=8........................................................................................................ 48

4-7. Time Integral of Relative Error in Energy Norm, Model Problem 2, 1

Element, p=8........................................................................................................ 49

4-8. Time Integral of Relative Error in Energy Norm, Model Problem 3, 5

Geometrically Graded Elements, Spatial DOF = 8 Nodes+5 Elements*(8-1)*

p = 39 ................................................................................................................... 49

4-9. h-DGFEM with Increasing Approximation Order rm .......................................... 51

4-10. h-DGFEM Performance at Multiple Values of rm ............................................... 52

4-11. CPU Times Corresponding to Figure 4-10; Note that the Numbered Data

Points Correlate Figures 4-10 and 4-11 ............................................................... 52

4-12. Comparison of Convergence Performance: CNM and h-DGFEM at rm = 7 ....... 53

4-13. Comparison of CPU Time in the Accuracy Range of 1.94 % to 1.22*10-5

%;

The Numbered Data Points Correlate Figures 4-12 and 4-13 ............................. 53

4-14. Temporal Error Control ....................................................................................... 54

4-15. Finite Element Solution to Model Problem 1, Plotted on Uniformly Spaced

Post-Process Grid................................................................................................. 55

4-16. h-DGFEM Performance at rm = 2, Time Grading Function h(t) = t7................... 56

4-17. Convergence Rate Using Various Values rm and h(t) = t7................................... 57

4-18. CPU Time Using Various Values rm and h(t) = t7

............................................... 57

4-19. Integral of Error in Energy Norm Reduced to below 0.001% ............................. 58

4-20. Comparison of CPU Time Performance in the Accuracy Range of 0.32 % to

1.2*10-4

% Corresponding to Figure 4-19; Note that the Numbered Data

Points Correlate Figures 4-19 and 4-20 ............................................................... 58

4-21. Temporal Error Control, h-DGFEM.................................................................... 59

4-22. Solution to Model Problem 2; the h-DGFEM Mesh is Shown by the Heavy

Lines..................................................................................................................... 60

4-23. Error in Energy Norm Reduced to below 1.0%................................................... 61

4-24. Comparison of CPU Time Performance in the Accuracy Range of 0.32 % to

1.2*10-4

% Corresponding to Figure 4-23; Note that the Numbered Data

Points Correlate Figures 4-23 and 4-24 ............................................................... 61

4-25. Temporal Error Control; Time-Halving Leads to Relative Errors that are

Better than Necessary .......................................................................................... 62

Page 12: Hp-DGFEM Book Small

ix

4-26. Convergence of Model Problem 3 Using the Integral of er(t) ............................. 63

4-27. Error in Energy Norm Reduced to below 1.0%................................................... 64

4-28. Comparison of CPU Time Performance Corresponding to Figure 4-27; Note

that the Numbered Data Points Correlate Figures 4-27 and 4-28........................ 64

4-29. Temporal Error Control ....................................................................................... 65

4-30. Solution to Model Problem 3; the h-DGFEM Mesh Is Shown by the Heavy

Lines..................................................................................................................... 66

4-31. Convergence Comparison: h- and hp-DGFEM Solving Model Problem 1........ 67

4-32. Comparison of CPU Time Performance Corresponding to Figure 4-31; Note

that the Numbered Data Points Correlate Figures 4-31 and 4-32........................ 68

4-33. Exponential Convergence of p-DGFEM ............................................................. 68

4-34. Convergence Comparison: h- and hp-DGFEM Solving Model Problem 2........ 69

4-35. Comparison of CPU Time Performance Corresponding to Figure 4-34; Note

that the Numbered Data Points Correlate with Figures 4-34 and 4-35................ 70

4-36. Initial Exponential and then Algebraic Convergence (p-DGFEM)..................... 70

4-37. Convergence Comparison: h- and hp-DGFEM Solving Model Problem 3........ 71

4-38. Comparison of CPU Time Performance Corresponding to Figure 4-37; Note

that the Numbered Data Points Correlate Figures 4-37 and 4-38........................ 72

4-39. Initial Exponential and then Algebraic Convergence (p-DGFEM)..................... 72

4-40. Model Problem 2 Converges Faster Than Algebraic Rate .................................. 74

4-41. Model Problem 2 Convergence Close to Exponential Rate ................................ 74

4-42. Model Problem 3 Converges Faster Than Algebraic Rate .................................. 75

4-43. Model Problem 3 Convergence Close to Exponential Rate ................................ 75

4-44 Optimal Spatial Grading Factor with Respect to a Specific Experiment ............ 76

5-1. Arbitrary Initial Condition ( , )f x y , 9 Elements, Refinement Level 1, p = 8 ..... 84

5-2. Result of Step 1 of L2-Projection ( , )f x y : All Nodal Values are Equal to

Zero ...................................................................................................................... 85

5-3. Result of Step 2 of L2-Projection ( , )f x y : All Element Sides are Equal to

Zero ...................................................................................................................... 85

5-4. Result of Step 3 of L2-Projection f : Error in Energy Norm = 2.59*10-5

%,

Error in Maximum Norm = 1.5*10-3

.................................................................... 86

5-5. Final Result. Assembled L2-Projection by Linear Combination of Projection

Coefficients with the Global Shape Functions .................................................... 86

5-6. Solution Domain .................................................................................................. 89

Page 13: Hp-DGFEM Book Small

x

5-7. Initial Solution ..................................................................................................... 89

5-8. Projection Error for the Initial Condition, Error in Energy Norm: 1.57*10-7

%,

Error in Maximum Norm = 5.0*10-5

.................................................................... 90

5-9. Projected Initial Solution ..................................................................................... 90

5-10. Model Problem 4: Convergence of the Finite Difference Method ..................... 91

5-11. Convergence of the h-DGFEM for rm = 4............................................................ 92

5-12. Convergence of the h-DGFEM for rm = 8............................................................ 92

5-13. Temporal Solutions Corresponding to the Most Accurate Solution of Figure

5-12; Time Starts at Top Left (t = 0), Progresses Row by Row and Ends at

Bottom Right (t = 1.0).......................................................................................... 93

5-14. Convergence of the p-DGFEM............................................................................ 94

5-15. Convergence of the hp-DGFEM.......................................................................... 94

5-16. Temporal Solutions Corresponding to the Most Accurate Solution of Figure

5-14; Time Starts at Top Left (t = 0), Progresses Row by Row and Ends at

Bottom Right (t = 1.0).......................................................................................... 95

5-17. Initial Solution ..................................................................................................... 96

5-18. Projection Error for the Initial Condition, Error in Energy Norm = 1.3*10-28

%, Error in Maximum Norm = 8.0*10-17

............................................................. 96

5-19. Projected Initial Solution ..................................................................................... 97

5-20. Convergence of the Finite Difference Method .................................................... 97

5-21. Convergence of the h-DGFEM............................................................................ 98

5-22. Convergence of the p-DGFEM............................................................................ 99

5-23. Convergence of the hp-DGFEM.......................................................................... 99

5-24. Temporal Solutions Corresponding to the Most Accurate Solution of Figure

5-21; Time Starts at Top Left (t = 0), Progresses Row by Row and Ends at

Bottom Right (t = 1.0)........................................................................................ 100

B-1 2D Shape Functions. Top Row: Vertex Modes, Four Left Columns without

First Row: Side Modes, Columns 5 through 9: Internal Modes ........................ 105

C-1. Convergence of Model Problem 1, 1 Element in Space, p = 3.......................... 106

C-2. Convergence of Model Problem 1, 1 Element in Space, p=4............................ 107

C-3. Convergence of Model Problem 1, 1 Element in Space, p=8............................ 107

C-4. Convergence of Model Problem 1, 10 Spatial Elements, p=8........................... 108

C-5. Convergence of Model Problem 1, 10 Spatial Elements, p=16......................... 108

C-6. Convergence of Model Problem 2, 1 Spatial Element, p=3 .............................. 109

C-7. Convergence of Model Problem 2, 1 Spatial Element, p=8 .............................. 110

Page 14: Hp-DGFEM Book Small

xi

C-8. Convergence of Model Problem 2, 10 Spatial Elements, p=8........................... 110

C-9. Convergence of Model Problem 3, 2 Spatial Elements, p=8............................. 111

C-10. Convergence of Model Problem 3, Geometrically Graded Mesh with 5

Elements, p=8, (Identical to Figure 4-8)............................................................ 112

Page 15: Hp-DGFEM Book Small

xii

Acknowledgements

This thesis marks my most significant academic accomplishment to date. Its creation

was eye opening, enjoyable, and revealing, yet, difficult, arduous, and extremely time

consuming. Certainly not an easy feat since full-time employment at Watlow Inc

required my full attention. Although I was advised of the challenges of the dual life as

an engineer and graduate student, I saw in this task an integral part of a Master of

Science Program.

As I now reflect upon the accomplishment, I realize how much it has reduced the

interactions with my family and friends during the past two years. My wife, Salomé,

probably carried the biggest burden, dealing with my mood swings, incoherent

ramblings about mathematical tasks in delirious morning hours, the experiences of all-

time highs when things worked well, and all-time lows when programming bugs left me

searching for weeks. Many thanks for her patience and understanding during this time.

She is simply the best!

The very generous tuition reimbursement program by Watlow Inc and the supportive

mentor, Louis P. Steinhauser made this graduate work possible. Their support of both

my professional and academic careers dates back to May of 1995 and there are no words

to express my gratitude. Thank you!

I like to think of my thesis advisor, Dr. Barna Szabó, as a brilliant, picky, meticulous,

hardworking, and patient gentleman, who has driven me “bananas” during this work. I

would like to thank him for his patience in his attempt to teach me hp-FEA and DG

principles, to enhance my understanding of Mathematics, to improve my technical

writing style, and to make me a more mature engineer.

Page 16: Hp-DGFEM Book Small

xiii

Page 17: Hp-DGFEM Book Small

xiv

Page 18: Hp-DGFEM Book Small

xv

Page 19: Hp-DGFEM Book Small

xvi

Page 20: Hp-DGFEM Book Small

1

Chapter 1

Mathematical Derivations of Heat Conduction

The derivation of the equations of linear heat conduction and the corresponding notation

are presented in fully three-dimensional setting. Mathematical models of linear heat

conduction are based on two fundamental laws of physics: Fourier’s law of heat

conduction and the conservation law. Fourier’s law of heat conduction states that

[ ] ( )q grad u= − Λ ⋅j (1-1)

where qf

is the heat flux vector with components zyx qqq ,, . The following notation will

be used:

=≡z

y

xdef

q

q

q

qqj

. (1-2)

qf

represents the heat flux per unit area (in W/m2 or equivalent units). [ ]Λ is the

symmetric positive-definite thermal conductivity matrix and u is the temperature field.

[ ]Λ can be written as

Page 21: Hp-DGFEM Book Small

2

[ ] xx xy xz

yx yy yz

zx zy zz

λ λ λ Λ = λ λ λ λ λ λ . (1-3)

From the condition of symmetry it follows that xy yxλ = λ , etc.

1.1 Strong Formulation

The conservation law states that the heat flow rate into any volume element plus the heat

generated per unit time in the volume element equals the specific heat multiplied by the

mass density and the rate of change in temperature. In Cartesian coordinates, the

mathematical statement of the conservation law is

( ) ( ) ( )t

ucQq

zq

yq

xzyx ∂

∂=+

∂∂+∂

∂+∂∂− ρ . (1-4)

Combining (1-1), (1-2), (1-3), and (1-4) results in

xx xy xz yx yy yz

zx zy zz

u u u u u u

x x y z y x y z

u u u uQ c

z x y z t

∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂λ + λ + λ + λ + λ + λ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂+ λ + λ + λ + = ρ ∂ ∂ ∂ ∂ ∂

(1-5)

where , , , and Q c tρ represent heat generation per unit volume per unit time, specific

heat, mass density, and time, respectively. Alternatively, equation (1-5) can be written

in the form:

([ ] ( ))u

div grad u Q ct

∂Λ ⋅ + = ρ ∂ . (1-6)

Page 22: Hp-DGFEM Book Small

3

1.2 Boundary Conditions

Four types of boundary conditions will be considered in the following. The boundary of

the solution domain Ω will be denoted by Γ . The boundary is divided into four non-

overlapping regions, which collectively cover the entire boundary:

1. Prescribed temperature: ( , ), uu u x t x= ∈Γj j#

2. Prescribed heat flux: ( , ), n n qq q x t x= ∈Γj j j# where the flux is normal to the

boundary

3. Convection: ( ( , ) ( , )), n c c cq h u x t u x t x= − ∈Γj j j j where ch is the coefficient of

convective heat transfer measured in [W/(m2K)] and cu is the temperature of the

convective medium

4. Radiation: 44( ( , ) ( , )), r s rq f f u x t u x t xε ∞= κ ⋅ ⋅ ⋅ − ∈Γj j j j

where κ is the Stefan-

Boltzmann Constant, fε is the emissivity function with 0 1fε< ≤ , sf is the view

factor function, u is the temperature function of the radiating body, and u∞ is

the reference temperature of the environment that absorbs the radiation

1.3 Generalized Formulation

To arrive at the generalized weak form of equation (1-4), we multiply by a scalar test

function v and integrate:

yx z

qq q uv dxdydz Qv dxdydz c v dxdydz

x y z tΩ Ω Ω∂ ∂ ∂ ∂− + + + = ρ ∂ ∂ ∂ ∂ ∫∫∫ ∫∫∫ ∫∫∫ (1-7)

Using the following identities,

Page 23: Hp-DGFEM Book Small

4

( )( )( )

xx x

y

y y

zz z

q vv dxdydz q v q dxdydz

x x x

q vv dxdydz q v q dxdydz

y y y

q vv dxdydz q v q dxdydz

z z z

Ω Ω

Ω Ω

Ω Ω

∂ ∂ ∂ = − ∂ ∂ ∂ ∂ ∂ ∂= − ∂ ∂ ∂ ∂ ∂ ∂ = − ∂ ∂ ∂

∫∫∫ ∫∫∫∫∫∫ ∫∫∫∫∫∫ ∫∫∫

(1-8)

we can rewrite (1-7) as follows:

( )

.

x y z

v v vdiv qv dxdydz q q q dxdydz

x y z

uQv dxdydz c v dxdydz

t

Ω Ω

Ω Ω

∂ ∂ ∂− ⋅ + + + + ∂ ∂ ∂ ∂+ ⋅ = ρ ⋅∂

∫∫∫ ∫∫∫∫∫∫ ∫∫∫

j

(1-9)

Applying the Gauss divergence theorem, equation (1-10) results.

( ) x y z

v v vq n v dS q q q dxdydz

x y z

uQv dxdydz c v dxdydz

t

Γ Ω

Ω Ω

∂ ∂ ∂− • ⋅ + + + + ∂ ∂ ∂ ∂+ ⋅ = ρ ⋅∂

∫∫ ∫∫∫∫∫∫ ∫∫∫

j j

(1-10)

Vector nj

is the outward positive unit normal and dS is the differential surface element.

Substituting (1-5) into (1-10), we have:

( )

.

xx xy xz

yx yy yz

zx zy zz

u u u v

x y z x

u u u vq n v dS dxdydz

x y z y

u u u v

x y z z

uQv dxdydz c v dxdydz

t

Γ Ω

Ω Ω

∂ ∂ ∂ ∂λ + λ + λ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ − • ⋅ − + λ + λ + λ + + ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ + λ + λ + λ ∂ ∂ ∂ ∂ ∂+ ⋅ = ρ ⋅∂

∫∫ ∫∫∫

∫∫∫ ∫∫∫

j j

(1-11)

Page 24: Hp-DGFEM Book Small

5

Defining the differential operator vector:

Tdef

Dx y z

∂ ∂ ∂= ∂ ∂ ∂ (1-12)

we can write:

( ) [ ] ( )( )

( )

.

T uD v D u dxdydz c v dxdydz

t

Qv dxdydz q n v dS

Ω Ω

Ω Γ

∂Λ + ρ ∂= − •∫∫∫ ∫∫∫∫∫∫ ∫∫ j j

(1-13)

Equation (1-13) is the generic form of the weak or generalized formulation of the

transient heat equation. The generic form is modified by the boundary conditions. The

prescribed temperature on u∂Ω is enforced by restriction. When heat flux is specified

)0( ≠Γq then the specified heat flux q~ is substituted for q in equation (1-13). When

convection is specified )0( ≠Γc then )( cc uuhq −= is substituted for q in (1-13) such

that upon rearrangement we have:

( ) ( )

( )( , ) [ ]

( ) .

c

q c

T

c

c c

B u v D v D u dxdydz h uvdS

F v Qvdxdydz q n v dS h u v dS

Ω Γ

Ω Γ Γ

= Λ += − ⋅ +∫∫∫ ∫∫∫∫∫ ∫∫ ∫∫f f (1-14)

For completeness, radiation heat transfer is mentioned as a boundary condition.

However, it is a nonlinear problem and will not be considered in the following. As a

short form for this equation, it is customary to write

)(),( vFvuB = (1-15)

Page 25: Hp-DGFEM Book Small

6

where ( ),B u v is a bilinear form defined on ( ) ( )1 1H HΩ × Ω and ( )F v is a linear

functional defined on ( )1H Ω . The space ( )E Ω is defined by a set of functions

( ), ,u x y z that have finite energy on Ω , which is satisfied by the following condition:

∞<≤=Ω CuuBuE ),(|)( (1-16)

where C is some positive constant. We associate the norm ( )E

u Ω with the space

( )E Ω . By definition:

( )

1|| || ( , ) .

2

def

Eu B u uΩ = (1-17)

The space ( )E Ω is called the energy space. Further, we define the subsets )(~ ΩE and

( )E Ωc as follows:

( ) | ( ), ( , , ) ( , , ), ( , , ) def

uE u u E u x y z u x y z x y zΩ = ∈ Ω = ∈Γ# # (1-18)

( ) | ( ), ( , , ) 0, ( , , ) def

uE u u E u x y z x y zΩ = ∈ Ω = ∈Γc (1-19)

The generalized solution is the function ( )EXu E∈ Ω# such that

( , ) ( ) ( )EXB u v F v v E= ∀ ∈ Ωc. (1-20)

This is equivalent to finding the minimum of the functional π

1

( , ) ( )2

def

B u u F uπ = − (1-21)

Page 26: Hp-DGFEM Book Small

7

on the space )(~ ΩE . Proof and further discussion on this subject can be found, for

example, in Finite Element Analysis [11].

Page 27: Hp-DGFEM Book Small

8

Chapter 2

Numerical Approximation of the Generalized

Formulation in Steady State

To solve (1-13) numerically, the domain Ω is partitioned into k tetrahedral, hexahedral,

and pentahedral elements, 1,2, , ( )k M= ∆… . A particular partition is called a finite

element mesh and is denoted by ∆ . A finite dimensional subspace S of ( )E Ω is

characterized by ∆ and a polynomial degree kp is assigned to each element. A brief

description of S is presented in the following.

2.1 Approximation Spaces

We denote the subspace ( , , )pS S Q= Ω ∆f f, and define

( )

( ).

def

def

S S E

S S E

= ∩ Ω= ∩ Ωc c

# # (2-1)

S is constructed according to the partition ∆ whereby each element k is mapped from

a standard element stΩ by the mapping functions. For example, the standard

quadrilateral element stΩ is defined as:

( )

, , 1, 1, 1q

stΩ = ξ η ζ ξ ≤ η ≤ ζ ≤ (2-2)

Page 28: Hp-DGFEM Book Small

9

The mapping between the standard quadrilateral element and the thk partition is defined

as follows:

( )

( )

( )

( , , )

( , , )

( , , ) .

k

x

k

y

k

z

x Q

y Q

z Q

= ξ η ζ= ξ η ζ= ξ η ζ

(2-3)

Let the space of polynomials of degree p defined on stΩ be pS . The finite element

space S is defined as the set of all functions ( ), ,u x y z , which lie in the energy space

( )E Ω and on the thk element ( )( )( ) ȟ,Ș,ȗ kpku Q S∈ :

( )( )( ) ( ) ( )( ) ( )( ) ( ) ( )

, ,

| ,

, , , , , , , , , 1, 2, ,k

defp

pk k k

x y z

S S Q

u u E

u Q Q Q S k M

≡ Ω ∆ =∈ Ω

ξ η ζ ξ η ζ ξ η ζ ∈ = ∆

f f

(2-4)

where pf

is the vector of polynomial degrees and Qf

is the vector of mapping functions

assigned to the elements

( ) ( )

1 2

1 2

, , ,

, , , .

def

M

def

M

p p p p

Q Q Q Q

==

f …f

… (2-5)

The continuity property of functions in S ensures that ( )S E⊂ Ω . The condition that

equation (1-13) must be satisfied for all v S∈ c results in a system of ordinary differential

equations of the form

[ ] .K a r= (2-6)

Page 29: Hp-DGFEM Book Small

10

where [ ]K is called the stiffness matrix and r the load vector. The size of matrix

[ ]K is called the number of degrees of freedom and is denoted by N .

2.2 Spatial Error Control

The subspace S determines the finite element solution FEu and hence the error

EX FEu u− . The spatial error is controlled by proper selection of the space S . In the p-

version, a hierarchical sequence of spaces 1 2 nS S S⊂ ⊂… is constructed and

convergence is monitored. In the h-version, various adaptive methods have been

proposed in A Posteriori Error Estimates for the Finite Element Method [1] and Error

Estimates for Adaptive Finite Element Computations [2].

2.3 Convergence Characteristics

There are two fundamentally different approaches to the implementation of the finite

element method, called the h-version and the p-version. In the h-version, the solution

domain is partitioned into elements and the solution is approximated by piecewise

polynomials, defined on elements of low polynomial degree, usually 1 or 2.

Convergence is achieved by letting the size of the elements approach zero. In the p-

version, on the other hand, the partition is generally fixed and the polynomial degree of

elements is increased. Convergence is achieved by letting the lowest polynomial degree

approach infinity. Both versions can be used in combination by refining the mesh and

increasing the polynomial degree of the elements so that the finite element solution

converges to the exact solution in an optimal or nearly optimal rate. This method is

called the hp-version.

Page 30: Hp-DGFEM Book Small

11

2.3.1 Natural Norm

The errors can be measured in various norms. The most commonly used norm is the

energy norm. The energy norm is called the natural norm because the finite element

solution satisfies the following relationship:

( ) ( )

minEX FE EXE Eu Su u u uΩ Ω∈− = − (2-7)

Referring to (1-17), the energy norm measure of error is:

( )

1( - , )

2

def

EX FE EX FE EX FEEu u B u u u uΩ− = − . (2-8)

A more useful measure is the relative error, defined by:

−=def

EX FE Er

EX E

u ue

u. (2-9)

The model problems discussed herein have been selected so as to make comparisons

with known exact solutions possible. Since exact solutions are generally not known in

engineering applications, this error can be estimated using an a posteriori estimation

procedure. Because p-extensions produce a sequence of hierarchic finite element

spaces, the convergence of the functional π with respect to the number of degrees of

freedom N given by (1-21) is monotonic.

Page 31: Hp-DGFEM Book Small

12

Chapter 3

Control of Spatial Errors in

the Presence of Singularities

In the following, numerical examples are presented that illustrate the application of the

finite element method to heat conduction problems. A finite element code with hp

extension capabilities in one dimension (1D) and two dimensions (2D) was written in

MATLAB®

.

3.1 Spatial Error in 1D by hp-Refinement

An example showing how spatial errors are controlled is described. While complicated

to program, hp-extensions allow for very efficient treatment of any elliptic problem.

Spatial errors occur unless the exact solution happens to lie in the finite element space.

As most finite element software is based on polynomial basis functions, it is useful to

investigate how well incompatible initial solutions, such as step functions, can be

approximated. Specifically, the initial condition ( ) 1u x = with prescribed boundaries

( )0 0u = and ( )1 0u = at 0t += , defined on the solution domain ( )0,1Ω = will be

discussed.

Page 32: Hp-DGFEM Book Small

13

Let us consider a homogeneous bar of unit length, initially at a constant temperature

0 1=u . Let us further assume that at 0t += the temperature is dropped to zero at the

ends of the bar. Thus the solution for 0>t lies in

( ) | ( ), (0) 0 (1) 0E u u E u uΩ = ∈ Ω = =c , . Since the solution at 0=t is not in ( )E Ωc , the

initial condition 0u is said to be incompatible. It is necessary to project 0u onto the

space ( )E Ωc . Using the 2L projection, this involves computing the minimum of the

integral

21

0 0

0

10

( ) , where ( ) ( )=

= − Φ Φ ∈ ⊂ Ω ∑∫ n

j j j

j

I u a x dx x S E . (3-1)

This results in a system of algebraic equations for , 1, 2, ,= …ja j n . The numerical

procedure will be discussed in detail in Section 4.3. The error between 0u and

2( )

0

1

ndefL

j j

j

u a=

= Φ∑ is measured in the least square sense that is the 2L norm. By definition:

2

21

0

10

12

0

0

n

j j

j

L

u a dx

e

u dx

= − Φ =

∑∫∫

. (3-2)

The incompatibility of the initial solution with the polynomial finite element space is

demonstrated in Figure 3-1. A single finite element is used ( )( )1M ∆ = with 8p = .

The approximation is oscillatory and the error in 2L norm is 14.9%. To reduce the error

in L2 norm, either the number of elements or their degrees of freedom must be increased.

It is shown in Figure 3-2 that doubling the polynomial order of the element leads to a

decrease in error in energy norm from 14.9% (Figure 3-1) to 8.1%.

Page 33: Hp-DGFEM Book Small

14

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

distance x [1]

tem

pera

ture

u [

1]

uEX

and uL2

of f(x) = 1.

uEX

uL2

FIGURE 3-1. Projection of Incompatible Solution onto Finite Element Solution

Space: 1 Element, p=8, Error in L2 Norm = 14.9%

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

distance x [1]

tem

pera

ture

u [

1]

uEX

and uL2

of f(x) = 1.

uEX

uL2

FIGURE 3-2. Projection of Incompatible Solution onto Finite Element Solution

Space, 1 Element, p=16, Error in L2 Norm = 8.1%

Page 34: Hp-DGFEM Book Small

15

However, in this particular case, it is more effective to use geometric grading toward the

ends of the domain. This is illustrated in Figure 3-3 where the results shown correspond

to a 3-element mesh. The large element is 80% of the total length, the small elements

are 10% each. It is seen that the oscillations are confined to the small elements only.

The relative error in 2L norm is 5.0 %.

By increasing the large element to 90% and reducing the small elements to 5% each, the

relative error in energy norm is further reduced to 3.5% (Figure 3-4). The obvious

question is, how well can 0u be approximated by this method.

The 2L norm error is dependent on the size of the smallest element at the end points and

can be made arbitrarily small. Considering, for example,

2( )

0

, 0

1, 1-

1, 1- 1

L

xx

u x

xx

≤ ≤ ε ε= ε < < ε − ε ≤ ≤ε (3-3)

we find:

( ) ( )2

2 212

( )

0 0

1 0 0

1 13

L xu u dx dx y dy

ε ε ε − = − = ε − = ε ∫ ∫ ∫ . (3-4)

Page 35: Hp-DGFEM Book Small

16

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

distance x [1]

tem

pera

ture

u [

1]

uEX

and uL2

of f(x) = 1.

uEX

uL2

FIGURE 3-3. Projection of Incompatible Solution onto Finite Element Solution

Space, 3 Elements, Graded Mesh 10%, p=8, Error in L2 Norm = 5.0%

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

distance x [1]

tem

pera

ture

u [

1]

uEX

and uL2

of f(x) = 1.

uEX

uL2

FIGURE 3-4. Projection of Incompatible Solution onto Finite Element Solution

Space, 3 Elements, Graded Mesh 5%, p=8, Error in L2 Norm = 3.5%

Page 36: Hp-DGFEM Book Small

17

Similarly:

( ) ( )2

21 1 12 2( )

0 0

1 1 0

11 1

3

L xu u dx dx y dy

−ε −ε− ε − = − = ε − = ε ∫ ∫ ∫ (3-5)

which indicates that the error in 2L norm is proportional to ε . In the numerical

example under consideration, we find a very similar dependence, which is depicted in

Figure 3-5.

100

101

10-15

10-10

10-5

100

||u(L2)

0 - u

0||

L2 / ||u

0||

L2 of f(x) = 1, f(0) = f(1) = 0, M(∆) = 3, p = 8

geometric grading factor g [1]

Err

or

in e

nerg

y n

orm

in %

FIGURE 3-5. Projection of Incompatible Solution onto FE Solution Space, 3

Elements, Grading = 0.1^g, p=8, Error in L2 Can Be Made Arbitrarily Small

Therefore, geometric grading coupled with p-extension is an effective tool for

approximating incompatible initial solutions. Although heat transfer problems are

generally "well behaved", this kind of grading is very effective for projecting

incompatible initial conditions onto the finite element space.

Page 37: Hp-DGFEM Book Small

18

3.2 Singularity in 2D

Singularities may arise from material discontinuities, sharp corners, and abrupt changes

in boundary conditions. To demonstrate singularities in two dimensions (2D), we

consider the L-shaped domain shown in Figure 3-6. Its re-entrant corner induces a

geometric singularity. Zero flux is prescribed on the edge between nodes 1 and 8 and

zero temperature on the edge between nodes 1 and 2.

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

0

0.5

1

1.5

3

4

5

2

1

2

3

8

1

7

6

y

x

u

L-shaped domain with 3 elements.

FIGURE 3-6. L-shaped Domain. Nodes are Numbered in Black; Elements are

Numbered in Red; Zero Temperature is Prescribed between Nodes 2 and 1; Zero

Flux is Prescribed between Nodes 1 and 8

Page 38: Hp-DGFEM Book Small

19

The exact solution of this problem in the vicinity of the re-entrant corner is of the form

i

i i

1

(cos ( 1) sin )

2 1 .

2

i

EX i

i

i

u A r

i

∞ λ=

= λ θ+ − λ θ−λ = πα

∑ (3-6)

The derivation of this is available in Finite Element Analysis [11]. The terms iA are the

expansion coefficients that depend on the other boundary conditions. α is the

complement of the angle of the reentrant corner as shown in Figure 3-7.

FIGURE 3-7. Domain with Re-entrant Corner

In this model problem 3

2

πα = , therefore 1

1

3λ = . In the following discussion we define

flux boundary conditions on the boundary segment such that the exact solution is

1

3 cos - sin3 3

EXu rθ θ = . (3-7)

A graphical illustration of EXu is shown in Figure 3-8.

Page 39: Hp-DGFEM Book Small

20

FIGURE 3-8. Exact Solution of uEX, i=1

The boundary conditions can be handled in two ways. One is to project EXu onto the

space of the of the basis functions on the boundaries using the 2L projection method. In

this case, the boundary conditions are enforced by restriction on the space of admissible

functions. The other method is to compute the normal flux nq and enforce the boundary

conditions in the weak sense. In this work, the second method was chosen:

[ ]ˆ n EXq n uΓ= − Λ ∇ . (3-8)

Vector nΓ is the normal on the boundary Γ and [ ]Λ is the thermal conductivity tensor.

Page 40: Hp-DGFEM Book Small

21

In this case:

2

3

2

3

1sin cos( , )

3 3 3

1 1( , ) sin cos3 3 3

EX

EX

EX

ru rr

u

u r rr

θ θ ∂ − −θ ∂∇ = = ∂ θ θ θ − + ∂θ . (3-9)

Visual representations of the boundary conditions are shown in Figure 3-9.

-0.5

0

0.5

1

1.5

-1.5

-1

-0.5

0

0.5

1

1.5

0

0.5

1

1.5

x

7

6

5

6

5

8

4

14

uEX

(cyan, black), ∇uΓq (blue), q

n (red)

1311

12

12

15

10212017

3

181922162827239

2426292235342915303336284241352136404334494841274247504056554733485457466362513961645045160495859534443515246383744453932313738322625303125201923241814131617

y

118

79

10

4

2

1

2

3

u

FIGURE 3-9. Exact Solution (Black Circles on Cyan Stems) Superimposed on the

L-shaped Domain; qn and ∇uΓ Displayed by Red and Blue Arrows, Respectively

Solving this 3-element problem using polynomial degree 3 leads to the approximate

solution shown graphically in Figure 3-10.

Page 41: Hp-DGFEM Book Small

22

FIGURE 3-10. Finite Element Solution uFE , 3 Elements, Polynomial Degree 3

Note that the numerical solution of Figure 3-10 is substantially different from the exact

solution in Figure 3-8. The error will be estimated in energy norm.

Letting

EX FEe u u= − (3-10)

we can write:

Page 42: Hp-DGFEM Book Small

23

[ ]2

1( ) ( ) ( , ) ( )

2

1 1( , ) ( ) ( , ) ( ) ( , )

2 2

( ) 0 .

FE EX EX EX EX

EX EX EX EX

EX E

u u e B u e u e F u e

B u u F u B u e F e B e e

u e

Π = Π − = − − − − == − + − + == Π + +

(3-11)

Therefore,

2

( ) ( )FE EXEe u u= Π −Π . (3-12)

Also, since

1

( ) ( , ) ( )2

EX EX EX EXu B u u F uΠ = − (3-13)

and

( , ) ( )EX EX EXB u u F u= (3-14)

we have

1 1

( ) ( ) ( ) .2 2

EX EX n EX EXu F u q u dsΓ

Π = − = − ∫ (3-15)

Since EXu is given by equation (3-7), ( )EXuΠ can be computed from (3-15) and

knowing ( )FEuΠ from the finite element solution:

[ ]1

2

1 2( ) ,FE n

n

r

ru a a a

r

Π = − …

B (3-16)

Page 43: Hp-DGFEM Book Small

24

one can compute:

2

( ) ( ).FE EXEe u u= Π −Π (3-17)

The relative error is:

100 Er

EX E

ee

u= (3-18)

where

2 1 1

( ) ( ) .2 2

EX EX n EX EXEu F u q u ds

Γ= = ∫ (3-19)

For the three element mesh shown in Figure 3-6 and p = 3, we have:

( ) - 6.695974660911005 - 001

( ) - 8.471380026768022 - 001

45.8 % .

FE

EX

r

u e

u e

e

Π =Π =

= (3-20)

Errors of this magnitude are generally not acceptable for engineering purposes. The

large error is caused by the fact that EXu is not analytic, in fact strongly singular in the

reentrant corner. Hence, approximation of EXu with piecewise polynomials is not easy.

It is known that, in such cases, meshes graded in geometric progression toward the

singular point with the grading factor of ( )2

2 1− are optimal. This topic is further

discussed in Finite Element Analysis [11]. The optimal mesh refinement strategy for

controlling the error associated with the singularity at the reentrant corner is illustrated

in Table 3-1.

Page 44: Hp-DGFEM Book Small

25

TABLE 3-1. Mesh Refinement Strategy; Left Column: Overview of Solution

Domain with Increased Element Count from Top To Bottom; Right Column:

Close-Up of Singularity with Increased Refinement

Page 45: Hp-DGFEM Book Small

26

The optimal rate of convergence is exponential as discussed in Finite Element Analysis

[11]. To realize exponential convergence it is necessary to increase both the number of

geometrically graded layers of elements and the polynomial degree. The asymptotic rate

of convergence when p is increased on a fixed mesh is algebraic. Specifically,

provided that 1A in equation (3-6) is not zero,

1E

ke

Nλ≤ , (3-21)

see Finite Element Analysis [11].

In this model problem 1

1

3λ = , hence the theoretical rate of convergence is

1

3. It is seen

in Table 3-2 and Figure 3-11 that the numerical rate of convergence is close to 1

3.

When the number of layers of refinement is increased with p then the rate of

convergence becomes exponential. This is illustrated in Table 3-3, where it is seen that

the numerical rate is increasing as the number of degrees of freedom is increased and in

Figure 3-12, where the relative error vs. degrees of freedom curve on a log-log scale is

seen to have an increasing downward slope.

Page 46: Hp-DGFEM Book Small

27

TABLE 3-2. Convergence of p-Refinement of L-Shaped Domain, 1 Refinement,

Polynomial Orders 1 through 8

Run# DOF Potential Energy Convergence Rate True Relative Error [%]

1

2

3

4

5

6

7

8

12

33

54

84

123

171

228

294

-7.019466711517294e-001

-7.720996474209324e-001

-7.801391374072846e-001

-7.971252036359559e-001

-8.082571556427428e-001

-8.157655245413216e-001

-8.210394799960001e-001

-8.249448993585982e-001

0.0000

0.3262

0.1151

0.3309

0.3301

0.3256

0.3199

0.3188

41.3993

29.7622

28.1227

24.2976

21.4235

19.2441

17.5522

16.1857

101

102

101.3

101.4

101.5

101.6

degrees of freedom DOF in [1]

rela

tive e

rror

e r in [

%]

Spatial Error Control by Increased Polynomial Order

||Π(uFE

)-Π(uEX

)|| / ||Π(uEX

)||E

FIGURE 3-11. Convergence of p-Refinement of L-Shaped Domain, 1 Refinement,

Polynomial Orders 1 through 8

Page 47: Hp-DGFEM Book Small

28

TABLE 3-3. Convergence of hp Refinement of L-Shaped Domain, 8 Refinements

and Polynomial Orders 1 through 8

Run# DOF Potential Energy Convergence Rate True Relative Error [%]

1

2

3

4

5

6

7

8

12

51

114

228

411

681

1056

1554

-7.019466711517294e-001

-8.183934050633468e-001

-8.396427254420245e-001

-8.454936007622418e-001

-8.467569499625519e-001

-8.470453032705809e-001

-8.471145647099563e-001

-8.471319142504697e-001

0.0000

0.5597

0.8355

1.0942

1.2407

1.3996

1.5671

1.7439

41.3993

18.4205

9.4063

4.4058

2.1209

1.0461

0.5260

0.2682

102

101

degrees of freedom DOF in [1]

rela

tive e

rror

e r in [

%]

Spatial Error Control by Increased Polynomial Order

||Π(uFE

)-Π(uEX

)|| / ||Π(uEX

)||E

FIGURE 3-12. Convergence of hp Refinement of L-Shaped Domain

Note the substantially reduced relative error, which is 0.2682%, at 1554 degrees of

freedom. The corresponding finite element solution is illustrated in Figure 3-13.

Page 48: Hp-DGFEM Book Small

29

FIGURE 3-13. Finite Element Solution of 8 Grading Refinements at Polynomial

Order 8; the Relative Error with Respect to the Exact Solution is 0.2682%

Page 49: Hp-DGFEM Book Small

30

Chapter 4

Spatial and Temporal Error Control in 1D Diffusion Problems The model problem to serve as the basis of the following discussion is equation (4-1),

which is the one-dimensional equivalent of (1-13).

( ) ( )0

0 0 0

( ) (0)

L L L

x L x

u u vc A vdx A dx AQvdx Aq v L Aq v

t x x = =∂ ∂ ∂ρ + λ = − +∂ ∂ ∂∫ ∫ ∫ (4-1)

where A represents the cross section of a bar.

4.1 The Finite Difference Method, 1D

The trial functions ∈ #tu S and the test functions v S∈ c

are written in the form

1

( ) ( )n

t i i

i

u a t x=

= Φ∑ (4-2)

1

( )=

= Φ∑N i i

i

v b x (4-3)

where N is the number of degrees of freedom and ∗= +n N n , where *n represents the

number of coefficients determined by the essential boundary conditions. On substituting

(4-2) and (4-3) into (4-1), a system of N coupled ordinary differential equations results:

Page 50: Hp-DGFEM Book Small

31

[ ] [ ] M a K a r+ =$ (4-4)

where the elements of matrices [ ] [ ] and M K are, respectively ijm and ijk :

0

0

.

Ldef

ij i j

Ldefji

ij

m cA dx

ddk A dx

dx dxλ

= Φ ΦΦΦ=

∫∫

(4-5)

The elements of vector r are:

1 1 0

0

0

0

( )

, 2,3,..., 1

( ) .

L

x

L

i i

L

n n x L

r AQ dx Aq

r AQ dx i n

r AQ dx Aq

=

=

= Φ +

= Φ = −

= Φ −

∫∫∫

$

$

$

(4-6)

The time derivative in (4-4) can be approximated by a finite difference time stepping

scheme:

( ) (1 ) .t t t t t ta a a a t+∆ +∆≈ + −θ + θ ∆$ $ (4-7)

At time steps and + ∆t t t , equation (4-4) reads:

[ ] [ ] [ ] [ ] .

t t t

t t t t t t

M a K a r

M a K a r+∆ +∆ +∆

+ =+ =

$

$ (4-8)

Multiplying the first equation of (4-8) by (1 )−θ and the second equation by θ , one can

write:

Page 51: Hp-DGFEM Book Small

32

[ ] [ ]

[ ] [ ] (1 ) (1 ) (1 )

.

t t t

t t t t t t

M a K a r

M a K a r+∆ +∆ +∆

−θ + −θ = −θθ + θ = θ

$

$ (4-9)

Adding the equations in (4-9), we get:

[ ] ( ) [ ] [ ] (1 ) (1 ) (1 ) .t t t t t t t t t

M a a K a K a r r+∆ +∆ +∆−θ + θ + −θ + θ = −θ + θ$ $ (4-10)

Recognizing that the term multiplying [ ]M is represented in equation (4-7), we can

write:

[ ] [ ] [ ] [ ]

1 1

(1 )

(1 ) .

t t t t t t

t t t

M a M a K a K at t

r r

+∆ +∆

+∆

− + −θ + θ =∆ ∆= −θ + θ

(4-11)

Combining:

[ ] [ ] [ ] [ ] 1 1(1 ) (1 ) .

t t t t t tM K a M K a r r

t t+∆ +∆ + θ = − −θ + −θ + θ ∆ ∆ (4-12)

This equation is well suited for electronic computations. If 0.5θ ≥ then the method is

known to be unconditionally stable through many references, such as Solution of

Diffusion Problems by the Finite Element Method [10]. If ∆t is not changed, then the

coefficient matrix on the left needs to be reduced only once. The computation of time

steps involves successive substitutions.

An algorithm was developed and programmed in MATLAB®

. A linear and constant

time stepping scheme is outlined in the following:

1. Define geometry, boundary conditions, and material properties, specify

constant time step t∆

Page 52: Hp-DGFEM Book Small

33

2. Compute stiffness matrix [ ]K and mass matrices [ ]M

3. Perform 2L projection of the initial conditions onto the finite element

subspace

4. Build load vector r incorporating the boundary conditions and modify

[ ] [ ] and K M accordingly

5. Prepare time integration by reducing to upper triangular form and solving

by Gaussian elimination (see “\” operator in MATLAB®

):

a. term1 = (M+θ*∆t *K)\(M-(1-θ)*∆t *K);

b. term2 = (M+θ*∆t *K)\( ∆t *r);

6. Solve at every time step:

a. For I = 2 to number of time steps

i. Compute at+∆t

= term1* at + term2;

ii. Check time step and reduce if necessary

b. End

7. Assemble solution at every time step

8. Perform post-processing operations

4.2 The Discontinuous Galerkin Method, 1D

The fundamental idea of this method is to use p-extension in both space and time

dimensions. To do this, we define the time domain ( )0,J T= and partition it into time

steps mI .

11, where ( , ), 1

M

m m m mmI I t t m M−= = ≤ ≤ (4-13)

Page 53: Hp-DGFEM Book Small

34

Each time step mI is associated with a temporal approximation order 0mr ≥ and a

similar or same finite element space as the spatial problem introduced in Chapters 1 and

2. With this approach, we seek fully discrete solutions mU on each time interval mI .

, ,

0

( , ) ( , ) ( ) ( ), , m

m

r

m j m j m mI xj

U t x U t x u x t t I xΩ == = ϕ ∈ ∈Ω∑ (4-14)

where ,j mu , respectively ,j mϕ , is a spatial basis function, respectively a polynomial time

function. As used in Chapter 3 to represent geometric basis functions, scaled Legendre

polynomials are also employed here as time basis functions ,j mϕ . More information on

these functions can be found in Finite Element Analysis [11]. mU is called a trial

function. The test functions are written in the form:

, ,0( , ) ( ) ( ), , .

mr

m i m i m miV t x v x t t I x== ϕ ∈ ∈Ω∑ (4-15)

Using the procedure described in The Discontinuous Galerkin Time-Stepping Algorithm

in hp-Version Context [6], the discontinuous Galerkin time stepping method is to find a

solution ( , )U t x by solving successively on each time step mI the problem: Find

( ),mU t x of the form (4-14) such that

1 1

1 1

m

m

mm m m m m

I

m m m

I

UV U V dxdt U V dx

t

gV dxdt U V dx

+ +− −Ω Ω

− +− −Ω Ω

∂ +∇ ∇ + ∂ = +∫ ∫ ∫∫ ∫ ∫ (4-16)

for all test functions ( ),mV t x of the form (4-15). Problem (4-16) is a discrete variational

formulation of (4-1) with the special case 1c Aρ = and 1kA = . )(1 xU m

−− and 1( )mU x+− are

the left and right handed limits of the function mU at the beginning of the time step mI .

Page 54: Hp-DGFEM Book Small

35

)(1 xU m

−− is also the initial data for computing mU on the time step mI . 1( )mU x+−

represents the discontinuous step from )(1 xU m

−− at 1mt − .

Combining (4-14) through (4-16), implementing the scaled Legendre polynomials as

temporal shape functions, considering the generic time step ( )0 1,I t t= , and omitting the

time step index m to avoid cumbersome notation, the following is true:

0 0

, 0

0

0

[ ( ) ( )]( , ) [ ] ( , )

( , ) ( , ) ( )

m

m m

m

m

r

j i j i j i H j i j i

i j I I

r

i i H o i H i

i I

dt t t u v dt a u v

g dt v U v t

+=

− +=

′ϕ ϕ + ϕ ϕ + ϕ ϕ

= ϕ + ϕ∑ ∫ ∫∑ ∫

(4-17)

where the scalar inner product ( , )j i Hu v and the energy inner product ( , )j ia u v are the

mass and stiffness matrices, [ ] [ ] and M K , respectively. The time step I can be

mapped from the reference interval (-1,1) by using the following domain mapping:

0 1 1 0

1 1ˆ ˆ( ) ( ) , .

2 2t F t t t tk k t t= = + + = − (4-18)

For clarity, the following abbreviations are introduced:

1

1

ˆ ˆˆ ˆ ˆ ˆ( 1) ( 1)ij j i j iA dt + +−

′= ϕ ϕ +ϕ − ϕ −∫ (4-19)

1

1

ˆ ˆˆ ˆ:ij j iB dt−

= ϕ ϕ∫ (4-20)

Hii vlvf ),ˆ(:)(ˆ 11 = (4-21)

1

1

1

ˆ ˆˆ: ( )i il g F dt−

= ϕ∫ c (4-22)

Page 55: Hp-DGFEM Book Small

36

Hii vlvf ),ˆ(:)(ˆ 22 = (4-23)

2

0ˆ ˆ: ( 1)i il U −= ϕ − . (4-24)

With (4-19) through (4-24), (4-17) can be compactly expressed as:

1 2

, 0 0

ˆ ˆˆ ˆ( , ) ( , ) ( ) ( )2 2

m mr r

ij j i H ij j i i i i i

i j i

k kA u v B a u v f v f v

= =+ = +∑ ∑ . (4-25)

The matrices A and B are hierarchical. This is exploited computationally by

calculating the largest temporal approximation order once and writing the matrices to a

storage medium for all future references.

The spatial problems are discretized as in Chapter 2. By using a finite dimensional

subspace pSf, the test and trial functions are expressed as linear combinations of the

basis functions ks . Mass and stiffness matrices are obtained which lead to the complete

matrix expression of the elliptic problem (4-26).

00 01 2

0 0 0

1 2

0

ˆ ˆ2

2

ˆ ˆ2

r

r r r

r rr

kA M K A M

u f fk

u f fkA M A M K

+ = + +

A f ff

B D B B B Bf ff

A

(4-26)

An algorithm was developed and programmed in MATLAB®

. Its adaptive time

stepping scheme is outlined:

1. Define geometry, boundary conditions, and material properties, specify

constant time step t∆

2. Compute stiffness matrix [ ]K and mass matrix [ ]M

Page 56: Hp-DGFEM Book Small

37

3. Perform 2L projection of the initial conditions onto the finite element

subspace

4. Build load vectors 1 2and f ff f

incorporating the boundary conditions,

modify K and M accordingly, and build block matrix BM by Kronecker

tensor product

5. Solve each time interval by reducing to upper triangular form and solving

by Gaussian elimination (see “\” operator in MATLAB®

): at every time

step I : ( ) 1 2\2

k ia BM f f

= + f f

;

6. Assemble solution for each time interval

7. Perform post-processing operations

The solution of the fully discrete system (4-26) for large systems is demanding

computationally. For efficient implementation of engineering problems, this system

should be decoupled. It has been shown that these systems are diagonalizable in the

complex number space at least up to a temporal approximation order of 100 (hp

Discontinuous Galerkin Time Stepping for Parabolic Problems [13].) Since the size of

matrices considered herein is small, diagonalization was not implemented.

4.3 L2 Projection of Initial Conditions at t = 0+

The initial conditions ( ),0f x + need to be expressed in terms of the coefficient vector

0ta+= . Therefore, ( ),0f x must be projected onto the finite element space ( , , )pS QΩ ∆f ff

defined in (2-4). The solution domain is partitioned into k elements of polynomial

order p . Each element is mapped from the standard element 1 1− ≤ ξ ≤ via the mapping

function (4-27),

Page 57: Hp-DGFEM Book Small

38

1

1 1.

2 2k kx x x +

−ξ + ξ= + (4-27)

We need to express ( ),0f x + as a piecewise polynomial function. On 1 1− ≤ ξ ≤ , it can

be approximated with linear combinations of the basis functions in p

iN Sf:

1 1 2 2 3 3 1 1( ,0 ) .p pf x a N a N a N a N+ + += + + + +… (4-28)

It should be noted that ( )1 ,0ka f x= and ( )2 1,0ka f x += because

( ) ( ) ( ) ( )1 1 2 21 1, 1 0, 1 1, 1 0, and 0 at 1 for 3iN N N N N i− = = = − = = ξ = ± ≥ . Therefore

we can rewrite (4-28) and define the zero-bounded function ( )g ξ and the difference

function ( )iF a .

( )1 3 3 4 4 1 1

21

3 3 4 4 1 1

1

1 1( ) ( ) ( )

2 2

( ) ( )2 k k

def

k k p p

defk

i p p

g f f x f x a N a N a N

lF a g a N a N a N d

+ + ++

+ +−

−ξ + ξξ = − − = + + += ξ − − − − ξ∫

… (4-29)

where ( 1) ( 1) 0g g− = + = . The coefficients ( )3, 4, , 1i ka i p= +… are determined by

minimizing ( )iF a with respect to ia :

0=∂∂

ia

F. (4-30)

The minimization condition (4-30) is necessary and sufficient for the determination of

( ) 3, 4, , 1ia i p= −… because F is a convex quadratic function, the minimum of which

is necessarily global. This results in a system of simultaneous equations:

Page 58: Hp-DGFEM Book Small

39

( )( )( )

( )

1

3 3 4 4 1 1 3

1

1

3 3 4 4 1 1 4

1

1

3 3 4 4 1 1

1

1

3 3 4 4 1 1 1

1

( ) 0

( ) 0

( ) 0

( ) 0 .

p p

p p

p p i

p p p

g a N a N a N N d

g a N a N a N N d

g a N a N a N N d

g a N a N a N N d

++ +

−+

+ +−

++ +

++ + +

ξ − − − − ξ =

ξ − − − − ξ =

ξ − − − − ξ =

ξ − − − − ξ =

∫∫∫∫

B

B

(4-31)

Defining

1

2 2

1

, , 1, 2, , 1ij i j kc N N d i j p+ +−

= ξ = −∫ … (4-32)

and

1

1

1

( ) , 1, 2, , 1i i kr g N d i p+−

= ξ ξ = −∫ … (4-33)

we have a system of simultaneous equations from which ( )3, 4, , 1i ka i p= +… can be

computed:

11 3 12 4 1, 1 1 1

21 3 22 4 2, 1 1 2

1 3 2 4 , 1 1

1,1 3 1,2 4 1, 1 1 1 .

p p

p p

i i i p p i

p p p p p p

c a c a c a r

c a c a c a r

c a c a c a r

c a c a c a r

− +− +

− +

− − − − + −

+ + + =+ + + =+ + + =

+ + + =

……B

…B

(4-34)

Page 59: Hp-DGFEM Book Small

40

The terms ijc can be determined once and for all, however, the terms ir generally

require numerical integration. Since all elements are mapped onto the standard element,

the Gauss-Legendre quadrature was employed.

4.3.1 L2 Projection of the Initial Solution f(x) = sin(πx)

The initial solution ( ) ( )sinf x x= π cannot be represented exactly because the sine

function is not in the finite element space pSf. However, when ( )f x is a smooth

function as in this case, then the error in maximum norm can be made arbitrarily small

by choosing p sufficiently high. For example, considering the finite element space in

Table 4-1.

Four positions of greater point density in Figure 4-1 coincide with the element

transitions. This is because the location of points corresponds to the quadrature points.

The approximation error corresponding to 3 elements and 6p = is shown in Figure 4-2.

The error at every element boundary is zero because the function values are assigned by

collocation.

In addition, it should be noted that the center element produces a much smaller error,

which can be explained by the fact that for the center element all of the asymmetric

basis functions are zero and the symmetric basis functions are good approximations of

the sinusoidal exact solution. Figure 4-2 also indicates that the error, corresponding to 3

elements and 6p = , is on the order of 10-8

.

Page 60: Hp-DGFEM Book Small

41

TABLE 4-1. L2 Projection of the Polynomial Function f(x) = sin(πx)

Initial Condition ( )f x

sin( )xπ

Number of Gauss Pts. GN 20

Solution Domain Ω 0 1x x≤ ≤

Number of Elements ∆ 3

Polynomial Order p 6

Left BC 0u ( )0 0f =

Right BC Lu ( ) 0f L =

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

6 6 6

1D mesh with 3 elements.

length x [1]th

ickness y

[1]

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

distance x [1]

tem

pe

ratu

re u

[1

]

u0 and u(L

2)

0 of f(x) = sin(pi*x), f(0) = f(1) = 0, M(∆) = 3, p = 6

u0

u(L2)

0

FIGURE 4-1. Comparison between Exact Function and its L2 Projection

Page 61: Hp-DGFEM Book Small

42

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-4

-3

-2

-1

0

1

2

3

4

x 10-8

distance x [1]

err

or

e [

1]

u(L2)

0 - u

0, f(x) = sin(pi*x), f(0) = f(1) = 0, M(∆) = 3, p = 6

spline

true data

FIGURE 4-2. Error Plot in the Range of ±4*10-8

The corresponding error in 2L norm amounts to 62.7 10 %−⋅ . Spatial error control can be

exercised by increasing the number of degrees of freedom. One can either increase the

number of elements or raise their polynomial order or both. In this particular case, we

found by trial and error that 7 elements of polynomial order 10 are sufficient to reach the

error, which is of the order of the machine ε . Of course, other 2L projections can be

used also. Table 4-2 lists the respective element configuration. The following Figures

4-3 and 4-4 present the comparison between exact and projected functions as well as the

error, which is on the order of the machine ε .

Page 62: Hp-DGFEM Book Small

43

TABLE 4-2. Refined L2-Projection of the Polynomial Function f(x) = sin(πx)

Initial Condition ( )f x

sin( )xπ

Number of Gauss Pts. GN 20

Solution Domain Ω 0 1x x≤ ≤

Number of Elements ∆ 7

Polynomial Order p 10

Left BC 0u ( )0 0f =

Right BC Lu ( ) 0f L =

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

10 10 10 10 10 10 10

1D mesh with 7 elements.

length x [1]

thic

kness y

[1]

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

distance x [1]

tem

pe

ratu

re u

[1

]

u0 and u(L

2)

0 of f(x) = sin(pi*x), f(0) = f(1) = 0, M(∆) = 7, p = 10

u0

u(L2)

0

FIGURE 4-3. Comparison between the Exact Function and its Projection

Page 63: Hp-DGFEM Book Small

44

The error in 2L norm is 131.6 10−⋅ . In summary, we have seen three methods that will

improve projection error and, as we will later see, increase the quality of the numerical

solution. The first is to increase in the number of elements, the second is to increase the

polynomial order of the elements, and the third is to apply geometric grading toward the

end points of the solution domain. The third method is effective for unsmooth problems.

The first two methods were presented herein. An application of the third method was

demonstrated in Chapter 3. Equivalently, fewer elements and higher polynomial order

will work as well. In Figure 4-5, 5 elements are used at polynomial order 11 to achieve

similar results as in Figure 4-4.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-3

-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

x 10-15

distance x [1]

err

or

e [

1]

u(L2)

0 - u

0, f(x) = sin(pi*x), f(0) = f(1) = 0, M(∆) = 7, p = 10

spline

true data

FIGURE 4-4. Relative Error Plotted in the Range of ±2*10-15

Page 64: Hp-DGFEM Book Small

45

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-5

-4

-3

-2

-1

0

1

2

3

x 10-15

distance x [1]

err

or

e [

1]

u(L2)

0 - u

0, f(x) = sin(pi*x), f(0) = f(1) = 0, M(∆) = 5, p = 11

spline

true data

FIGURE 4-5. Relative Error Plotted in the Range of ±4*10-15

4.3.2 L2 Projection of the Initial Solution f(x) = x(1-x)

In the special case when ( )f x is a polynomial or piecewise polynomial function, the

initial condition can be represented exactly. For example, if ( ) (1 )f x x x= − then a

single element with 2p ≥ is sufficient for the description of the initial condition. This

would not be sufficient to represent the solution in time, however.

4.4 Temporal Error Control

The Crank-Nicolson method (CNM) is second order accurate in time and is

unconditionally stable. For this reason, it is a widely used method for integrating

ordinary differential equations. Higher order time methods can be used for integrating

smooth solutions more accurately, however, they are not applicable when the solution

changes substantially over small time intervals. Lower order methods have greater

generality in this regard.

Page 65: Hp-DGFEM Book Small

46

Spatial errors largely depend upon the smoothness of the initial conditions. Since spatial

solution gradients diminish with time, the solution becomes smoother and smoother.

Therefore spatial errors decrease with time. Both the spatial and temporal errors will be

investigated with respect to specific cases.

4.4.1 Adaptive Time Solvers

The finite difference and discontinuous Galerkin algorithms described in Sections 4.1

and 4.2 were implemented in MATLAB®

. These solvers enabled performance tests with

respect to convergence and CPU time. The tests were conducted using the three initial

conditions, representing two very smooth and compatible initial conditions and one

incompatible initial condition, which were 2L projected in Sections 4.3 and 3.1. The

boundary conditions were enforced by restriction in the boundary points. The three

problem statements are expressed in (4-35), (4-36), and (4-37) and will be referred to as

Model Problems 1, 2, and 3, respectively.

( )1

( ,0) sin( ), (0, ) 0, ( , ) 0u x x u t u L t= π = = (4-35)

( )2

( ,0) (1 ), (0, ) 0, ( , ) 0u x x x u t u L t= − = = (4-36)

( )3

( ,0) 1, (0, ) 0, ( , ) 0u x u t u L t= = = (4-37)

hp-DGFEM for Parabolic Evolution Problems [5] gives the exact solutions for the three

model problems:

( ) 21

( , ) sin( ) t

EXu x t x e−π= π ⋅ (4-38)

( ) 2 22

3 31

1 cos( )( , ) 4 sin( )l t

EX

l

lu x t e l x

l

∞ − π=

− π= ππ∑ (4-39)

( ) 2 23

1

1 cos( )( , ) 2 sin( )l t

EX

l

lu x t e l x

l

∞ − π=

− π= ππ∑ . (4-40)

Page 66: Hp-DGFEM Book Small

47

The computer program, which was written in support of this work, computes the relative

error in energy norm on the basis of (2-9). This value is compared with the maximum

acceptable relative error specified by the user. Upon starting the h-DGFEM option, the

solver starts with one finite time increment, computes a numerical solution for the entire

time domain, and determines the maximum relative error in energy norm. As long as

the maximum acceptable error in energy norm is smaller than the computed value, the

solver automatically creates a new mesh in the time domain, using a temporal grading

function, and starts over. In hp-DFGEM mode, the solver increases the degrees of

freedom in time by both doubling the number of elements in time and their polynomial

order. There is also a program option that provides a choice between monitoring the

relative spatial error in energy norm with respect to time ( )re t or its time integral

( )0

1T

r

t

e t dtT =∫ , where T is the total time of transient solution. Since 1T = in this work,

the term 1

T is omitted in the following.

The numerical experiments were performed with both error options. The first and more

stringent error option strongly enforces the error limit, which might lead to unreasonably

fine and computationally expensive discretizations. In these cases, the overall solution

quality is driven well below the error limit only to accommodate a localized error. For

example, this is true for incompatible initial conditions. The second and less stringent

error option is used throughout this work.

In the following, convergence is investigated by monitoring the maximum relative error

using (2-9) versus the degrees of freedom of the increasingly refined mesh. To assess

solver performance, the CPU time of all solver runs inclusive of assembly time is

recorded within the program. Since the computation of the exact solutions is very time-

intensive for Model Problems 2 and 3 and is not indicative of solver performance, its

clock time is subtracted from the total CPU time.

Page 67: Hp-DGFEM Book Small

48

When computing with finite difference methods, most of the computer time is spent on

computing the continuously changing coefficient vector of the spatial solution through

time. It should be pointed out that, in the interest of numerical efficiency, all matrix

reductions were performed before this loop was entered.

The Performance of the h-DGFEM with rm = 0 is Similar to that of a Finite

Difference Solver.

Certain similarities exist between the implementations of finite difference and

discontinuous Galerkin solvers. Both implementations employ spatial finite element

solvers with hp-extension capabilities. From the multitude of available finite difference

methods, the Backward-Euler method and the CNM were chosen. Since they are both

first order time approximations, they are comparable to temporal approximation order 1

of the h-DGFEM. This is illustrated in Figures 4-6, 4-7, and 4-8, where the time integral

of the relative error is computed for Model Problems 1 and 2 while solving with the

Backward-Euler, Crank-Nicolson, and h-DGFEM ( )0mr = . These errors plotted against

the number of degrees of freedom on a log-log scale.

100

101

102

103

104

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 7

tim

e inte

gra

l of

the r

ela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

1

2

34

5

6

7

8

9

10

11

12

13

14

1

2

3

4

5

6

7

8

1

2

3

4

5

6

7

8

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE 4-6. Time Integral of Relative Error in Energy Norm, Model Problem 1;

1 Element, p=8

Page 68: Hp-DGFEM Book Small

49

100

101

102

103

104

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 7

tim

e inte

gra

l of

the r

ela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

1

2

34

5

6

7

8

9

10

11

12

13

14

1

2

3

4

5

6

7

8

1

2

3

4

5

6

7

8

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE 4-7. Time Integral of Relative Error in Energy Norm, Model Problem 2,

1 Element, p=8

100

101

102

103

104

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 39

tim

e inte

gra

l of

the r

ela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

1

2

3 45

6

7

8

9

10

11

12

13

1

2

3

4

5

6

7

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE 4-8. Time Integral of Relative Error in Energy Norm, Model Problem 3,

5 Geometrically Graded Elements, Spatial DOF = 8 Nodes+5 Elements*(8-1)*p =

39

Page 69: Hp-DGFEM Book Small

50

The convergence paths of Model Problems 1 and 2 have almost identical appearance.

However, close inspection reveals that they are slightly different from one another. The

rates of convergence of the CNM and the h-DGFEM are approximately equal. While

the CNM has a smaller error in the time integral of the relative error in energy norm in

the first iteration, the h-DGFEM takes over in all following iterations. The Backward

Euler Method has lower errors than the other methods, however, it generates larger

errors beginning at iteration 3. In addition, its rate of convergence is smaller than those

displayed by the other two methods.

Due to extremely slow convergence of Model Problem 3, the Backward Euler algorithm

was not used. However, to reach an error in energy norm less than 1.0%, geometric

grading had to be used in this case to control the spatial error. h-DGFEM outperforms

CNM after the first iteration, although CNM settles at a higher rate of convergence

beginning with iteration 10.

Of course, Figures 4-6, 4-7, and 4-8 are only meaningful if the spatial error is negligible

in relation to the temporal error. By observing temporal convergence characteristics for

increasingly refined spatial discretizations, it was determined that one element at

polynomial order 8 is sufficient for Model Problems 1 and 2. Model Problem 3 requires

a geometrically graded mesh of 5 elements. See Appendix C for more detail.

The Initial Solution f(x) = sin(πx).

By increasing the temporal approximation order of the h-DGFEM, it is demonstrated in

Figure 4-9 that the rate of convergence increases linearly. Slopes of -1, -2, -3, and -4 are

obtained for approximation orders 0, 1, 2, and 3, respectively. When comparing the h-

DGFEM with finite difference solvers through experimental computations, the finite-

difference solvers were adjusted for best performance. By trial and error, it was

determined that one element with a spatial polynomial order of 8 resulted in the best

convergence at minimal solution times.

Page 70: Hp-DGFEM Book Small

51

100

101

102

103

10-6

10-4

10-2

100

102

12

3

4

5

6

7

8

1

2

3

4

5

6

7

8

9

1

2

3

4

5

6

7

1

2

3

4

5

6

Comparison of Convergence Performance, DOF in Space = 49

tim

e inte

gra

l of

the r

ela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

h-DGFEM, rm

=0

h-DGFEM, rm

=1

h-DGFEM, rm

=2

h-DGFEM, rm

=3

FIGURE 4-9. h-DGFEM with Increasing Approximation Order rm

In this exploratory procedure, it was also determined that the finite difference solvers

can reach a relative error in energy norm of less than 10-4

% within reasonable CPU

time. Accordingly, one spatial element was used for the h-DGFEM method, whereby an

optimal polynomial approximation order mr was selected from Figures 4-10 and 4-11,

which illustrate convergence paths and CPU times, respectively.

From the results, it was concluded that the temporal approximation order 7mr = was the

most effective temporal discretization of the h-DGFEM to reach an error in energy norm

of less than 10-4

% and to meet the requirement of converging slightly better than the

CNM. Using these solver parameters, approximate solutions of the heat equation for

Model Problem 1 over the time period of one second were computed. Performance

comparisons of temporal approximation orders 1 through 9 with respect to convergence

and CPU time are given in Figures 4-12 and 4-13.

Page 71: Hp-DGFEM Book Small

52

100

101

102

103

10-6

10-5

10-4

10-3

10-2

10-1

100

101

102

1

2

3

4

5

6

7

8

9

1

2

3

4

5

6

7

1

2

3

4

5

6

1

2

3

4

5

1

2

3

4

1

2

3

1

2

3

1

2

3

1

2

Comparison of Convergence Performance, DOF in Space = 7

tim

e inte

gra

l of

the r

ela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

h-DGFEM, rm

=1

h-DGFEM, rm

=2

h-DGFEM, rm

=3

h-DGFEM, rm

=4

h-DGFEM, rm

=5

h-DGFEM, rm

=6

h-DGFEM, rm

=7

h-DGFEM, rm

=8

h-DGFEM, rm

=9

FIGURE 4-10. h-DGFEM Performance at Multiple Values of rm

100

101

102

103

10-2

10-1

100

101

102

1

2

3

4

5

6

7

8

9

1 2

3

4

5

6

7

2 3

4

5

6

1

2

3

4

5

2

3

4

1

2

3

1

2

3

1

2

3

1 2

Comparison of Time Performance

CP

U t

ime t

[sec]

DOF in time [1]

h-DGFEM, rm

=1

h-DGFEM, rm

=2

h-DGFEM, rm

=3

h-DGFEM, rm

=4

h-DGFEM, rm

=5

h-DGFEM, rm

=6

h-DGFEM, rm

=7

h-DGFEM, rm

=8

h-DGFEM, rm

=9

FIGURE 4-11. CPU Times Corresponding to Figure 4-10; Note that the Numbered

Data Points Correlate Figures 4-10 and 4-11

Page 72: Hp-DGFEM Book Small

53

100

101

102

103

104

10-6

10-4

10-2

100

102

Comparison of Convergence Performance, DOF in Space = 7

tim

e inte

gra

l of

rela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

12

3

4

5

6

7

8

9

10

11

12

13

1

2

3

CNMh-DGFEM, r

m=7

FIGURE 4-12. Comparison of Convergence Performance: CNM and h-DGFEM at

rm = 7

100

101

102

103

104

10-2

10-1

100

101

102

1

7

8

9

10

11

12

13

1 2

3

Comparison of Time Performance

CP

U t

ime t

[sec]

DOF in time [1]

CNMh-DGFEM, r

m=7

FIGURE 4-13. Comparison of CPU Time in the Accuracy Range of 1.94 % to

1.22*10-5

%; The Numbered Data Points Correlate Figures 4-12 and 4-13

Page 73: Hp-DGFEM Book Small

54

When the mesh is coarse then the CPU time is very short and therefore it is not very

repeatable. Hence, a comparison is difficult. However, for coarse meshes the relative

errors are so large that they are not important for engineering purposes. For this reason,

relative errors greater than 2.0% were disregarded. Based on Figure 4-12, the discussion

will focus on iterations 6 through 13 of the CNM and 1 through 3 for the h-DGFEM.

Figure 4-13 illustrates the comparison of CPU time needed to perform the computations

of Figure 4-12. After 0.032 seconds of solver time, CNM and h-DGFEM reach iteration

8 and iteration 2. Their respective errors in energy norm are 24.5 10 %−⋅ and 31.1 10 %−⋅ .

As iterations are increased from this point, the h-DGFEM outperforms the CNM with an

increasing margin. At iteration 13, the CNM reaches an error of 54.9 10 %−⋅ in 14.9

seconds and, after 0.047 seconds, the h-DGFEM reaches iteration 3 reporting an error of

67.5 10 %−⋅ . In this particular case, the h-DGFEM outperforms the CNM by a factor of

315 on a time basis at a 6.5 fold smaller integral error. Figure 4-14 illustrates the error

in energy norm over the entire time domain for the CNM and the h-DGFEM. Figure 4-

15 illustrates the finite element solution FEu .

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 110

-6

10-5

10-4

10-3

Temporal Error History, IC: u(x,t = 0) = sin(pi*x), 100*||uFE

-uEX

||L2

/ ||uEX

||L2

time t [sec]

rela

tive e

rror

e r [%

]

h-DGFEM, p=8, rm

=8

CNM, p=8

FIGURE 4-14. Temporal Error Control

Page 74: Hp-DGFEM Book Small

55

FIGURE 4-15. Finite Element Solution to Model Problem 1, Plotted on Uniformly

Spaced Post-Process Grid

The Initial Solution f(x) = x(1-x).

Analogously, an approximate solution of the heat equation was computed for this model

problem. This solution is “not arbitrarily smooth in time and therefore convergence

rates are dominated by the temporal regularity” of the solution, as stated in hp-DGFEM

for Parabolic Evolution Problems [5]. However, the same reference indicates that “the

optimal convergence rates can be recovered by the use of graded time meshes.” In

accordance with the cited reference, the temporal grading function 2 3

( ) mrh t t+= was used

to obtain Figure 4-16.

Page 75: Hp-DGFEM Book Small

56

100

101

102

103

10-4

10-3

10-2

10-1

100

101

102

Comparison of Convergence Performance, DOF in Space = 63

tim

e inte

gra

l of

rela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

1

2

3

4

5

6

7

8

1 2

3

4

5

6

7

uniform h-DGFEM, rm

=2

graded h-DGFEM, rm

=2

FIGURE 4-16. h-DGFEM Performance at rm = 2, Time Grading Function h(t) = t7

This figure indicates that for 2mr = , the optimal convergence slope of –3 is obtained by

use of the temporal grading ( )h t . In preparation to a comparison between h-DGFEM

and finite difference algorithms for this model problem, Figures 4-17 and 4-18 were

prepared, which, at various values for mr , illustrate the rate of convergence and CPU

time, respectively. Inspection of these figures led to the conclusion that from the range

4 9mr≤ ≤ , the temporal approximation order 9mr = resulted in the best performance.

In conjunction with the temporal grading function 2 3

( ) mrh t t+= , the h-DGFEM

converged to an error in energy norm of less than 10-3

%, which was slightly better than

the CNM. In addition, one geometrically graded layer of elements had to be used at the

boundary points to achieve errors below 10-1

%. This demonstrates the fact that the

solution to Model Problem 2 is not arbitrarily smooth although its initial solution lies in

2L . Using these solver parameters, approximate solutions of the heat equation for

Model Problem 2 over the time period of one second were computed. Performance

Page 76: Hp-DGFEM Book Small

57

comparisons with respect to convergence and CPU time are illustrated in Figures 4-19

and 4-20.

100

101

102

103

10-5

10-4

10-3

10-2

10-1

100

101

1 23

4

5

6

1 23

4

5

6

1 23

4

5

6

1 23

4

5

1 23

4

5

1 2 3

4

5

Comparison of Convergence Performance, DOF in Space = 23

tim

e inte

gra

l of

rela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

h-DGFEM, rm

=4

h-DGFEM, rm

=5

h-DGFEM, rm

=6

h-DGFEM, rm

=7

h-DGFEM, rm

=8

h-DGFEM, rm

=9

FIGURE 4-17. Convergence Rate Using Various Values rm and h(t) = t7

100

101

102

103

100

101

102

1

2

3

4

5

6

1

2

3

4

5

6

1

2

3

4

5

6

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

Comparison of Time Performance

CP

U t

ime t

[sec]

DOF in time [1]

h-DGFEM, rm

=4

h-DGFEM, rm

=5

h-DGFEM, rm

=6

h-DGFEM, rm

=7

h-DGFEM, rm

=8

h-DGFEM, rm

=9

FIGURE 4-18. CPU Time Using Various Values rm and h(t) = t7

Page 77: Hp-DGFEM Book Small

58

100

101

102

103

104

10-4

10-3

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 23

tim

e inte

gra

l of

rela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

12

3

4

5

6

7

8

9

10

11

12

1 2 3

4

5

CNMh-DGFEM, r

m=9

FIGURE 4-19. Integral of Error in Energy Norm Reduced to below 0.001%

100

101

102

103

104

10-2

10-1

100

101

102

1

3

5

6

7

8

9

10

11

12

1

2

3

4

5

Comparison of Time Performance

CP

U t

ime t

[sec]

DOF in time [1]

CNMh-DGFEM, r

m=9

FIGURE 4-20. Comparison of CPU Time Performance in the Accuracy Range of

0.32 % to 1.2*10-4

% Corresponding to Figure 4-19; Note that the Numbered Data

Points Correlate Figures 4-19 and 4-20

Page 78: Hp-DGFEM Book Small

59

Considering the magnitudes of error in energy norm in Figure 4-19, only CNM

iterations 6 through 12 and all h-DGFEM are of interest from an engineering

perspective. Cross-referencing Figure 4-20, the CNM converges in 7 iterations and

0.063 seconds to an error of 0.32% and the h-DGFEM converges in 1 iteration and

0.078 seconds to an error of 0.44%. As iterations are increased from this point, the h-

DGFEM again outperforms the CNM with increasing margin. In 12 iterations, the CNM

reaches 3.3*10-4

% in 17.1 seconds; the h-DGFEM converges to 1.2*10-4

% in 5

iterations and 2.48 seconds. In this particular case, the h-DGFEM outperforms the

CNM by a factor of 6.8 on a time basis at approximately equal integral error in energy

norm. Figure 4-21 demonstrates the algorithmic control over the error in energy norm

over the entire time domain. Figure 4-22 shows the finite element solution for Model

Problem 2 and the geometrically graded 3-element mesh used in connection with the h-

DGFEM solution. In the time domain, the adaptive time solver used 4 temporal

elements of increasing length. The increasing length is based on the temporal grading

function2 3

( ) mrh t t+= . The superimposed grid indicates the location of 20 Gauss points,

which were specified along both spatial and temporal elements.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 110

-7

10-6

10-5

10-4

10-3

10-2

10-1

Temporal Error History, IC: u(x,t = 0) = x.*(1-x)

time t [sec]

rela

tive e

rror

e r [%

]

h-DGFEM, p=8, rm

=9

CNM, p=8

FIGURE 4-21. Temporal Error Control, h-DGFEM

Page 79: Hp-DGFEM Book Small

60

FIGURE 4-22. Solution to Model Problem 2; the h-DGFEM Mesh is Shown by the

Heavy Lines

The Initial Solution f(x) = 1, f(0) = f(1) = 0.

Approximate solutions of the heat equation were computed for this model problem. In

this case, the initial solution has strongly singular characteristics at the boundary points

of the domain. Furthermore, the projected initial solution exhibits oscillations at the

boundary points. A comparison of solver performance between CNM and h-DGFEM is

illustrated in Figure 4-23 and the corresponding solution times are shown in Figure 4-24.

Page 80: Hp-DGFEM Book Small

61

100

101

102

103

104

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 55

tim

e inte

gra

l of

rela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

1

2

3 45

6

7

8

9

10

11

12

13

14

1

2

3

4

CNM, p=8h-DGFEM, p=8, r

m=8

FIGURE 4-23. Error in Energy Norm Reduced to below 1.0%

100

101

102

103

104

10-2

10-1

100

101

102

103

1

3 5

6

7

8

9

10

11

12

13

14

1

2

3

4

Comparison of Time Performance

CP

U t

ime t

[sec]

DOF in time [1]

CNM, p-8h-DGFEM, p=8, r

m=8

FIGURE 4-24. Comparison of CPU Time Performance in the Accuracy Range of

0.32 % to 1.2*10-4

% Corresponding to Figure 4-23; Note that the Numbered Data

Points Correlate Figures 4-23 and 4-24

Page 81: Hp-DGFEM Book Small

62

Considering the magnitudes of error in energy norm in Figure 4-23, only CNM

iterations 13 and 14 and h-DGFEM iterations 3 and 4 are of interest from an engineering

perspective. To reach an error in energy norm of less than 1.0%, the CNM takes 415.69

seconds (0.74%) while the h-DGFEM converges in 1.27 seconds (0.43%).

Figure 4-25 illustrates the relative error in energy norm for the CNM and the h-DGFEM.

The figure reveals that the simple time-halving algorithm converges to the desired

accuracy with respect to both methods, however, produces inefficient time

discretization. As the solvers address the start-up singularity with repeated refinements

along the entire time domain, the error toward the end of the time domain becomes

smaller than necessary. More sophisticated adaptive algorithms are likely to improve

this inefficiency.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 110

-5

10-4

10-3

10-2

10-1

100

101

102

Temporal Error History, IC: u(x,t = 0) = 1, 100*||uFE

-uEX

||L2

/ ||uEX

||L2

time t [sec]

rela

tive e

rror

e r [%

]

h-DGFEM, p=8, rm

=8

CNM

FIGURE 4-25. Temporal Error Control; Time-Halving Leads to Relative Errors

that are Better than Necessary

Better results are expected with graded meshes. To improve the h-DGFEM, the

temporal grading function 2 3

( ) mrh t t+= was used again. Since the CNM was

Page 82: Hp-DGFEM Book Small

63

significantly outperformed in the previous calculation, the MATLAB®

-internal ODE

Solver Suite was substituted. Trial and error experimentation indicated that from

various solver options, the option ode15s, described in Appendix E, performed best with

respect to this model problem. Since substantial local errors at time zero were expected,

integral error monitoring was chosen. A 5-element geometrically graded mesh with

8p = was employed.

Using the grading function ( )h t , the convergence paths of several temporal

approximation orders were computed. The results are shown in Figure 4-26.

100

101

102

103

10-3

10-2

10-1

100

101

102

Convergence for Increasing Temporal Polynomial Order, DOF in Space = 55

tim

e inte

gra

l of

rela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

1 2

3

4

5

1 2

3

4

5

1 2

3

4

5

1 2

3

4

5

1 2

3

4

1 23

4

h-DGFEM, rm

=3

h-DGFEM, rm

=4

h-DGFEM, rm

=5

h-DGFEM, rm

=6

h-DGFEM, rm

=7

h-DGFEM, rm

=8

FIGURE 4-26. Convergence of Model Problem 3 Using the Integral of er(t)

Selecting 8mr = , the h-DGFEM is compared with ode15s. The convergence paths and

corresponding CPU times are shown in Figures 4-27 and 4-28. In the interest of keeping

the spatial error small, a geometrically graded mesh with 7 elements at 8p = was used.

Page 83: Hp-DGFEM Book Small

64

100

101

102

103

10-2

10-1

100

101

Comparison of Convergence Performance, DOF in Space = 55

tim

e inte

gra

l of

rela

tive e

rror

e r fro

m t

=0 t

o T

DOF in time [1]

1

12

3

4

ode15sh-DGFEM, p=8, r

m=8

FIGURE 4-27. Error in Energy Norm Reduced to below 1.0%

100

101

102

103

10-1

100

101

1

1

2

3

4

Comparison of Time Performance

CP

U t

ime t

[sec]

DOF in time [1]

ode15sh-DGFEM, p=8, r

m=8

FIGURE 4-28. Comparison of CPU Time Performance Corresponding to Figure 4-

27; Note that the Numbered Data Points Correlate Figures 4-27 and 4-28

Page 84: Hp-DGFEM Book Small

65

Comparing the ode15s iteration 1 and h-DGFEM iteration 4, it is found that these

algorithms converge to errors in energy norm of 0.02% in 0.69 seconds and to 0.04% in

1.42 seconds, respectively. Although ode15s is slightly better than h-DGFEM, it is

interesting to note this research version of h-DGFEM is quite effective and competitive

with this professionally developed solver. Therefore the development of a sophisticated

adaptive algorithm for h-DGFEM appears very promising.

Figure 4-29 illustrates the relative error in energy norm for the ode15s and the h-

DGFEM. The solvers behave in very similar fashion. Since they have been developed

from one another independently, it is reassuring of the validity of this work.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 110

-4

10-3

10-2

10-1

100

101

102

Temporal Error History, IC: u(x,t = 0) = 1, 100*||uFE

-uEX

||L2

/ ||uEX

||L2

time t [sec]

rela

tive e

rror

e r [%

]

h-DGFEM, p=8, rm

=8

ode15s

FIGURE 4-29. Temporal Error Control

Finally, Figure 4-30 illustrates the h-DGFEM solution.

Page 85: Hp-DGFEM Book Small

66

FIGURE 4-30. Solution to Model Problem 3; the h-DGFEM Mesh Is Shown by the

Heavy Lines

4.4.2 p-DGFEM and hp-DGFEM in 1D-Space and Time

The p-DGFEM and hp-DGFEM introduced in Chapter 4.2 were also programmed in

MATLAB®

. To produce higher degrees of freedom systematically, the p-DGFEM

increments the temporal approximation order to achieve higher degrees of freedom.

Analogously, the hp-DGFEM increases the temporal approximation order and the

number of elements in the time domain simultaneously. With these methods, greater

speeds of convergence than that of h-DGFEM are expected for Model Problems 1, 2,

and 3.

Page 86: Hp-DGFEM Book Small

67

The Initial Solution f(x) = sin(πx).

Using 4 spatial elements with temporal approximation order 7mr = , it is illustrated in

Figure 4-31 that the hp-DGFEM converges faster than the h-DGFEM. The

corresponding CPU times are plotted in Figure 4-32. Since the exact solution of Model

Problem 1 can be computed directly, very small errors in energy norm can be achieved

within relatively short CPU times. In Figure 4-33, it is demonstrated that the p-DGFEM

converges exponentially when the exact solutions are analytic in time.

100

101

102

103

10-12

10-10

10-8

10-6

10-4

10-2

100

102

Comparison of Convergence Performance, DOF in Space = 39

inte

gra

l of

rela

tive e

rror

e r(t)

DOF in time [1]

1

2

3

4

5

2

3

4

5

6

7

h-DGFEM, rm

=7

hp-DGFEM, rm

=7

FIGURE 4-31. Convergence Comparison: h- and hp-DGFEM Solving Model

Problem 1

Page 87: Hp-DGFEM Book Small

68

100

101

102

103

10-2

10-1

100

101

1

2

3

4

5

2

3

4

5

6

7

Comparison of Time Performance

CP

U t

ime t

[sec]

DOF in time [1]

h-DGFEM, rm

=7

hp-DGFEM, rm

=7

FIGURE 4-32. Comparison of CPU Time Performance Corresponding to Figure 4-

31; Note that the Numbered Data Points Correlate Figures 4-31 and 4-32

0 2 4 6 8 10 12 14 1610

-7

10-6

10-5

10-4

10-3

10-2

10-1

100

101

102

103

Time Convergence, Spatial DOF = 39

inte

gra

l of

e r(t)

[%]

DOF in time [1]

100* ∫ er(t)dt

FIGURE 4-33. Exponential Convergence of p-DGFEM

Page 88: Hp-DGFEM Book Small

69

The Initial Solution f(x) = x(1-x).

Figures 4-34 and 4-35 illustrate that the hp-DGFEM does not improve performance

when using a 4-element mesh with 8p = and grading toward the endpoints. h and hp

methods exhibit approximately the same performance. In Section 4.4.3, it is shown that

the hp-DGFEM will outperform the h-DGFEM when an appropriate time grading is

used.

The p-DGFEM, however accomplishes faster than algebraic convergence initially and

then algebraic convergence once the spatial error becomes dominant (Figure 4-36.) To

continue faster than algebraic convergence as degrees of freedom in time are increased,

the spatial discretization would need to be refined. Appendix C provides examples to

verify this point.

100

101

102

103

10-4

10-3

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 63

inte

gra

l of

rela

tive e

rror

e r(t)

DOF in time [1]

1

2

3

4

5

2

3

4

5

6

7

h-DGFEM, rm

=9

hp-DGFEM, rm

=9

FIGURE 4-34. Convergence Comparison: h- and hp-DGFEM Solving Model

Problem 2

Page 89: Hp-DGFEM Book Small

70

100

101

102

103

10-2

10-1

100

101

1

2

3

4

5

2

3

4

5

6

7

Comparison of Time Performance

CP

U t

ime t

[sec]

DOF in time [1]

h-DGFEM, rm

=9

hp-DGFEM, rm

=9

FIGURE 4-35. Comparison of CPU Time Performance Corresponding to Figure 4-

34; Note that the Numbered Data Points Correlate Figures 4-34 and 4-35

0 2 4 6 8 10 1210

-1

100

101

102

103

Time Convergence, Spatial DOF = 63

inte

gra

l of

e r(t)

[%]

DOF in time [1]

100* ∫ er(t)dt

FIGURE 4-36. Initial Exponential and then Algebraic Convergence (p-DGFEM)

Page 90: Hp-DGFEM Book Small

71

The Initial Solution f(x) = 1, f(0) = f(1) = 0.

Figures 4-37 and 4-38 illustrate that the hp-DGFEM does not improve performance

when using a 4-element mesh with 8p = and grading order 2 at the endpoints of the

domain.

h-DGFEM and hp-DGFEM methods display approximately equal performance. As will

be seen in the next section, the hp-DGFEM will outperform the h-DGFEM and p-

DGFEM when an appropriate time grading is used. The p-DGFEM achieves close to

exponential convergence initially and then algebraic convergence once the spatial error

becomes dominant (Figure 4-39.)

100

101

102

103

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 63

inte

gra

l of

rela

tive e

rror

e r(t)

DOF in time [1]

1

2

3

4

5

6

2

3

4

5

6

7

h-DGFEM, rm

=9

hp-DGFEM, rm

=9

FIGURE 4-37. Convergence Comparison: h- and hp-DGFEM Solving Model

Problem 3

Page 91: Hp-DGFEM Book Small

72

100

101

102

103

10-2

10-1

100

101

1

2

3

4

5

6

2

3

4

5

6

7

Comparison of Time Performance

CP

U t

ime t

[sec]

DOF in time [1]

h-DGFEM, rm

=9

hp-DGFEM, rm

=9

FIGURE 4-38. Comparison of CPU Time Performance Corresponding to Figure 4-

37; Note that the Numbered Data Points Correlate Figures 4-37 and 4-38

0 2 4 6 8 10 12 1410

0

101

102

103

Time Convergence, Spatial DOF = 63

inte

gra

l of

e r(t)

[%]

DOF in time [1]

100* ∫ er(t)dt

FIGURE 4-39. Initial Exponential and then Algebraic Convergence (p-DGFEM)

Page 92: Hp-DGFEM Book Small

73

4.4.3 hp-DGFEM with Temporal Grading

Finally, it is shown that with the appropriate time grading functions ( )h t , faster

convergence than that achieved in Section 4.4.2 can be achieved with the hp-DGFEM.

In this algorithm, both spatial and temporal polynomial degrees are incremented to

achieve greater rates of convergence. An example of such a time grading function is:

( ) nh t t= (4-41)

where n is a positive real number.

In addition, a temporal approximation order function can be defined and used in the

search for optimal convergence. An example of such a function is:

mr m= µ (4-42)

where µ is a positive real number.

By experimenting with the temporal grading function (4-41) using 2 3mn r= + and the

temporal approximation order function (4-42) using 0.5, 0.75, 1.0, and 1.5µ = , very

high rates of convergence can be achieved. Figures 4-40 and 4-42 illustrate faster than

algebraic convergence on a semi-logarithmic scale. Representing the same data on a

logarithmic scale in Figures 4-41 and 4-43, close to exponential convergence is

observed.

Page 93: Hp-DGFEM Book Small

74

The Initial Solution f(x) = x(1-x).

100

101

102

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 59

inte

gra

l of

e r(t)

DOF in time [1]

1

2

3

4

5

1

2

3

4

1

2

3

4

1

2

3

4

µ = 0.5

µ =0.75

µ =1.0

µ = 1.5

FIGURE 4-40. Model Problem 2 Converges Faster Than Algebraic Rate

0 5 10 15 20 25 30 35 40 45 5010

-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 59

inte

gra

l of

e r(t)

DOF in time [1]

1

2

3

4

5

1

2

3

4

1

2

3

4

1

2

3

4

µ = 0.5

µ =0.75

µ =1.0

µ = 1.5

FIGURE 4-41. Model Problem 2 Convergence Close to Exponential Rate

Page 94: Hp-DGFEM Book Small

75

The Initial Solution f(x) = 1, f(0) = f(1) = 0.

100

101

102

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 59

inte

gra

l of

e r(t)

DOF in time [1]

1

2

3

4

5

1

2

3

4

5

1

2

3

4

1

2

3

4

µ = 0.5

µ =0.75

µ =1.0

µ = 1.5

FIGURE 4-42. Model Problem 3 Converges Faster Than Algebraic Rate

0 10 20 30 40 50 60 7010

-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 59

inte

gra

l of

e r(t)

DOF in time [1]

1

2

3

4

5

1

2

3

4

5

1

2

3

4

1

2

3

4

µ = 0.5

µ =0.75

µ =1.0

µ = 1.5

FIGURE 4-43. Model Problem 3 Convergence Close to Exponential Rate

Page 95: Hp-DGFEM Book Small

76

4.5 The Influence of the Spatial Grading Factor on the

Temporal Error

In the balance between temporal and spatial errors, it is of interest which kind of spatial

grading will be optimal for controlling the error of approximations in time. At this

point, it is not known what kind of grading is optimal and whether it is a constant or a

function. An experiment performed with 8 time elements using 8mr = and 2 3

( ) mrh t t+=

verifies the existence of the optimal spatial grading factor, which amounts to 0.14 in this

particular case. This is captured in Figure 4-44.

0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.28.929

8.9295

8.93

8.9305

8.931

8.9315

grading factor [1]

err

or

in e

nerg

y n

orm

of

tem

pora

l solu

tion [

%]

m(∆) = 2, grading level = 2

FIGURE 4-44. Optimal Spatial Grading Factor with Respect to a Specific

Experiment

Page 96: Hp-DGFEM Book Small

77

Chapter 5

Temporal Error Control in 2D Time

Dependent Problems

The transient solver feature described in Chapter 4 was combined with the 2D spatial

solver described in Chapter 3 and integrated with the MATLAB®

program structure.

The result of this effort was a two dimensional (2D) spatial solver with h, p, and hp

extension capabilities in both the spatial and time domains. The model problem to serve

as the basis of discussion is equation (5-1), which is the two-dimensional equivalent of

equation (1-13).

( ) [ ] ( ) =

c

q c

T

z c z z

z n z c c z

uD v D u t dxdy h uvt ds c vt dxdy

t

Qvt dxdy q vt ds h u vt ds

Ω Γ Ω

Ω Γ Γ

∂Λ + + ρ =∂− +

∫∫ ∫ ∫∫∫∫ ∫ ∫ (5-1)

where zt is the element thickness, and

Tdef

Dx y

∂ ∂= ∂ ∂ . (5-2)

The remaining variables are defined in Chapter 1.

Page 97: Hp-DGFEM Book Small

78

5.1 The Finite Difference Method, Two Spatial Dimensions

Equation (4-12) is applicable to two-dimensional problems without any changes.

However, the spatial approximation requires a new set of shape functions and

computation of the stiffness matrix [ ]K , the mass matrix [ ]M , and the load vector r

in two dimensions. The hierarchic shape functions described in Finite Element Analysis

[11] and illustrated in Appendix B were implemented.

The coefficients ijk of the stiffness matrix [ ]K are computed element by element and the

global stiffness matrix is assembled by summing the element-level stiffness matrices

( )

[ ] [ ]( )

e

ij ij

e

e

e

k k

K K

==∑∑ (5-3)

where e is the element number, the subscripts and i j represent the serial numbers of

the basis functions defined on the solution domain Ω , [ ]( )eK are the inflated elemental

stiffness matrices, and

( ) [ ] ( ) [ ][ ] ( )

e

Te

ij i j zk D D t dxdyΩ

= Φ Λ Φ∫∫ . (5-4)

It should be noted that the local stiffness matrices [ ]( )eK are inflated to enable the

simple notation of equation (5-3). A one to one relationship between the global basis

function numbers i and the local basis function numbers I is required.

( , )

( , ) .

i i I e

I I i e

== (5-5)

Page 98: Hp-DGFEM Book Small

79

With the nodal coordinates denoted by 1 1( , )X Y , 2 2( , )X Y , 3 3( , )X Y , and 4 4( , )X Y , the

mapping

( ) ( )( ) ( )( )

( )( ) ( )( )( )

1 2

3 4

1, 1 1 1 1

4

1 1 1 1

k

xx Q X X

X X

= ξ η = −ξ −η + + ξ −η ++ + ξ + η + −ξ +η

(5-6)

( ) ( )( ) ( )( )

( )( ) ( )( )( )

1 2

3 4

1, 1 1 1 1

4

1 1 1 1

k

yy Q Y Y

Y Y

= ξ η = −ξ −η + + ξ −η ++ + ξ +η + −ξ +η

(5-7)

was used. Only straight-sided quadrilaterals were employed in this investigation.

Therefore the relationship between the polynomial shape functions IN and the basis

functions ( ),i x yΦ is given by

( ) ( ) ( ) ( ) ( )( ), , , ,e e

I i x yN Q Qξ η = Φ ξ η ξ η . (5-8)

The elemental stiffness matrices are computed by evaluating

( ) ( ) [ ] ( )( )* * , , 1, 2, , 2

st

Te e

IJ I J zk D N D N J t d d I J nΩ = Λ ξ η = ∫∫ … . (5-9)

where [ ]J is the Jacobian matrix

[ ] def

x y

Jx y

∂ ∂ ∂ξ ∂ξ = ∂ ∂ ∂η ∂η (5-10)

Page 99: Hp-DGFEM Book Small

80

and *D is obtained from [ ]D by applying the chain rule to (5-11) and (5-12):

11 12J Jx y

∂ ∂ ∂= +∂ξ ∂ ∂ (5-11)

21 22J Jx y

∂ ∂ ∂= +∂η ∂ ∂ . (5-12)

Denoting the inverse of the Jacobian matrix by *J , *D is obtained by substituting

the following terms into [ ]D :

* *

11 12J Jx

∂ ∂ ∂= +∂ ∂ξ ∂η (5-13)

* *

21 22J Jy

∂ ∂ ∂= +∂ ∂ξ ∂η . (5-14)

Using Gaussian quadrature with GN points and weights rw and sw , the numerical

computation involves the evaluation of a double sum:

( ) ( ) [ ] * *

1 1

G G

r

s

N N Te

IJ r s I J z

r s

k w w D N D N J t ξ=ξ= = η=η = Λ ∑∑ . (5-15)

Analogously, the mass matrix terms ijm are

( ) 1 1

1 1

e

IJ I Jm N N J d d− −

= ξ η∫ ∫ . (5-16)

Integrating by the Gaussian quadrature, once again a double sum must be evaluated:

Page 100: Hp-DGFEM Book Small

81

( ) ( ) ( )( )

1 1

, ,G G

r

s

N Ne

IJ r s I J z

r s

m w w N N J t ξ=ξη=η= == ξ η ξ η∑∑ . (5-17)

The convective term in equation (5-1),

c

c zh uvt dsΓ∫ (5-18)

modifies the stiffness matrix K and is computed by

( ) ( )( ) ( )( )

( )( ) ( )( )( )( ) ( )( )( )( ) ( )( )( )( ) ( )( )

2 2

11 22

2 2

21 22

,2 21

11 12

2 2

21 22

, if 1

, if 2

,

, if 3

, if 4

G

s s

i i

s sN def i i

s s s

IJ c i i I i J i s z ss si

i i

s s

i i

J P J P s

J P J P s

k h w N P N P t

J P J P s

J P J P s

=

+ = + == α α = + = + =

∑ (5-19)

and the integer s denotes the element side number and ( )s

iP is a vector quantity

denoting the coordinates of the thi Gauss point along side s .

Finally, the load vector r is composed from the boundary condition terms on the right

hand side of equation (5-1). Denoting the heat generation load vector component Qr ,

the flux component by qr , and the convective component by cr , we have:

Q q cr r r r= + + (5-20)

with

( ) ( ) ( ) ( )( ) ( ) ( ) ( ) ( )( )( )

1 1

, , , , , ,G G

s

r

N Ne e e e

Q r s x y z x y

r s

r w w Q Q Q t Q Q J ξ=ξ= = η=η= ξ η ξ η ξ η ξ η∑∑ , (5-21)

Page 101: Hp-DGFEM Book Small

82

( ) ( )( )

( )( ) ( )( )( )( ) ( )( )( )( ) ( )( )( )( ) ( )( )

2 2

11 22

2 2

21 22

, , ,2 21

11 12

2 2

21 22

, if 1

, if 2

, where

, if 3

, if 4

G

s s

i i

s sN def i i

s s

q I n i i I i i s z ss si

i i

s s

i i

J P J P s

J P J P s

r q w N P t

J P J P s

J P J P s

=

+ = + == β β = + = + =

∑ (5-22)

and

( ) ( ) ( )( ) 11

22

, , , ,

1 11

22

, if 1

, if 2, where

, if 3

, if 4

GNs s s

c I c i c i i I i i s z s

i

J s

J sr h u w N P t

J s

J s

=

= == χ χ = = =∑ . (5-23)

5.2 The Discontinuous Galerkin Method, 2D

The changes to the mass matrix and stiffness matrix, as discussed in Section 5.1, apply

here as well. The boundary conditions were implemented in accordance with the

procedure described in Section 5.1.

5.3 L2 Projection of Initial Conditions at t = 0+

The 2L projection, introduced in Section 4.3, is the linear combination of shape

functions that, with respect to the particular discretization, optimally represents an initial

condition in the space 2L . In two dimensions, the coefficients of this linear combination

are obtained in three steps: First, the vertex modes, multiplied by the corresponding

values of the initial temperature distribution, are subtracted from the initial temperature

distribution function ( , )f x y :

Page 102: Hp-DGFEM Book Small

83

4

1

( , ) ( , ) ( , )l l l

l

f x y f x y N f x y=

= −∑ . (5-24)

Then all element sides are L2-projected by using the set of all elemental side modes,

which is analogous to the procedure of Section 4.3:

( )1

1

( , ) ( , ) ( , ), , ,p

e

m m s s

m

f x y f x y a x y m x y−

== − Φ ∈ϒ ∈Γ∑ (5-25)

where sϒ is the set of indices of all side modes, ma are the side mode coefficients, and

( )e

sΓ are the corresponding element boundaries. Finally, all internal modes are projected,

which completes the operation:

( )

( , ) ( , ) ( , ), n , ,e

n n

n

f x y f x y b x y x y= − Φ ∈Ζ ∈Ω∑ (5-26)

where Ζ is the set of indices of all internal modes, nb are the internal mode coefficients,

and ( )eΩ are the corresponding element domains. The function ( , )f x y is the error

between the original function ( ),f x y and the projected function. These three steps

fully define the coefficient vector from which the initial condition is determined as a

linear combination of the global shape functions.

To illustrate the above procedure, the L-shaped domain from Chapter 3 was used and

imposed with the initial condition

( , ) sin( ) cos( )f x y x y= π π . (5-27)

Page 103: Hp-DGFEM Book Small

84

Figures 5-1, 5-2, 5-3, 5-4, and 5-5 illustrate the initial condition, the results of the three

projection steps, and the final projected result. The error in energy norm with respect to

the projected solution is 2.6*10-5

% and the error in maximum norm is 1.5*10-3

%

FIGURE 5-1. Arbitrary Initial Condition ( , )f x y , 9 Elements, Refinement Level 1,

p = 8

Page 104: Hp-DGFEM Book Small

85

FIGURE 5-2. Result of Step 1 of L2 Projection ( , )f x y : All Nodal Values are

Equal to Zero

FIGURE 5-3. Result of Step 2 of L2 Projection ( , )f x y : All Element Sides are

Equal to Zero

Page 105: Hp-DGFEM Book Small

86

FIGURE 5-4. Result of Step 3 of L2 Projection f : Error in Energy Norm =

2.59*10-5

%, Error in Maximum Norm = 1.5*10-3

FIGURE 5-5. Final Result. Assembled L2 Projection by Linear Combination of

Projection Coefficients with the Global Shape Functions

Page 106: Hp-DGFEM Book Small

87

5.4 Model Problems in 2D

The performance of the adaptive time solvers of Chapter 4 in 2D has been investigated

with respect to two model problems, as introduced in hp Discontinuous Galerkin Time

Stepping for Parabolic Problems [13]. The following transient heat conduction problem

was solved:

in

, 0 , 1

0 1

u u g Jt

x y x y

J t t

∂ −∆ = Ω×∂Ω = ≤ ≤

= ≤ ≤ (5-28)

0 on u J= ∂Ω× (5-29)

( ), , 0 ( , ,0) in u x y t f x y= = Ω (5-30)

where the heat generation term 0g = and ( , ,0)f x y is the initial condition. Temporal

error control was added to finite difference and discontinuous Galerkin methods and

comparisons with respect to speed and convergence were performed. The tests were

conducted using two initial conditions. To ensure compatibility with the finite element

space, these initial conditions were projected onto the space 2L . The constant

temperature boundary conditions were enforced by restriction at the domain boundaries.

The initial conditions in (5-31) and (5-33) will be referred to as Model Problems 4 and

5.

Since exact solutions need to be calculated to assess convergence, the following

problems had to be calculated on a rectangular domain. One p-element was used for all

numerical experiments.

Page 107: Hp-DGFEM Book Small

88

5.4.1 Model Problem 4

( )4

( , ,0) sin( )sin( ), 0u x y x y g= π π = (5-31)

As stated in hp Discontinuous Galerkin Time Stepping for Parabolic Problems [13],

( )4( , ,0)u x y is actually the first eigenfunction of the Laplacian and compatible with

being in 1

0 ( )H Ω . The corresponding exact solution ( )4

( , , )EXu x y t is smooth in space and

time:

( )4 2( , , ) exp( 2 )sin( )sin( )EXu x y t t x y= − π π π (5-32)

5.4.2 Model Problem 5

( )5

( , ,0) (1 ) (1 ), 0u x y x x y y g= − − = (5-33)

The initial condition ( )5

( , ,0)u x y is also compatible with being in 1

0 ( )H Ω . The exact

solution ( )5

( , , )EXu x y t is represented as a Fourier series with coefficients 5,kla :

( ) 2 2 25 ( )

5,

1 1

( , , ) sin( )sin( )t l k

EX kl

l k

u x y t a e l x k y∞ ∞ −π += =

= π π∑∑ (5-34)

5, 3 3 6

(1 cos( ))(1 cos( ))16kl

l ka

l k

− π − π= π . (5-35)

5.5 The Initial Solution f(x,y,0) = sin(πx)sin(πy)

One element with 8p = was used to solve this problem. The projection error in energy

norm amounts 1.57*10-7

% at a maximum norm of 5.0*10-5

. The Figures 5-6, 5-7, 5-8,

Page 108: Hp-DGFEM Book Small

89

and 5-9 illustrate the solution domain, the initial solution, the projection error, and the

projected initial solution, respectively.

FIGURE 5-6. Solution Domain

FIGURE 5-7. Initial Solution

Page 109: Hp-DGFEM Book Small

90

FIGURE 5-8. Projection Error for the Initial Condition, Error in Energy Norm:

1.57*10-7

%, Error in Maximum Norm = 5.0*10-5

FIGURE 5-9. Projected Initial Solution

Page 110: Hp-DGFEM Book Small

91

5.5.1 The Finite Difference Time Solver

At 8p = , the finite difference solver reduces the error in energy norm to 10-4

by

implementing more than 400 time steps within 17.24 seconds. The convergence path is

illustrated in Figure 5-10.

100

101

102

103

10-5

10-4

10-3

10-2

10-1

100

101

102

103

DOF in time [1]

inte

gra

l err

or:

100* ∫ e r(t

)dt

[%]

Time Convergence, Spatial DOF = 14

100* ∫ er(t)dt

FIGURE 5-10. Model Problem 4: Convergence of the Finite Difference Method

5.5.2 The Discontinuous Galerkin Time Solvers

At 8p = and m4 and r 8mr = = were used, requiring total CPU-times of 6.61 and 1.61

seconds to converge to an error below 10-4

% (h-DGFEM.) Respectively, convergence

is illustrated in Figures 5-11 and 5-12. Faster than algebraic convergence and only

algebraic convergence was observed when using 4 and 8m mr r= = , respectively. Again,

this is explained by the interplay between spatial and temporal errors. The DGFEM

converges faster than algebraic as long as the temporal error is larger than the spatial

error. As the spatial error becomes dominant, the solver performance returns to

Page 111: Hp-DGFEM Book Small

92

algebraic (see Appendix C). A few temporal solution steps of the most accurate overall

time solution are shown in Figure 5-13.

100

101

102

10-5

10-4

10-3

10-2

10-1

100

101

DOF in time [1]

inte

gra

l err

or:

100* ∫ e r(t

)dt

[%]

Time Convergence, Spatial DOF = 14

100* ∫ er(t)dt

FIGURE 5-11. Convergence of the h-DGFEM for rm = 4

100

101

102

10-7

10-6

10-5

10-4

10-3

10-2

10-1

DOF in time [1]

inte

gra

l err

or:

100* ∫ e r(t

)dt

[%]

Time Convergence, Spatial DOF = 14

100* ∫ er(t)dt

FIGURE 5-12. Convergence of the h-DGFEM for rm = 8

Page 112: Hp-DGFEM Book Small

93

FIGURE 5-13. Temporal Solutions Corresponding to the Most Accurate Solution

of Figure 5-12; Time Starts at Top Left (t = 0), Progresses Row by Row and Ends at

Bottom Right (t = 1.0)

At 8p = , the p-DGFEM required 6.92 seconds to converge to an error in energy norm

of 10-4

. The convergence behavior is plotted in Figure 5-14. The last iteration of this

solution illustrates again departure from faster than algebraic convergence, which is

discussed in Appendix C. The hp-DGFEM requires 7.59 seconds to reduce the relative

error in energy norm to 10-4

%. Convergence is illustrated in Figure 5-15. Figure 5-16

illustrates a few temporal solutions.

Page 113: Hp-DGFEM Book Small

94

100

101

10-4

10-3

10-2

10-1

100

101

102

DOF in time [1]

inte

gra

l err

or:

100* ∫ e r(t

)dt

[%]

Time Convergence, Spatial DOF = 14

100* ∫ er(t)dt

FIGURE 5-14. Convergence of the p-DGFEM

100

101

102

10-5

10-4

10-3

10-2

10-1

100

101

102

DOF in time [1]

inte

gra

l err

or:

100* ∫ e r(t

)dt

[%]

Time Convergence, Spatial DOF = 14

100* ∫ er(t)dt

FIGURE 5-15. Convergence of the hp-DGFEM

Page 114: Hp-DGFEM Book Small

95

FIGURE 5-16. Temporal Solutions Corresponding to the Most Accurate Solution

of Figure 5-14; Time Starts at Top Left (t = 0), Progresses Row by Row and Ends at

Bottom Right (t = 1.0)

5.6 The Initial Solution f(x,y,0) = x(1-x)y(1-y)

One element with 8p = was used to solve this problem. Since this initial solution lies

in in the space 2L , the projection error in energy norm amounts to only 1.3*10-28

% and

a maximum norm of 8.0*10-17

. Figures 5-17, 5-18, and 5-19 illustrate the initial

solution, the projection error, and the projected initial solution, respectively.

Page 115: Hp-DGFEM Book Small

96

FIGURE 5-17. Initial Solution

FIGURE 5-18. Projection Error for the Initial Condition, Error in Energy Norm =

1.3*10-28

%, Error in Maximum Norm = 8.0*10-17

Page 116: Hp-DGFEM Book Small

97

FIGURE 5-19. Projected Initial Solution

5.6.1 The Finite Difference Time Solver

At 8p = , the finite difference solver reduces the error to less than 10-4

% within 39.22

seconds. The convergence path behavior is illustrated in Figure 5-20.

100

101

102

103

10-5

10-4

10-3

10-2

10-1

100

101

102

103

DOF in time [1]

inte

gra

l err

or:

100* ∫ e r(t

)dt

[%]

Time Convergence, Spatial DOF = 14

100* ∫ er(t)dt

FIGURE 5-20. Convergence of the Finite Difference Method

Page 117: Hp-DGFEM Book Small

98

5.6.2 The Discontinuous Galerkin Time Solvers

At 8p = and 8mr = , the h-DGFEM solver requires a total CPU-time of 15.58 seconds

to reduce the error in energy norm to less than 10-4

%. The convergence path is

illustrated in Figure 5-21. p-DGFEM and hp-DGFEM computed for 21.93 and 31.93

seconds, respectively. Their convergence plots are shown in Figures 5-22 and 5-23,

respectively. The last five iterations of Figure 5-22 again exemplify the interplay

between spatial and temporal errors, which is discussed in Appendix C. Corresponding

to the most accurate solution of Figure 5-21, Figure 5-24 illustrates a few temporal

solutions.

100

101

102

10-5

10-4

10-3

10-2

10-1

DOF in time [1]

inte

gra

l err

or:

100* ∫ e r(t

)dt

[%]

Time Convergence, Spatial DOF = 14

100* ∫ er(t)dt

FIGURE 5-21. Convergence of the h-DGFEM

Page 118: Hp-DGFEM Book Small

99

100

101

102

10-4

10-3

10-2

10-1

100

101

102

DOF in time [1]

inte

gra

l err

or:

100* ∫ e r(t

)dt

[%]

Time Convergence, Spatial DOF = 14

100* ∫ er(t)dt

FIGURE 5-22. Convergence of the p-DGFEM

100

101

102

10-5

10-4

10-3

10-2

10-1

100

101

102

DOF in time [1]

inte

gra

l err

or:

100* ∫ e r(t

)dt

[%]

Time Convergence, Spatial DOF = 14

100* ∫ er(t)dt

FIGURE 5-23. Convergence of the hp-DGFEM

Page 119: Hp-DGFEM Book Small

100

FIGURE 5-24. Temporal Solutions Corresponding to the Most Accurate Solution

of Figure 5-21; Time Starts at Top Left (t = 0), Progresses Row by Row and Ends at

Bottom Right (t = 1.0)

Page 120: Hp-DGFEM Book Small

101

Chapter 6

Conclusions

This work was concerned with the numerical solution of transient heat diffusion

problems in the light of a new technique that has gained much popularity in the Applied

Mathematics community in recent years. The method is called the hp-Discontinuous

Galerkin FEM (hp-DGFEM) and promises, upon selecting optimal combinations of h

and p, faster than algebraic, and even exponential, convergence, a fact that has long been

established for steady state hp-FEM applications. High convergence rates are of interest

in engineering applications from a perspective of time saving. In addition, the hierarchy

of the hp method makes it feasible to use a posteriori error estimates to assess solution

quality.

Since hp-DGFEM is in the research stage, the topic was approached from the point of

view of implementation. Steady state hp-FEM in one and two dimensions was

implemented. The algorithmic structure of the implementation is outlined in Chapters 1

and 2. Chapter 3 presents the first set of examples in which spatial errors are controlled

by systematic mesh refinement in problem areas. This is shown by the construction of a

very singular problem on the L-shaped domain and solving the same via successive

refinement in its reentrant corner. Theoretically predicted convergence rates were

achieved which provided verification of the developed code.

Next, the work focused on the time domain. The initial conditions required special

treatment. For compatibility with the finite element formulation, initial conditions need

Page 121: Hp-DGFEM Book Small

102

to either lie in the energy space or they need to be projected into the energy space prior

to time integration. This was accomplished by the development of an 2L projection

algorithm, which ensured that any numerical problem was transitioned consistently into

the FEM. The early parts of Chapters 4 and 5 discuss this issue in great detail. It is

shown that arbitrarily high accuracy of an incompatible solution in one dimension can

be obtained.

Following this preliminary investigation, work on the actual time solvers was

performed. First the backward Euler and the Crank-Nicolson finite difference solvers

were implemented. Next, the more complicated hp-Discontinuous Galerkin solver was

realized. Eventually, a program structure resulted which enabled the investigation of

temporal solver performance in one and two-dimensions.

The research software was written in MATLAB®

and designed for comparing various

time solvers. In this framework, the Backward Euler Finite Difference Method, the

Crank-Nicolson Finite Difference Method, and the Discontinuous Galerkin Method with

h-, p-, and hp-extensions were developed and investigated experimentally. In addition,

the built-in MATLAB®

ODE Solver Suite was included as a benchmark. Solver

performance was evaluated on the basis of speed and accuracy with respect to known

exact solutions of special model problems. These model problems are popular

benchmarks in the research of time dependent problems and represent an interface to

other studies.

The current hp-DGFEM research code delivers a much better performance than the

finite difference methods and is comparable with the professionally developed ode15s,

although performance optimization was not an objective of this work. In addition, it was

demonstrated that the DG solvers converge faster than algebraic.

Page 122: Hp-DGFEM Book Small

103

The interplay between spatial and temporal errors was often manifest during this study

and is discussed in various sections. It is concluded that optimal solver performance

will depend on a sound balance between these two errors. From the numerical

experiments, it became evident that solver optimality will also depend on the balance

between the h and p discretization of the time solver. Therefore, solver optimality

studies are one of the logical extensions of this work. Since the main focus of this work

rested on the implementation of the hp-DGFEM algorithm, such an optimal time/space

solver algorithm was not investigated. However, time solver optimality was considered

with respect to geometric grading. While the grading factor of 0.14 worked best in a

specific example, much more work needs to be done to obtain general results.

From an applied engineering perspective, future work may consider a posteriori error

estimators, optimal time/space solver algorithms, the addition of the third geometric

dimension, and convection as well as radiation boundary conditions in the hp-DGFEM

context.

Furthermore, the numerical computation of equation (4-26) could be accelerated by

decoupling as described in hp Discontinuous Galerkin Time Stepping for Parabolic

Problems [13]. Furthermore, replacement of critical MATLAB®

interpreter functions

with dynamic link libraries written in C/C++

would improve software performance. For

example, the interpreted MATLAB®

function ‘kron.m’ currently handles the block

matrix assembly of (4-26). It is expected that the performance of this function revealed

that its performance could be enhanced by orders of magnitude.

Page 123: Hp-DGFEM Book Small

104

Appendix A

Conventions

It should be mentioned that the material properties λ , c , and ρ generally depend on

direction and temperature. However, all numerical calculations presented herein were

limited to isotropic and constant material properties. All quantities are given in SI units,

whereas the units themselves are generally omitted. Table A-1 references the physical

quantities used and their respective units.

TABLE A-1. Physical Quantities and their Units as Used in this Paper

Physical Quantity Variable SI Units Units in Words

Time t [s] Seconds

Distance , , x y z [m] Meters

Area A [m2] Square Meters

Temperature u [ºC], [K] Degrees Celsius, Kelvin

Density ρ [kg/m3] Kilograms per Cubic Meter

Specific Heat C [J/(kg*K)] Joules per Kilogram and

Kelvin

Thermal Conductivity λ [W/(m*K)] Watts per Meters and Kelvin

Thermal Diffusivity α [m2/s] Square Meters per Second

Page 124: Hp-DGFEM Book Small

105

Appendix B

Shape Functions in 2D for Quadrilateral

Elements with p = 8

FIGURE B-1. 2D Shape Functions. Top Row: Vertex Modes, Four Left Columns

without First Row: Side Modes, Columns 5 through 9: Internal Modes

Page 125: Hp-DGFEM Book Small

106

Appendix C

Appropriate Spatial Discretizations

for Model Problems 1, 2, and 3

Figures C-1 through C-5 illustrate the convergence of Model Problem 1,

( ) sin( ), (0) 0, (1) 0f x x f f= π = = , with respect to an increasingly refined discretization.

To reach an error in energy norm of less than 10-1

%, it is concluded by inspection that

one element with 8p = refines the solution domain sufficiently. Figures C-3, C-4, and

C-5 are virtually identical, indicating that the spatial solution has converged.

100

101

102

103

104

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 2

rela

tive e

rror

e r = 1

00*|

|uFE-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

34

5

6

7

8

9 10 11

1

2

3

4

5

67 8 9 10 11 12

1

2

3

4

56 7 8 9

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-1. Convergence of Model Problem 1, 1 Element in Space, p = 3

Page 126: Hp-DGFEM Book Small

107

100

101

102

103

104

105

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 3

rela

tive e

rror

e r = 1

00*|

|uFE-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

34

5

6

7

8

9

10

11

12

13

1415

1

2

3

4

5

6

7

89

12

3

4

5

6

7

8

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-2. Convergence of Model Problem 1, 1 Element in Space, p=4

100

101

102

103

104

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 7

rela

tive e

rror

e r = 1

00*|

|uFE-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

34

5

6

7

8

9

10

11

12

13

14

1

2

3

4

5

6

7

8

12

3

4

5

6

7

8

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-3. Convergence of Model Problem 1, 1 Element in Space, p=8

Page 127: Hp-DGFEM Book Small

108

100

101

102

103

104

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 79

rela

tive e

rror

e r = 1

00*|

|uFE-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

34

5

6

7

8

9

10

11

12

13

14

1

2

3

4

5

6

7

8

12

3

4

5

6

7

8

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-4. Convergence of Model Problem 1, 10 Spatial Elements, p=8

100

101

102

103

104

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 159

rela

tive e

rror

e r = 1

00*|

|uFE-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

34

5

6

7

8

9

10

11

12

13

14

1

2

3

4

5

6

7

8

12

3

4

5

6

7

8

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-5. Convergence of Model Problem 1, 10 Spatial Elements, p=16

Page 128: Hp-DGFEM Book Small

109

Figures C-6 through C-8 illustrate the convergence of Model Problem 2,

( ) (1 ), (0) 0, (1) 0f x x x f f= − = = , with respect to an increasingly refined discretization.

To reach an error in energy norm of less than 10-1

%, it is concluded by inspection that

one element with 8p = refines the solution domain sufficiently. Figures C-7 and C-8

are virtually identical, indicating that the spatial solution has converged.

100

101

102

103

104

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 2

rela

tive e

rror

e r = 1

00*|

|uFE-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

34

5

6

7

8

9 10 11

1

2

3

4

5

6 7 8 9 10 11

1

2

3

4

56 7 8 9

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-6. Convergence of Model Problem 2, 1 Spatial Element, p=3

Page 129: Hp-DGFEM Book Small

110

100

101

102

103

104

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 7

rela

tive e

rror

e r = 1

00*|

|uFE-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

34

5

6

7

8

9

10

11

12

13

14

1

2

3

4

5

6

7

8

1

2

3

4

5

6

7

8

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-7. Convergence of Model Problem 2, 1 Spatial Element, p=8

100

101

102

103

104

10-2

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 79

rela

tive e

rror

e r = 1

00*|

|uFE-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

34

5

6

7

8

9

10

11

12

13

14

1

2

3

4

5

6

7

8

1

2

3

4

5

6

7

8

Backward Euler, p=8

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-8. Convergence of Model Problem 2, 10 Spatial Elements, p=8

Page 130: Hp-DGFEM Book Small

111

Figures C-9 and C-10 illustrate the convergence of Model Problem 3,

( ) 1, (0) 0, (1) 0f x f f= = = , with respect to an increasingly refined discretization. To

reach an error in energy norm of less than 10-1

%, it is concluded by inspection that five

geometrically graded elements with 8p = are required to refine the solution domain

sufficiently. The steady algebraic convergence of Figure C-10 supports this claim.

100

101

102

103

104

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 14

rela

tive e

rror

e r = 1

00*|

|uFE-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

3 45

6

7

8

9

10

11

12

1

2

3

4

5

67

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-9. Convergence of Model Problem 3, 2 Spatial Elements, p=8

Page 131: Hp-DGFEM Book Small

112

100

101

102

103

104

10-1

100

101

102

103

Comparison of Convergence Performance, DOF in Space = 39

rela

tive e

rror

e r = 1

00*|

|uF

E-u

EX|| L

2 /

||u

EX|| L

2 [

%]

DOF in time [1]

1

2

3 45

6

7

8

9

10

11

12

13

1

2

3

4

5

6

7

CNM, p=8h-DGFEM, p=8, r

m=0

FIGURE C-10. Convergence of Model Problem 3, Geometrically Graded Mesh

with 5 Elements, p=8, (Identical to Figure 4-8)

Page 132: Hp-DGFEM Book Small

113

Appendix D

MATLAB® ODE Solver: ode15s

MATLAB The Language of Technical Computing [12] states that “ode15s is a variable

order solver based on the numerical differentiation formulas (NDFs). Optionally, it uses

the backward differentiation formulas (BDFs, also known as Gear's method) that are

usually less efficient. ode15s is a multi-step solver.” More information about this solver

is available in Matlab program documentation and on the Internet by simply using the

keyword ode15s. In addition, http://www.mathworks.com/ is another resource.

From MATLAB The Language of Technical Computing [12] :

ODE15S is a quasi-constant step size implementation in

terms of backward differences of the Klopfenstein-

Shampine family of Numerical Differentiation Formulas

of orders 1-5. The natural "free" interpolants are used.

Local extrapolation is not done. By default, Jacobians are

generated numerically. Details are to be found in The

MATLAB ODE Suite, L. F. Shampine and M. W.

Reichelt, SIAM Journal on Scientific Computing, 18-1,

1997, and in Solving Index-1 DAEs in MATLAB and

Simulink, L. F. Shampine, M. W. Reichelt, and J. A.

Kierzenka, SIAM Review, 41-3, 1999.

Page 133: Hp-DGFEM Book Small

114

References

[1] Babuška, I. and W.C. Rheinboldt. 1978. A Posteriori Error Estimates for the

Finite Element Method.. International Journal of. Numerical Methods in

Engineering, Vol 12, pp. 1597-1615.

[2] Babuška, I. and W.C. Rheinboldt. 1978. Error Estimates for Adaptive Finite

Element Computations. SIAM J. Numerical Analysis Vol. 15, pp. 736-754.

[3] Kwon, Young W. and H. Bang. 1997. The Finite Element Method using

MATLAB. 1st ed. New York, N.Y.: CRC Press.

[4] Rektorys, Karel. 1980. Variational Methods in Mathematics, Science and

Engineering. 2nd

ed. D. Reidel Publishing Company, Boston, MA, USA.

[5] Schötzau, Dominik. 1999. hp-DGFEM for Parabolic Evolution Problems.

Swiss Federal Institute of Technology, Zürich, Switzerland, Diss. ETH No.

13041.

[6] Schötzau, Dominik. 1999. The Discontinuous Galerkin Time-Stepping

Algorithm in hp-Version Context. ETH Zürich, CH-8092 Zürich, Switzerland,

Seminar für Angewandte Mathematik.

[7] Shampine, L.F. 1997. The MATLAB ODE Suite. SIAM Journal on Scientific

Computing, Vol. 18, pp 1-22.

[8] Shampine, L.F. 1999. Solving Index-1 DAEs in MATLAB and Simulink.

SIAM Review, Vol. 41, pp 538-552.

Page 134: Hp-DGFEM Book Small

115

[9] Simmons, George F. 1991. Differential Equations with Applications and

Historical Notes. 2nd

ed. International Series in Pure and Applied Mathematics.

Hightstown, N.J.: McGraw-Hill, Inc.

[10] Szabó, Barna A. 1998. Solution of Diffusion Problems by the Finite Element

Method. Lecture Material from Course ME 547-Advanced Finite Element

Analysis. Washington University in Saint Louis, Department of Mechanical

Engineering.

[11] Szabó, Barna A. and Ivo Babuška. 1991. Finite Element Analysis. 1st ed. New

York, N.Y.: John Wiley & Sons, Inc.

[12] The Mathworks Inc. 2000. MATLAB The Language of Technical Computing.

Using MATLAB, Version 6.

[13] Werder, T., K. Gerdes, D. Schötzau., and C. Schwab. 2000. hp Discontinuous

Galerkin Time Stepping for Parabolic Problems. Eidgenössische Technische

Hochschule, CH-8092 Zürich, Switzerland, Seminar für Angewandte

Mathematik, Research Report No. 2000-01.

Page 135: Hp-DGFEM Book Small

116

Vita

A. Konrad Juethner

Born on 14 Mar 1968 in Dortmund, North-Rhine Westfalia, Germany

Professional Accomplishments

• Establishment and Leadership of Numerical Solutions Team at Watlow Inc

• Co-inventor of US-Patents 5,786,838, 6,124,579, and 6,147,335

• COOP Student with Watlow Inc from May 1995 through December 1996

• Mandatory Military Service in German Army (Deutsche Bundeswehr),

August 1988 through October 1989

Professional Society Memberships

• National Society of Professional Engineers (NSPE), EIT Certificate

• Society for Industrial and Applied Mathematics (SIAM)

Academic Accomplishments

• Acceptance of Contributed Talk to a SIAM Conference in Berlin Germany in

August 2001

• Bachelor of Science in Mechanical Engineering from Washington University

in Saint Louis, Missouri, December 1996

• Pi Tau Sigma, Honorary Mechanical Engineering Fraternity, April 1996

• Bachelor of Arts, Major in Physics, Minor in Mathematics, Drury University

in Springfield, Missouri, May 1994

• Kappa Mu Epsilon, Mathematics Honor Society, February 1994

Page 136: Hp-DGFEM Book Small

117

• Pre-Clinical Program (9 Courses), Ludwig-Maximillians Universität Medical

School, July 1991

• “Abitur”, German High School Diploma, Gymnasium Bad Aibling in Bad

Aibling, Bavaria, Germany, July 1988

December, 2001

Page 137: Hp-DGFEM Book Small

Short Title: hp-Discontinuous Galerkin FEM A. Konrad Juethner, M.S. 2001