fundamentals of computational fluid dynamics

276

Upload: thawmin

Post on 13-Nov-2014

1.429 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Fundamentals of Computational Fluid Dynamics

Fundamentals of Computational Fluid

Dynamics

Harvard Lomax and Thomas H� PulliamNASA Ames Research Center

David W� ZinggUniversity of Toronto Institute for Aerospace Studies

August ��� ����

Page 2: Fundamentals of Computational Fluid Dynamics
Page 3: Fundamentals of Computational Fluid Dynamics

Contents

� INTRODUCTION �

��� Motivation � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� Background � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

����� Problem Speci�cation and Geometry Preparation � � � � � � � ������ Selection of Governing Equations and Boundary Conditions � ������ Selection of Gridding Strategy and Numerical Method � � � � ������ Assessment and Interpretation of Results � � � � � � � � � � � � �

��� Overview � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� Notation � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

� CONSERVATION LAWS AND THE MODEL EQUATIONS �

��� Conservation Laws � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� The Navier�Stokes and Euler Equations � � � � � � � � � � � � � � � � � ��� The Linear Convection Equation � � � � � � � � � � � � � � � � � � � � ��

����� Dierential Form � � � � � � � � � � � � � � � � � � � � � � � � � ������� Solution in Wave Space � � � � � � � � � � � � � � � � � � � � � � ��

��� The Diusion Equation � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Dierential Form � � � � � � � � � � � � � � � � � � � � � � � � � ������� Solution in Wave Space � � � � � � � � � � � � � � � � � � � � � � ��

��� Linear Hyperbolic Systems � � � � � � � � � � � � � � � � � � � � � � � � ����� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

� FINITE�DIFFERENCE APPROXIMATIONS ��

��� Meshes and Finite�Dierence Notation � � � � � � � � � � � � � � � � � ����� Space Derivative Approximations � � � � � � � � � � � � � � � � � � � � ����� Finite�Dierence Operators � � � � � � � � � � � � � � � � � � � � � � � ��

����� Point Dierence Operators � � � � � � � � � � � � � � � � � � � � ������� Matrix Dierence Operators � � � � � � � � � � � � � � � � � � � ������� Periodic Matrices � � � � � � � � � � � � � � � � � � � � � � � � � ������� Circulant Matrices � � � � � � � � � � � � � � � � � � � � � � � � �

iii

Page 4: Fundamentals of Computational Fluid Dynamics

��� Constructing Dierencing Schemes of Any Order � � � � � � � � � � � � ������� Taylor Tables � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Generalization of Dierence Formulas � � � � � � � � � � � � � � ������� Lagrange and Hermite Interpolation Polynomials � � � � � � � ������� Practical Application of Pad�e Formulas � � � � � � � � � � � � � ������� Other Higher�Order Schemes � � � � � � � � � � � � � � � � � � � �

��� Fourier Error Analysis � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Application to a Spatial Operator � � � � � � � � � � � � � � � � ��

��� Dierence Operators at Boundaries � � � � � � � � � � � � � � � � � � � ������� The Linear Convection Equation � � � � � � � � � � � � � � � � ������� The Diusion Equation � � � � � � � � � � � � � � � � � � � � � � ��

��� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

� THE SEMI�DISCRETE APPROACH ��

��� Reduction of PDE�s to ODE�s � � � � � � � � � � � � � � � � � � � � � � ������� The Model ODE�s � � � � � � � � � � � � � � � � � � � � � � � � ������� The Generic Matrix Form � � � � � � � � � � � � � � � � � � � � ��

��� Exact Solutions of Linear ODE�s � � � � � � � � � � � � � � � � � � � � ������� Eigensystems of Semi�Discrete Linear Forms � � � � � � � � � � ������� Single ODE�s of First� and Second�Order � � � � � � � � � � � � ������� Coupled First�Order ODE�s � � � � � � � � � � � � � � � � � � � ������� General Solution of Coupled ODE�s with Complete Eigensystems ��

��� Real Space and Eigenspace � � � � � � � � � � � � � � � � � � � � � � � � ������� De�nition � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Eigenvalue Spectrums for Model ODE�s � � � � � � � � � � � � � ������� Eigenvectors of the Model Equations � � � � � � � � � � � � � � ������� Solutions of the Model ODE�s � � � � � � � � � � � � � � � � � � ��

��� The Representative Equation � � � � � � � � � � � � � � � � � � � � � � ����� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

� FINITE�VOLUME METHODS ��

��� Basic Concepts � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� Model Equations in Integral Form � � � � � � � � � � � � � � � � � � � � ��

����� The Linear Convection Equation � � � � � � � � � � � � � � � � ������� The Diusion Equation � � � � � � � � � � � � � � � � � � � � � � ��

��� One�Dimensional Examples � � � � � � � � � � � � � � � � � � � � � � � ������� A Second�Order Approximation to the Convection Equation � ������� A Fourth�Order Approximation to the Convection Equation � ������� A Second�Order Approximation to the Diusion Equation � � �

��� A Two�Dimensional Example � � � � � � � � � � � � � � � � � � � � � �

Page 5: Fundamentals of Computational Fluid Dynamics

��� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

� TIME�MARCHING METHODS FOR ODE�S �

��� Notation � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� Converting Time�Marching Methods to O�E�s � � � � � � � � � � � � � ���� Solution of Linear O�E�s With Constant Coe�cients � � � � � � � � �

����� First� and Second�Order Dierence Equations � � � � � � � � � ������ Special Cases of Coupled First�Order Equations � � � � � � � � �

��� Solution of the Representative O�E�s � � � � � � � � � � � � � � � � � ������� The Operational Form and its Solution � � � � � � � � � � � � � ������� Examples of Solutions to Time�Marching O�E�s � � � � � � � � ��

��� The �� � Relation � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Establishing the Relation � � � � � � � � � � � � � � � � � � � � � ������� The Principal ��Root � � � � � � � � � � � � � � � � � � � � � � � ������� Spurious ��Roots � � � � � � � � � � � � � � � � � � � � � � � � � ������� One�Root Time�Marching Methods � � � � � � � � � � � � � � � ��

��� Accuracy Measures of Time�Marching Methods � � � � � � � � � � � � ������� Local and Global Error Measures � � � � � � � � � � � � � � � � ������� Local Accuracy of the Transient Solution �er�� j�j � er�� � � � � ������ Local Accuracy of the Particular Solution �er�� � � � � � � � � ������� Time Accuracy For Nonlinear Applications � � � � � � � � � � � � ����� Global Accuracy � � � � � � � � � � � � � � � � � � � � � � � � � � �

��� Linear Multistep Methods � � � � � � � � � � � � � � � � � � � � � � � � � ������ The General Formulation � � � � � � � � � � � � � � � � � � � � � � ������ Examples � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ Two�Step Linear Multistep Methods � � � � � � � � � � � � � � � �

�� Predictor�Corrector Methods � � � � � � � � � � � � � � � � � � � � � � � � ���� Runge�Kutta Methods � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� Implementation of Implicit Methods � � � � � � � � � � � � � � � � � � � ��

��� �� Application to Systems of Equations � � � � � � � � � � � � � � �� ��� �� Application to Nonlinear Equations � � � � � � � � � � � � � � � ������ �� Local Linearization for Scalar Equations � � � � � � � � � � � � ������ �� Local Linearization for Coupled Sets of Nonlinear Equations � ���

���� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

� STABILITY OF LINEAR SYSTEMS ���

��� Dependence on the Eigensystem � � � � � � � � � � � � � � � � � � � � � ������ Inherent Stability of ODE�s � � � � � � � � � � � � � � � � � � � � � � � ���

����� The Criterion � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� Complete Eigensystems � � � � � � � � � � � � � � � � � � � � � � ���

Page 6: Fundamentals of Computational Fluid Dynamics

����� Defective Eigensystems � � � � � � � � � � � � � � � � � � � � � � ���

��� Numerical Stability of O�E �s � � � � � � � � � � � � � � � � � � � � � � ���

����� The Criterion � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

����� Complete Eigensystems � � � � � � � � � � � � � � � � � � � � � � ���

����� Defective Eigensystems � � � � � � � � � � � � � � � � � � � � � � ���

��� Time�Space Stability and Convergence of O�E�s � � � � � � � � � � � � ���

��� Numerical Stability Concepts in the Complex ��Plane � � � � � � � � � ��

����� ��Root Traces Relative to the Unit Circle � � � � � � � � � � � ��

����� Stability for Small �t � � � � � � � � � � � � � � � � � � � � � � � ���

��� Numerical Stability Concepts in the Complex �h Plane � � � � � � � � ���

����� Stability for Large h� � � � � � � � � � � � � � � � � � � � � � � � ���

����� Unconditional Stability� A�Stable Methods � � � � � � � � � � � ���

����� Stability Contours in the Complex �h Plane� � � � � � � � � � � ���

��� Fourier Stability Analysis � � � � � � � � � � � � � � � � � � � � � � � � ���

����� The Basic Procedure � � � � � � � � � � � � � � � � � � � � � � � ���

����� Some Examples � � � � � � � � � � � � � � � � � � � � � � � � � � ���

����� Relation to Circulant Matrices � � � � � � � � � � � � � � � � � � ���

�� Consistency � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

��� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

CHOICE OF TIME�MARCHING METHODS ��

�� Stiness De�nition for ODE�s � � � � � � � � � � � � � � � � � � � � � � ���

���� Relation to ��Eigenvalues � � � � � � � � � � � � � � � � � � � � ���

���� Driving and Parasitic Eigenvalues � � � � � � � � � � � � � � � � ���

���� Stiness Classi�cations � � � � � � � � � � � � � � � � � � � � � � ���

�� Relation of Stiness to Space Mesh Size � � � � � � � � � � � � � � � � ���

�� Practical Considerations for Comparing Methods � � � � � � � � � � � ���

�� Comparing the E�ciency of Explicit Methods � � � � � � � � � � � � � ���

���� Imposed Constraints � � � � � � � � � � � � � � � � � � � � � � � ���

���� An Example Involving Diusion � � � � � � � � � � � � � � � � � ���

���� An Example Involving Periodic Convection � � � � � � � � � � � ���

�� Coping With Stiness � � � � � � � � � � � � � � � � � � � � � � � � � � ��

���� Explicit Methods � � � � � � � � � � � � � � � � � � � � � � � � � ��

���� Implicit Methods � � � � � � � � � � � � � � � � � � � � � � � � � ���

���� A Perspective � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

�� Steady Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

�� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

Page 7: Fundamentals of Computational Fluid Dynamics

RELAXATION METHODS ���

��� Formulation of the Model Problem � � � � � � � � � � � � � � � � � � � �������� Preconditioning the Basic Matrix � � � � � � � � � � � � � � � � �������� The Model Equations � � � � � � � � � � � � � � � � � � � � � � � ���

��� Classical Relaxation � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� The Delta Form of an Iterative Scheme � � � � � � � � � � � � � ������� The Converged Solution� the Residual� and the Error � � � � � ������� The Classical Methods � � � � � � � � � � � � � � � � � � � � � � ���

��� The ODE Approach to Classical Relaxation � � � � � � � � � � � � � � �� ����� The Ordinary Dierential Equation Formulation � � � � � � � � �� ����� ODE Form of the Classical Methods � � � � � � � � � � � � � � ���

��� Eigensystems of the Classical Methods � � � � � � � � � � � � � � � � � �������� The Point�Jacobi System � � � � � � � � � � � � � � � � � � � � � �������� The Gauss�Seidel System � � � � � � � � � � � � � � � � � � � � � �������� The SOR System � � � � � � � � � � � � � � � � � � � � � � � � � �

��� Nonstationary Processes � � � � � � � � � � � � � � � � � � � � � � � � � ����� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

�� MULTIGRID ��

� �� Motivation � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� Eigenvector and Eigenvalue Identi�cation with Space Frequencies���� ���� Properties of the Iterative Method � � � � � � � � � � � � � � � ���

� �� The Basic Process � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� A Two�Grid Process � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

�� NUMERICAL DISSIPATION ���

���� One�Sided First�Derivative Space Dierencing � � � � � � � � � � � � � � ����� The Modi�ed Partial Dierential Equation � � � � � � � � � � � � � � � � ����� The Lax�Wendro Method � � � � � � � � � � � � � � � � � � � � � � � � � ����� Upwind Schemes � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

������ Flux�Vector Splitting � � � � � � � � � � � � � � � � � � � � � � � �� ������ Flux�Dierence Splitting � � � � � � � � � � � � � � � � � � � � � ���

���� Arti�cial Dissipation � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

�� SPLIT AND FACTORED FORMS ���

���� The Concept � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Factoring Physical Representations � Time Splitting � � � � � � � � � ������ Factoring Space Matrix Operators in ��D � � � � � � � � � � � � � � � � ��

Page 8: Fundamentals of Computational Fluid Dynamics

������ Mesh Indexing Convention � � � � � � � � � � � � � � � � � � � � �� ������ Data Bases and Space Vectors � � � � � � � � � � � � � � � � � � ��������� Data Base Permutations � � � � � � � � � � � � � � � � � � � � � ��������� Space Splitting and Factoring � � � � � � � � � � � � � � � � � � ���

���� Second�Order Factored Implicit Methods � � � � � � � � � � � � � � � � ������� Importance of Factored Forms in � and � Dimensions � � � � � � � � � ������� The Delta Form � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

�� LINEAR ANALYSIS OF SPLIT AND FACTORED FORMS ���

���� The Representative Equation for Circulant Operators � � � � � � � � � ������� Example Analysis of Circulant Systems � � � � � � � � � � � � � � � � � ���

������ Stability Comparisons of Time�Split Methods � � � � � � � � � ��������� Analysis of a Second�Order Time�Split Method � � � � � � � � ���

���� The Representative Equation for Space�Split Operators � � � � � � � � ������ Example Analysis of ��D Model Equations � � � � � � � � � � � � � � � ���

������ The Unfactored Implicit Euler Method � � � � � � � � � � � � � ��������� The Factored Nondelta Form of the Implicit Euler Method � � ��������� The Factored Delta Form of the Implicit Euler Method � � � � ��������� The Factored Delta Form of the Trapezoidal Method � � � � � ���

���� Example Analysis of the ��D Model Equation � � � � � � � � � � � � � ������� Problems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

A USEFUL RELATIONS AND DEFINITIONS FROM LINEAR AL�

GEBRA ��

A�� Notation � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���A�� De�nitions � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� A�� Algebra � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���A�� Eigensystems � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���A�� Vector and Matrix Norms � � � � � � � � � � � � � � � � � � � � � � � � ���

B SOME PROPERTIES OF TRIDIAGONAL MATRICES ���

B�� Standard Eigensystem for Simple Tridiagonals � � � � � � � � � � � � � ���B�� Generalized Eigensystem for Simple Tridiagonals � � � � � � � � � � � � ��B�� The Inverse of a Simple Tridiagonal � � � � � � � � � � � � � � � � � � � ���B�� Eigensystems of Circulant Matrices � � � � � � � � � � � � � � � � � � � ��

B���� Standard Tridiagonals � � � � � � � � � � � � � � � � � � � � � � �� B���� General Circulant Systems � � � � � � � � � � � � � � � � � � � � ���

B�� Special Cases Found From Symmetries � � � � � � � � � � � � � � � � � ���B�� Special Cases Involving Boundary Conditions � � � � � � � � � � � � � ���

Page 9: Fundamentals of Computational Fluid Dynamics

C THEHOMOGENEOUS PROPERTYOF THE EULER EQUATIONS���

Page 10: Fundamentals of Computational Fluid Dynamics

Chapter �

INTRODUCTION

��� Motivation

The material in this book originated from attempts to understand and systemize nu�merical solution techniques for the partial dierential equations governing the physicsof �uid �ow� As time went on and these attempts began to crystallize� underlyingconstraints on the nature of the material began to form� The principal such constraintwas the demand for uni�cation� Was there one mathematical structure which couldbe used to describe the behavior and results of most numerical methods in commonuse in the �eld of �uid dynamics� Perhaps the answer is arguable� but the authorsbelieve the answer is a�rmative and present this book as justi�cation for that be�lief� The mathematical structure is the theory of linear algebra and the attendanteigenanalysis of linear systems�

The ultimate goal of the �eld of computational �uid dynamics �CFD� is to under�stand the physical events that occur in the �ow of �uids around and within designatedobjects� These events are related to the action and interaction of phenomena suchas dissipation� diusion� convection� shock waves� slip surfaces� boundary layers� andturbulence� In the �eld of aerodynamics� all of these phenomena are governed bythe compressible Navier�Stokes equations� Many of the most important aspects ofthese relations are nonlinear and� as a consequence� often have no analytic solution�This� of course� motivates the numerical solution of the associated partial dierentialequations� At the same time it would seem to invalidate the use of linear algebra forthe classi�cation of the numerical methods� Experience has shown that such is notthe case�

As we shall see in a later chapter� the use of numerical methods to solve partialdierential equations introduces an approximation that� in eect� can change theform of the basic partial dierential equations themselves� The new equations� which

Page 11: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� INTRODUCTION

are the ones actually being solved by the numerical process� are often referred to asthe modi�ed partial dierential equations� Since they are not precisely the same asthe original equations� they can� and probably will� simulate the physical phenomenalisted above in ways that are not exactly the same as an exact solution to the basicpartial dierential equation� Mathematically� these dierences are usually referred toas truncation errors� However� the theory associated with the numerical analysis of�uid mechanics was developed predominantly by scientists deeply interested in thephysics of �uid �ow and� as a consequence� these errors are often identi�ed with aparticular physical phenomenon on which they have a strong eect� Thus methods aresaid to have a lot of �arti�cial viscosity� or said to be highly dispersive� This meansthat the errors caused by the numerical approximation result in a modi�ed partialdierential equation having additional terms that can be identi�ed with the physicsof dissipation in the �rst case and dispersion in the second� There is nothing wrong�of course� with identifying an error with a physical process� nor with deliberatelydirecting an error to a speci�c physical process� as long as the error remains in someengineering sense �small�� It is safe to say� for example� that most numerical methodsin practical use for solving the nondissipative Euler equations create a modi�ed partialdierential equation that produces some form of dissipation� However� if used andinterpreted properly� these methods give very useful information�

Regardless of what the numerical errors are called� if their eects are not thor�oughly understood and controlled� they can lead to serious di�culties� producinganswers that represent little� if any� physical reality� This motivates studying theconcepts of stability� convergence� and consistency� On the other hand� even if theerrors are kept small enough that they can be neglected �for engineering purposes��the resulting simulation can still be of little practical use if ine�cient or inappropriatealgorithms are used� This motivates studying the concepts of stiness� factorization�and algorithm development in general� All of these concepts we hope to clarify inthis book�

��� Background

The �eld of computational �uid dynamics has a broad range of applicability� Indepen�dent of the speci�c application under study� the following sequence of steps generallymust be followed in order to obtain a satisfactory solution�

����� Problem Speci�cation and Geometry Preparation

The �rst step involves the speci�cation of the problem� including the geometry� �owconditions� and the requirements of the simulation� The geometry may result from

Page 12: Fundamentals of Computational Fluid Dynamics

���� BACKGROUND �

measurements of an existing con�guration or may be associated with a design study�Alternatively� in a design context� no geometry need be supplied� Instead� a setof objectives and constraints must be speci�ed� Flow conditions might include� forexample� the Reynolds number and Mach number for the �ow over an airfoil� Therequirements of the simulation include issues such as the level of accuracy needed� theturnaround time required� and the solution parameters of interest� The �rst two ofthese requirements are often in con�ict and compromise is necessary� As an exampleof solution parameters of interest in computing the �ow�eld about an airfoil� one maybe interested in i� the lift and pitching moment only� ii� the drag as well as the liftand pitching moment� or iii� the details of the �ow at some speci�c location�

����� Selection of Governing Equations and Boundary Con�

ditions

Once the problem has been speci�ed� an appropriate set of governing equations andboundary conditions must be selected� It is generally accepted that the phenomena ofimportance to the �eld of continuum �uid dynamics are governed by the conservationof mass� momentum� and energy� The partial dierential equations resulting fromthese conservation laws are referred to as the Navier�Stokes equations� However� inthe interest of e�ciency� it is always prudent to consider solving simpli�ed formsof the Navier�Stokes equations when the simpli�cations retain the physics which areessential to the goals of the simulation� Possible simpli�ed governing equations includethe potential��ow equations� the Euler equations� and the thin�layer Navier�Stokesequations� These may be steady or unsteady and compressible or incompressible�Boundary types which may be encountered include solid walls� in�ow and out�owboundaries� periodic boundaries� symmetry boundaries� etc� The boundary conditionswhich must be speci�ed depend upon the governing equations� For example� at a solidwall� the Euler equations require �ow tangency to be enforced� while the Navier�Stokesequations require the no�slip condition� If necessary� physical models must be chosenfor processes which cannot be simulated within the speci�ed constraints� Turbulenceis an example of a physical process which is rarely simulated in a practical context �atthe time of writing� and thus is often modelled� The success of a simulation dependsgreatly on the engineering insight involved in selecting the governing equations andphysical models based on the problem speci�cation�

����� Selection of Gridding Strategy and Numerical Method

Next a numerical method and a strategy for dividing the �ow domain into cells� orelements� must be selected� We concern ourselves here only with numerical meth�ods requiring such a tessellation of the domain� which is known as a grid� or mesh�

Page 13: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� INTRODUCTION

Many dierent gridding strategies exist� including structured� unstructured� hybrid�composite� and overlapping grids� Furthermore� the grid can be altered based onthe solution in an approach known as solution�adaptive gridding� The numericalmethods generally used in CFD can be classi�ed as �nite�dierence� �nite�volume��nite�element� or spectral methods� The choices of a numerical method and a grid�ding strategy are strongly interdependent� For example� the use of �nite�dierencemethods is typically restricted to structured grids� Here again� the success of a sim�ulation can depend on appropriate choices for the problem or class of problems ofinterest�

����� Assessment and Interpretation of Results

Finally� the results of the simulation must be assessed and interpreted� This step canrequire post�processing of the data� for example calculation of forces and moments�and can be aided by sophisticated �ow visualization tools and error estimation tech�niques� It is critical that the magnitude of both numerical and physical�model errorsbe well understood�

��� Overview

It should be clear that successful simulation of �uid �ows can involve a wide range ofissues from grid generation to turbulence modelling to the applicability of various sim�pli�ed forms of the Navier�Stokes equations� Many of these issues are not addressedin this book� Some of them are presented in the books by Anderson� Tannehill� andPletcher ��� and Hirsch ���� Instead we focus on numerical methods� with emphasison �nite�dierence and �nite�volume methods for the Euler and Navier�Stokes equa�tions� Rather than presenting the details of the most advanced methods� which arestill evolving� we present a foundation for developing� analyzing� and understandingsuch methods�

Fortunately� to develop� analyze� and understand most numerical methods used to�nd solutions for the complete compressible Navier�Stokes equations� we can make useof much simpler expressions� the so�called �model� equations� These model equationsisolate certain aspects of the physics contained in the complete set of equations� Hencetheir numerical solution can illustrate the properties of a given numerical methodwhen applied to a more complicated system of equations which governs similar phys�ical phenomena� Although the model equations are extremely simple and easy tosolve� they have been carefully selected to be representative� when used intelligently�of di�culties and complexities that arise in realistic two� and three�dimensional �uid�ow simulations� We believe that a thorough understanding of what happens when

Page 14: Fundamentals of Computational Fluid Dynamics

���� NOTATION �

numerical approximations are applied to the model equations is a major �rst step inmaking con�dent and competent use of numerical approximations to the Euler andNavier�Stokes equations� As a word of caution� however� it should be noted that�although we can learn a great deal by studying numerical methods as applied to themodel equations and can use that information in the design and application of nu�merical methods to practical problems� there are many aspects of practical problemswhich can only be understood in the context of the complete physical systems�

��� Notation

The notation is generally explained as it is introduced� Bold type is reserved for realphysical vectors� such as velocity� The vector symbol� is used for the vectors �orcolumn matrices� which contain the values of the dependent variable at the nodesof a grid� Otherwise� the use of a vector consisting of a collection of scalars shouldbe apparent from the context and is not identi�ed by any special notation� Forexample� the variable u can denote a scalar Cartesian velocity component in the Eulerand Navier�Stokes equations� a scalar quantity in the linear convection and diusionequations� and a vector consisting of a collection of scalars in our presentation ofhyperbolic systems� Some of the abbreviations used throughout the text are listedand de�ned below�

PDE Partial dierential equation

ODE Ordinary dierential equation

O�E Ordinary dierence equation

RHS Right�hand side

P�S� Particular solution of an ODE or system of ODE�s

S�S� Fixed �time�invariant� steady�state solution

k�D k�dimensional space��bc�

Boundary conditions� usually a vector

O��� A term of order �i�e�� proportional to� �

Page 15: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� INTRODUCTION

Page 16: Fundamentals of Computational Fluid Dynamics

Chapter �

CONSERVATION LAWS AND

THE MODEL EQUATIONS

We start out by casting our equations in the most general form� the integral conserva�tion�law form� which is useful in understanding the concepts involved in �nite�volumeschemes� The equations are then recast into divergence form� which is natural for�nite�dierence schemes� The Euler and Navier�Stokes equations are brie�y discussedin this Chapter� The main focus� though� will be on representative model equations�in particular� the convection and diusion equations� These equations contain manyof the salient mathematical and physical features of the full Navier�Stokes equations�The concepts of convection and diusion are prevalent in our development of nu�merical methods for computational �uid dynamics� and the recurring use of thesemodel equations allows us to develop a consistent framework of analysis for consis�tency� accuracy� stability� and convergence� The model equations we study have twoproperties in common� They are linear partial dierential equations �PDE�s� withcoe�cients that are constant in both space and time� and they represent phenomenaof importance to the analysis of certain aspects of �uid dynamic problems�

��� Conservation Laws

Conservation laws� such as the Euler and Navier�Stokes equations and our modelequations� can be written in the following integral form�Z

V �t��QdV �

ZV �t��

QdV �Z t�

t�

IS�t�

n�FdSdt �Z t�

t�

ZV �t�

PdV dt �����

In this equation� Q is a vector containing the set of variables which are conserved�e�g�� mass� momentum� and energy� per unit volume� The equation is a statement of

Page 17: Fundamentals of Computational Fluid Dynamics

CHAPTER �� CONSERVATION LAWS AND THE MODEL EQUATIONS

the conservation of these quantities in a �nite region of space with volume V �t� andsurface area S�t� over a �nite interval of time t� � t�� In two dimensions� the regionof space� or cell� is an area A�t� bounded by a closed contour C�t�� The vector n isa unit vector normal to the surface pointing outward� F is a set of vectors� or tensor�containing the �ux of Q per unit area per unit time� and P is the rate of productionof Q per unit volume per unit time� If all variables are continuous in time� then Eq���� can be rewritten as

d

dt

ZV �t�

QdV �IS�t�

n�FdS �ZV �t�

PdV �����

Those methods which make various numerical approximations of the integrals in Eqs���� and ��� and �nd a solution for Q on that basis are referred to as �nite�volumemethods� Many of the advanced codes written for CFD applications are based on the�nite�volume concept�

On the other hand� a partial derivative form of a conservation law can also bederived� The divergence form of Eq� ��� is obtained by applying Gauss�s theorem tothe �ux integral� leading to

�Q

�t�r�F � P �����

where r� is the well�known divergence operator given� in Cartesian coordinates� by

r� ��i�

�x� j

�y� k

�z

�� �����

and i� j� and k are unit vectors in the x� y� and z coordinate directions� respectively�Those methods which make various approximations of the derivatives in Eq� ��� and�nd a solution for Q on that basis are referred to as �nite�di�erence methods�

��� The Navier�Stokes and Euler Equations

The Navier�Stokes equations form a coupled system of nonlinear PDE�s describingthe conservation of mass� momentum and energy for a �uid� For a Newtonian �uidin one dimension� they can be written as

�Q

�t��E

�x� �����

with

Q �

��������

�u

e

������ � E �

��������u

�u� � p

u�e � p�

��������������

����u�x

���u�u

�x� �T

�x

������ �����

Page 18: Fundamentals of Computational Fluid Dynamics

���� THE NAVIER�STOKES AND EULER EQUATIONS �

where � is the �uid density� u is the velocity� e is the total energy per unit volume� p isthe pressure� T is the temperature� � is the coe�cient of viscosity� and is the thermalconductivity� The total energy e includes internal energy per unit volume � �where is the internal energy per unit mass� and kinetic energy per unit volume �u����These equations must be supplemented by relations between � and and the �uidstate as well as an equation of state� such as the ideal gas law� Details can be foundin Anderson� Tannehill� and Pletcher ��� and Hirsch ���� Note that the convective�uxes lead to �rst derivatives in space� while the viscous and heat conduction termsinvolve second derivatives� This form of the equations is called conservation�law orconservative form� Non�conservative forms can be obtained by expanding derivativesof products using the product rule or by introducing dierent dependent variables�such as u and p� Although non�conservative forms of the equations are analyticallythe same as the above form� they can lead to quite dierent numerical solutions interms of shock strength and shock speed� for example� Thus the conservative form isappropriate for solving �ows with features such as shock waves�

Many �ows of engineering interest are steady �time�invariant�� or at least may betreated as such� For such �ows� we are often interested in the steady�state solution ofthe Navier�Stokes equations� with no interest in the transient portion of the solution�The steady solution to the one�dimensional Navier�Stokes equations must satisfy

�E

�x� �����

If we neglect viscosity and heat conduction� the Euler equations are obtained� Intwo�dimensional Cartesian coordinates� these can be written as

�Q

�t��E

�x��F

�y� ����

with

Q �

�����q�q�q�q�

���� �

�������u�ve

���� � E �

������u

�u� � p�uv

u�e � p�

���� � F �

������v�uv

�v� � pv�e � p�

���� �����

where u and v are the Cartesian velocity components� Later on we will make use ofthe following form of the Euler equations as well�

�Q

�t� A

�Q

�x� B

�Q

�y� ���� �

The matrices A � �E�Q

and B � �F�Q

are known as the �ux Jacobians� The �ux vectorsgiven above are written in terms of the primitive variables� �� u� v� and p� In order

Page 19: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� CONSERVATION LAWS AND THE MODEL EQUATIONS

to derive the �ux Jacobian matrices� we must �rst write the �ux vectors E and F interms of the conservative variables� q�� q�� q�� and q�� as follows�

E �

�������������

E�

E�

E�

E�

�������������

����������������

q�

�� � ��q� � ����

q��

q�� ���

q��

q�

q�q�q�

� q�q�q�� ���

�q��

q��

�q��q�q��

���������������������

F �

�������������

F�

F�

F�

F�

�������������

���������������

q�

q�q�q�

�� � ��q� � ����

q��

q�� ���

q��

q�

� q�q�q�� ���

�q��q�q��

�q��

q��

��������������������

We have assumed that the pressure satis�es p � �� � ���e � ��u� � v����� from theideal gas law� where � is the ratio of speci�c heats� cp�cv� From this it follows thatthe �ux Jacobian of E can be written in terms of the conservative variables as

A ��Ei

�qj�

���������������

a�� ��� ���q�q�

���� ��

�q�q�

�� � �

��q�q�

��q�q�

� �q�q�

� �q�q�

a�� a�� a�� ��q�q�

��������������������

where

a�� �� � �

�q�q�

��

� �� �

�q�q�

��

Page 20: Fundamentals of Computational Fluid Dynamics

���� THE NAVIER�STOKES AND EULER EQUATIONS ��

a�� � �� � ��

���q�q�

��

�q�q�

���q�q�

��� �

�q�q�

��q�q�

a�� � �

�q�q�

�� � � �

���

�q�q�

��

�q�q�

���

a�� � ��� � ��

�q�q�

��q�q�

�������

and in terms of the primitive variables as

A �

�������������

a�� ��� ��u ��� ��v �� � ��

�uv v u

a�� a�� a�� �u

������������������

where

a�� �� � �

�v� � �� �

�u�

a�� � �� � ��u�u� � v��� �ue

a�� � �e

�� � � �

���u� � v��

a�� � ��� ��uv ������

Derivation of the two forms of B � �F��Q is similar� The eigenvalues of the �uxJacobian matrices are purely real� This is the de�ning feature of hyperbolic systemsof PDE�s� which are further discussed in Section ���� The homogeneous property ofthe Euler equations is discussed in Appendix C�

The Navier�Stokes equations include both convective and diusive �uxes� Thismotivates the choice of our two scalar model equations associated with the physicsof convection and diusion� Furthermore� aspects of convective phenomena associ�ated with coupled systems of equations such as the Euler equations are important indeveloping numerical methods and boundary conditions� Thus we also study linearhyperbolic systems of PDE�s�

Page 21: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� CONSERVATION LAWS AND THE MODEL EQUATIONS

��� The Linear Convection Equation

����� Di�erential Form

The simplest linear model for convection and wave propagation is the linear convectionequation given by the following PDE�

�u

�t� a

�u

�x� ������

Here u�x� t� is a scalar quantity propagating with speed a� a real constant which maybe positive or negative� The manner in which the boundary conditions are speci�edseparates the following two phenomena for which this equation is a model�

��� In one type� the scalar quantity u is given on one boundary� correspondingto a wave entering the domain through this �in�ow� boundary� No bound�ary condition is speci�ed at the opposite side� the �out�ow� boundary� Thisis consistent in terms of the well�posedness of a �st�order PDE� Hence thewave leaves the domain through the out�ow boundary without distortion orre�ection� This type of phenomenon is referred to� simply� as the convectionproblem� It represents most of the �usual� situations encountered in convect�ing systems� Note that the left�hand boundary is the in�ow boundary whena is positive� while the right�hand boundary is the in�ow boundary when a isnegative�

��� In the other type� the �ow being simulated is periodic� At any given time�what enters on one side of the domain must be the same as that which isleaving on the other� This is referred to as the biconvection problem� It isthe simplest to study and serves to illustrate many of the basic properties ofnumerical methods applied to problems involving convection� without specialconsideration of boundaries� Hence� we pay a great deal of attention to it inthe initial chapters�

Now let us consider a situation in which the initial condition is given by u�x� � �u��x�� and the domain is in�nite� It is easy to show by substitution that the exactsolution to the linear convection equation is then

u�x� t� � u��x� at� �����

The initial waveform propagates unaltered with speed jaj to the right if a is positiveand to the left if a is negative� With periodic boundary conditions� the waveformtravels through one boundary and reappears at the other boundary� eventually re�turning to its initial position� In this case� the process continues forever without any

Page 22: Fundamentals of Computational Fluid Dynamics

���� THE LINEAR CONVECTION EQUATION ��

change in the shape of the solution� Preserving the shape of the initial conditionu��x� can be a di�cult challenge for a numerical method�

����� Solution in Wave Space

We now examine the biconvection problem in more detail� Let the domain be givenby � x � � � We restrict our attention to initial conditions in the form

u�x� � � f� �ei�x ������

where f� � is a complex constant� and is the wavenumber� In order to satisfy theperiodic boundary conditions� must be an integer� It is a measure of the number ofwavelengths within the domain� With such an initial condition� the solution can bewritten as

u�x� t� � f�t�ei�x ���� �

where the time dependence is contained in the complex function f�t�� Substitutingthis solution into the linear convection equation� Eq� ����� we �nd that f�t� satis�esthe following ordinary dierential equation �ODE�

df

dt� �iaf ������

which has the solutionf�t� � f� �e�ia�t ������

Substituting f�t� into Eq� ��� gives the following solution

u�x� t� � f� �ei��x�at� � f� �ei��x��t� ������

where the frequency� �� the wavenumber� � and the phase speed� a� are related by

� � a ������

The relation between the frequency and the wavenumber is known as the dispersionrelation� The linear relation given by Eq� ���� is characteristic of wave propagationin a nondispersive medium� This means that the phase speed is the same for allwavenumbers� As we shall see later� most numerical methods introduce some disper�sion that is� in a simulation� waves with dierent wavenumbers travel at dierentspeeds�

An arbitrary initial waveform can be produced by summing initial conditions ofthe form of Eq� ����� For M modes� one obtains

u�x� � �MXm��

fm� �ei�mx ������

Page 23: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� CONSERVATION LAWS AND THE MODEL EQUATIONS

where the wavenumbers are often ordered such that � � � � � � � � M � Since thewave equation is linear� the solution is obtained by summing solutions of the form ofEq� ����� giving

u�x� t� �MXm��

fm� �ei�m�x�at� ������

Dispersion and dissipation resulting from a numerical approximation will cause theshape of the solution to change from that of the original waveform�

��� The Di�usion Equation

����� Di�erential Form

Diusive �uxes are associated with molecular motion in a continuum �uid� A simplelinear model equation for a diusive process is

�u

�t� �

��u

�x�������

where � is a positive real constant� For example� with u representing the tempera�ture� this parabolic PDE governs the diusion of heat in one dimension� Boundaryconditions can be periodic� Dirichlet �speci�ed u�� Neumann �speci�ed �u��x�� ormixed Dirichlet!Neumann�

In contrast to the linear convection equation� the diusion equation has a nontrivialsteady�state solution� which is one that satis�es the governing PDE with the partialderivative in time equal to zero� In the case of Eq� ����� the steady�state solutionmust satisfy

��u

�x�� �����

Therefore� u must vary linearly with x at steady state such that the boundary con�ditions are satis�ed� Other steady�state solutions are obtained if a source term g�x�is added to Eq� ����� as follows�

�u

�t� �

��u

�x�� g�x�

�������

giving a steady state�solution which satis�es

��u

�x�� g�x� � ���� �

Page 24: Fundamentals of Computational Fluid Dynamics

���� THE DIFFUSION EQUATION ��

In two dimensions� the diusion equation becomes

�u

�t� �

��u

�x����u

�y�� g�x� y�

�������

where g�x� y� is again a source term� The corresponding steady equation is

��u

�x����u

�y�� g�x� y� � ������

While Eq� ���� is parabolic� Eq� ���� is elliptic� The latter is known as the Poissonequation for nonzero g� and as Laplace�s equation for zero g�

����� Solution in Wave Space

We now consider a series solution to Eq� ����� Let the domain be given by � x � with boundary conditions u� � � ua� u� � � ub� It is clear that the steady�statesolution is given by a linear function which satis�es the boundary conditions� i�e��h�x� � ua � �ub � ua�x� � Let the initial condition be

u�x� � �MXm��

fm� � sinmx � h�x� ������

where must be an integer in order to satisfy the boundary conditions� A solutionof the form

u�x� t� �MXm��

fm�t� sin mx � h�x� ������

satis�es the initial and boundary conditions� Substituting this form into Eq� ����gives the following ODE for fm�

dfmdt

� ��m�fm ������

and we �ndfm�t� � fm� �e��

�m�t ������

Substituting fm�t� into equation ����� we obtain

u�x� t� �MXm��

fm� �e���m�t sinmx � h�x� ������

The steady�state solution �t��� is simply h�x�� Eq� ���� shows that high wavenum�ber components �large m� of the solution decay more rapidly than low wavenumbercomponents� consistent with the physics of diusion�

Page 25: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� CONSERVATION LAWS AND THE MODEL EQUATIONS

��� Linear Hyperbolic Systems

The Euler equations� Eq� ��� form a hyperbolic system of partial dierential equa�tions� Other systems of equations governing convection and wave propagation phe�nomena� such as the Maxwell equations describing the propagation of electromagneticwaves� are also of hyperbolic type� Many aspects of numerical methods for such sys�tems can be understood by studying a one�dimensional constant�coe�cient linearsystem of the form

�u

�t� A

�u

�x� �����

where u � u�x� t� is a vector of length m and A is a real m � m matrix� Forconservation laws� this equation can also be written in the form

�u

�t��f

�x� ������

where f is the �ux vector and A � �f�u

is the �ux Jacobian matrix� The entries in the�ux Jacobian are

aij ��fi�uj

���� �

The �ux Jacobian for the Euler equations is derived in Section ����Such a system is hyperbolic if A is diagonalizable with real eigenvalues�� Thus

" � X��AX ������

where " is a diagonal matrix containing the eigenvalues of A� and X is the matrixof right eigenvectors� Premultiplying Eq� ��� by X��� postmultiplying A by theproduct XX��� and noting that X and X�� are constants� we obtain

�X��u

�t��

�z � �X��AX X��u

�x� ������

With w � X��u� this can be rewritten as

�w

�t� "

�w

�x� ������

When written in this manner� the equations have been decoupled into m scalar equa�tions of the form

�wi

�t� �i

�wi

�x� ������

�See Appendix A for a brief review of some basic relations and de�nitions from linear algebra�

Page 26: Fundamentals of Computational Fluid Dynamics

���� PROBLEMS ��

The elements of w are known as characteristic variables� Each characteristic variablesatis�es the linear convection equation with the speed given by the correspondingeigenvalue of A�

Based on the above� we see that a hyperbolic system in the form of Eq� ��� has asolution given by the superposition of waves which can travel in either the positive ornegative directions and at varying speeds� While the scalar linear convection equationis clearly an excellent model equation for hyperbolic systems� we must ensure thatour numerical methods are appropriate for wave speeds of arbitrary sign and possiblywidely varying magnitudes�

The one�dimensional Euler equations can also be diagonalized� leading to threeequations in the form of the linear convection equation� although they remain non�linear� of course� The eigenvalues of the �ux Jacobian matrix� or wave speeds� are

u� u � c� and u � c� where u is the local �uid velocity� and c �q�p�� is the local

speed of sound� The speed u is associated with convection of the �uid� while u � cand u � c are associated with sound waves� Therefore� in a supersonic �ow� wherejuj � c� all of the wave speeds have the same sign� In a subsonic �ow� where juj � c�wave speeds of both positive and negative sign are present� corresponding to the factthat sound waves can travel upstream in a subsonic �ow�

The signs of the eigenvalues of the matrix A are also important in determiningsuitable boundary conditions� The characteristic variables each satisfy the linear con�vection equation with the wave speed given by the corresponding eigenvalue� There�fore� the boundary conditions can be speci�ed accordingly� That is� characteristicvariables associated with positive eigenvalues can be speci�ed at the left boundary�which corresponds to in�ow for these variables� Characteristic variables associatedwith negative eigenvalues can be speci�ed at the right boundary� which is the in��ow boundary for these variables� While other boundary condition treatments arepossible� they must be consistent with this approach�

��� Problems

�� Show that the ��D Euler equations can be written in terms of the primitivevariables R � ��� u� p�T as follows�

�R

�t� M

�R

�x�

where

M �

��� u � u ���

�p u

��

Page 27: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� CONSERVATION LAWS AND THE MODEL EQUATIONS

Assume an ideal gas� p � �� � ���e� �u�����

�� Find the eigenvalues and eigenvectors of the matrix M derived in question ��

�� Derive the �ux Jacobian matrix A � �E��Q for the ��D Euler equations result�ing from the conservative variable formulation �Eq� ����� Find its eigenvaluesand compare with those obtained in question ��

�� Show that the two matrices M and A derived in questions � and �� respectively�are related by a similarity transform� �Hint� make use of the matrix S ��Q��R��

�� Write the ��D diusion equation� Eq� ����� in the form of Eq� ����

�� Given the initial condition u�x� � � sinx de�ned on � x � � � write it in theform of Eq� ����� that is� �nd the necessary values of fm� �� �Hint� use M � �with � � � and � � ���� Next consider the same initial condition de�nedonly at x � � j��� j � � �� �� �� Find the values of fm� � required to reproducethe initial condition at these discrete points using M � � with m � m� ��

�� Plot the �rst three basis functions used in constructing the exact solution tothe diusion equation in Section ������ Next consider a solution with boundaryconditions ua � ub � � and initial conditions from Eq� ���� with fm� � � �for � � m � �� fm� � � for m � �� Plot the initial condition on the domain � x � � Plot the solution at t � � with � � ��

� Write the classical wave equation ��u��t� � c���u��x� as a �rst�order system�i�e�� in the form

�U

�t� A

�U

�x�

where U � ��u��x� �u��t�T � Find the eigenvalues and eigenvectors of A�

�� The Cauchy�Riemann equations are formed from the coupling of the steadycompressible continuity �conservation of mass� equation

��u

�x���v

�y�

and the vorticity de�nition

� � ��v

�x��u

�y�

Page 28: Fundamentals of Computational Fluid Dynamics

���� PROBLEMS ��

where � � for irrotational �ow� For isentropic and homenthalpic �ow� thesystem is closed by the relation

� ��

�� � � �

�u� � v� � �

�� �

���

Note that the variables have been nondimensionalized� Combining the twoPDE�s� we have

�f�q�

�x��g�q�

�y�

where

q ��uv

�� f �

���uv

�� g �

���v�u

�One approach to solving these equations is to add a time�dependent term and�nd the steady solution of the following equation�

�q

�t��f

�x��g

�y�

�a� Find the �ux Jacobians of f and g with respect to q�

�b� Determine the eigenvalues of the �ux Jacobians�

�c� Determine the conditions �in terms of � and u� under which the system ishyperbolic� i�e�� has real eigenvalues�

�d� Are the above �uxes homogeneous� �See Appendix C��

Page 29: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� CONSERVATION LAWS AND THE MODEL EQUATIONS

Page 30: Fundamentals of Computational Fluid Dynamics

Chapter �

FINITE�DIFFERENCE

APPROXIMATIONS

In common with the equations governing unsteady �uid �ow� our model equationscontain partial derivatives with respect to both space and time� One can approxi�mate these simultaneously and then solve the resulting dierence equations� Alterna�tively� one can approximate the spatial derivatives �rst� thereby producing a systemof ordinary dierential equations� The time derivatives are approximated next� lead�ing to a time�marching method which produces a set of dierence equations� Thisis the approach emphasized here� In this chapter� the concept of �nite�dierenceapproximations to partial derivatives is presented� These can be applied either tospatial derivatives or time derivatives� Our emphasis in this chapter is on spatialderivatives time derivatives are treated in Chapter �� Strategies for applying these�nite�dierence approximations will be discussed in Chapter ��

All of the material below is presented in a Cartesian system� We emphasize thefact that quite general classes of meshes expressed in general curvilinear coordinatesin physical space can be transformed to a uniform Cartesian mesh with equispacedintervals in a so�called computational space� as shown in Figure ���� The computationalspace is uniform all the geometric variation is absorbed into variable coe�cients of thetransformed equations� For this reason� in much of the following accuracy analysis�we use an equispaced Cartesian system without being unduly restrictive or losingpractical application�

��� Meshes and Finite�Di�erence Notation

The simplest mesh involving both time and space is shown in Figure ���� Inspectionof this �gure permits us to de�ne the terms and notation needed to describe �nite�

��

Page 31: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

x

y

Figure ���� Physical and computational spaces�

dierence approximations� In general� the dependent variables� u� for example� arefunctions of the independent variables t� and x� y� z� For the �rst several chapterswe consider primarily the ��D case u � u�x� t�� When only one variable is denoted�dependence on the other is assumed� The mesh index for x is always j� and that fort is always n� Then on an equispaced grid

x � xj � j�x �����

t � tn � n�t � nh �����

where �x is the spacing in x and �t the spacing in t� as shown in Figure ���� Notethat h � �t throughout� Later k and l are used for y and z in a similar way� Whenn� j� k� l are used for other purposes �which is sometimes necessary�� local contextshould make the meaning obvious�

The convention for subscript and superscript indexing is as follows�

u�t � kh� � u��n � k�h� � unk

u�x � m�x� � u��j � m��x� � ujm �����

u�x � m�x� t � kh� � u�nk�jm

Notice that when used alone� both the time and space indices appear as a subscript�but when used together� time is always a superscript and is usually enclosed withparentheses to distinguish it from an exponent�

Page 32: Fundamentals of Computational Fluid Dynamics

���� MESHES AND FINITE�DIFFERENCE NOTATION ��

t

xj-2 j-1 j j+1 j+2

n

n-1

n+1x

t

Grid orNodePoints

Figure ���� Space�time grid arrangement�

Derivatives are expressed according to the usual conventions� Thus for partialderivatives in space or time we use interchangeably

�xu ��u

�x� �tu �

�u

�t� �xxu �

��u

�x�� etc� �����

For the ordinary time derivative in the study of ODE�s we use

u� �du

dt�����

In this text� subscripts on dependent variables are never used to express derivatives�Thus ux will not be used to represent the �rst derivative of u with respect to x�

The notation for dierence approximations follows the same philosophy� but �withone exception� it is not unique� By this we mean that the symbol � is used to representa dierence approximation to a derivative such that� for example�

�x � �x� �xx � �xx �����

but the precise nature �and order� of the approximation is not carried in the symbol�� Other ways are used to determine its precise meaning� The one exception is thesymbol �� which is de�ned such that

�tn � tn� � tn� �xj � xj� � xj� �un � un� � un� etc� �����

When there is no subscript on �t or �x� the spacing is uniform�

Page 33: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

��� Space Derivative Approximations

A dierence approximation can be generated or evaluated by means of a simple Taylorseries expansion� For example� consider u�x� t� with t �xed� Then� following thenotation convention given in Eqs� ��� to ���� x � j�x and u�x � k�x� � u�j�x �k�x� � ujk� Expanding the latter term about x gives�

ujk � uj � �k�x�

��u

�x

�j

��

��k�x��

���u

�x�

�j

� � � �� �

n#�k�x�n

��nu

�xn

�j

� � � � ����

Local dierence approximations to a given partial derivative can be formed from linearcombinations of uj and ujk for k � ������ � � ��

For example� consider the Taylor series expansion for uj��

uj� � uj � ��x�

��u

�x

�j

��

���x��

���u

�x�

�j

� � � �� �

n#��x�n

��nu

�xn

�j

� � � � �����

Now subtract uj and divide by �x to obtain

uj� � uj�x

��u

�x

�j

��

���x�

���u

�x�

�j

� � � � ���� �

Thus the expression �uj��uj���x is a reasonable approximation for��u�x

�j

as long as

�x is small relative to some pertinent length scale� Next consider the space dierenceapproximation �uj��uj�������x�� Expand the terms in the numerator about j andregroup the result to form the following equation

uj� � uj����x

���u

�x

�j

��

��x�

���u

�x�

�j

��

�� �x�

��u

�x

�j

� � � ������

When expressed in this manner� it is clear that the discrete terms on the left side ofthe equation represent a �rst derivative with a certain amount of error which appearson the right side of the equal sign� It is also clear that the error depends on thegrid spacing to a certain order� The error term containing the grid spacing to thelowest power gives the order of the method� From Eq� ��� � we see that the expression�uj��uj���x is a �rst�order approximation to

��u�x

�j� Similarly� Eq� ���� shows that

�uj�� uj�������x� is a second�order approximation to a �rst derivative� The latteris referred to as the three�point centered dierence approximation� and one often seesthe summary result presented in the form�

�u

�x

�j

�uj� � uj��

��x� O��x�� ������

�We assume that u�x� t� is continuously di�erentiable�

Page 34: Fundamentals of Computational Fluid Dynamics

���� FINITE�DIFFERENCE OPERATORS ��

��� Finite�Di�erence Operators

����� Point Di�erence Operators

Perhaps the most common examples of �nite�dierence formulas are the three�pointcentered�dierence approximations for the �rst and second derivatives���

�u

�x

�j

��

��x�uj� � uj��� � O��x�� �������

��u

�x�

�j

��

�x��uj� � �uj � uj��� � O��x�� ������

These are the basis for point di�erence operators since they give an approximation toa derivative at one discrete point in a mesh in terms of surrounding points� However�neither of these expressions tells us how other points in the mesh are dierenced orhow boundary conditions are enforced� Such additional information requires a moresophisticated formulation�

����� Matrix Di�erence Operators

Consider the relation

��xxu�j ��

�x��uj� � �uj � uj��� ������

which is a point dierence approximation to a second derivative� Now let us derive amatrix operator representation for the same approximation� Consider the four pointmesh with boundary points at a and b shown below� Notice that when we speak of�the number of points in a mesh�� we mean the number of interior points excludingthe boundaries�

a � � � � bx � � � � � j � � � � M

Four point mesh� �x � ��M � ��

Now impose Dirichlet boundary conditions� u� � � ua� u� � � ub and use thecentered dierence approximation given by Eq� ���� at every point in the mesh� We

�We will derive the second derivative operator shortly�

Page 35: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

arrive at the four equations�

��xxu�� ��

�x��ua � �u� � u��

��xxu�� ��

�x��u� � �u� � u��

��xxu�� ��

�x��u� � �u� � u��

��xxu�� ��

�x��u� � �u� � ub� ������

Writing these equations in the more suggestive form

��xxu�� � � ua ��u� �u� ���x�

��xxu�� � � u� ��u� �u� ���x�

��xxu�� � � u� ��u� �u� ���x�

��xxu�� � � u� ��u� �ub ���x�

������

it is clear that we can express them in a vector�matrix form� and further� that theresulting matrix has a very special form� Introducing

�u �

�����u�u�u�u�

���� � ��bc�

��

�x�

�����ua ub

���� �����

and

A ��

�x�

������� �

� �� �� �� �

� ��

���� ������

we can rewrite Eq� ���� as

�xx�u � A�u ���bc�

���� �

This example illustrates a matrix dierence operator� Each line of a matrix dier�ence operator is based on a point dierence operator� but the point operators usedfrom line to line are not necessarily the same� For example� boundary conditions maydictate that the lines at or near the bottom or top of the matrix be modi�ed� In theextreme case of the matrix dierence operator representing a spectral method� none

Page 36: Fundamentals of Computational Fluid Dynamics

���� FINITE�DIFFERENCE OPERATORS ��

of the lines is the same� The matrix operators representing the three�point central�dierence approximations for a �rst and second derivative with Dirichlet boundaryconditions on a four�point mesh are

�x ��

��x

����� �

�� ��� �

��

���� � �xx ��

�x�

������� �

� �� �� �� �

� ��

���� ������

As a further example� replace the fourth line in Eq� ���� by the following pointoperator for a Neumann boundary condition �See Section ������

��xxu�� ��

�x

��u

�x

�b

� �

�x��u� � u�� ������

where the boundary condition is��u

�x

�x��

��u

�x

�b

������

Then the matrix operator for a three�point central�dierencing scheme at interiorpoints and a second�order approximation for a Neumann condition on the right isgiven by

�xx ��

�x�

������� �

� �� �� �� �

��� ����

���� ������

Each of these matrix dierence operators is a square matrix with elements that areall zeros except for those along bands which are clustered around the central diagonal�We call such a matrix a banded matrix and introduce the notation

B�M � a� b� c� �

���������

b ca b c

� � �

a b ca b

��������

���

M

������

where the matrix dimensions are M �M � Use of M in the argument is optional�and the illustration is given for a simple tridiagonal matrix although any number of

Page 37: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

bands is a possibility� A tridiagonal matrix without constants along the bands can beexpressed as B��a��b��c�� The arguments for a banded matrix are always odd in numberand the central one always refers to the central diagonal�

We can now generalize our previous examples� De�ning �u as�

�u �

���������

u�u�u����uM

�������� ������

we can approximate the second derivative of �u by

�xx�u ��

�x�B������ ���u�

��bc�

������

where��bc�

stands for the vector holding the Dirichlet boundary conditions on theleft and right sides�

��bc�

��

�x��ua� � � � � � � ub�T �����

If we prescribe Neumann boundary conditions on the right side� as in Eqs� ���� and����� we �nd

�xx�u ��

�x�B��a��b� ���u �

��bc�

������

where

�a � ��� �� � � � � ����T

�b � ���������� � � � ������T��bc�

��

�x�

ua� � � � � � � ��x

��u

�x

�b

�T

Notice that the matrix operators given by Eqs� ���� and ���� carry more informa�tion than the point operator given by Eq� ����� In Eqs� ���� and ����� the boundaryconditions have been uniquely speci�ed and it is clear that the same point operatorhas been applied at every point in the �eld except at the boundaries� The ability tospecify in the matrix derivative operator the exact nature of the approximation at the

�Note that �u is a function of time only since each element corresponds to one speci�c spatiallocation�

Page 38: Fundamentals of Computational Fluid Dynamics

���� FINITE�DIFFERENCE OPERATORS ��

various points in the �eld including the boundaries permits the use of quite generalconstructions which will be useful later in considerations of stability�

Since we make considerable use of both matrix and point operators� it is importantto establish a relation between them� A point operator is generally written for somederivative at the reference point j in terms of neighboring values of the function� Forexample

��xu�j � a�uj�� � a�uj�� � buj � c�uj� ���� �

might be the point operator for a �rst derivative� The corresponding matrix operatorhas for its arguments the coe�cients giving the weights to the values of the functionat the various locations� A j�shift in the point operator corresponds to a diagonalshift in the matrix operator� Thus the matrix equivalent of Eq� ��� is

�x�u � B�a�� a�� b� c�� ��u ������

Note the addition of a zero in the �fth element which makes it clear that b is thecoe�cient of uj�

����� Periodic Matrices

The above illustrated cases in which the boundary conditions are �xed� If the bound�ary conditions are periodic� the form of the matrix operator changes� Consider theeight�point periodic mesh shown below� This can either be presented on a linear meshwith repeated entries� or more suggestively on a circular mesh as in Figure ���� Whenthe mesh is laid out on the perimeter of a circle� it doesn�t really matter where thenumbering starts as long as it �ends� at the point just preceding its starting location�

� � � � � � � � � � � � � � � �x � � � � � � � � � � � �j � � � � � � � � M

Eight points on a linear periodic mesh� �x � � �M

The matrix that represents dierencing schemes for scalar equations on a periodicmesh is referred to as a periodic matrix� A typical periodic tridiagonal matrix operator

Page 39: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

1

2

3

4

5

6

7

8

Figure ���� Eight points on a circular mesh�

with nonuniform entries is given for a ��point mesh by

Bp�� � �a��b��c� �

����������

b� c� a�a� b� c�

a� b� c�a� b� c

a� b c�c� a b�

���������������

����� Circulant Matrices

In general� as shown in the example� the elements along the diagonals of a periodicmatrix are not constant� However� a special subset of a periodic matrix is the circulantmatrix� formed when the elements along the various bands are constant� Circulantmatrices play a vital role in our analysis� We will have much more to say about themlater� The most general circulant matrix of order � is�����

b� b� b� b�b� b� b� b�b� b� b� b�b� b� b� b�

���� ������

Notice that each row of a circulant matrix is shifted �see Figure ���� one element tothe right of the one above it� The special case of a tridiagonal circulant matrix is

Page 40: Fundamentals of Computational Fluid Dynamics

���� CONSTRUCTING DIFFERENCING SCHEMES OF ANY ORDER ��

given by

Bp�M � a� b� c� �

���������

b c aa b c

� � �

a b cc a b

��������

���

M

������

When the standard three�point central�dierencing approximations for a �rst andsecond derivative� see Eq� ����� are used with periodic boundary conditions� they takethe form

��x�p ��

��x

����� � ��

�� ��� �

� ��

���� ��

��xBp���� � ��

and

��xx�p ��

�x�

������� � �

� �� �� �� �

� � ��

���� ��

�x�Bp������ �� ������

Clearly� these special cases of periodic operators are also circulant operators� Lateron we take advantage of this special property� Notice that there are no boundarycondition vectors since this information is all interior to the matrices themselves�

��� Constructing Di�erencing Schemes of Any Or�

der

����� Taylor Tables

The Taylor series expansion of functions about a �xed point provides a means for con�structing �nite�dierence point�operators of any order� A simple and straightforwardway to carry this out is to construct a �Taylor table�� which makes extensive use ofthe expansion given by Eq� ��� As an example� consider Table ���� which representsa Taylor table for an approximation of a second derivative using three values of thefunction centered about the point at which the derivative is to be evaluated�

Page 41: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

���u

�x�

�j

� �

�x��a uj�� � b uj � c uj�� � �

�x� �x�� �x�� �x��uj

��u�x

�j

���u�x�

�j

���u�x�

�j

���u�x�

�j

�x� ����u�x�

�j

�a � uj�� �a �a � ���� � �� �a � ����� � �

� �a � ����� � �� �a � ����� � �

���b � uj �b�c � uj� �c �c � ��� � �

� �c � ���� � �� �c � ���� � �

� �c � ���� � ���

Table ���� Taylor table for centered ��point Lagrangian approximation to a secondderivative�

The table is constructed so that some of the algebra is simpli�ed� At the top of thetable we see an expression with a question mark� This represents one of the questionsthat a study of this table can answer namely� what is the local error caused by theuse of this approximation� Notice that all of the terms in the equation appear ina column at the left of the table �although� in this case� �x� has been multipliedinto each term in order to simplify the terms to be put into the table�� Then noticethat at the head of each column there appears the common factor that occurs in theexpansion of each term about the point j� that is�

�xk ���ku

�xk

�j

k � � �� �� � � �

The columns to the right of the leftmost one� under the headings� make up the Taylortable� Each entry is the coe�cient of the term at the top of the corresponding columnin the Taylor series expansion of the term to the left of the corresponding row� Forexample� the last row in the table corresponds to the Taylor series expansion of�c uj��

�c uj� � �c uj � c � ��� � �

��x �

��u

�x

�j

� c � ���� � �

��x� �

���u

�x�

�j

�c � ���� � �

��x� �

���u

�x�

�j

� c � ���� � �

���x� �

���u

�x�

�j

� � � � ������

A Taylor table is simply a convenient way of forming linear combinations of Taylorseries on a term by term basis�

Page 42: Fundamentals of Computational Fluid Dynamics

���� CONSTRUCTING DIFFERENCING SCHEMES OF ANY ORDER ��

Consider the sum of each of these columns� To maximize the order of accuracyof the method� we proceed from left to right and force� by the proper choice of a� b�and c� these sums to be zero� One can easily show that the sums of the �rst threecolumns are zero if we satisfy the equation

����� �� ��� ��

�� ��

����� abc

�� �

���

��

��

The solution is given by �a� b� c� � ������ ���

The columns that do not sum to zero constitute the error�

We designate the �rst nonvanishing sum to be ert� and refer toit as the Taylor series error�

In this case ert occurs at the �fth column in the table �for this example all evencolumns will vanish by symmetry� and one �nds

ert ��

�x�

��a��

��c��

��x�

���u

�x�

�j

���x�

��

���u

�x�

�j

������

Note that �x� has been divided through to make the error term consistent� Wehave just derived the familiar ��point central�dierencing point operator for a secondderivative

���u

�x�

�j

� �

�x��uj�� � �uj � uj�� � O��x�� �����

The Taylor table for a ��point backward�dierencing operator representing a �rstderivative is shown in Table ����

Page 43: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

��u

�x

�j

� �

�x�a�uj�� � a�uj�� � b uj� � �

�x� �x�� �x�� �x��uj

��u�x

�j

���u�x�

�j

���u�x�

�j

���u�x�

�j

�x ���u�x

�j

�a� � uj�� �a� �a� � ���� � �� �a� � ����� � �

� �a� � ����� � �� �a� � ����� � �

���a� � uj�� �a� �a� � ���� � �

� �a� � ����� � �� �a� � ����� � �

� �a� � ����� � ���

�b � uj �b

Table ���� Taylor table for backward ��point Lagrangian approximation to a �rstderivative�

This time the �rst three columns sum to zero if����� �� ��� � �� ��

����� a�a�b

�� �

��� ��

��which gives �a�� a�� b� � �

������� ��� In this case the fourth column provides the leadingtruncation error term�

ert ��

�x

�a��

�a��

��x�

���u

�x�

�j

��x�

���u

�x�

�j

������

Thus we have derived a second�order backward�dierence approximation of a �rstderivative� �

�u

�x

�j

� �

��x�uj�� � �uj�� � �uj� � O��x�� ���� �

����� Generalization of Di�erence Formulas

In general� a dierence approximation to the mth derivative at grid point j can becast in terms of q � p � � neighboring points as�

�mu

�xm

�j

�qX

i��p

aiuji � ert ������

Page 44: Fundamentals of Computational Fluid Dynamics

���� CONSTRUCTING DIFFERENCING SCHEMES OF ANY ORDER ��

where the ai are coe�cients to be determined through the use of Taylor tables toproduce approximations of a given order� Clearly this process can be used to �ndforward� backward� skewed� or central point operators of any order for any derivative�It could be computer automated and extended to higher dimensions� More important�however� is the fact that it can be further generalized� In order to do this� let usapproach the subject in a slightly dierent way� that is from the point of view ofinterpolation formulas� These formulas are discussed in many texts on numericalanalysis�

����� Lagrange and Hermite Interpolation Polynomials

The Lagrangian interpolation polynomial is given by

u�x� �KXk��

ak�x�uk ������

where ak�x� are polynomials in x of degree K� The construction of the ak�x� can betaken from the simple Lagrangian formula for quadratic interpolation �or extrapola�tion� with non�equispaced points

u�x� � u��x� � x��x� � x�

�x� � x���x� � x��� u�

�x� � x��x� � x�

�x� � x���x� � x��

�u��x� � x��x� � x�

�x� � x���x� � x��������

Notice that the coe�cient of each uk is one when x � xk� and zero when x takesany other discrete value in the set� If we take the �rst or second derivative of u�x��impose an equispaced mesh� and evaluate these derivatives at the appropriate dis�crete point� we rederive the �nite�dierence approximations just presented� Finite�dierence schemes that can be derived from Eq� ���� are referred to as Lagrangianapproximations�

A generalization of the Lagrangian approach is brought about by using Hermitianinterpolation� To construct a polynomial for u�x�� Hermite formulas use values of thefunction and its derivative�s� at given points in space� Our illustration is for the casein which discrete values of the function and its �rst derivative are used� producingthe expression

u�x� �X

ak�x�uk �X

bk�x�

��u

�x

�k

������

Page 45: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

Obviously higher�order derivatives could be included as the problems dictate� A com�plete discussion of these polynomials can be found in many references on numericalmethods� but here we need only the concept�

The previous examples of a Taylor table constructed explicit point dierence op�erators from Lagrangian interpolation formulas� Consider next the Taylor table foran implicit space dierencing scheme for a �rst derivative arising from the use of aHermite interpolation formula� A generalization of Eq� ���� can include derivativesat neighboring points� i�e��

sXi��r

bi

��mu

�xm

�ji

�qX

i��p

aiuji � ert ������

analogous to Eq� ����� An example formula is illustrated at the top of Table ���� Herenot only is the derivative at point j represented� but also included are derivatives atpoints j � � and j � �� which also must be expanded using Taylor series about pointj� This requires the following generalization of the Taylor series expansion given inEq� ��� �

�mu

�xm

�jk

��Xn��

n#�k�x�n

�n

�xn

���mu

�xm

��j

������

The derivative terms now have coe�cients �the coe�cient on the j point is takenas one to simplify the algebra� which must be determined using the Taylor tableapproach as outlined below�

d

��u

�x

�j��

��u

�x

�j

� e

��u

�x

�j�

� �

�x�auj�� � buj � cuj�� � �

�x� �x�� �x�� �x�� �x�uj

��u�x

�j

���u�x�

�j

���u�x�

�j

���u�x�

�j

���u�x�

�j

�x � d��u�x

�j��

d d � ���� � �� d � ����� � �

� d � ����� � �� d � ����� � �

��

�x ���u�x

�j

�x � e��u�x

�j�

e e � ��� � �� e � ���� � �

� e � ���� � �� e � ���� � �

��

�a � uj�� �a �a � ���� � �� �a � ����� � �

� �a � ����� � �� �a � ����� � �

�� �a � ���� � ��� �b � uj �b

�c � uj� �c �c � ��� � �� �c � ���� � �

� �c � ���� � �� �c � ���� � �

�� �c � ��� � ���

Table ���� Taylor table for central ��point Hermitian approximation to a �rst derivative�

Page 46: Fundamentals of Computational Fluid Dynamics

���� CONSTRUCTING DIFFERENCING SCHEMES OF ANY ORDER ��

To maximize the order of accuracy� we must satisfy the relation��������� �� �� � �� � ��� �� �� �� �� � ��� �� �� �

������

�������abcde

������ �

������� ��

������having the solution �a� b� c� d� e� � �

����� � �� �� ��� Under these conditions the sixthcolumn sums to

ert ��x�

��

��u

�x

�j

������

and the method can be expressed as��u

�x

�j��

� �

��u

�x

�j

��u

�x

�j�

� �

�x��uj�� � uj�� � O��x�� �����

This is also referred to as a Pad�e formula�

����� Practical Application of Pad�e Formulas

It is one thing to construct methods using the Hermitian concept and quite anotherto implement them in a computer code� In the form of a point operator it is probablynot evident at �rst just how Eq� ��� can be applied� However� the situation is quiteeasy to comprehend if we express the same method in the form of a matrix operator�A banded matrix notation for Eq� ��� is

�B��� �� ���x�u �

��xB���� � ���u �

��bc�

������

in which Dirichlet boundary conditions have been imposed�� Mathematically this isequivalent to

�x�u � ��B��� �� ������

��xB���� � ���u �

��bc��

���� �

which can be reexpressed by the �predictor�corrector� sequence

�$u ��

��xB���� � ���u �

��bc�

�x�u � � �B��� �� ������$u ������

�In this case the vector containing the boundary conditions would include values of both u and�u��x at both boundaries�

Page 47: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

With respect to practical implementation� the meaning of the predictor in thissequence should be clear� It simply says � take the vector array �u� dierence it�add the boundary conditions� and store the result in the intermediate array �$u� Themeaning of the second row is more subtle� since it is demanding the evaluation of aninverse operator� but it still can be given a simple interpretation� An inverse matrixoperator implies the solution of a coupled set of linear equations� These operatorsare very common in �nite dierence applications� They appear in the form of bandedmatrices having a small bandwidth� in this case a tridiagonal� The evaluation of�B��� �� ����� is found by means of a tridiagonal �solver�� which is simple to code�e�cient to run� and widely used� In general� Hermitian or Pad�e approximations canbe practical when they can be implemented by the use of e�cient banded solvers�

���� Other Higher�Order Schemes

Hermitian forms of the second derivative can also be easily derived by means of aTaylor table� For example

�xx�u � �� �B��� � � ������

�x�B������ ���u �

��bc��

������

is O��x�� and makes use of only tridiagonal operations� It should be mentioned thatthe spline approximation is one form of a Pad�e matrix dierence operator� It is givenby

�xx�u � � �B��� �� ������

�x�B������ ���u �

��bc��

������

but its order of accuracy is only O��x��� How much this reduction in accuracy isoset by the increased global continuity built into a spline �t is not known� We notethat the spline �t of a �rst derivative is identical to any of the expressions in Eqs���� to �����

A �nal word on Hermitian approximations� Clearly they have an advantage over��point Lagrangian schemes because of their increased accuracy� However� a moresubtle point is that they get this increase in accuracy using information that is stilllocal to the point where the derivatives are being evaluated� In application� this canbe advantageous at boundaries and in the vicinity of steep gradients� It is obvious� ofcourse� that �ve point schemes using Lagrangian approximations can be derived thathave the same order of accuracy as the methods given in Eqs� ��� and ����� but theywill have a wider spread of space indices� In particular� two Lagrangian schemes withthe same order of accuracy are �here we ignore the problem created by the boundaryconditions� although this is one of the principal issues in applying these schemes��

��u

�x� �

���xBp����� � �����u � O

��x�

�������

Page 48: Fundamentals of Computational Fluid Dynamics

���� FOURIER ERROR ANALYSIS ��

���u

�x�� �

���x�Bp���� ����� � �������u � O

��x�

�������

��� Fourier Error Analysis

In order to select a �nite�dierence scheme for a given application one must be ableto assess the accuracy of the candidate schemes� The accuracy of an operator is oftenexpressed in terms of the order of the leading error term determined from a Taylortable� While this is a useful measure� it provides a fairly limited description� Furtherinformation about the error behavior of a �nite�dierence scheme can be obtainedusing Fourier error analysis�

���� Application to a Spatial Operator

An arbitrary periodic function can be decomposed into its Fourier components� whichare in the form ei�x� where is the wavenumber� It is therefore of interest to examinehow well a given �nite�dierence operator approximates derivatives of ei�x� We willconcentrate here on �rst derivative approximations� although the analysis is equallyapplicable to higher derivatives�

The exact �rst derivative of ei�x is

�ei�x

�x� iei�x ������

If we apply� for example� a second�order centered dierence operator to uj � ei�xj �where xj � j�x� we get

��xu�j �uj� � uj��

��x

�ei��x�j�� � ei��x�j���

��x

��ei��x � e�i��x�ei�xj

��x

��

��x��cos �x � i sin �x�� �cos �x� i sin�x��ei�xj

� isin�x

�xei�xj

� i�ei�xj ������

Page 49: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

0 0.5 1 1.5 2 2.5 30

0.5

1

1.5

2

2.5

3

κ x∆

κ* x∆

2 Centralnd

4 Centralth

4 Padeth

Figure ���� Modi�ed wavenumber for various schemes�

where � is the modi�ed wavenumber� The modi�ed wavenumber is so named becauseit appears where the wavenumber� � appears in the exact expression� Thus the degreeto which the modi�ed wavenumber approximates the actual wavenumber is a measureof the accuracy of the approximation�

For the second�order centered dierence operator the modi�ed wavenumber is givenby

� �sin�x

�x�����

Note that � approximates to second�order accuracy� as is to be expected� since

sin�x

�x� � ��x�

�� � � �

Equation ��� is plotted in Figure ���� along with similar relations for the stan�dard fourth�order centered dierence scheme and the fourth�order Pad�e scheme� Theexpression for the modi�ed wavenumber provides the accuracy with which a givenwavenumber component of the solution is resolved for the entire wavenumber rangeavailable in a mesh of a given size� � �x � �

In general� �nite�dierence operators can be written in the form

��x�j � ��ax�j � ��sx�j

Page 50: Fundamentals of Computational Fluid Dynamics

���� FOURIER ERROR ANALYSIS ��

where ��ax�j is an antisymmetric operator and ��sx�j is a symmetric operator� If werestrict our interest to schemes extending from j � � to j � �� then

��axu�j ��

�x�a��uj� � uj��� � a��uj� � uj��� � a��uj� � uj����

and

��sxu�j ��

�x�d�uj � d��uj� � uj��� � d��uj� � uj��� � d��uj� � uj����

The corresponding modi�ed wavenumber is

i� ��

�x�d� � ��d� cos �x � d� cos ��x � d� cos ��x�

� �i�a� sin �x � a� sin ��x � a� sin ��x� ������

When the �nite�dierence operator is antisymmetric �centered�� the modi�ed wavenum�ber is purely real� When the operator includes a symmetric component� the modi�edwavenumber is complex� with the imaginary component being entirely error� Thefourth�order Pad�e scheme is given by

��xu�j�� � ���xu�j � ��xu�j� ��

�x�uj� � uj���

The modi�ed wavenumber for this scheme satis�es�

i�e�i��x � �i� � i�ei��x ��

�x�ei��x � e�i��x�

which gives

i� ��i sin�x

�� � cos �x��x

The modi�ed wavenumber provides a useful tool for assessing dierence approx�imations� In the context of the linear convection equation� the errors can be givena physical interpretation� Consider once again the linear convection equation in theform

�u

�t� a

�u

�x�

�In terms of a circulant matrix operator A� the antisymmetric part is obtained from �A�AT ���and the symmetric part from �A�AT ����

�Note that terms such as ��xu�j�� are handled by letting ��xu�j � ik�ei�j�x and evaluating theshift in j�

Page 51: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

on a domain extending from �� to �� Recall from Section ����� that a solutioninitiated by a harmonic function with wavenumber is

u�x� t� � f�t�ei�x ���� �

where f�t� satis�es the ODEdf

dt� �iaf

Solving for f�t� and substituting into Eq� ��� gives the exact solution as

u�x� t� � f� �ei��x�at�

If second�order centered dierences are applied to the spatial term� the followingODE is obtained for f�t��

df

dt� �ia

�sin�x

�x

�f � �ia�f ������

Solving this ODE exactly �since we are considering the error from the spatial approx�imation only� and substituting into Eq� ��� � we obtain

unumerical�x� t� � f� �ei��x�a�t� ������

where a� is the numerical �or modi�ed� phase speed� which is related to the modi�edwavenumber by

a�

a��

For the above example�a�

a�

sin �x

�x

The numerical phase speed is the speed at which a harmonic function is propagatednumerically� Since a��a � � for this example� the numerical solution propagatestoo slowly� Since a� is a function of the wavenumber� the numerical approximationintroduces dispersion� although the original PDE is nondispersive� As a result� awaveform consisting of many dierent wavenumber components eventually loses itsoriginal form�

Figure ��� shows the numerical phase speed for the schemes considered previously�The number of points per wavelength �PPW � by which a given wave is resolved isgiven by � ��x� The resolving e�ciency of a scheme can be expressed in termsof the PPW required to produce errors below a speci�ed level� For example� thesecond�order centered dierence scheme requires PPW to produce an error inphase speed of less than �� percent� The ��point fourth�order centered scheme and

Page 52: Fundamentals of Computational Fluid Dynamics

���� DIFFERENCE OPERATORS AT BOUNDARIES ��

0 0.5 1 1.5 2 2.5 30

0.2

0.4

0.6

0.8

1

1.2

κ x∆

2 Centralnd

4 Centralth

4 Padeth

aa

*_

Figure ���� Numerical phase speed for various schemes�

the fourth�order Pad�e scheme require �� and � PPW respectively to achieve thesame error level�

For our example using second�order centered dierences� the modi�ed wavenumberis purely real� but in the general case it can include an imaginary component as well�as shown in Eq� ����� In that case� the error in the phase speed is determined fromthe real part of the modi�ed wavenumber� while the imaginary part leads to an errorin the amplitude of the solution� as can be seen by inspecting Eq� ����� Thus theantisymmetric portion of the spatial dierence operator determines the error in speedand the symmetric portion the error in amplitude� This will be further discussed inSection �����

��� Di�erence Operators at Boundaries

As discussed in Section ������ a matrix dierence operator incorporates both thedierence approximation in the interior of the domain and that at the boundaries�In this section� we consider the boundary operators needed for our model equationsfor convection and diusion� In the case of periodic boundary conditions� no specialboundary operators are required�

Page 53: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

���� The Linear Convection Equation

Referring to Section ���� the boundary conditions for the linear convection equationcan be either periodic or of in�ow�out�ow type� In the latter case� a Dirichlet bound�ary condition is given at the in�ow boundary� while no condition is speci�ed at theout�ow boundary� Here we assume that the wave speed a is positive thus the left�hand boundary is the in�ow boundary� and the right�hand boundary is the out�owboundary� Thus the vector of unknowns is

�u � �u�� u�� � � � � uM �T ������

and u� is speci�ed�Consider �rst the in�ow boundary� It is clear that as long as the interior dierence

approximation does not extend beyond uj��� then no special treatment is requiredfor this boundary� For example� with second�order centered dierences we obtain

�x�u � A�u ���bc�

������

with

A ��

��x

������ �

�� ��� �

� � �

����� ���bc�

��

��x

�������u�

���

����� ������

However� if we use the fourth�order interior operator given in Eq� ����� then theapproximation at j � � requires a value of uj��� which is outside the domain� Hence�a dierent operator is required at j � � which extends only to j � �� while havingthe appropriate order of accuracy� Such an operator� known as a numerical boundaryscheme� can have an order of accuracy which is one order lower than that of theinterior scheme� and the global accuracy will equal that of the interior scheme� Forexample� with fourth�order centered dierences� we can use the following third�orderoperator at j � ��

��xu�� ��

��x���u� � �u� � �u� � u�� ������

which is easily derived using a Taylor table� The resulting dierence operator has theform of Eq� ���� with

A ��

���x

�������� �� ��� ��

� � ��� � �

����� ���bc�

��

���x

��������u�u� ���

����� ������

�Proof of this theorem is beyond the scope of this book the interested reader should consult theliterature for further details�

Page 54: Fundamentals of Computational Fluid Dynamics

���� DIFFERENCE OPERATORS AT BOUNDARIES ��

This approximation is globally fourth�order accurate�At the out�ow boundary� no boundary condition is speci�ed� We must approx�

imate �u��x at node M with no information about uM�� Thus the second�ordercentered�dierence operator� which requires uj�� cannot be used at j � M � Abackward�dierence formula must be used� With a second�order interior operator�the following �rst�order backward formula can be used�

��xu�M ��

�x�uM � uM��� �����

This produces a dierence operator with

A ��

��x

�����������

��� �

�� �� � �

�� ��� �

�����������

��bc�

��

��x

���������

�u� ���

�������� ������

In the case of a fourth�order centered interior operator the last two rows of A requiremodi�cation�

Another approach to the development of boundary schemes is in terms of spaceextrapolation� The following formula allows uM� to be extrapolated from the interiordata to arbitrary order on an equispaced grid�

��� E���puM� � ���� �

where E is the shift operator de�ned by Euj � uj� and the order of the approxima�tion is p� �� For example� with p � � we obtain

��� �E�� � E���uM� � uM� � �uM � uM�� � ������

which gives the following �rst�order approximation to uM��

uM� � �uM � uM�� ������

Substituting this into the second�order centered�dierence operator applied at nodeM gives

��xu�M ��

��x�uM� � uM��� �

��x��uM � uM�� � uM���

��

�x�uM � uM��� ������

which is identical to Eq� ����

Page 55: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

���� The Di�usion Equation

In solving the diusion equation� we must consider Dirichlet and Neumann boundaryconditions� The treatment of a Dirichlet boundary condition proceeds along the samelines as the in�ow boundary for the convection equation discussed above� With thesecond�order centered interior operator

��xxu�j ��

�x��uj� � �uj � uj��� ������

no modi�cations are required near boundaries� leading to the dierence operator givenin Eq� �����

For a Neumann boundary condition� we assume that �u��x is speci�ed at j �M � �� that is �

�u

�x

�M�

��u

�x

�b

������

Thus we design an operator at node M which is in the following form�

��xxu�M ��

�x��auM�� � buM� �

c

�x

��u

�x

�M�

������

where a� b� and c are constants which can easily be determined using a Taylor table�as shown in Table ����

���u

�x�

�j

��� �

�x��auj�� � buj� �

c

�x

��u

�x

�j�

� � �

�x� �x�� �x�� �x��uj

��u�x

�j

���u�x�

�j

���u�x�

�j

���u�x�

�j

�x� ����u�x�

�j

�a � uj�� �a �a � ���� � �� �a � ����� � �

� �a � ����� � �� �a � ����� � �

���b � uj �b��x � c �

��u�x

�j�

�c �c � ��� � �� �c � ���� � �

� �c � ���� � ��

Table ���� Taylor table for Neumann boundary condition�

Solving for a� b� and c� we obtain the following operator�

��xxu�M ��

��x���uM�� � �uM� �

��x

��u

�x

�M�

������

Page 56: Fundamentals of Computational Fluid Dynamics

���� PROBLEMS ��

which produces the dierence operator given in Eq� ����� Notice that this operatoris second�order accurate� In the case of a numerical approximation to a Neumannboundary condition� this is necessary to obtain a globally second�order accurate for�mulation� This contrasts with the numerical boundary schemes described previouslywhich can be one order lower than the interior scheme�

We can also obtain the operator in Eq� ���� using the space extrapolation idea�Consider a second�order backward�dierence approximation applied at node M � ���

�u

�x

�M�

��

��x�uM�� � �uM � �uM�� � O��x�� �����

Solving for uM� gives

uM� ��

�uM � uM�� � ��x

��u

�x

�M�

�� O��x�� ������

Substituting this into the second�order centered dierence operator for a secondderivative applied at node M gives

��xxu�M ��

�x��uM� � �uM � uM��� ��� �

��

��x�

�uM�� � �uM � �uM � uM�� � ��x

��u

�x

�M�

��

��x���uM�� � �uM� �

��x

��u

�x

�M�

�����

which is identical to Eq� �����

�� Problems

�� Derive a third�order �nite�dierence approximation to a �rst derivative in theform

��xu�j ��

�x�auj�� � buj�� � cuj � duj��

Find the leading error term�

�� Derive a �nite�dierence approximation to a �rst derivative in the form

a��xu�j�� � ��xu�j ��

�x�buj�� � cuj � duj��

Find the leading error term�

Page 57: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

�� Using a � �interior� point mesh� write out the ��� matrices and the boundary�condition vector formed by using the scheme derived in question � when bothu and �u��x are given at j � and u is given at j � ��

�� Repeat question � with d � �

�� Derive a �nite�dierence approximation to a third derivative in the form

��xxxu�j ��

�x��auj�� � buj�� � cuj � duj� � euj��

Find the leading error term�

�� Derive a compact �or Pad�e� �nite�dierence approximation to a second deriva�tive in the form

d��xxu�j�� � ��xxu�j � e��xxu�j� ��

�x��auj�� � buj � cuj��

Find the leading error term�

�� Find the modi�ed wavenumber for the operator derived in question �� Plot thereal and imaginary parts of ��x vs� �x for � �x � � Compare the realpart with that obtained from the fourth�order centered operator �Eq� ������

� Application of the second�derivative operator to the function ei�x gives

��ei�x

�x�� ��ei�x

Application of a dierence operator for the second derivative gives

��xxei�j�x�j � ���ei�x

thus de�ning the modi�ed wavenumber � for a second derivative approxima�tion� Find the modi�ed wavenumber for the second�order centered dierence op�erator for a second derivative� the noncompact fourth�order operator �Eq� ������and the compact fourth�order operator derived in question �� Plot ���x�� vs���x�� for � �x � �

�� Find the grid�points�per�wavelength �PPW � requirement to achieve a phasespeed error less than �� percent for sixth�order noncompact and compact cen�tered approximations to a �rst derivative�

Page 58: Fundamentals of Computational Fluid Dynamics

���� PROBLEMS ��

� � Consider the following one�sided dierencing schemes� which are �rst�� second��and third�order� respectively�

��xu�j � �uj � uj��� ��x

��xu�j � ��uj � �uj�� � uj��� ����x�

��xu�j � ���uj � �uj�� � �uj�� � �uj��� ����x�

Find the modi�ed wavenumber for each of these schemes� Plot the real andimaginary parts of ��x vs� �x for � �x � � Derive the two leadingterms in the truncation error for each scheme�

Page 59: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� FINITE�DIFFERENCE APPROXIMATIONS

Page 60: Fundamentals of Computational Fluid Dynamics

Chapter �

THE SEMI�DISCRETE

APPROACH

One strategy for obtaining �nite�dierence approximations to a PDE is to start bydierencing the space derivatives only� without approximating the time derivative�In the following chapters� we proceed with an analysis making considerable use ofthis concept� which we refer to as the semi�discrete approach� Dierencing the spacederivatives converts the basic PDE into a set of coupled ODE�s� In the most generalnotation� these ODE�s would be expressed in the form

d�u

dt� �F ��u� t� �����

which includes all manner of nonlinear and time�dependent possibilities� On occasion�we use this form� but the rest of this chapter is devoted to a more specialized matrixnotation described below�

Another strategy for constructing a �nite�dierence approximation to a PDE isto approximate all the partial derivatives at once� This generally leads to a pointdierence operator �see Section ������ which� in turn� can be used for the time advanceof the solution at any given point in the mesh� As an example let us consider themodel equation for diusion

�u

�t� �

��u

�x�

Using three�point central�dierencing schemes for both the time and space derivatives�we �nd

u�n��j � u

�n���j

�h� �

��u�n�j� � �u�n�j � u

�n�j��

�x�

�or

u�n��j � u

�n���j �

�h�

�x�

hu�n�j� � �u

�n�j � u

�n�j��

i�����

��

Page 61: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� THE SEMI�DISCRETE APPROACH

Clearly Eq� ��� is a dierence equation which can be used at the space point j toadvance the value of u from the previous time levels n and n � � to the level n � ��It is a full discretization of the PDE� Note� however� that the spatial and temporaldiscretizations are separable� Thus� this method has an intermediate semi�discreteform and can be analyzed by the methods discussed in the next few chapters�

Another possibility is to replace the value of u�n�j in the right hand side of Eq� ���

with the time average of u at that point� namely �u�n��j � u

�n���j ���� This results in

the formula

u�n��j � u

�n���j �

�h�

�x�

��u�n�j� � �

��u�n��j � u

�n���j

�A� u�n�j��

� �����

which can be solved for u�n�� and time advanced at the point j� In this case� thespatial and temporal discretizations are not separable� and no semi�discrete formexists�

Equation ��� is sometimes called Richardson�s method of overlapping steps andEq� ��� is referred to as the DuFort�Frankel method� As we shall see later on� thereare subtle points to be made about using these methods to �nd a numerical solutionto the diusion equation� There are a number of issues concerning the accuracy�stability� and convergence of Eqs� ��� and ��� which we cannot comment on until wedevelop a framework for such investigations� We introduce these methods here only todistinguish between methods in which the temporal and spatial terms are discretizedseparately and those for which no such separation is possible� For the time being� weshall separate the space dierence approximations from the time dierencing� In thisapproach� we reduce the governing PDE�s to ODE�s by discretizing the spatial termsand use the well�developed theory of ODE solutions to aid us in the development ofan analysis of accuracy and stability�

��� Reduction of PDEs to ODEs

����� The Model ODE�s

First let us consider the model PDE�s for diusion and biconvection described inChapter �� In these simple cases� we can approximate the space derivatives withdierence operators and express the resulting ODE�s with a matrix formulation� Thisis a simple and natural formulation when the ODE�s are linear�

Page 62: Fundamentals of Computational Fluid Dynamics

���� REDUCTION OF PDES TO ODES ��

Model ODE for Di�usion

For example� using the ��point central�dierencing scheme to represent the secondderivative in the scalar PDE governing diusion leads to the following ODE diusionmodel

d�u

dt�

�x�B������ ���u � ��bc� �����

with Dirichlet boundary conditions folded into the ��bc� vector�

Model ODE for Biconvection

The term biconvection was introduced in Section ���� It is used for the scalar con�vection model when the boundary conditions are periodic� In this case� the ��pointcentral�dierencing approximation produces the ODE model given by

d�u

dt� � a

��xBp���� � ���u �����

where the boundary condition vector is absent because the �ow is periodic�Eqs� ��� and ��� are the model ODE�s for diusion and biconvection of a scalar in

one dimension� They are linear with coe�cient matrices which are independent of xand t�

����� The Generic Matrix Form

The generic matrix form of a semi�discrete approximation is expressed by the equation

d�u

dt� A�u� �f�t� �����

Note that the elements in the matrix A depend upon both the PDE and the type ofdierencing scheme chosen for the space terms� The vector �f�t� is usually determinedby the boundary conditions and possibly source terms� In general� even the Eulerand Navier�Stokes equations can be expressed in the form of Eq� ���� In such casesthe equations are nonlinear� that is� the elements of A depend on the solution �u andare usually derived by �nding the Jacobian of a �ux vector� Although the equationsare nonlinear� the linear analysis presented in this book leads to diagnostics that aresurprisingly accurate when used to evaluate many aspects of numerical methods asthey apply to the Euler and Navier�Stokes equations�

Page 63: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� THE SEMI�DISCRETE APPROACH

��� Exact Solutions of Linear ODEs

In order to advance Eq� ��� in time� the system of ODE�s must be integrated using atime�marching method� In order to analyze time�marching methods� we will make useof exact solutions of coupled systems of ODE�s� which exist under certain conditions�The ODE�s represented by Eq� ��� are said to be linear if F is linearly dependent onu �i�e�� if �F��u � A where A is independent of u�� As we have already pointed out�when the ODE�s are linear they can be expressed in a matrix notation as Eq� ��� inwhich the coe�cient matrix� A� is independent of u� If A does depend explicitly ont� the general solution cannot be written whereas� if A does not depend explicitly ont� the general solution to Eq� ��� can be written� This holds regardless of whether ornot the forcing function� �f � depends explicitly on t�

As we shall soon see� the exact solution of Eq� ��� can be written in terms ofthe eigenvalues and eigenvectors of A� This will lead us to a representative scalarequation for use in analyzing time�marching methods� These ideas are developed inthe following sections�

����� Eigensystems of Semi�Discrete Linear Forms

Complete Systems

An M �M matrix is represented by a complete eigensystem if it has a complete setof linearly independent eigenvectors �see Appendix A� � An eigenvector� �xm� and itscorresponding eigenvalue� �m� have the property that

A�xm � �m�xm or

�A� �mI��xm � �����

The eigenvalues are the roots of the equation

det�A� �I� �

We form the right�hand eigenvector matrix of a complete system by �lling its columnswith the eigenvectors �xm�

X �h�x� � �x� � � � � �xM

iThe inverse is the left�hand eigenvector matrix� and together they have the propertythat

X��AX � " ����

where " is a diagonal matrix whose elements are the eigenvalues of A�

Page 64: Fundamentals of Computational Fluid Dynamics

���� EXACT SOLUTIONS OF LINEAR ODES ��

Defective Systems

If an M�M matrix does not have a complete set of linearly independent eigenvectors�it cannot be transformed to a diagonal matrix of scalars� and it is said to be defective�It can� however� be transformed to a diagonal set of blocks� some of which may bescalars �see Appendix A�� In general� there exists some S which transforms anymatrix A such that

S��AS � J

where

J �

��������

J�J�

� � �

Jm� � �

�������and

J �n�m �

�������m �

�m� � �� � � �

�m

������������n

The matrix J is said to be in Jordan canonical form� and an eigenvalue with multi�plicity n within a Jordan block is said to be a defective eigenvalue� Defective systemsplay a role in numerical stability analysis�

����� Single ODE�s of First� and Second�Order

First�Order Equations

The simplest nonhomogeneous ODE of interest is given by the single� �rst�orderequation

du

dt� �u � ae�t �����

where �� a� and � are scalars� all of which can be complex numbers� The equationis linear because � does not depend on u� and has a general solution because � doesnot depend on t� It has a steady�state solution if the right�hand side is independentof t� i�e�� if � � � and is homogeneous if the forcing function is zero� i�e�� if a � �Although it is quite simple� the numerical analysis of Eq� ��� displays many of thefundamental properties and issues involved in the construction and study of mostpopular time�marching methods� This theme will be developed as we proceed�

Page 65: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� THE SEMI�DISCRETE APPROACH

The exact solution of Eq� ��� is� for � � ��

u�t� � c�e�t �

ae�t

�� �

where c� is a constant determined by the initial conditions� In terms of the initialvalue of u� it can be written

u�t� � u� �e�t � ae�t � e�t

�� �

The interesting question can arise� What happens to the solution of Eq� ��� when� � �� This is easily found by setting � � � � � solving� and then taking the limitas � � Using this limiting device� we �nd that the solution to

du

dt� �u � ae�t ���� �

is given by

u�t� � �u� � � at�e�t

As we shall soon see� this solution is required for the analysis of defective systems�

Second�Order Equations

The homogeneous form of a second�order equation is given by

d�u

dt�� a�

du

dt� a�u � ������

where a� and a� are complex constants� Now we introduce the dierential operatorD such that

D � d

dt

and factor u�t� out of Eq� ����� giving

�D� � a�D � a�� u�t� �

The polynomial in D is referred to as a characteristic polynomial and designatedP �D�� Characteristic polynomials are fundamental to the analysis of both ODE�s andO�E�s� since the roots of these polynomials determine the solutions of the equations�For ODE�s� we often label these roots in order of increasing modulus as ��� ��� � � �� �m�

Page 66: Fundamentals of Computational Fluid Dynamics

���� EXACT SOLUTIONS OF LINEAR ODES ��

� � �� �M � They are found by solving the equation P ��� � � In our simple example�there would be two roots� �� and ��� determined from

P ��� � �� � a�� � a� � ������

and the solution to Eq� ���� is given by

u�t� � c�e��t � c�e

��t ������

where c� and c� are constants determined from initial conditions� The proof of thisis simple and is found by substituting Eq� ���� into Eq� ����� One �nds the result

c�e��t���� � a��� � a�� � c�e

��t���� � a��� � a��

which is identically zero for all c�� c�� and t if and only if the ��s satisfy Eq� �����

����� Coupled First�Order ODE�s

A Complete System

A set of coupled� �rst�order� homogeneous equations is given by

u�� � a�� u� � a�� u�

u�� � a�� u� � a�� u� ������

which can be written

�u�� A�u � �u � �u�� u��

T � A � �aij� �

a�� a��a�� a��

�Consider the possibility that a solution is represented by

u� � c� x��e��t � c� x��e

��t

u� � c� x��e��t � c� x��e

��t ������

By substitution� these are indeed solutions to Eq� ���� if and only ifa�� a��a�� a��

� x��x��

�� ��

x��x��

��

a�� a��a�� a��

� x��x��

�� ��

x��x��

�������

Notice that a higher�order equation can be reduced to a coupled set of �rst�orderequations by introducing a new set of dependent variables� Thus� by setting

u� � u� � u� � u �

we �nd Eq� ���� can be written

u�� � �a�u� � a�u�

u�� � u� ������

which is a subset of Eq� �����

Page 67: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� THE SEMI�DISCRETE APPROACH

A Derogatory System

Eq� ���� is still a solution to Eq� ���� if �� � �� � �� provided two linearly independentvectors exist to satisfy Eq� ���� with A � "� In this case

�� �

� ��

�� �

��

�and

�� �

� � �

�� �

� �

provide such a solution� This is the case where A has a complete set of eigenvectorsand is not defective�

A Defective System

If A is defective� then it can be represented by the Jordan canonical formu��u��

��

� � �

� u�u�

������

whose solution is not obvious� However� in this case� one can solve the top equation�rst� giving u��t� � u�� �e�t� Then� substituting this result into the second equation�one �nds

du�dt

� �u� � u�� �e�t

which is identical in form to Eq� ��� and has the solution

u��t� � �u�� � � u�� �t�e�t

From this the reader should be able to verify that

u��t� ��a � bt � ct�

�e�t

is a solution to ��� u��

u��u��

�� �

����� �� �

����� u�u�u�

��if

a � u�� � � b � u�� � � c ��

�u�� � ������

The general solution to such defective systems is left as an exercise�

Page 68: Fundamentals of Computational Fluid Dynamics

���� EXACT SOLUTIONS OF LINEAR ODES ��

����� General Solution of Coupled ODE�s with Complete Eigen�

systems

Let us consider a set of coupled� nonhomogeneous� linear� �rst�order ODE�s withconstant coe�cients which might have been derived by space dierencing a set ofPDE�s� Represent them by the equation

d�u

dt� A�u� �f�t� ���� �

Our assumption is that the M �M matrix A has a complete eigensystem� and canbe transformed by the left and right eigenvector matrices� X�� and X� to a diagonalmatrix " having diagonal elements which are the eigenvalues of A� see Section ������Now let us multiply Eq� ��� from the left by X�� and insert the identity combinationXX�� � I between A and �u� There results

X��d�u

dt� X��AX �X���u�X���f�t� ������

Since A is independent of both �u and t� the elements in X�� and X are also indepen�dent of both �u and t� and Eq� ���� can be modi�ed to

d

dtX���u � "X���u�X���f�t�

Finally� by introducing the new variables �w and �g such that

�w � X���u � �g�t� � X���f�t� ������

we reduce Eq� ��� to a new algebraic form

d�w

dt� "�w � �g�t� ������

It is important at this point to review the results of the previous paragraph� Noticethat Eqs� ��� and ���� are expressing exactly the same equality� The only dierencebetween them was brought about by algebraic manipulations which regrouped thevariables� However� this regrouping is crucial for the solution process because Eqs�

�In the following� we exclude defective systems� not because they cannot be analyzed �the exampleat the conclusion of the previous section proves otherwise�� but because they are only of limitedinterest in the general development of our theory�

Page 69: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� THE SEMI�DISCRETE APPROACH

���� are no longer coupled� They can be written line by line as a set of independent�single� �rst�order equations� thus

w�� � ��w� � g��t�

���

w�m � �mwm � gm�t�

���

w�M � �MwM � gM�t� ������

For any given set of gm�t� each of these equations can be solved separately and thenrecoupled� using the inverse of the relations given in Eqs� �����

�u�t� � X�w�t�

�MXm��

wm�t��xm ������

where �xm is the m�th column of X� i�e�� the eigenvector corresponding to �m�We next focus on the very important subset of Eq� ��� when neither A nor �f has

any explicit dependence on t� In such a case� the gm in Eqs� ���� and ���� are alsotime invariant and the solution to any line in Eq� ���� is

wm�t� � cme�mt �

�mgm

where the cm are constants that depend on the initial conditions� Transforming backto the u�system gives

�u�t� � X�w�t�

�MXm��

wm�t��xm

�MXm��

cme�mt �xm �

MXm��

�mgm�xm

�MXm��

cme�mt �xm � X"��X���f

�MXm��

cme�mt �xm � A���f

�z �Transient

�z �Steady�state

������

Page 70: Fundamentals of Computational Fluid Dynamics

���� REAL SPACE AND EIGENSPACE ��

Note that the steady�state solution is A���f � as might be expected�The �rst group of terms on the right side of this equation is referred to classically

as the complementary solution or the solution of the homogeneous equations� Thesecond group is referred to classically as the particular solution or the particularintegral� In our application to �uid dynamics� it is more instructive to refer to thesegroups as the transient and steady�state solutions� respectively� An alternative� butentirely equivalent� form of the solution is

�u�t� � c�e��t �x� � � � �� cme

�mt �xm � � � �� cMe�M t �xM � A���f ������

��� Real Space and Eigenspace

����� De�nition

Following the semi�discrete approach discussed in Section ���� we reduce the partialdierential equations to a set of ordinary dierential equations represented by thegeneric form

d�u

dt� A�u� �f �����

The dependent variable �u represents some physical quantity or quantities which relateto the problem of interest� For the model problems on which we are focusing mostof our attention� the elements of A are independent of both u and t� This permitsus to say a great deal about such problems and serves as the basis for this section�In particular� we can develop some very important and fundamental concepts thatunderly the global properties of the numerical solutions to the model problems� Howthese relate to the numerical solutions of more practical problems depends upon theproblem and� to a much greater extent� on the cleverness of the relator�

We begin by developing the concept of �spaces�� That is� we identify dierentmathematical reference frames �spaces� and view our solutions from within each�In this way� we get dierent perspectives of the same solution� and this can addsigni�cantly to our understanding�

The most natural reference frame is the physical one� We say

If a solution is expressed in terms of �u� it is saidto be in real space�

There is� however� another very useful frame� We saw in Sections ����� and ��� thatpre� and post�multiplication of A by the appropriate similarity matrices transforms Ainto a diagonal matrix� composed� in the most general case� of Jordan blocks or� in the

Page 71: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� THE SEMI�DISCRETE APPROACH

simplest nondefective case� of scalars� Following Section ��� and� for simplicity� usingonly complete systems for our examples� we found that Eq� ��� had the alternativeform

d�w

dt� "�w � �g

which is an uncoupled set of �rst�order ODE�s that can be solved independently forthe dependent variable vector �w� We say

If a solution is expressed in terms of �w� it is said tobe in eigenspace �often referred to as wave space��

The relations that transfer from one space to the other are�

�w � X���u�g � X���f

�u � X�w�f � X�g

The elements of �u relate directly to the local physics of the problem� However� theelements of �w are linear combinations of all of the elements of �u� and individuallythey have no direct local physical interpretation�

When the forcing function �f is independent of t� the solutions in the two spacesare represented by

�u�t� �X

cme�mt �xm � X"��X���f

and

wm�t� � cme�mt �

�mgm m � �� �� � � � �M

for real space and eigenspace� respectively� At this point we make two observations�

�� the transient portion of the solution in real space consists of a linear combinationof contributions from each eigenvector� and

�� the transient portion of the solution in eigenspace provides the weighting ofeach eigenvector component of the transient solution in real space�

����� Eigenvalue Spectrums for Model ODE�s

It is instructive to consider the eigenvalue spectrums of the ODE�s formulated bycentral dierencing the model equations for diusion and biconvection� These modelODE�s are presented in Section ���� Equations for the eigenvalues of the simple

Page 72: Fundamentals of Computational Fluid Dynamics

���� REAL SPACE AND EIGENSPACE ��

tridiagonals� B�M � a� b� c� and Bp�M � a� b� c�� are given in Appendix B� From SectionB��� we �nd for the model diusion equation with Dirichlet boundary conditions

�m ��

�x�

��� � � cos

�m

M � �

���

���

�x�sin�

�m

��M � ��

� m � �� �� � � � �M ������

and� from Section B��� for the model biconvection equation

�m ��ia�x

sin�

�m

M

�m � � �� � � � �M � �

� �i�ma m � � �� � � � �M � � ���� �

where

�m �sinm�x

�xm � � �� � � � �M � � ������

is the modi�ed wavenumber from Section ���� m � m� and �x � � �M � Noticethat the diusion eigenvalues are real and negative while those representing periodicconvection are all pure imaginary� The interpretation of this result plays a veryimportant role later in our stability analysis�

����� Eigenvectors of the Model Equations

Next we consider the eigenvectors of the two model equations� These follow as specialcases from the results given in Appendix B�

The Di�usion Model

Consider Eq� ���� the model ODE�s for diusion� First� to help visualize the matrixstructure� we present results for a simple ��point mesh and then we give the generalcase� The right�hand eigenvector matrix X is given by�����

sin �x�� sin ��x�� sin ��x�� sin ��x��sin �x�� sin ��x�� sin ��x�� sin ��x��sin �x�� sin ��x�� sin ��x�� sin ��x��sin �x�� sin ��x�� sin ��x�� sin ��x��

����The columns of the matrix are proportional to the eigenvectors� Recall that xj �j�x � j ��M � ��� so in general the relation �u � X �w can be written as

uj �MXm��

wm sinmxj j � �� �� � � � �M ������

Page 73: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� THE SEMI�DISCRETE APPROACH

For the inverse� or left�hand eigenvector matrix X��� we �nd

�����sin �x�� sin �x�� sin �x�� sin �x��sin ��x�� sin ��x�� sin ��x�� sin ��x��sin ��x�� sin ��x�� sin ��x�� sin ��x��sin ��x�� sin ��x�� sin ��x�� sin ��x��

����The rows of the matrix are proportional to the eigenvectors� In general �w � X���ugives

wm �MXj��

uj sinmxj m � �� �� � � � �M ������

In the �eld of harmonic analysis� Eq� ���� represents a sine transform of the func�tion u�x� for an M �point sample between the boundaries x � and x � with thecondition u� � � u� � � � Similarly� Eq� ���� represents the sine synthesis thatcompanions the sine transform given by Eq� ����� In summary�

For the model diusion equation�

�w � X���u is a sine transform from real space to �sine� wavespace�

�u � X�w is a sine synthesis from wave space back to realspace�

The Biconvection Model

Next consider the model ODE�s for periodic convection� Eq� ���� The coe�cientmatrices for these ODE�s are always circulant� For our model ODE� the right�handeigenvectors are given by

�xm � ei j ���m�M��j � � �� � � � �M � �m � � �� � � � �M � �

With xj � j ��x � j � � �M � we can write �u � X �w as

uj �M��Xm��

wmeimxj j � � �� � � � �M � � ������

Page 74: Fundamentals of Computational Fluid Dynamics

���� REAL SPACE AND EIGENSPACE ��

For a ��point periodic mesh� we �nd the following left�hand eigenvector matrixfrom Appendix B��������

w�

w�

w�

w�

���� ��

������ � � �� e��i��� e��i��� e��i���

� e��i��� e��i��� e���i���

� e��i��� e���i��� e���i���

���������u�u�u�u�

���� � X���u

In general

wm ��

M

M��Xj��

uje�imxj m � � �� � � � �M � �

This equation is identical to a discrete Fourier transform of the periodic dependentvariable �u using an M �point sample between and including x � and x � � ��x�

For circulant matrices� it is straightforward to establish the fact that the relation�u � X�w represents the Fourier synthesis of the variable �w back to �u� In summary�

For any circulant system�

�w � X���u is a complex Fourier transform from real space towave space�

�u � X�w is a complex Fourier synthesis from wave spaceback to real space�

����� Solutions of the Model ODE�s

We can now combine the results of the previous sections to write the solutions of ourmodel ODE�s�

The Di�usion Equation

For the diusion equation� Eq� ���� becomes

uj�t� �MXm��

cme�mt sinmxj � �A��f�j� j � �� �� � � � �M ������

where

�m ����

�x�sin�

�m

��M � ��

�������

Page 75: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� THE SEMI�DISCRETE APPROACH

With the modi�ed wavenumber de�ned as

�m ��

�xsin

�m�x

�������

and using m � m� we can write the ODE solution as

uj�t� �MXm��

cme����m

�t sinmxj � �A��f�j� j � �� �� � � � �M �����

This can be compared with the exact solution to the PDE� Eq� ����� evaluated at thenodes of the grid�

uj�t� �MXm��

cme���m�t sinmxj � h�xj�� j � �� �� � � � �M ������

We see that the solutions are identical except for the steady solution and themodi�ed wavenumber in the transient term� The modi�ed wavenumber is an approx�imation to the actual wavenumber� The dierence between the modi�ed wavenumberand the actual wavenumber depends on the dierencing scheme and the grid resolu�tion� This dierence causes the various modes �or eigenvector components� to decayat rates which dier from the exact solution� With conventional dierencing schemes�low wavenumber modes are accurately represented� while high wavenumber modes �ifthey have signi�cant amplitudes� can have large errors�

The Convection Equation

For the biconvection equation� we obtain

uj�t� �M��Xm��

cme�mtei�mxj � j � � �� � � � �M � � ���� �

where

�m � �i�ma ������

with the modi�ed wavenumber de�ned in Eq� ����� We can write this ODE solutionas

uj�t� �M��Xm��

cme�i��matei�mxj � j � � �� � � � �M � � ������

Page 76: Fundamentals of Computational Fluid Dynamics

���� THE REPRESENTATIVE EQUATION ��

and compare it to the exact solution of the PDE� Eq� ����� evaluated at the nodes ofthe grid�

uj�t� �M��Xm��

fm� �e�i�matei�mxj � j � � �� � � � �M � � ������

Once again the dierence appears through the modi�ed wavenumber contained in�m� As discussed in Section ���� this leads to an error in the speed with which variousmodes are convected� since � is real� Since the error in the phase speed depends onthe wavenumber� while the actual phase speed is independent of the wavenumber�the result is erroneous numerical dispersion� In the case of non�centered dierencing�discussed in Chapter ��� the modi�ed wavenumber is complex� The form of Eq� ����shows that the imaginary portion of the modi�ed wavenumber produces nonphysicaldecay or growth in the numerical solution�

��� The Representative Equation

In Section ���� we pointed out that Eqs� ��� and ���� express identical results but interms of dierent groupings of the dependent variables� which are related by algebraicmanipulation� This leads to the following important concept�

The numerical solution to a set of linear ODE�s �in which A isnot a function of t� is entirely equivalent to the solution obtainedif the equations are transformed to eigenspace� solved there intheir uncoupled form� and then returned as a coupled set to realspace�

The importance of this concept resides in its message that we can analyze time�marching methods by applying them to a single� uncoupled equation and our con�clusions will apply in general� This is helpful both in analyzing the accuracy oftime�marching methods and in studying their stability� topics which are covered inChapters � and ��

Our next objective is to �nd a �typical� single ODE to analyze� We found theuncoupled solution to a set of ODE�s in Section ���� A typical member of the familyis

dwm

dt� �mwm � gm�t� ������

The goal in our analysis is to study typical behavior of general situations� not partic�ular problems� For such a purpose Eq� ���� is not quite satisfactory� The role of �m isclear it stands for some representative eigenvalue in the original A matrix� However�

Page 77: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� THE SEMI�DISCRETE APPROACH

the question is� What should we use for gm�t� when the time dependence cannot beignored� To answer this question� we note that� in principle� one can express any oneof the forcing terms gm�t� as a �nite Fourier series� For example

�g�t� �Xk

akeikt

for which Eq� ���� has the exact solution�

w�t� � ce�t �Xk

akeikt

ik � �

From this we can extract the k�th term and replace ik with �� This leads to

The Representative ODE

dw

dt� �w � ae�t

������

which can be used to evaluate all manner of time�marching methods� In such evalua�tions the parameters � and � must be allowed to take the worst possible combinationof values that might occur in the ODE eigensystem� The exact solution of the repre�sentative ODE is �for � � ���

w�t� � ce�t �ae�t

�� �������

��� Problems

�� Consider the �nite�dierence operator derived in question � of Chapter �� Usingthis operator to approximate the spatial derivative in the linear convection equa�tion� write the semi�discrete form obtained with periodic boundary conditionson a ��point grid �M � ���

�� Consider the application of the operator given in Eq� ���� to the ��D diusionequation with Dirichlet boundary conditions� Write the resulting semi�discreteODE form� Find the entries in the boundary�condition vector�

�� Write the semi�discrete form resulting from the application of second�order cen�tered dierences to the following equation on the domain � x � � withboundary conditions u� � � � u��� � ��

�u

�t�

��u

�x�� �x

Page 78: Fundamentals of Computational Fluid Dynamics

���� PROBLEMS ��

�� Consider a grid with � interior points spanning the domain � x � � Forinitial conditions u�x� � � sin�mx� and boundary conditions u� � t� � u� � t� � � plot the exact solution of the diusion equation with � � � at t � � withm � � and m � �� �Plot the solution at the grid nodes only�� Calculate thecorresponding modi�ed wavenumbers for the second�order centered operatorfrom Eq� ����� Calculate and plot the corresponding ODE solutions�

�� Consider the matrix

A � �Bp�� ���� � ������x�

corresponding to the ODE form of the biconvection equation resulting from theapplication of second�order central dierencing on a � �point grid� Note thatthe domain is � x � � and �x � � �� � The grid nodes are given byxj � j�x� j � � �� � � � �� The eigenvalues of the above matrix A� as well as thematrices X and X��� can be found from Appendix B��� Using these� computeand plot the ODE solution at t � � for the initial condition u�x� � � sinx�Compare with the exact solution of the PDE� Calculate the numerical phasespeed from the modi�ed wavenumber corresponding to this initial conditionand show that it is consistent with the ODE solution� Repeat for the initialcondition u�x� � � sin �x�

Page 79: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� THE SEMI�DISCRETE APPROACH

Page 80: Fundamentals of Computational Fluid Dynamics

Chapter �

FINITE�VOLUME METHODS

In Chapter �� we saw how to derive �nite�dierence approximations to arbitraryderivatives� In Chapter �� we saw that the application of a �nite�dierence approxi�mation to the spatial derivatives in our model PDE�s produces a coupled set of ODE�s�In this Chapter� we will show how similar semi�discrete forms can be derived using�nite�volume approximations in space� Finite�volume methods have become popu�lar in CFD as a result� primarily� of two advantages� First� they ensure that thediscretization is conservative� i�e�� mass� momentum� and energy are conserved in adiscrete sense� While this property can usually be obtained using a �nite�dierenceformulation� it is obtained naturally from a �nite�volume formulation� Second� �nite�volume methods do not require a coordinate transformation in order to be applied onirregular meshes� As a result� they can be applied on unstructured meshes consistingof arbitrary polyhedra in three dimensions or arbitrary polygons in two dimensions�This increased �exibility can be used to great advantage in generating grids aboutarbitrary geometries�

Finite�volume methods are applied to the integral form of the governing equations�either in the form of Eq� ��� or Eq� ���� Consistent with our emphasis on semi�discretemethods� we will study the latter form� which is

d

dt

ZV �t�

QdV �IS�t�

n�FdS �ZV �t�

PdV �����

We will begin by presenting the basic concepts which apply to �nite�volume strategies�Next we will give our model equations in the form of Eq� ���� This will be followedby several examples which hopefully make these concepts clear�

��

Page 81: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�VOLUME METHODS

��� Basic Concepts

The basic idea of a �nite�volume method is to satisfy the integral form of the con�servation law to some degree of approximation for each of many contiguous controlvolumes which cover the domain of interest� Thus the volume V in Eq� ��� is that of acontrol volume whose shape is dependent on the nature of the grid� In our examples�we will consider only control volumes which do not vary with time� Examining Eq����� we see that several approximations must be made� The �ux is required at theboundary of the control volume� which is a closed surface in three dimensions and aclosed contour in two dimensions� This �ux must then be integrated to �nd the net�ux through the boundary� Similarly� the source term P must be integrated over thecontrol volume� Next a time�marching method� can be applied to �nd the value ofZ

VQdV �����

at the next time step�

Let us consider these approximations in more detail� First� we note that theaverage value of Q in a cell with volume V is

%Q � �

V

ZVQdV �����

and Eq� ��� can be written as

Vd

dt%Q �

ISn�FdS �

ZVPdV �����

for a control volume which does not vary with time� Thus after applying a time�marching method� we have updated values of the cell�averaged quantities %Q� In orderto evaluate the �uxes� which are a function of Q� at the control�volume boundary� Qcan be represented within the cell by some piecewise approximation which producesthe correct value of %Q� This is a form of interpolation often referred to as recon�struction� As we shall see in our examples� each cell will have a dierent piecewiseapproximation to Q� When these are used to calculate F�Q�� they will generallyproduce dierent approximations to the �ux at the boundary between two controlvolumes� that is� the �ux will be discontinuous� A nondissipative scheme analogousto centered dierencing is obtained by taking the average of these two �uxes� Anotherapproach known as �ux�dierence splitting is described in Chapter ���

The basic elements of a �nite�volume method are thus the following�

�Timemarching methods will be discussed in the next chapter�

Page 82: Fundamentals of Computational Fluid Dynamics

���� MODEL EQUATIONS IN INTEGRAL FORM ��

�� Given the value of %Q for each control volume� construct an approximation toQ�x� y� z� in each control volume� Using this approximation� �nd Q at thecontrol�volume boundary� Evaluate F�Q� at the boundary� Since there is adistinct approximation to Q�x� y� z� in each control volume� two distinct valuesof the �ux will generally be obtained at any point on the boundary between twocontrol volumes�

�� Apply some strategy for resolving the discontinuity in the �ux at the control�volume boundary to produce a single value of F�Q� at any point on the bound�ary� This issue is discussed in Section �������

�� Integrate the �ux to �nd the net �ux through the control�volume boundaryusing some sort of quadrature�

�� Advance the solution in time to obtain new values of %Q�

The order of accuracy of the method is dependent on each of the approximations�These ideas should be clari�ed by the examples in the remainder of this chapter�

In order to include diusive �uxes� the following relation between rQ and Q issometimes used� Z

VrQdV �

ISnQdS �����

or� in two dimensions� ZArQdA �

ICnQdl �����

where the unit vector n points outward from the surface or contour�

��� Model Equations in Integral Form

���� The Linear Convection Equation

A two�dimensional form of the linear convection equation can be written as

�u

�t� a cos �

�u

�x� a sin �

�u

�y� �����

This PDE governs a simple plane wave convecting the scalar quantity� u�x� y� t� withspeed a along a straight line making an angle � with respect to the x�axis� Theone�dimensional form is recovered with � � �

Page 83: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�VOLUME METHODS

For unit speed a� the two�dimensional linear convection equation is obtained fromthe general divergence form� Eq� ���� with

Q � u ����

F � iu cos � � ju sin � �����

P � ���� �

Since Q is a scalar� F is simply a vector� Substituting these expressions into a two�dimensional form of Eq� ��� gives the following integral form

d

dt

ZAudA �

ICn��iu cos � � ju sin ��ds � ������

where A is the area of the cell which is bounded by the closed contour C�

���� The Di�usion Equation

The integral form of the two�dimensional diusion equation with no source term andunit diusion coe�cient � is obtained from the general divergence form� Eq� ���� with

Q � u ������

F � �ru ������

� ��i�u

�x� j

�u

�y

�������

P � ������

Using these� we �ndd

dt

ZAudA �

ICn�

�i�u

�x� j

�u

�y

�ds ������

to be the integral form of the two�dimensional diusion equation�

��� One�Dimensional Examples

We restrict our attention to a scalar dependent variable u and a scalar �ux f � as inthe model equations� We consider an equispaced grid with spacing �x� The nodes ofthe grid are located at xj � j�x as usual� Control volume j extends from xj ��x��to xj � �x��� as shown in Fig� ���� We will use the following notation�

xj���� � xj ��x��� xj��� � xj � �x�� ������

Page 84: Fundamentals of Computational Fluid Dynamics

���� ONE�DIMENSIONAL EXAMPLES ��

j j+1j-1 j+2j-2

j-1/2 j+1/2

∆ x

L RL R

Figure ���� Control volume in one dimension�

uj���� � u�xj������ fj���� � f�uj����� �����

With these de�nitions� the cell�average value becomes

%uj�t� � �

�x

Z xj����

xj����

u�x� t�dx ������

and the integral form becomes

d

dt��x%uj� � fj��� � fj���� �

Z xj����

xj����

Pdx ���� �

Now with � � x� xj� we can expand u�x� in Eq� ���� in a Taylor series about xj�with t �xed� to get

%uj � �

�x

Z �x��

��x��

��uj � �

��u

�x

�j

���

���u

�x�

�j

���

���u

�x�

�j

� � � �

� d�� uj �

�x�

��

���u

�x�

�j

��x�

���

���u

�x�

�j

� O��x�� ������

or

%uj � uj � O��x�� ������

where uj is the value at the center of the cell� Hence the cell�average value and thevalue at the center of the cell dier by a term of second order�

���� A Second�Order Approximation to the Convection Equa�

tion

In one dimension� the integral form of the linear convection equation� Eq� ����� be�comes

�xd%ujdt

� fj��� � fj���� � ������

Page 85: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� FINITE�VOLUME METHODS

with f � u� We choose a piecewise constant approximation to u�x� in each cell suchthat

u�x� � %uj xj���� � x � xj��� ������

Evaluating this at j � ��� gives

fLj��� � f�uLj���� � uLj��� � %uj ������

where the L indicates that this approximation to fj��� is obtained from the approx�imation to u�x� in the cell to the left of xj���� as shown in Fig� ���� The cell to theright of xj���� which is cell j � �� gives

fRj��� � %uj� ������

Similarly� cell j is the cell to the right of xj����� giving

fRj���� � %uj ������

and cell j � � is the cell to the left of xj����� giving

fLj���� � %uj�� �����

We have now accomplished the �rst step from the list in Section ��� we have de�nedthe �uxes at the cell boundaries in terms of the cell�average data� In this example�the discontinuity in the �ux at the cell boundary is resolved by taking the average ofthe �uxes on either side of the boundary� Thus

&fj��� ��

��fLj��� � fRj���� �

��%uj � %uj�� ������

and

&fj���� ��

��fLj���� � fRj����� �

��%uj�� � %uj� ���� �

where &f denotes a numerical �ux which is an approximation to the exact �ux�Substituting Eqs� ���� and ��� into the integral form� Eq� ����� we obtain

�xd%ujdt

��

��%uj � %uj��� �

��%uj�� � %uj� � �x

d%ujdt

��

��%uj� � %uj��� � ������

With periodic boundary conditions� this point operator produces the following semi�discrete form�

d�%u

dt� � �

��xBp���� � ���%u ������

Page 86: Fundamentals of Computational Fluid Dynamics

���� ONE�DIMENSIONAL EXAMPLES ��

This is identical to the expression obtained using second�order centered dierences�except it is written in terms of the cell average �%u� rather than the nodal values� �u�Hence our analysis and understanding of the eigensystem of the matrix Bp���� � ��is relevant to �nite�volume methods as well as �nite�dierence methods� Since theeigenvalues of Bp���� � �� are pure imaginary� we can conclude that the use of theaverage of the �uxes on either side of the cell boundary� as in Eqs� ���� and ��� � canlead to a nondissipative �nite�volume method�

���� A Fourth�Order Approximation to the Convection Equa�

tion

Let us replace the piecewise constant approximation in Section ����� with a piecewisequadratic approximation as follows

u��� � a�� � b� � c ������

where � is again equal to x � xj� The three parameters a� b� and c are chosen tosatisfy the following constraints�

�x

Z ��x��

���x��u���d� � %uj��

�x

Z �x��

��x��u���d� � %uj ������

�x

Z ��x��

�x��u���d� � %uj�

These constraints lead to

a �%uj� � �%uj � %uj��

��x�

b �%uj� � %uj��

��x������

c ��%uj�� � ��%uj � %uj�

��

With these values of a� b� and c� the piecewise quadratic approximation producesthe following values at the cell boundaries�

uLj��� ��

���%uj� � �%uj � %uj��� ������

Page 87: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� FINITE�VOLUME METHODS

uRj���� ��

���%uj� � �%uj � �%uj��� ������

uRj��� ��

���%uj� � �%uj� � �%uj� �����

uLj���� ��

���%uj � �%uj�� � %uj��� ������

using the notation de�ned in Section ������ Recalling that f � u� we again use theaverage of the �uxes on either side of the boundary to obtain

&fj��� ��

��f�uLj���� � f�uRj�����

��

����%uj� � �%uj� � �%uj � %uj��� ���� �

and

&fj���� ��

��f�uLj����� � f�uRj������

��

����%uj� � �%uj � �%uj�� � %uj��� ������

Substituting these expressions into the integral form� Eq� ����� gives

�xd%ujdt

��

����%uj� � %uj� � %uj�� � %uj��� � ������

This is a fourth�order approximation to the integral form of the equation� as can beveri�ed using Taylor series expansions �see question � at the end of this chapter��With periodic boundary conditions� the following semi�discrete form is obtained�

d�%u

dt� � �

���xBp����� � �����%u ������

This is a system of ODE�s governing the evolution of the cell�average data�

���� A Second�Order Approximation to the Di�usion Equa�

tion

In this section� we describe two approaches to deriving a �nite�volume approximationto the diusion equation� The �rst approach is simpler to extend to multidimensions�while the second approach is more suited to extension to higher order accuracy�

Page 88: Fundamentals of Computational Fluid Dynamics

���� ONE�DIMENSIONAL EXAMPLES ��

In one dimension� the integral form of the diusion equation� Eq� ����� becomes

�xd%ujdt

� fj��� � fj���� � ������

with f � �ru � ��u��x� Also� Eq� ��� becomesZ b

a

�u

�xdx � u�b�� u�a� ������

We can thus write the following expression for the average value of the gradient of uover the interval xj � x � xj��

�x

Z xj��

xj

�u

�xdx �

�x�uj� � uj� ������

From Eq� ����� we know that the value of a continuous function at the center of a giveninterval is equal to the average value of the function over the interval to second�orderaccuracy� Hence� to second�order� we can write

&fj��� � ���u

�x

�j���

� � �

�x�%uj� � %uj� ������

Similarly�

&fj���� � � �

�x�%uj � %uj��� �����

Substituting these into the integral form� Eq� ����� we obtain

�xd%ujdt

��

�x�%uj�� � �%uj � %uj�� ������

or� with Dirichlet boundary conditions�

d�%u

dt�

�x�B������ ���%u�

��bc�

���� �

This provides a semi�discrete �nite�volume approximation to the diusion equation�and we see that the properties of the matrix B������ �� are relevant to the study of�nite�volume methods as well as �nite�dierence methods�

For our second approach� we use a piecewise quadratic approximation as in Section������ From Eq� ���� we have

�u

�x��u

��� �a� � b ������

Page 89: Fundamentals of Computational Fluid Dynamics

CHAPTER �� FINITE�VOLUME METHODS

with a and b given in Eq� ����� With f � ��u��x� this gives

fRj��� � fLj��� � � �

�x�%uj� � %uj� ������

fRj���� � fLj���� � � �

�x�%uj � %uj��� ������

Notice that there is no discontinuity in the �ux at the cell boundary� This produces

d%ujdt

��

�x��%uj�� � �%uj � %uj�� ������

which is identical to Eq� ����� The resulting semi�discrete form with periodic bound�ary conditions is

d�%u

dt�

�x�Bp������ ���%u ������

which is written entirely in terms of cell�average data�

��� A Two�Dimensional Example

The above one�dimensional examples of �nite�volume approximations obscure someof the practical aspects of such methods� Thus our �nal example is a �nite�volumeapproximation to the two�dimensional linear convection equation on a grid consistingof regular triangles� as shown in Figure ���� As in Section ������ we use a piecewiseconstant approximation in each control volume and the �ux at the control volumeboundary is the average of the �uxes obtained on either side of the boundary� Thenodal data are stored at the vertices of the triangles formed by the grid� The controlvolumes are regular hexagons with area A� � is the length of the sides of the triangles�and � is the length of the sides of the hexagons� The following relations hold between�� �� and A�

� ��p�

A ��p

���

A�

��������

The two�dimensional form of the conservation law is

d

dt

ZAQdA �

ICn�Fdl � ������

Page 90: Fundamentals of Computational Fluid Dynamics

���� A TWO�DIMENSIONAL EXAMPLE �

05

4

3

2

1

a

bc

d

e f

lp

Figure ���� Triangular grid�

where we have ignored the source term� The contour in the line integral is composedof the sides of the hexagon� Since these sides are all straight� the unit normals canbe taken outside the integral and the �ux balance is given by

d

dt

ZAQ dA �

X���

n� �Z�Fdl �

where � indexes a side of the hexagon� as shown in Figure ���� A list of the normalsfor the mesh orientation shown is given in Table ����

Side� � Outward Normal�n

�i�p� j���� i

� �i�p

� j���� ��i�

p� j���

� �i� ��i�p� j���

Table ���� Outward normals� see Fig� ����i and j are unit normals along x and y� respectively�

Page 91: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� FINITE�VOLUME METHODS

For Eq� ����� the two�dimensional linear convection equation� we have for side �

n� �Z�Fdl � n� � �i cos � � j sin ��

Z ��

���u����d� �����

where � is a length measured from the middle of a side �� Making the change ofvariable z � ���� one has the expressionZ ��

���u���d� � �

Z ���

����u�z�dz ������

Then� in terms of u and the hexagon area A� we have

d

dt

ZAu dA �

X���

n� � �i cos � � j sin ��

�Z ���

����u�z�dz

��

� ���� �

The values of n� � �i cos � � j sin �� are given by the expressions in Table ���� Thereare no numerical approximations in Eq� ��� � That is� if the integrals in the equationare evaluated exactly� the integrated time rate of change of the integral of u over thearea of the hexagon is known exactly�

Side� � n� � �i cos � � j sin ��

�cos � �p� sin ����� cos �� �cos � �

p� sin ����

� �� cos � �p

� sin ����� � cos �� �� cos � �p� sin ����

Table ���� Weights of �ux integrals� see Eq� ��� �

Introducing the cell average� ZAu dA � A%up ������

and the piecewise�constant approximation u � %up over the entire hexagon� the ap�proximation to the �ux integral becomes trivial� Taking the average of the �ux oneither side of each edge of the hexagon gives for edge ��Z

�u�z�dz �

%up � %ua�

Z ���

����dz �

%up � %ua�

������

Page 92: Fundamentals of Computational Fluid Dynamics

���� PROBLEMS �

Similarly� we have for the other �ve edges�Z�u�z�dz �

%up � %ub�

������

Z�u�z�dz �

%up � %uc�

������

Z�u�z�dz �

%up � %ud�

������

Zu�z�dz �

%up � %ue�

������

Z�u�z�dz �

%up � %uf�

������

Substituting these into Eq� ��� � along with the expressions in Table ���� we obtain

Ad%updt

��

���� cos ���%ua � %ud� � �cos � �

p� sin ���%ub � %ue�

��� cos � �p

� sin ���%uc � %uf�� � �����

or

d%updt

��

����� cos ���%ua � %ud� � �cos � �

p� sin ���%ub � %ue�

��� cos � �p

� sin ���%uc � %uf�� � ������

The reader can verify� using Taylor series expansions� that this is a second�orderapproximation to the integral form of the two�dimensional linear convection equation�

��� Problems

�� Use Taylor series to verify that Eq� ���� is a fourth�order approximation to Eq������

�� Find the semi�discrete ODE form governing the cell�average data resulting fromthe use of a linear approximation in developing a �nite�volume method for thelinear convection equation� Use the following linear approximation�

u��� � a� � b

Page 93: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� FINITE�VOLUME METHODS

where b � %uj and

a �%uj� � %uj��

��x

and use the average �ux at the cell interface�

�� Using the �rst approach given in Section ������ derive a �nite�volume approx�imation to the spatial terms in the two�dimensional diusion equation on asquare grid�

�� Repeat question � for a grid consisting of equilateral triangles�

Page 94: Fundamentals of Computational Fluid Dynamics

Chapter �

TIME�MARCHING METHODS

FOR ODE�S

After discretizing the spatial derivatives in the governing PDE�s �such as the Navier�Stokes equations�� we obtain a coupled system of nonlinear ODE�s in the form

d�u

dt� �F ��u� t� �����

These can be integrated in time using a time�marching method to obtain a time�accurate solution to an unsteady �ow problem� For a steady �ow problem� spatialdiscretization leads to a coupled system of nonlinear algebraic equations in the form

�F ��u� � �����

As a result of the nonlinearity of these equations� some sort of iterative method isrequired to obtain a solution� For example� one can consider the use of Newton�smethod� which is widely used for nonlinear algebraic equations �See Section ��� �����This produces an iterative method in which a coupled system of linear algebraicequations must be solved at each iteration� These can be solved iteratively usingrelaxation methods� which will be discussed in Chapter �� or directly using Gaussianelimination or some variation thereof�

Alternatively� one can consider a time�dependent path to the steady state and usea time�marching method to integrate the unsteady form of the equations until thesolution is su�ciently close to the steady solution� The subject of the present chapter�time�marching methods for ODE�s� is thus relevant to both steady and unsteady �owproblems� When using a time�marching method to compute steady �ows� the goal issimply to remove the transient portion of the solution as quickly as possible time�accuracy is not required� This motivates the study of stability and stiness� topicswhich are covered in the next two chapters�

Page 95: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� TIME�MARCHING METHODS FOR ODES

Application of a spatial discretization to a PDE produces a coupled system ofODE�s� Application of a time�marching method to an ODE produces an ordinarydi�erence equation �O�E �� In earlier chapters� we developed exact solutions to ourmodel PDE�s and ODE�s� In this chapter we will present some basic theory of linearO�E�s which closely parallels that for linear ODE�s� and� using this theory� we willdevelop exact solutions for the model O�E�s arising from the application of time�marching methods to the model ODE�s�

��� Notation

Using the semi�discrete approach� we reduce our PDE to a set of coupled ODE�srepresented in general by Eq� ���� However� for the purpose of this chapter� we needonly consider the scalar case

du

dt� u� � F �u� t� �����

Although we use u to represent the dependent variable� rather than w� the readershould recall the arguments made in Chapter � to justify the study of a scalar ODE�Our �rst task is to �nd numerical approximations that can be used to carry out thetime integration of Eq� ��� to some given accuracy� where accuracy can be measuredeither in a local or a global sense� We then face a further task concerning the numericalstability of the resulting methods� but we postpone such considerations to the nextchapter�

In Chapter �� we introduced the convention that the n subscript� or the �n� su�perscript� always points to a discrete time value� and h represents the time interval�t� Combining this notation with Eq� ��� gives

u�n � Fn � F �un� tn� tn � nh

Often we need a more sophisticated notation for intermediate time steps involvingtemporary calculations denoted by $u� %u� etc� For these we use the notation

$u�n � $Fn � F �$un� tn � �h�

The choice of u� or F to express the derivative in a scheme is arbitrary� They areboth commonly used in the literature on ODE�s�

The methods we study are to be applied to linear or nonlinear ODE�s� but themethods themselves are formed by linear combinations of the dependent variable andits derivative at various time intervals� They are represented conceptually by

un� � f���u

�n�� ��u

�n� ���u

�n��� � � � � ��un� ���un��� � � �

������

Page 96: Fundamentals of Computational Fluid Dynamics

���� CONVERTING TIME�MARCHING METHODS TO O�ES �

With an appropriate choice of the ��s and � �s� these methods can be constructedto give a local Taylor series accuracy of any order� The methods are said to beexplicit if �� � and implicit otherwise� An explicit method is one in which the newpredicted solution is only a function of known data� for example� u�n� u�n��� un� andun�� for a method using two previous time levels� and therefore the time advance issimple� For an implicit method� the new predicted solution is also a function of thetime derivative at the new time level� that is� u�n�� As we shall see� for systems ofODE�s and nonlinear problems� implicit methods require more complicated strategiesto solve for un� than explicit methods�

��� Converting Time�Marching Methods to O�Es

Examples of some very common forms of methods used for time�marching generalODE�s are�

un� � un � hu�n �����

un� � un � hu�n� �����

and

$un� � un � hu�n

un� ��

��un � $un� � h$u�n�� �����

According to the conditions presented under Eq� ���� the �rst and third of these areexamples of explicit methods� We refer to them as the explicit Euler method and theMacCormack predictor�corrector method�� respectively� The second is implicit andreferred to as the implicit �or backward� Euler method�

These methods are simple recipes for the time advance of a function in terms of itsvalue and the value of its derivative� at given time intervals� The material presentedin Chapter � develops a basis for evaluating such methods by introducing the conceptof the representative equation

du

dt� u� � �u � ae�t ����

written here in terms of the dependent variable� u� The value of this equation arisesfrom the fact that� by applying a time�marching method� we can analytically convert

�Here we give only MacCormack�s time�marching method� The method commonly referred to asMacCormack�s method� which is a fullydiscrete method� will be presented in Section ���

Page 97: Fundamentals of Computational Fluid Dynamics

CHAPTER �� TIME�MARCHING METHODS FOR ODES

such a linear ODE into a linear O�E � The latter are subject to a whole body ofanalysis that is similar in many respects to� and just as powerful as� the theory ofODE�s� We next consider examples of this conversion process and then go into thegeneral theory on solving O�E�s�

Apply the simple explicit Euler scheme� Eq� ���� to Eq� ��� There results

un� � un � h��un � ae�hn�

or

un� � �� � �h�un � hae�hn �����

Eq� ��� is a linear O�E � with constant coe�cients� expressed in terms of the depen�dent variable un and the independent variable n� As another example� applying theimplicit Euler method� Eq� ���� to Eq� ��� we �nd

un� � un � h��un� � ae�h�n��

�or

��� �h�un� � un � he�h � ae�hn ���� �

As a �nal example� the predictor�corrector sequence� Eq� ���� gives

$un� � �� � �h�un � ahe�hn

��

��� � �h�$un� � un� � �

�un �

�ahe�h�n�� ������

which is a coupled set of linear O�E�s with constant coe�cients� Note that the �rstline in Eq� ���� is identical to Eq� ���� since the predictor step in Eq� ��� is simplythe explicit Euler method� The second line in Eq� ���� is obtained by noting that

$u�n� � F �$un�� tn � h�

� �$un� � ae�h�n�� ������

Now we need to develop techniques for analyzing these dierence equations so thatwe can compare the merits of the time�marching methods that generated them�

��� Solution of Linear O�Es With Constant Co�

e�cients

The techniques for solving linear di�erence equations with constant coe�cients is aswell developed as that for ODE�s and the theory follows a remarkably parallel path�This is demonstrated by repeating some of the developments in Section ���� but fordierence rather than dierential equations�

Page 98: Fundamentals of Computational Fluid Dynamics

���� SOLUTION OF LINEAR O�ES WITH CONSTANT COEFFICIENTS �

���� First� and Second�Order Di�erence Equations

First�Order Equations

The simplest nonhomogeneous O�E of interest is given by the single �rst�order equa�tion

un� � �un � abn ������

where �� a� and b are� in general� complex parameters� The independent variable isnow n rather than t� and since the equations are linear and have constant coe�cients�� is not a function of either n or u� The exact solution of Eq� ���� is

un � c��n �

abn

b� �

where c� is a constant determined by the initial conditions� In terms of the initialvalue of u it can be written

un � u��n � a

bn � �n

b� �

Just as in the development of Eq� ��� � one can readily show that the solution of thedefective case� �b � ���

un� � �un � a�n

isun �

hu� � an���

i�n

This can all be easily veri�ed by substitution�

Second�Order Equations

The homogeneous form of a second�order dierence equation is given by

un� � a�un� � a�un � ������

Instead of the dierential operator D � ddt

used for ODE�s� we use for O�E�s thedierence operator E �commonly referred to as the displacement or shift operator�and de�ned formally by the relations

un� � Eun � unk � Ekun

Further notice that the displacement operator also applies to exponents� thus

b � bn � bn � E � bn

Page 99: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� TIME�MARCHING METHODS FOR ODES

where � can be any fraction or irrational number�The roles of D and E are the same insofar as once they have been introduced to

the basic equations the value of u�t� or un can be factored out� Thus Eq� ���� cannow be re�expressed in an operational notion as

�E� � a�E � a��un � ������

which must be zero for all un� Eq� ���� is known as the operational form of Eq� �����The operational form contains a characteristic polynomial P �E� which plays the samerole for dierence equations that P �D� played for dierential equations that is� itsroots determine the solution to the O�E� In the analysis of O�E�s� we label theseroots ��� ��� � � �� etc� and refer to them as the ��roots� They are found by solving theequation P ��� � � In the simple example given above� there are just two � rootsand in terms of them the solution can be written

un � c�����n � c�����

n ������

where c� and c� depend upon the initial conditions� The fact that Eq� ���� is asolution to Eq� ���� for all c� � c� and n should be veri�ed by substitution�

���� Special Cases of Coupled First�Order Equations

A Complete System

Coupled� �rst�order� linear homogeneous dierence equations have the form

u�n��� � c��u

�n�� � c��u

�n��

u�n��� � c��u

�n�� � c��u

�n�� ������

which can also be written

�un� � C�un � �un �hu�n�� � u

�n��

iT� C �

�c�� c��c�� c��

�The operational form of Eq� ���� can be written�

�c�� � E� c��c�� �c�� � E�

� �u�u�

��n�� �C � E I ��un �

which must be zero for all u� and u�� Again we are led to a characteristic polynomial�this time having the form P �E� � det �C � E I �� The ��roots are found from

P ��� � det�

�c�� � �� c��c�� �c�� � ��

��

Page 100: Fundamentals of Computational Fluid Dynamics

���� SOLUTION OF THE REPRESENTATIVE O�ES ��

Obviously the �k are the eigenvalues of C and� following the logic of Section ����if �x are its eigenvectors� the solution of Eq� ���� is

�un ��X

k��

ck��k�n�xk

where ck are constants determined by the initial conditions�

A Defective System

The solution of O�E�s with defective eigensystems follows closely the logic in Section����� for defective ODE�s� For example� one can show that the solution to��� %un�

&un�

un�

�� �

��� �� �� �

����� %un

&unun

��is

%un � %u��n

&un �h&u� � %u�n�

��i�n

un �

u� � &u�n�

�� � %u�n�n� ��

����

��n �����

��� Solution of the Representative O�Es

���� The Operational Form and its Solution

Examples of the nonhomogeneous� linear� �rst�order ordinary dierence equations�produced by applying a time�marching method to the representative equation� aregiven by Eqs� ��� to ����� Using the displacement operator� E� these equations canbe written

�E � �� � �h��un � h � ae�hn ������

���� �h�E � ��un � h � E � ae�hn ���� �

E ��� � �h�

����� � �h�E E � �

� $uu

�n

� h �

���E

�� ae�hn ������

Page 101: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� TIME�MARCHING METHODS FOR ODES

All three of these equations are subsets of the operational form of the representativeO�E

P �E�un � Q�E� � ae�hn ������

which is produced by applying time�marching methods to the representative ODE� Eq������ We can express in terms of Eq� ���� all manner of standard time�marching meth�ods having multiple time steps and various types of intermediate predictor�correctorfamilies� The terms P �E� and Q�E� are polynomials in E referred to as the charac�teristic polynomial and the particular polynomial� respectively�

The general solution of Eq� ���� can be expressed as

un �KXk��

ck��k�n � ae�hn � Q�e�h�

P �e�h�������

where �k are the K roots of the characteristic polynomial� P ��� � � When determi�nants are involved in the construction of P �E� and Q�E�� as would be the case forEq� ����� the ratio Q�E��P �E� can be found by Kramer�s rule� Keep in mind thatfor methods such as in Eq� ���� there are multiple �two in this case� solutions� onefor un and $un and we are usually only interested in the �nal solution un� Notice also�the important subset of this solution which occurs when � � � representing a timeinvariant particular solution� or a steady state� In such a case

un �KXk��

ck��k�n � a � Q���

P ���

���� Examples of Solutions to Time�Marching O�E�s

As examples of the use of Eqs� ���� and ����� we derive the solutions of Eqs� ���� to����� For the explicit Euler method� Eq� ����� we have

P �E� � E � �� �h

Q�E� � h ������

and the solution of its representative O�E follows immediately from Eq� �����

un � c��� � �h�n � ae�hn � h

e�h � �� �h

For the implicit Euler method� Eq� ��� � we have

P �E� � ��� �h�E � �

Q�E� � hE ������

Page 102: Fundamentals of Computational Fluid Dynamics

���� THE �� � RELATION ��

so

un � c�

��

�� �h

�n� ae�hn � he�h

��� �h�e�h � �

In the case of the coupled predictor�corrector equations� Eq� ����� one solves for the�nal family un �one can also �nd a solution for the intermediate family $u�� and thereresults

P �E� � det

E ��� � �h�

����� � �h�E E � �

�� E

�E � �� �h� �

���h�

Q�E� � det�

E h��

��� � �h�E ��hE

��

�hE�E � � � �h�

The ��root is found from

P ��� � ��� � �� �h� �

���h�

��

which has only one nontrivial root �� � is simply a shift in the reference index��The complete solution can therefore be written

un � c�

�� � �h �

���h�

�n� ae�hn �

�h�e�h � � � �h

�e�h � �� �h� �

���h�

������

��� The �� � Relation

��� Establishing the Relation

We have now been introduced to two basic kinds of roots� the ��roots and the ��roots�The former are the eigenvalues of the A matrix in the ODE�s found by space dier�encing the original PDE� and the latter are the roots of the characteristic polynomialin a representative O�E found by applying a time�marching method to the repre�sentative ODE� There is a fundamental relation between the two which can be usedto identify many of the essential properties of a time�march method� This relation is�rst demonstrated by developing it for the explicit Euler method�

First we make use of the semi�discrete approach to �nd a system of ODE�s andthen express its solution in the form of Eq� ����� Remembering that t � nh� one canwrite

u�t� � c��e��h

�n �x� � � � �� cm�e�mh

�n �xm � � � �� cM�e�Mh

�n �xM � P�S� ������

Page 103: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� TIME�MARCHING METHODS FOR ODES

where for the present we are not interested in the form of the particular solution�P�S��� Now the explicit Euler method produces for each ��root� one ��root� whichis given by � � � � �h� So if we use the Euler method for the time advance of theODE�s� the solution� of the resulting O�E is

un � c�����n �x� � � � �� cm��m�n �xm � � � �� cM��M�n �xM � P�S� �����

where the cm and the �xm in the two equations are identical and �m � �� � �mh��Comparing Eq� ���� and Eq� ���� we see a correspondence between �m and e�mh�Since the value of e�h can be expressed in terms of the series

e�h � � � �h ��

���h� �

���h� � � � �� �

n#�nhn � � � �

the truncated expansion � � � � �h is a reasonable� approximation for small enough�h�

Suppose� instead of the Euler method� we use the leapfrog method for the timeadvance� which is de�ned by

un� � un�� � �hu�n ������

Applying Eq� �� to Eq� ����� we have the characteristic polynomial P �E� � E� ���hE � �� so that for every � the � must satisfy the relation

��m � ��mh�m � � � ���� �

Now we notice that each � produces two ��roots� For one of these we �nd

�m � �mh �q

� � ��mh� ������

� � � �mh ��

���mh

� � �

��mh

� � � � � ������

This is an approximation to e�mh with an error O���h��� The other root� �mh �q� � ��mh

�� will be discussed in Section ������

�Based on Section �����The error is O���h���

Page 104: Fundamentals of Computational Fluid Dynamics

���� THE �� � RELATION ��

��� The Principal ��Root

Based on the above we make the following observation�

Application of the same time�marching method to all of the equations ina coupled system linear ODE�s in the form of Eq� ���� always producesone ��root for every ��root that satis�es the relation

� � � � �h ��

���h� � � � �� �

k#�khk � O

�hk�

�where k is the order of the time�marching method�

������

We refer to the root that has the above property as the principal ��root� and designateit ��m��� The above property can be stated regardless of the details of the time�

marching method� knowing only that its leading error is O�hk�

�� Thus the principal

root is an approximation to e�h up to O�hk��

Note that a second�order approximation to a derivative written in the form

��tu�n ��

�h�un� � un��� ������

has a leading truncation error which is O�h��� while the second�order time�marchingmethod which results from this approximation� which is the leapfrog method�

un� � un�� � �hu�n ������

has a leading truncation error O�h��� This arises simply because of our notationfor the time�marching method in which we have multiplied through by h to get anapproximation for the function un� rather than the derivative as in Eq� ����� Thefollowing example makes this clear� Consider a solution obtained at a given time Tusing a second�order time�marching method with a time step h� Now consider thesolution obtained using the same method with a time step h��� Since the error pertime step is O�h��� this is reduced by a factor of eight �considering the leading termonly�� However� twice as many time steps are required to reach the time T � Thereforethe error at the end of the simulation is reduced by a factor of four� consistent witha second�order approximation�

��� Spurious ��Roots

We saw from Eq� ��� that the �� � relation for the leapfrog method produces two��roots for each �� One of these we identi�ed as the principal root which always

Page 105: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� TIME�MARCHING METHODS FOR ODES

has the property given in ����� The other is referred to as a spurious ��root anddesignated ��m��� In general� the ��� relation produced by a time�marching schemecan result in multiple ��roots all of which� except for the principal one� are spurious�All spurious roots are designated ��m�k where k � �� �� � � �� No matter whether a��root is principal or spurious� it is always some algebraic function of the product �h�To express this fact we use the notation � � ���h��

If a time�marching method produces spurious ��roots� the solution for the O�E inthe form shown in Eq� ��� must be modi�ed� Following again the message of Section���� we have

un � c������n��x� � � � �� cm���m�n�

�xm � � � �� cM���M�n��xM � P�S�

�c������n��x� � � � �� cm���m�n�

�xm � � � �� cM���M�n��xM

�c������n��x� � � � �� cm���m�n�

�xm � � � �� cM���M�n��xM

�etc�� if there are more spurious roots ������

Spurious roots arise if a method uses data from time level n � � or earlier toadvance the solution from time level n to n � �� Such roots originate entirely fromthe numerical approximation of the time�marching method and have nothing to dowith the ODE being solved� However� generation of spurious roots does not� in itself�make a method inferior� In fact� many very accurate methods in practical use forintegrating some forms of ODE�s have spurious roots�

It should be mentioned that methods with spurious roots are not self starting�For example� if there is one spurious root to a method� all of the coe�cients �cm��in Eq� ���� must be initialized by some starting procedure� The initial vector �u�does not provide enough data to initialize all of the coe�cients� This results becausemethods which produce spurious roots require data from time level n � � or earlier�For example� the leapfrog method requires �un�� and thus cannot be started usingonly �un�

Presumably �i�e�� if one starts the method properly� the spurious coe�cients areall initialized with very small magnitudes� and presumably the magnitudes of thespurious roots themselves are all less than one �see Chapter ��� Then the presence ofspurious roots does not contaminate the answer� That is� after some �nite time theamplitude of the error associated with the spurious roots is even smaller then whenit was initialized� Thus while spurious roots must be considered in stability analysis�they play virtually no role in accuracy analysis�

��� One�Root Time�Marching Methods

There are a number of time�marching methods that produce only one ��root for each��root� We refer to them as one�root methods� They are also called one�step methods�

Page 106: Fundamentals of Computational Fluid Dynamics

���� ACCURACY MEASURES OF TIME�MARCHING METHODS ��

They have the signi�cant advantage of being self�starting which carries with it thevery useful property that the time�step interval can be changed at will throughoutthe marching process� Three one�root methods were analyzed in Section ������ Apopular method having this property� the so�called ��method� is given by the formula

un� � un � hh��� ��u�n � �u�n�

iThe ��method represents the explicit Euler �� � �� the trapezoidal �� � �

��� and the

implicit Euler methods �� � ��� respectively� Its �� � relation is

� �� � ��� ���h

�� ��h

It is instructive to compare the exact solution to a set of ODE�s �with a completeeigensystem� having time�invariant forcing terms with the exact solution to the O�E�sfor one�root methods� These are

�u�t� � c��e��h

�n �x� � � � �� cm�e�mh

�n �xm � � � �� cM�e�Mh

�n �xM � A���f

�un � c�����n �x� � � � �� cm��m�n �xm � � � �� cM��M �n �xM � A���f ������

respectively� Notice that when t and n � � these equations are identical� so that allthe constants� vectors� and matrices are identical except the �u and the terms insidethe parentheses on the right hand sides� The only error made by introducing the timemarching is the error that � makes in approximating e�h�

��� Accuracy Measures of Time�Marching Meth�

ods

��� Local and Global Error Measures

There are two broad categories of errors that can be used to derive and evaluate time�marching methods� One is the error made in each time step� This is a local error suchas that found from a Taylor table analysis� see Section ���� It is usually used as thebasis for establishing the order of a method� The other is the error determined at theend of a given event which has covered a speci�c interval of time composed of manytime steps� This is a global error� It is useful for comparing methods� as we shall seein Chapter �

It is quite common to judge a time�marching method on the basis of results foundfrom a Taylor table� However� a Taylor series analysis is a very limited tool for �ndingthe more subtle properties of a numerical time�marching method� For example� it isof no use in�

Page 107: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� TIME�MARCHING METHODS FOR ODES

�nding spurious roots�

evaluating numerical stability and separating the errors in phase and amplitude�

analyzing the particular solution of predictor�corrector combinations�

�nding the global error�

The latter three of these are of concern to us here� and to study them we make use ofthe material developed in the previous sections of this chapter� Our error measuresare based on the dierence between the exact solution to the representative ODE�given by

u�t� � ce�t �ae�t

�� ������

and the solution to the representative O�E�s� including only the contribution fromthe principal root� which can be written as

un � c�����n � ae�hn � Q�e�h�

P �e�h�������

��� Local Accuracy of the Transient Solution �er�� j�j � er��

Transient error

The particular choice of an error measure� either local or global� is to some extentarbitrary� However� a necessary condition for the choice should be that the measurecan be used consistently for all methods� In the discussion of the ��� relation wesaw that all time�marching methods produce a principal ��root for every ��root thatexists in a set of linear ODE�s� Therefore� a very natural local error measure for thetransient solution is the value of the dierence between solutions based on these tworoots� We designate this by er� and make the following de�nition

er� � e�h � ��

The leading error term can be found by expanding in a Taylor series and choosingthe �rst nonvanishing term� This is similar to the error found from a Taylor table�The order of the method is the last power of �h matched exactly�

Page 108: Fundamentals of Computational Fluid Dynamics

���� ACCURACY MEASURES OF TIME�MARCHING METHODS ��

Amplitude and Phase Error

Suppose a � eigenvalue is imaginary� Such can indeed be the case when we study theequations governing periodic convection which produces harmonic motion� For suchcases it is more meaningful to express the error in terms of amplitude and phase�Let � � i� where � is a real number representing a frequency� Then the numericalmethod must produce a principal ��root that is complex and expressible in the form

�� � �r � i�i � ei�h ���� �

From this it follows that the local error in amplitude is measured by the deviation ofj��j from unity� that is

era � �� j��j � ��q

�����r � �����i

and the local error in phase can be de�ned as

er� � �h� tan�� �����i�����r�� ������

Amplitude and phase errors are important measures of the suitability of time�marchingmethods for convection and wave propagation phenomena�

The approach to error analysis described in Section ��� can be extended to thecombination of a spatial discretization and a time�marching method applied to thelinear convection equation� The principal root� ����h�� is found using � � �ia��where � is the modi�ed wavenumber of the spatial discretization� Introducing theCourant number� Cn � ah��x� we have �h � �iCn

��x� Thus one can obtainvalues of the principal root over the range � �x � for a given value of theCourant number� The above expression for er� can be normalized to give the errorin the phase speed� as follows

erp �er��h

� � �tan�� �����i�����r��

Cn�x������

where � � �a� A positive value of erp corresponds to phase lag �the numerical phasespeed is too small�� while a negative value corresponds to phase lead �the numericalphase speed is too large��

��� Local Accuracy of the Particular Solution �er��

The numerical error in the particular solution is found by comparing the particularsolution of the ODE with that for the O�E� We have found these to be given by

P�S��ODE� � ae�t � �

��� ��

Page 109: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� TIME�MARCHING METHODS FOR ODES

and

P�S��O�E� � ae�t � Q�e�h�

P �e�h�

respectively� For a measure of the local error in the particular solution we introducethe de�nition

er� � h

�P�S��O�E�

P�S��ODE�

� �

�������

The multiplication by h converts the error from a global measure to a local one� sothat the order of er� and er� are consistent� In order to determine the leading errorterm� Eq� ���� can be written in terms of the characteristic and particular polynomialsas

er� �co

�� ��n

��� ��Q�e�h

�� P

�e�h

�o������

where

co � limh��

h��� ��

P�e�h

�The value of co is a method�dependent constant that is often equal to one� If theforcing function is independent of time� � is equal to zero� and for this case� manynumerical methods generate an er� that is also zero�

The algebra involved in �nding the order of er� can be quite tedious� However�this order is quite important in determining the true order of a time�marching methodby the process that has been outlined� An illustration of this is given in the sectionon Runge�Kutta methods�

��� Time Accuracy For Nonlinear Applications

In practice� time�marching methods are usually applied to nonlinear ODE�s� and itis necessary that the advertised order of accuracy be valid for the nonlinear cases aswell as for the linear ones� A necessary condition for this to occur is that the localaccuracies of both the transient and the particular solutions be of the same order�More precisely� a time�marching method is said to be of order k if

er� � c� � ��h�k�� ������

er� � c� � ��h�k�� ������

where k � smallest of�k�� k�� ������

Page 110: Fundamentals of Computational Fluid Dynamics

���� ACCURACY MEASURES OF TIME�MARCHING METHODS � �

The reader should be aware that this is not su�cient� For example� to derive all ofthe necessary conditions for the fourth�order Runge�Kutta method presented laterin this chapter the derivation must be performed for a nonlinear ODE� However� theanalysis based on a linear nonhomogeneous ODE produces the appropriate conditionsfor the majority of time�marching methods used in CFD�

�� Global Accuracy

In contrast to the local error measures which have just been discussed� we can alsode�ne global error measures� These are useful when we come to the evaluation oftime�marching methods for speci�c purposes� This subject is covered in Chapter after our introduction to stability in Chapter ��

Suppose we wish to compute some time�accurate phenomenon over a �xed intervalof time using a constant time step� We refer to such a computation as an �event��Let T be the �xed time of the event and h be the chosen step size� Then the requirednumber of time steps� is N� given by the relation

T � Nh

Global error in the transient

A natural extension of er� to cover the error in an entire event is given by

Er� � e�T � �����h��N �����

Global error in amplitude and phase

If the event is periodic� we are more concerned with the global error in amplitude andphase� These are given by

Era � ���q

�����r � �����i

�N������

and

Er� � N

�h� tan��

�����i����r

��� �T �N tan�� �����i�����r� ���� �

Page 111: Fundamentals of Computational Fluid Dynamics

� � CHAPTER �� TIME�MARCHING METHODS FOR ODES

Global error in the particular solution

Finally� the global error in the particular solution follows naturally by comparing thesolutions to the ODE and the O�E� It can be measured by

Er� � ��� ��Q�e�h

�P�e�h

� � �

�� Linear Multistep Methods

In the previous sections� we have developed the framework of error analysis for timeadvance methods and have randomly introduced a few methods without addressingmotivational� developmental or design issues� In the subsequent sections� we introduceclasses of methods along with their associated error analysis� We shall not spend muchtime on development or design of these methods� since most of them have historicorigins from a wide variety of disciplines and applications� The Linear MultistepMethods �LMM�s� are probably the most natural extension to time marching of thespace dierencing schemes introduced in Chapter � and can be analyzed for accuracyor designed using the Taylor table approach of Section ����

���� The General Formulation

When applied to the nonlinear ODE

du

dt� u� � F�u� t�

all linear multistep methods can be expressed in the general form

�Xk���K

�kunk � h�X

k���K

�kFnk ������

where the notation for F is de�ned in Section ���� The methods are said to be linearbecause the ��s and ��s are independent of u and n� and they are said to be K�stepbecause K time�levels of data are required to marching the solution one time�step� h�They are explicit if �� � and implicit otherwise�

When Eq� ���� is applied to the representative equation� Eq� ��� and the result isexpressed in operational form� one �nds�� �X

k���K

�kEk

�Aun � h

�� �Xk���K

�kEk

�A��un � ae�hn� ������

Page 112: Fundamentals of Computational Fluid Dynamics

���� LINEAR MULTISTEP METHODS � �

We recall from Section ����� that a time�marching method when applied to the repre�sentative equation must provide a ��root� labeled ��� that approximates e�h throughthe order of the method� The condition referred to as consistency simply means that� � � as h � � and it is certainly a necessary condition for the accuracy of anytime marching method� We can also agree that� to be of any value in time accuracy�a method should at least be �rst�order accurate� that is � � �� ��h� as h� � Onecan show that these conditions are met by any method represented by Eq� ���� ifX

k

�k � andXk

�k �Xk

�K � k � ���k

Since both sides of Eq� ���� can be multiplied by an arbitrary constant� these methodsare often �normalized� by requiring X

k

�k � �

Under this condition co � � in Eq� �����

���� Examples

There are many special explicit and implicit forms of linear multistep methods� Twowell�known families of them� referred to as Adams�Bashforth �explicit� and Adams�Moulton �implicit�� can be designed using the Taylor table approach of Section ����The Adams�Moulton family is obtained from Eq� ���� with

�� � �� �� � ��� �k � � k � ������ � � � ������

The Adams�Bashforth family has the same ��s with the additional constraint that�� � � The three�step Adams�Moulton method can be written in the following form

un� � un � h���u�n� � ��u

�n � ���u

�n�� � ���u

�n��� ������

A Taylor table for Eq� ���� can be generated as

un h � u�n h� � u��n h� � u���n h� � u����nun� � � �

���

���

�un ���h��u�n� ��� ��� ��� �

� ��� ���h��u�n ���

�h���u�n�� ���� ��� ���� �� ���

��

�h���u�n�� ��������� ��������� ����������� ���������

��

Table ���� Taylor table for the Adams�Moulton three�step linear multistep method�

Page 113: Fundamentals of Computational Fluid Dynamics

� � CHAPTER �� TIME�MARCHING METHODS FOR ODES

This leads to the linear system������ � � �� �� ��� � ��� �� ���

�������������������

���� �

���������

���� ������

to solve for the ��s� resulting in

�� � ����� �� � ������ ��� � ������ ��� � ���� ������

which produces a method which is fourth�order accurate�� With �� � one obtains��� � � � �� �� � ��

����� ��������

�� �

��� ���

�� ������

giving

�� � ������ ��� � ������� ��� � ���� �����

This is the third�order Adams�Bashforth method�A list of simple methods� some of which are very common in CFD applications�

is given below together with identifying names that are sometimes associated withthem� In the following material AB�n� and AM�n� are used as abbreviations for the�n�th order Adams�Bashforth and �n�th order Adams�Moulton methods� One canverify that the Adams type schemes given below satisfy Eqs� ���� and ���� up to theorder of the method�

Explicit Methods

un� � un � hu�n Eulerun� � un�� � �hu�n Leapfrog

un� � un � ��hh�u�n � u�n��

iAB�

un� � un � h��

h��u�n � ��u�n�� � �u�n��

iAB�

Implicit Methods

un� � un � hu�n� Implicit Euler

un� � un � ��hhu�n � u�n�

iTrapezoidal �AM��

un� � ��

h�un � un�� � �hu�n�

i�nd�order Backward

un� � un � h��

h�u�n� � u�n � u�n��

iAM�

�Recall from Section ����� that a kthorder timemarching method has a leading truncation errorterm which is O�hk����

Page 114: Fundamentals of Computational Fluid Dynamics

���� LINEAR MULTISTEP METHODS � �

���� Two�Step Linear Multistep Methods

High resolution CFD problems usually require very large data sets to store the spatialinformation from which the time derivative is calculated� This limits the interestin multistep methods to about two time levels� The most general two�step linearmultistep method �i�e�� K�� in Eq� ������ that is at least �rst�order accurate� can bewritten as

�� � ��un� � ��� � ���un � �un��� � hh�u�n� � ��� � � ��u�n � �u�n��

i������

Clearly the methods are explicit if � � and implicit otherwise� A list of methodscontained in Eq� ���� is given in Table ���� Notice that the Adams methods have� � � which corresponds to ��� � in Eq� ����� Methods with � � ����� whichcorresponds to �� � in Eq� ����� are known as Milne methods�

� � � Method Order

Euler �� Implicit Euler �

��� Trapezoidal or AM� �� ��� �nd Order Backward �

��� ���� Adams type ���� ���� ���� Lees Type ���� ���� ���� Two�step trapezoidal ���� ���� ���� A�contractive � ���� Leapfrog � ��� AB� � ���� ���� Most accurate explicit �

��� ���� Third�order implicit ����� ���� AM� ���� ���� ���� Milne �

Table ���� Some linear one� and two�step methods� see Eq� �����

One can show after a little algebra that both er� and er� are reduced to �h���i�e�� the methods are �nd�order accurate� if

� � � � � ��

The class of all �rd�order methods is determined by imposing the additional constraint

� � �� � �

Finally a unique fourth�order method is found by setting � � �� � ���� � ���

Page 115: Fundamentals of Computational Fluid Dynamics

� � CHAPTER �� TIME�MARCHING METHODS FOR ODES

��� Predictor�Corrector Methods

There are a wide variety of predictor�corrector schemes created and used for a varietyof purposes� Their use in solving ODE�s is relatively easy to illustrate and understand�Their use in solving PDE�s can be much more subtle and demands concepts whichhave no counterpart in the analysis of ODE�s�

Predictor�corrector methods constructed to time�march linear or nonlinear ODE�sare composed of sequences of linear multistep methods� each of which is referred toas a family in the solution process� There may be many families in the sequence� andusually the �nal family has a higher Taylor�series order of accuracy than the inter�mediate ones� Their use is motivated by ease of application and increased e�ciency�where measures of e�ciency are discussed in the next two chapters�

A simple one�predictor� one�corrector example is given by

$un � un � �hu�n

un� � un � hh�$u�n � �u�n

i���� �

where the parameters �� � and � are arbitrary parameters to be determined� Onecan analyze this sequence by applying it to the representative equation and usingthe operational techniques outlined in Section ���� It is easy to show� following theexample leading to Eq� ����� that

P �E� � E �hE � �� �� � ���h� ����h�

i������

Q�E� � E � h � ��E � � � ���h� ������

Considering only local accuracy� one is led� by following the discussion in Section ����to the following observations� For the method to be second�order accurate both er�and er� must be O�h��� For this to hold for er�� it is obvious from Eq� ���� that

� � � � � �� ��

which provides two equations for three unknowns� The situation for er� requires somealgebra� but it is not di�cult to show using Eq� ���� that the same conditions alsomake it O�h��� One concludes� therefore� that the predictor�corrector sequence

$un � un � �hu�n

un� � un ��

�h��

�$u�n �

���� �

�u�n

�������

is a second�order accurate method for any ��

�Such as alternating direction� fractionalstep� and hybrid methods�

Page 116: Fundamentals of Computational Fluid Dynamics

��� RUNGE�KUTTA METHODS � �

A classical predictor�corrector sequence is formed by following an Adams�Bashforthpredictor of any order with an Adams�Moulton corrector having an order one higher�The order of the combination is then equal to the order of the corrector� If the orderof the corrector is �k�� we refer to these as ABM�k� methods� The Adams�Bashforth�Moulton sequence for k � � is

$un� � un ��

�hh�u�n � u�n��

iun� � un �

h

��

h�$u�n� � u�n � u�n��

i������

Some simple� speci�c� second�order accurate methods are given below� The Gazdagmethod� which we discuss in Chapter � is

$un� � un ��

�hh�$u�n � $u�n��

iun� � un �

�hh$u�n � $u�n�

i������

The Burstein method� obtained from Eq� ���� with � � ��� is

$un��� � un ��

�hu�n

un� � un � h$u�n��� ������

and� �nally� MacCormack�s method� presented earlier in this chapter� is

$un� � un � hu�n

un� ��

��un � $un� � h$u�n�� ������

Note that MacCormack�s method can also be written as

$un� � un � hu�n

un� � un ��

�h�u�n � $u�n�� �����

from which it is clear that it is obtained from Eq� ���� with � � ��

�� Runge�Kutta Methods

There is a special subset of predictor�corrector methods� referred to as Runge�Kuttamethods�� that produce just one ��root for each ��root such that ���h� corresponds

�Although implicit and multistep RungeKutta methods exist� we will consider only singlestep�explicit RungeKutta methods here�

Page 117: Fundamentals of Computational Fluid Dynamics

� CHAPTER �� TIME�MARCHING METHODS FOR ODES

to the Taylor series expansion of e�h out through the order of the method and thentruncates� Thus for a Runge�Kutta method of order k �up to �th order�� the principal�and only� ��root is given by

� � � � �h ��

���h� � � � �� �

k#�khk ������

It is not particularly di�cult to build this property into a method� but� as we pointedout in Section ������ it is not su�cient to guarantee k�th order accuracy for the solutionof u� � F �u� t� or for the representative equation� To ensure k�th order accuracy� themethod must further satisfy the constraint that

er� � O�hk�� ���� �

and this is much more di�cult�The most widely publicized Runge�Kutta process is the one that leads to the

fourth�order method� We present it below in some detail� It is usually introduced inthe form

k� � hF �un� tn�

k� � hF �un � �k�� tn � �h�

k� � hF �un � ��k� � ��k�� tn � ��h�

k� � hF �un � ��k� � ��k� � ��k�� tn � ��h�

followed by

u�tn � h�� u�tn� � ��k� � ��k� � ��k� � ��k� ������

However� we prefer to present it using predictor�corrector notation� Thus� a schemeentirely equivalent to ���� is

bun � un � �hu�n$un� � un � ��hu

�n � ��hbu�n

un� � un � ��hu�n � ��hbu�n � ��h$u�n�

un� � un � ��hu�n � ��hbu�n � ��h$u�n� � ��hu

�n�

������

Appearing in Eqs� ���� and ���� are a total of �� parameters which are to bedetermined such that the method is fourth�order according to the requirements inEqs� ���� and ��� � First of all� the choices for the time samplings� �� ��� and ��� arenot arbitrary� They must satisfy the relations

� � �

�� � �� � ��

�� � �� � �� � �� ������

Page 118: Fundamentals of Computational Fluid Dynamics

��� RUNGE�KUTTA METHODS � �

The algebra involved in �nding algebraic equations for the remaining � parametersis not trivial� but the equations follow directly from �nding P �E� and Q�E� and thensatisfying the conditions in Eqs� ���� and ��� � Using Eq� ���� to eliminate the ��swe �nd from Eq� ���� the four conditions

�� � �� � �� � �� � � ������ � ���� � ���� � ��� ���

����� � ������ � ����� � ��� ���������� � ���� ���

������

These four relations guarantee that the �ve terms in � exactly match the �rst � termsin the expansion of e�h� To satisfy the condition that er� � O�k�� we have to ful�llfour more conditions

���� � ���

�� � ���

�� � ��� ���

���� � ���

�� � ���

�� � ��� ���

������ � ����

��� � ������ � ���� ���

������� � �������� � ����� � �� ���

������

The number in parentheses at the end of each equation indicates the order thatis the basis for the equation� Thus if the �rst � equations in ���� and the �rstequation in ���� are all satis�ed� the resulting method would be third�order accurate�As discussed in Section ������ the fourth condition in Eq� ���� cannot be derivedusing the methodology presented here� which is based on a linear nonhomogenousrepresentative ODE� A more general derivation based on a nonlinear ODE can befound in several books�

There are eight equations in ���� and ���� which must be satis�ed by the � unknowns� Since the equations are overdetermined� two parameters can be set arbi�trarily� Several choices for the parameters have been proposed� but the most popularone is due to Runge� It results in the �standard� fourth�order Runge�Kutta methodexpressed in predictor�corrector form as

bun��� � un ��

�hu�n

$un��� � un ��

�hbu�n���

un� � un � h$u�n���

un� � un ��

�hhu�n � �

�bu�n��� � $u�n���

�� u�n�

i������

�The present approach based on a linear inhomogeneous equation provides all of the necessaryconditions for RungeKutta methods of up to third order�

Page 119: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� TIME�MARCHING METHODS FOR ODES

Notice that this represents the simple sequence of conventional linear multistep meth�ods referred to� respectively� as

Euler PredictorEuler CorrectorLeapfrog PredictorMilne Corrector

��������� � RK�

One can easily show that both the Burstein and the MacCormack methods given byEqs� ���� and ���� are second�order Runge�Kutta methods� and third�order methodscan be derived from Eqs� ���� by setting �� � and satisfying only Eqs� ���� and the�rst equation in ����� It is clear that for orders one through four� RK methods of orderk require k evaluations of the derivative function to advance the solution one timestep� We shall discuss the consequences of this in Chapter � Higher�order Runge�Kutta methods can be developed� but they require more derivative evaluations thantheir order� For example� a �fth�order method requires six evaluations to advancethe solution one step� In any event� storage requirements reduce the usefulness ofRunge�Kutta methods of order higher than four for CFD applications�

���� Implementation of Implicit Methods

We have presented a wide variety of time�marching methods and shown how to derivetheir � � � relations� In the next chapter� we will see that these methods can havewidely dierent properties with respect to stability� This leads to various trade�os which must be considered in selecting a method for a speci�c application� Ourpresentation of the time�marching methods in the context of a linear scalar equationobscures some of the issues involved in implementing an implicit method for systemsof equations and nonlinear equations� These are covered in this Section�

�� �� Application to Systems of Equations

Consider �rst the numerical solution of our representative ODE

u� � �u � ae�t ������

using the implicit Euler method� Following the steps outlined in Section ���� weobtained

��� �h�un� � un � he�h � ae�hn �����

Page 120: Fundamentals of Computational Fluid Dynamics

����� IMPLEMENTATION OF IMPLICIT METHODS ���

Solving for un� gives

un� ��

�� �h�un � he�h � ae�hn� ������

This calculation does not seem particularly onerous in comparison with the applica�tion of an explicit method to this ODE� requiring only an additional division�

Now let us apply the implicit Euler method to our generic system of equationsgiven by

�u� � A�u� �f�t� ��� �

where �u and �f are vectors and we still assume that A is not a function of �u or t� Nowthe equivalent to Eq� ��� is

�I � hA��un� � �un � �h�f�t � h� �����

or

�un� � �I � hA�����un � h�f�t � h�� �����

The inverse is not actually performed� but rather we solve Eq� ��� as a linear systemof equations� For our one�dimensional examples� the system of equations which mustbe solved is tridiagonal �e�g�� for biconvection� A � �aBp���� � �����x�� and henceits solution is inexpensive� but in multidimensions the bandwidth can be very large� Ingeneral� the cost per time step of an implicit method is larger than that of an explicitmethod� The primary area of application of implicit methods is in the solution ofsti� ODE�s� as we shall see in Chapter �

�� �� Application to Nonlinear Equations

Now consider the general nonlinear scalar ODE given by

du

dt� F �u� t� �����

Application of the implicit Euler method gives

un� � un � hF �un�� tn�� �����

This is a nonlinear dierence equation� As an example� consider the nonlinear ODE

du

dt�

�u� � �����

Page 121: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� TIME�MARCHING METHODS FOR ODES

solved using implicit Euler time marching� which gives

un� � h�

�u�n� � un �����

which requires a nontrivial method to solve for un�� There are several dierentapproaches one can take to solving this nonlinear dierence equation� An iterativemethod� such as Newton�s method �see below�� can be used� In practice� the �initialguess� for this nonlinear problem can be quite close to the solution� since the �initialguess� is simply the solution at the previous time step� which implies that a lineariza�tion approach may be quite successful� Such an approach is described in the nextSection�

�� �� Local Linearization for Scalar Equations

General Development

Let us start the process of local linearization by considering Eq� ���� In order toimplement the linearization� we expand F �u� t� about some reference point in time�Designate the reference value by tn and the corresponding value of the dependentvariable by un� A Taylor series expansion about these reference quantities gives

F �u� t� � F �un� tn� �

��F

�u

�n

�u� un� �

��F

�t

�n

�t� tn�

��

���F

�u�

�n

�u� un�� �

���F

�u�t

�n

�u� un��t� tn�

��

���F

�t�

�n

�t� tn�� � � � � �����

On the other hand� the expansion of u�t� in terms of the independent variable t is

u�t� � un � �t� tn�

��u

�t

�n

��

��t� tn��

���u

�t�

�n

� � � � ����

If t is within h of tn� both �t � tn�k and �u � un�k are O�hk�� and Eq� ��� can bewritten

F �u� t� � Fn �

��F

�u

�n

�u� un� �

��F

�t

�n

�t� tn� � O�h�� �����

Page 122: Fundamentals of Computational Fluid Dynamics

����� IMPLEMENTATION OF IMPLICIT METHODS ���

Notice that this is an expansion of the derivative of the function� Thus� relative to theorder of expansion of the function� it represents a second�order�accurate� locally�linearapproximation to F �u� t� that is valid in the vicinity of the reference station tn andthe corresponding un � u�tn�� With this we obtain the locally �in the neighborhoodof tn� time�linear representation of Eq� ���� namely

du

dt�

��F

�u

�n

u �

�Fn �

��F

�u

�n

un

��

��F

�t

�n

�t� tn� � O�h�� ���� �

Implementation of the Trapezoidal Method

As an example of how such an expansion can be used� consider the mechanics ofapplying the trapezoidal method for the time integration of Eq� ���� The trapezoidalmethod is given by

un� � un ��

�h�Fn� � Fn� � hO�h�� ������

where we write hO�h�� to emphasize that the method is second order accurate� UsingEq� ��� to evaluate Fn� � F �un�� tn��� one �nds

un� � un ��

�h

Fn �

��F

�u

�n

�un� � un� � h

��F

�t

�n

� O�h�� � Fn

��hO�h�� ������

Note that the O�h�� term within the brackets �which is due to the local linearization�is multiplied by h and therefore is the same order as the hO�h�� error from theTrapezoidal Method� The use of local time linearization updated at the end of eachtime step� and the trapezoidal time march� combine to make a second�order�accuratenumerical integration process� There are� of course� other second�order implicit time�marching methods that can be used� The important point to be made here is thatlocal linearization updated at each time step has not reduced the order of accuracy ofa second�order time�marching process�

A very useful reordering of the terms in Eq� ���� results in the expression

�� �

�h

��F

�u

�n

��un � hFn �

�h���F

�t

�n

������

which is now in the delta form which will be formally introduced in Section ����� Inmany �uid mechanic applications the nonlinear function F is not an explicit function

Page 123: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� TIME�MARCHING METHODS FOR ODES

of t� In such cases the partial derivative of F �u� with respect to t is zero and Eq� ����simpli�es to the second�order accurate expression

�� �

�h

��F

�u

�n

��un � hFn ������

Notice that the RHS is extremely simple� It is the product of h and the RHS ofthe basic equation evaluated at the previous time step� In this example� the basicequation was the simple scalar equation ���� but for our applications� it is generallythe space�dierenced form of the steady�state equation of some �uid �ow problem�

A numerical time�marching procedure using Eq� ���� is usually implemented asfollows�

�� Solve for the elements of h�Fn� store them in an array say �R� and save �un�

�� Solve for the elements of the matrix multiplying ��un and store in some appro�priate manner making use of sparseness or bandedness of the matrix if possible�Let this storage area be referred to as B�

�� Solve the coupled set of linear equations

B��un � �R

for ��un� �Very seldom does one �nd B�� in carrying out this step��

�� Find �un� by adding ��un to �un� thus

�un� � ��un � �un

The solution for �un� is generally stored such that it overwrites the value of �unand the process is repeated�

Implementation of the Implicit Euler Method

We have seen that the �rst�order implicit Euler method can be written

un� � un � hFn� ������

if we introduce Eq� ��� into this method� rearrange terms� and remove the explicitdependence on time� we arrive at the form

�� h

��F

�u

�n

��un � hFn ������

Page 124: Fundamentals of Computational Fluid Dynamics

����� IMPLEMENTATION OF IMPLICIT METHODS ���

We see that the only dierence between the implementation of the trapezoidal method

and the implicit Euler method is the factor of �� in the brackets of the left side of

Eqs� ���� and ����� Omission of this factor degrades the method in time accuracy byone order of h� We shall see later that this method is an excellent choice for steadyproblems�

Newton�s Method

Consider the limit h � � of Eq� ���� obtained by dividing both sides by h andsetting ��h � � There results

���F

�u

�n

�un � Fn ������

or

un� � un ��

�F

�u

�n

���Fn �����

This is the well�known Newton method for �nding the roots of a nonlinear equationF �u� � � The fact that it has quadratic convergence is veri�ed by a glance at Eqs���� and �� �remember the dependence on t has been eliminated for this case�� Byquadratic convergence� we mean that the error after a given iteration is proportionalto the square of the error at the previous iteration� where the error is the dierencebetween the current solution and the converged solution� Quadratic convergence isthus a very powerful property� Use of a �nite value of h in Eq� ���� leads to linearconvergence� i�e�� the error at a given iteration is some multiple of the error at theprevious iteration� The reader should ponder the meaning of letting h � � for thetrapezoidal method� given by Eq� �����

�� �� Local Linearization for Coupled Sets of Nonlinear Equa�

tions

In order to present this concept� let us consider an example involving some sim�ple boundary�layer equations� We choose the Falkner�Skan equations from classicalboundary�layer theory� Our task is to apply the implicit trapezoidal method to theequations

d�f

dt�� f

d�f

dt�� �

�����df

dt

���A � ������

Here f represents a dimensionless stream function� and � is a scaling factor�

Page 125: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� TIME�MARCHING METHODS FOR ODES

First of all we reduce Eq� ���� to a set of �rst�order nonlinear equations by thetransformations

u� �d�f

dt�� u� �

df

dt� u� � f ���� �

This gives the coupled set of three nonlinear equations

u�� � F� � �u� u� � ���� u��

�u�� � F� � u�

u�� � F� � u� ���� ��

and these can be represented in vector notation as

d�u

dt� �F ��u� ���� ��

Now we seek to make the same local expansion that derived Eq� ��� � except thatthis time we are faced with a nonlinear vector function� rather than a simple nonlinearscalar function� The required extension requires the evaluation of a matrix� calledthe Jacobian matrix�� Let us refer to this matrix as A� It is derived from Eq� ��� �by the following process

A � �aij� � �Fi ��uj ���� ��

For the general case involving a third order matrix this is

A �

�����������

�F��u�

�F��u�

�F��u�

�F��u�

�F��u�

�F��u�

�F��u�

�F��u�

�F��u�

�������������� ��

The expansion of �F ��u� about some reference state �un can be expressed in a waysimilar to the scalar expansion given by eq ���� Omitting the explicit dependency

on the independent variable t� and de�ning �F n as �F ��un�� one has �

Recall that we derived the Jacobian matrices for the twodimensional Euler equations in Section���

The Taylor series expansion of a vector contains a vector for the �rst term� a matrix times avector for the second term� and tensor products for the terms of higher order�

Page 126: Fundamentals of Computational Fluid Dynamics

����� PROBLEMS ���

�F ��u� � �F n � An

��u� �un

�� O�h�� ���� ��

where t� tn and the argument for O�h�� is the same as in the derivation of Eq� ���Using this we can write the local linearization of Eq� ��� � as

d�u

dt� An

�u ���F n � An

�un

� �z ��constant�

�O�h�� ���� ��

which is a locally�linear� second�order�accurate approximation to a set of couplednonlinear ordinary dierential equations that is valid for t � tn � h� Any �rst� orsecond�order time�marching method� explicit or implicit� could be used to integratethe equations without loss in accuracy with respect to order� The number of times�and the manner in which� the terms in the Jacobian matrix are updated as the solutionproceeds depends� of course� on the nature of the problem�

Returning to our simple boundary�layer example� which is given by Eq� ��� �� we�nd the Jacobian matrix to be

A �

��� � u� ��u� �u�� �

�� ���� ��

The student should be able to derive results for this example that are equivalent tothose given for the scalar case in Eq� ����� Thus for the Falkner�Skan equations thetrapezoidal method results in�����

� � h��u��n ��h�u��n

h� �u��n

� h� �

�h� �

������� ��u��n

��u��n��u��n

���h

��� � �u�u��n � ���� u���n�u��n�u��n

��We �nd �un� from ��un ��un� and the solution is now advanced one step� Re�evaluatethe elements using �un� and continue� Without any iterating within a step advance�the solution will be second�order�accurate in time�

���� Problems

�� Find an expression for the nth term in the Fibonacci series� which is givenby �� �� �� �� �� � � � � Note that the series can be expressed as the solution to adierence equation of the form un� � un � un��� What is u�� �Let the �rstterm given above be u���

Page 127: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� TIME�MARCHING METHODS FOR ODES

�� The trapezoidal method un� � un � ��h�u�n� � u�n� is used to solve the repre�

sentative ODE�

�a� What is the resulting O�E�

�b� What is its exact solution�

�c� How does the exact steady�state solution of the O�E compare with theexact steady�state solution of the ODE if � � �

�� The �nd�order backward method is given by

un� ��

h�un � un�� � �hu�n�

i�a� Write the O�E for the representative equation� Identify the polynomials

P �E� and Q�E��

�b� Derive the ��� relation� Solve for the ��roots and identify them as principalor spurious�

�c� Find er� and the �rst two nonvanishing terms in a Taylor series expansionof the spurious root�

�d� Perform a ��root trace relative to the unit circle for both diusion andconvection�

�� Consider the time�marching scheme given by

un� � un�� ��h

��u�n� � u�n � u�n���

�a� Write the O�E for the representative equation� Identify the polynomialsP �E� and Q�E��

�b� Derive the �� � relation�

�c� Find er��

�� Find the dierence equation which results from applying the Gazdag predictor�corrector method �Eq� ����� to the representative equation� Find the ��� rela�tion�

�� Consider the following time�marching method�

$un��� � un � hu�n��

%un��� � un � h$u�n�����

un� � un � h%u�n���

Page 128: Fundamentals of Computational Fluid Dynamics

����� PROBLEMS ���

Find the dierence equation which results from applying this method to therepresentative equation� Find the ��� relation� Find the solution to the dier�ence equation� including the homogeneous and particular solutions� Find er�and er�� What order is the homogeneous solution� What order is the particularsolution� Find the particular solution if the forcing term is �xed�

�� Write a computer program to solve the one�dimensional linear convection equa�tion with periodic boundary conditions and a � � on the domain � x � ��Use �nd�order centered dierences in space and a grid of � points� For theinitial condition� use

u�x� � � e�����x��������

with � � � � Use the explicit Euler� �nd�order Adams�Bashforth �AB��� im�plicit Euler� trapezoidal� and �th�order Runge�Kutta methods� For the explicitEuler and AB� methods� use a Courant number� ah��x� of �� for the othermethods� use a Courant number of unity� Plot the solutions obtained at t � �compared to the exact solution �which is identical to the initial condition��

� Repeat problem � using �th�order �noncompact� dierences in space� Use only�th�order Runge�Kutta time marching at a Courant number of unity� Showsolutions at t � � and t � � compared to the exact solution�

�� Using the computer program written for problem �� compute the solution att � � using �nd�order centered dierences in space coupled with the �th�orderRunge�Kutta method for grids of � � � � and � nodes� On a log�log scale�plot the error given by vuuut MX

j��

�uj � uexactj ��

M

where M is the number of grid nodes and uexact is the exact solution� Find theglobal order of accuracy from the plot�

� � Using the computer program written for problem � repeat problem � using�th�order �noncompact� dierences in space�

��� Write a computer program to solve the one�dimensional linear convection equa�tion with in�ow�out�ow boundary conditions and a � � on the domain �x � �� Let u� � t� � sin�t with � � � � Run until a periodic steady stateis reached which is independent of the initial condition and plot your solution

Page 129: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� TIME�MARCHING METHODS FOR ODES

compared with the exact solution� Use �nd�order centered dierences in spacewith a �st�order backward dierence at the out�ow boundary �as in Eq� �����together with �th�order Runge�Kutta time marching� Use grids with � � � �and � nodes and plot the error vs� the number of grid nodes� as described inproblem �� Find the global order of accuracy�

��� Repeat problem �� using �th�order �noncompact� centered dierences� Use athird�order forward�biased operator at the in�ow boundary �as in Eq� ������ Atthe last grid node� derive and use a �rd�order backward operator �using nodesj��� j��� j��� and j� and at the second last node� use a �rd�order backward�biased operator �using nodes j��� j��� j� and j�� see problem � in Chapter���

��� Using the approach described in Section ������ �nd the phase speed error� erp�and the amplitude error� era� for the combination of second�order centered dif�ferences and �st� �nd� �rd� and �th�order Runge�Kutta time�marching at aCourant number of unity� Also plot the phase speed error obtained using exactintegration in time� i�e�� that obtained using the spatial discretization alone�Note that the required ��roots for the various Runge�Kutta methods can bededuced from Eq� ����� without actually deriving the methods� Explain yourresults�

Page 130: Fundamentals of Computational Fluid Dynamics

Chapter �

STABILITY OF LINEAR

SYSTEMS

A general de�nition of stability is neither simple nor universal and depends on theparticular phenomenon being considered� In the case of the nonlinear ODE�s ofinterest in �uid dynamics� stability is often discussed in terms of �xed points andattractors� In these terms a system is said to be stable in a certain domain if� fromwithin that domain� some norm of its solution is always attracted to the same �xedpoint� These are important and interesting concepts� but we do not dwell on them inthis work� Our basic concern is with time�dependent ODE�s and O�E �s in which thecoe�cient matrices are independent of both u and t see Section ���� We will referto such matrices as stationary� Chapters � and � developed the representative formsof ODE�s generated from the basic PDE�s by the semidiscrete approach� and thenthe O�E�s generated from the representative ODE�s by application of time�marchingmethods� These equations are represented by

d�u

dt� A�u� �f�t� �����

and

�un� � C�un � �gn �����

respectively� For a one�step method� the latter form is obtained by applying a time�marching method to the generic ODE form in a fairly straightforward manner� Forexample� the explicit Euler method leads to C � I � hA� and �gn � �f�nh�� Methodsinvolving two or more steps can always be written in the form of Eq� ��� by introducingnew dependent variables� Note also that only methods in which the time and spacediscretizations are treated separately can be written in an intermediate semi�discreteform such as Eq� ���� The fully�discrete form� Eq� ��� and the associated stabilityde�nitions and analysis are applicable to all methods�

���

Page 131: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� STABILITY OF LINEAR SYSTEMS

�� Dependence on the Eigensystem

Our de�nitions of stability are based entirely on the behavior of the homogeneousparts of Eqs� ��� and ���� The stability of Eq� ��� depends entirely on the eigensys�tem� of A� The stability of Eq� ��� can often also be related to the eigensystem ofits matrix� However� in this case the situation is not quite so simple since� in ourapplications to partial dierential equations �especially hyperbolic ones�� a stabilityde�nition can depend on both the time and space dierencing� This is discussed inSection ���� Analysis of these eigensystems has the important added advantage thatit gives an estimate of the rate at which a solution approaches a steady�state if asystem is stable� Consideration will be given to matrices that have both completeand defective eigensystems� see Section ������ with a reminder that a complete systemcan be arbitrarily close to a defective one� in which case practical applications canmake the properties of the latter appear to dominate�

If A and C are stationary� we can� in theory at least� estimate their fundamentalproperties� For example� in Section ������ we found from our model ODE�s for dif�fusion and periodic convection what could be expected for the eigenvalue spectrumsof practical physical problems containing these phenomena� These expectations arereferred to many times in the following analysis of stability properties� They areimportant enough to be summarized by the following�

For diusion dominated �ows the ��eigenvalues tend to lie along the negativereal axis�

For periodic convection�dominated �ows the ��eigenvalues tend to lie along theimaginary axis�

In many interesting cases� the eigenvalues of the matrices in Eqs� ��� and ���are su�cient to determine the stability� In previous chapters� we designated theseeigenvalues as �m and �m for Eqs� ��� and ���� respectively� and we will �nd itconvenient to examine the stability of various methods in both the complex � andcomplex � planes�

�This is not the case if the coe�cient matrix depends on t even if it is linear�

Page 132: Fundamentals of Computational Fluid Dynamics

���� INHERENT STABILITY OF ODES ���

�� Inherent Stability of ODEs

����� The Criterion

Here we state the standard stability criterion used for ordinary dierential equa�tions�

For a stationary matrix A� Eq� ��� is inherently stable if� when �f isconstant� �u remains bounded as t���

�����

Note that inherent stability depends only on the transient solution of the ODE�s�

����� Complete Eigensystems

If a matrix has a complete eigensystem� all of its eigenvectors are linearly independent�and the matrix can be diagonalized by a similarity transformation� In such a case itfollows at once from Eq� ����� for example� that the ODE�s are inherently stable ifand only if

���m� � for all m �����

This states that� for inherent stability� all of the � eigenvalues must lie on� or to theleft of� the imaginary axis in the complex � plane� This criterion is satis�ed for themodel ODE�s representing both diusion and biconvection� It should be emphasized�as it is an important practical consideration in convection�dominated systems� thatthe special case for which � � �i is included in the domain of stability� In this caseit is true that �u does not decay as t � �� but neither does it grow� so the abovecondition is met� Finally we note that for ODE�s with complete eigensystems theeigenvectors play no role in the inherent stability criterion�

����� Defective Eigensystems

In order to understand the stability of ODE�s that have defective eigensystems� weinspect the nature of their solutions in eigenspace� For this we draw on the results inSections ����� and especially on Eqs� ��� to ���� in that section� In an eigenspacerelated to defective systems the form of the representative equation changes from asingle equation to a Jordan block� For example� instead of Eq� ���� a typical form ofthe homogeneous part might be��� u

��

u��u��

�� �

����� �� �

����� u�u�u�

��

Page 133: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� STABILITY OF LINEAR SYSTEMS

for which one �nds the solution

u��t� � u�� �e�t

u��t� � �u�� � � u�� �t�e�t

u��t� ��u�� � � u�� �t �

�u�� �t�

�e�t �����

Inspecting this solution� we see that for such cases condition ��� must be modi�edto the form

���m� � for all m �����

since for pure imaginary �� u� and u� would grow without bound �linearly or quadrat�ically� if u�� � � or u�� � � � Theoretically this condition is su�cient for stabilityin the sense of Statement ��� since tke�j jt � as t�� for all non�zero � However�in practical applications the criterion may be worthless since there may be a verylarge growth of the polynomial before the exponential �takes over� and brings aboutthe decay� Furthermore� on a computer such a growth might destroy the solutionprocess before it could be terminated�

Note that the stability condition ��� excludes the imaginary axis which tends to beoccupied by the eigenvalues related to biconvection problems� However� condition ���is of little or no practical importance if signi�cant amounts of dissipation are present�

�� Numerical Stability of O�E s

����� The Criterion

The O�E companion to Statement ��� is

For a stationary matrix C� Eq� ��� is numerically stable if� when �g isconstant� �un remains bounded as n���

�����

We see that numerical stability depends only on the transient solution of the O�E �s�This de�nition of stability is sometimes referred to as asymptotic or time stability�

As we stated at the beginning of this chapter� stability de�nitions are not unique� Ade�nition often used in CFD literature stems from the development of PDE solutionsthat do not necessarily follow the semidiscrete route� In such cases it is appropriateto consider simultaneously the eects of both the time and space approximations� Atime�space domain is �xed and stability is de�ned in terms of what happens to somenorm of the solution within this domain as the mesh intervals go to zero at someconstant ratio� We discuss this point of view in Section ����

Page 134: Fundamentals of Computational Fluid Dynamics

���� TIME�SPACE STABILITY AND CONVERGENCE OF O�ES ���

����� Complete Eigensystems

Consider a set of O�E �s governed by a complete eigensystem� The stability criterion�according to the condition set in Eq� ���� follows at once from a study of Eq� ���and its companion for multiple ��roots� Eq� ����� Clearly� for such systems a time�marching method is numerically stable if and only if

j��m�kj � � for all m and k ����

This condition states that� for numerical stability� all of the � eigenvalues �bothprincipal and spurious� if there are any� must lie on or inside the unit circle in thecomplex ��plane�

This de�nition of stability for O�E �s is consistent with the stability de�nition forODE�s� Again the sensitive case occurs for the periodic�convection model which placesthe �correct� location of the principal ��root precisely on the unit circle where thesolution is only neutrally stable� Further� for a complete eigensystem� the eigenvectorsplay no role in the numerical stability assessment�

����� Defective Eigensystems

The discussion for these systems parallels the discussion for defective ODE�s� ExamineEq� ��� and note its similarity with Eq� ���� We see that for defective O�E�s therequired modi�cation to �� is

j��m�kj � � for all m and k �����

since defective systems do not guarantee boundedness for j�j � �� for example in Eq���� if j�j � � and either u�� � or u�� � � we get linear or quadratic growth�

�� Time�Space Stability and Convergence of O�Es

Let us now examine the concept of stability in a dierent way� In the previousdiscussion we considered in some detail the following approach�

�� The PDE�s are converted to ODE�s by approximating the space derivatives ona �nite mesh�

�� Inherent stability of the ODE�s is established by guaranteeing that ���� � �

�� Time�march methods are developed which guarantee that j���h�j � � and thisis taken to be the condition for numerical stability�

Page 135: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� STABILITY OF LINEAR SYSTEMS

This does guarantee that a stationary system� generated from a PDE on some �xedspace mesh� will have a numerical solution that is bounded as t � nh � �� Thisdoes not guarantee that desirable solutions are generated in the time march processas both the time and space mesh intervals approach zero�

Now let us de�ne stability in the time�space sense� First construct a �nite time�space domain lying within � x � L and � t � T � Cover this domain with a gridthat is equispaced in both time and space and �x the mesh ratio by the equation�

cn ��t

�x

Next reduce our O�E approximation of the PDE to a two�level �i�e�� two time�planes�formula in the form of Eq� ���� The homogeneous part of this formula is

�un� � C�un ���� �

Eq� ��� is said to be stable if any bounded initial vector� �u�� produces a boundedsolution vector� �un� as the mesh shrinks to zero for a �xed cn� This is the classicalde�nition of stability� It is often referred to as Lax or Lax�Richtmyer stability� Clearlyas the mesh intervals go to zero� the number of time steps� N � must go to in�nity inorder to cover the entire �xed domain� so the criterion in ��� is a necessary conditionfor this stability criterion�

The signi�cance of this de�nition of stability arises through Lax�s Theorem� whichstates that� if a numerical method is stable �in the sense of Lax� and consistent thenit is convergent� A method is consistent if it produces no error �in the Taylor seriessense� in the limit as the mesh spacing and the time step go to zero �with cn �xed� inthe hyperbolic case�� This is further discussed in Section ��� A method is convergentif it converges to the exact solution as the mesh spacing and time step go to zero inthis manner�� Clearly� this is an important property�

Applying simple recursion to Eq� ��� � we �nd

�un � Cn�u�

and using vector and matrix p�norms �see Appendix A� and their inequality relations�we have

jj�unjj � jjCn�u�jj � jjCnjj � jj�u�jj � jjCjjn � jj�u�jj ������

�This ratio is appropriate for hyperbolic problems a di�erent ratio may be needed for parabolicproblems such as the model di�usion equation�

�In the CFD literature� the word converge is used with two entirely di�erent meanings� Here werefer to a numerical solution converging to the exact solution of the PDE� Later we will refer to thenumerical solution converging to a steady state solution�

Page 136: Fundamentals of Computational Fluid Dynamics

���� TIME�SPACE STABILITY AND CONVERGENCE OF O�ES ���

Since the initial data vector is bounded� the solution vector is bounded if

jjCjj � � ������

where jjCjj represents any p�norm of C� This is often used as a su�cient conditionfor stability�

Now we need to relate the stability de�nitions given in Eqs� �� and ��� with thatgiven in Eq� ����� In Eqs� �� and ���� stability is related to the spectral radius ofC� i�e�� its eigenvalue of maximum magnitude� In Eq� ����� stability is related to ap�norm of C� It is clear that the criteria are the same when the spectral radius is atrue p�norm�

Two facts about the relation between spectral radii and matrix norms are wellknown�

�� The spectral radius of a matrix is its L� norm when the matrix is normal� i�e��it commutes with its transpose�

�� The spectral radius is the lower bound of all norms�

Furthermore� when C is normal� the second inequality in Eq� ���� becomes an equal�ity� In this case� Eq� ���� becomes both necessary and su�cient for stability� Fromthese relations we draw two important conclusions about the numerical stability ofmethods used to solve PDE�s�

The stability criteria in Eqs� �� and ���� are identical for stationary systemswhen the governing matrix is normal� This includes symmetric� asymmetric�and circulant matrices� These criteria are both necessary and su�cient formethods that generate such matrices and depend solely upon the eigenvalues ofthe matrices�

If the spectral radius of any governing matrix is greater than one� the methodis unstable by any criterion� Thus for general matrices� the spectral radiuscondition is necessary� but not su�cient for stability�

�Actually the necessary condition is that the spectral radius of C be less than or equal to � �O��t�� but this distinction is not critical for our purposes here�

Page 137: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� STABILITY OF LINEAR SYSTEMS

�� Numerical Stability Concepts in the Complex

��Plane

���� ��Root Traces Relative to the Unit Circle

Whether or not the semi�discrete approach was taken to �nd the dierencing approx�imation of a set of PDE�s� the �nal dierence equations can be represented by

�un� � C�un � �gn

Furthermore if C has a complete eigensystem� the solution to the homogeneous partcan always be expressed as

�un � c��n� �x� � � � �� cm�

nm�xm � � � �� cM�

nM�xM

where the �m are the eigenvalues of C� If the semi�discrete approach is used� we can�nd a relation between the � and the � eigenvalues� This serves as a very convenientguide as to where we might expect the ��roots to lie relative to the unit circle in thecomplex ��plane� For this reason we will proceed to trace the locus of the ��rootsas a function of the parameter �h for the equations modeling diusion and periodicconvection��

Locus of the exact trace

Figure ��� shows the exact trace of the ��root if it is generated by e�h representingeither diusion or biconvection� In both cases the represents the starting valuewhere h � and � � �� For the diusion model� �h is real and negative� As themagnitude of �h increases� the trace representing the dissipation model heads towardsthe origin as �h �� ��� On the other hand� for the biconvection model� �h � i�his always imaginary� As the magnitude of �h increases� the trace representing thebiconvection model travels around the circumference of the unit circle� which it neverleaves� We must be careful in interpreting � when it is representing ei�h� The factthat it lies on the unit circle means only that the amplitude of the representation iscorrect� it tells us nothing of the phase error �see Eq� ������ The phase error relatesto the position on the unit circle�

�The subject of defective eigensystems has been addressed� From now on we will omit furtherdiscussion of this special case�

�Or� if you like� the parameter h for �xed values of � equal to � and i for the di�usion andbiconvection cases� respectively�

Page 138: Fundamentals of Computational Fluid Dynamics

���� NUMERICAL STABILITY CONCEPTS IN THE COMPLEX ��PLANE ���

Examples of some methods

Now let us compare the exact ��root traces with some that are produced by actualtime�marching methods� Table ��� shows the ��� relations for a variety of methods�Figures ��� and ��� illustrate the results produced by various methods when they areapplied to the model ODE�s for diusion and periodic�convection� Eqs� ��� and ����It is implied that the behavior shown is typical of what will happen if the methodsare applied to diusion� �or dissipation�� dominated or periodic convection�dominatedproblems as well as what does happen in the model cases� Most of the importantpossibilities are covered by the illustrations�

� � � �� �h � Explicit Euler� �� � ��h� � � � Leapfrog

� �� � �� � ���h�� � �

��h � AB�

� �� � �� � �����h��� � ��

���h� � ����h � AB�

� ���� �h�� � � Implicit Euler

� ���� ���h�� �� � �

��h� � Trapezoidal

� ����� ���h�� �

�� � �� � �nd O Backward

����� ����h�� �� �

���h�� � ����h � AM�

� �� � �� � �����h � ��

����h��� � �

���h�� � ���h� � ABM�

� �� � �� � ��h��� � ���h� � �

��h � Gazdag

�� � � �� �h � ���

�h� � RK�

�� � � �� �h � ���

�h� � ���

�h� � ����

�h� � RK�

�� ����� ���h�� �

��h� � �� � ���h� � Milne �th

Table ���� Some �� � Relations

a Explicit Euler Method

Figure ��� shows results for the explicit Euler method� When used for dissipation�dominated cases it is stable for the range ��� �h � � �Usually the magnitude of � hasto be estimated and often it is found by trial and error�� When used for biconvectionthe �� trace falls outside the unit circle for all �nite h� and the method has no rangeof stability in this case�

Page 139: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� STABILITY OF LINEAR SYSTEMS

h= οο

- oo,σ = e σ = ei h

oo,

a) Dissipation b) Convection

λ

ωhωhλ hλ

Ι(σ) Ι(σ)

(σ) (σ)RR

h= 0λ h= 0ω

Figure ���� Exact traces of ��roots for model equations�

b Leapfrog Method

This is a two�root method� since there are two ��s produced by every �� Whenapplied to dissipation dominated problems we see from Fig� ��� that the principalroot is stable for a range of �h� but the spurious root is not� In fact� the spuriousroot starts on the unit circle and falls outside of it for all ���h� � � However� forbiconvection cases� when � is pure imaginary� the method is not only stable� but italso produces a � that falls precisely on the unit circle in the range � �h � ��As was pointed out above� this does not mean� that the method is without error�Although the �gure shows that there is a range of �h in which the leapfrog methodproduces no error in amplitude� it says nothing about the error in phase� More is saidabout this in Chapter �

c Second�Order Adams�Bashforth Method

This is also a two�root method but� unlike the leapfrog scheme� the spurious rootstarts at the origin� rather than on the unit circle� see Fig� ���� Therefore� there isa range of real negative �h for which the method will be stable� The �gure showsthat the range ends when �h � ��� since at that point the spurious root leaves thecircle and j��j becomes greater than one� The situation is quite dierent when the

Page 140: Fundamentals of Computational Fluid Dynamics

���� NUMERICAL STABILITY CONCEPTS IN THE COMPLEX ��PLANE ���

σ1

σ1

λ h=-2

σ1

σ1

σ2

σ2

λ h=-1

σ1σ2

σ2 σ1

a) Euler Explicit

b) Leapfrog

c) AB2

h = 1ω

ConvectionDiffusion

Figure ���� Traces of ��roots for various methods�

��root is pure imaginary� In that case as �h increases away from zero the spuriousroot remains inside the circle and remains stable for a range of �h� However� theprincipal root falls outside the unit circle for all �h � � and for the biconvectionmodel equation the method is unstable for all h�

d Trapezoidal Method

The trapezoidal method is a very popular one for reasons that are partially illustratedin Fig� ���� Its ��roots fall on or inside the unit circle for both the dissipating andthe periodic convecting case and� in fact� it is stable for all values of �h for which� itself is inherently stable� Just like the leapfrog method it has the capability of

Page 141: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� STABILITY OF LINEAR SYSTEMS

producing only phase error for the periodic convecting case� but there is a majordierence between the two since the trapezoidal method produces no amplitude errorfor any �h � not just a limited range between � �h � ��

e Gazdag Method

The Gazdag method was designed to produce low phase error� Since its characteristicpolynomial for � is a cubic �Table ���� no� � �� it must have two spurious roots inaddition to the principal one� These are shown in Fig� ���� In both the dissipationand biconvection cases� a spurious root limits the stability� For the dissipating case�

a spurious root leaves the unit circle when �h � ���� and for the biconvecting case�

when �h � ��� Note that both spurious roots are located at the origin when � � �

f�g Second� and Fourth�Order Runge�Kutta Methods� RK� and RK�

Traces of the ��roots for the second� and fourth�order Runge�Kutta methods areshown in Fig� ���� The �gures show that both methods are stable for a range of�h when �h is real and negative� but that the range of stability for RK� is greater�going almost all the way to ���� whereas RK� is limited to ��� On the other hand forbiconvection RK� is unstable for all �h� whereas RK� remains inside the unit circlefor � �h � �

p�� One can show that the RK� stability limit is about j�hj � �� for

all complex �h for which ���� � �

���� Stability for Small �t

It is interesting to pursue the question of stability when the time step size� h� is smallso that accuracy of all the ��roots is of importance� Situations for which this is notthe case are considered in Chapter �

Mild instability

All conventional time�marching methods produce a principal root that is very closeto e�h for small values of �h� Therefore� on the basis of the principal root� thestability of a method that is required to resolve a transient solution over a relativelyshort time span may be a moot issue� Such cases are typi�ed by the AB� and RK�methods when they are applied to a biconvection problem� Figs� ���c and ���f showthat for both methods the principal root falls outside the unit circle and is unstablefor all �h� However� if the transient solution of interest can be resolved in a limitednumber of time steps that are small in the sense of the �gure� the error caused by thisinstability may be relatively unimportant� If the root had fallen inside the circle the

Page 142: Fundamentals of Computational Fluid Dynamics

���� NUMERICAL STABILITY CONCEPTS IN THE COMPLEX ��PLANE ���

σ1σ1

σ1

σ1

σ2

σ3

σ1σ1

σ1

σ1

σ2

σ3

d) Trapezoidal

e) Gazdag

f) RK2

g) RK4

λ h=- οο h = 2/3ω

λ h=-2

λ h=-2.8 h = 2 2ω

Diffusion Convection

Figure ���� Traces of ��roots for various methods �cont�d��

Page 143: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� STABILITY OF LINEAR SYSTEMS

method would have been declared stable but an error of the same magnitude wouldhave been committed� just in the opposite direction� For this reason the AB� and theRK� methods have both been used in serious quantitative studies involving periodicconvection� This kind of instability is referred to as mild instability and is not aserious problem under the circumstances discussed�

Catastrophic instability

There is a much more serious stability problem for small h that can be brought aboutby the existence of certain types of spurious roots� One of the best illustrations of thiskind of problem stems from a critical study of the most accurate� explicit� two�step�linear multistep method �see Table �����

un� � ��un � �un�� � �h��u�n � u�n��

�������

One can show� using the methods given in Section ���� that this method is third�order accurate both in terms of er� and er�� so from an accuracy point of view it isattractive� However� let us inspect its stability even for very small values of �h� Thiscan easily be accomplished by studying its characteristic polynomial when �h � �From Eq� ���� it follows that for �h � � P �E� � E� � �E � �� Factoring P ��� � we �nd P ��� � �� � ���� � �� � � There are two ��roots ��� the principal one�equal to �� and ��� a spurious one� equal to ��##

In order to evaluate the consequences of this result� one must understand howmethods with spurious roots work in practice� We know that they are not self start�ing� and the special procedures chosen to start them initialize the coe�cients of thespurious roots� the cmk for k � � in Eq� ����� If the starting process is well designedthese coe�cients are forced to be very small� and if the method is stable� they getsmaller with increasing n� However� if the magnitude of one of the spurious � isequal to �� one can see disaster is imminent because ����� � � � Even a very smallinitial value of cmk is quickly overwhelmed� Such methods are called catastrophicallyunstable and are worthless for most� if not all� computations�

Milne and Adams type methods

If we inspect the ��root traces of the multiple root methods in Figs� ��� and ���� we�nd them to be of two types� One type is typi�ed by the leapfrog method� In thiscase a spurious root falls on the unit circle when h� � The other type is exempli�edby the �nd�order Adams�Bashforth and Gazdag methods� In this case all spuriousroots fall on the origin when h� �

The former type is referred to as a Milne Method� Since at least one spurious rootfor a Milne method always starts on the unit circle� the method is likely to become

Page 144: Fundamentals of Computational Fluid Dynamics

���� NUMERICAL STABILITY CONCEPTS IN THE COMPLEX �H PLANE���

unstable for some complex � as h proceeds away from zero� On the basis of a Taylorseries expansion� however� these methods are generally the most accurate insofar asthey minimize the coe�cient in the leading term for ert�

The latter type is referred to as an Adams Method� Since for these methodsall spurious methods start at the origin for h � � they have a guaranteed range ofstability for small enough h� However� on the basis of the magnitude of the coe�cientin the leading Taylor series error term� they suer� relatively speaking� from accuracy�

For a given amount of computational work� the order of accuracy of the twotypes is generally equivalent� and stability requirements in CFD applications generallyoverride the �usually small� increase in accuracy provided by a coe�cient with lowermagnitude�

�� Numerical Stability Concepts in the Complex

�h Plane

���� Stability for Large h�

The reason to study stability for small values of h is fairly easy to comprehend�Presumably we are seeking to resolve some transient and� since the accuracy of thetransient solution for all of our methods depends on the smallness of the time�step�we seek to make the size of this step as small as possible� On the other hand� thecost of the computation generally depends on the number of steps taken to computea solution� and to minimize this we wish to make the step size as large as possible�In the compromise� stability can play a part� Aside from ruling out catastrophicallyunstable methods� however� the situation in which all of the transient terms areresolved constitutes a rather minor role in stability considerations�

By far the most important aspect of numerical stability occurs under conditionswhen�

One has inherently stable� coupled systems with ��eigenvalues having widelyseparated magnitudes�

or

We seek only to �nd a steady�state solution using a path that includes theunwanted transient�

In both of these cases there exist in the eigensystems relatively large values ofj�hj associated with eigenvectors that we wish to drive through the solution processwithout any regard for their individual accuracy in eigenspace� This situation is

Page 145: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� STABILITY OF LINEAR SYSTEMS

the major motivation for the study of numerical stability� It leads to the subject ofstiness discussed in the next chapter�

���� Unconditional Stability� A�Stable Methods

Inherent stability of a set of ODE�s was de�ned in Section ��� and� for coupled setswith a complete eigensystem� it amounted to the requirement that the real parts of all� eigenvalues must lie on� or to the left of� the imaginary axis in the complex � plane�This serves as an excellent reference frame to discuss and de�ne the general stabilityfeatures of time�marching methods� For example� we start with the de�nition�

A numerical method is unconditionally stable if it is stable for all ODE�sthat are inherently stable�

A method with this property is said to be A�stable� A method is Ao�stable if theregion of stability contains the negative real axis in the complex �h plane� and I�stableif it contains the entire imaginary axis� By applying a fairly simple test for A�stabilityin terms of positive real functions to the class of two�step LMM�s given in Section������ one �nds these methods to be A�stable if and only if

� � � ��

�������

� � ��

�������

� � � � �� �

�������

A set of A�stable implicit methods is shown in Table ����

� � � Method Order

� Implicit Euler ���� Trapezoidal �� ��� �nd O Backward �

��� ���� Adams type ���� ���� ���� Lees ���� ���� ���� Two�step trapezoidal ��� ���� ���� A�contractive �

Table ���� Some unconditionally stable �A�stable� implicit methods�

Notice that none of these methods has an accuracy higher than second�order� It canbe proved that the order of an A�stable LMM cannot exceed two� and� furthermore

Page 146: Fundamentals of Computational Fluid Dynamics

���� NUMERICAL STABILITY CONCEPTS IN THE COMPLEX �H PLANE���

that of all �nd�order A�stable methods� the trapezoidal method has the smallesttruncation error�

Returning to the stability test using positive real functions one can show that atwo�step LMM is Ao�stable if and only if

� � � ��

�������

� � ��

������

� � � � ������

For �rst�order accuracy� the inequalities ���� to ���� are less stringent than ���� to����� For second�order accuracy� however� the parameters ��� �� �� are related by thecondition

� � � � � ��

and the two sets of inequalities reduce to the same set which is

� � �� � � ���� �

� � ��

�������

Hence� two�step� second�order accurate LMM�s that are A�stable and Ao�stable sharethe same ��� �� �� parameter space� Although the order of accuracy of an A�stablemethod cannot exceed two� Ao�stable LMM methods exist which have an accuracy ofarbitrarily high order�

It has been shown that for a method to be I�stable it must also be A�stable�Therefore� no further discussion is necessary for the special case of I�stability�

It is not di�cult to prove that methods having a characteristic polynomial forwhich the coe�cient of the highest order term in E is unity can never be uncondi�tionally stable� This includes all explicit methods and predictor�corrector methodsmade up of explicit sequences� Such methods are referred to� therefore� as condition�ally stable methods�

���� Stability Contours in the Complex �h Plane�

A very convenient way to present the stability properties of a time�marching methodis to plot the locus of the complex �h for which j�j � �� such that the resulting

�Or can be made equal to unity by a trivial normalization �division by a constant independent of�h�� The proof follows from the fact that the coe�cients of such a polynomial are sums of variouscombinations of products of all its roots�

Page 147: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� STABILITY OF LINEAR SYSTEMS

λ h)

λ h)

c) Euler Implicit

1

Stable

Unstable

b) Trapezoid Implicit

λ h)

λ h)

Stable Unstable

λ h)

λ h)

1

a) Euler Explicit

Stable

Unstable

θ = 0 θ = 1/2 θ = 1

I

R

I

R R

I(((

( ( (

Figure ���� Stability contours for the ��method�

contour goes through the point �h � � Here j�j refers to the maximum absolutevalue of any �� principal or spurious� that is a root to the characteristic polynomial fora given �h� It follows from Section ��� that on one side of this contour the numericalmethod is stable while on the other� it is unstable� We refer to it� therefore� as astability contour�

Typical stability contours for both explicit and implicit methods are illustrated inFig� ���� which is derived from the one�root ��method given in Section ������

Contours for explicit methods

Fig� ���a shows the stability contour for the explicit Euler method� In the followingtwo ways it is typical of all stability contours for explicit methods�

�� The contour encloses a �nite portion of the left�half complex �h�plane�

�� The region of stability is inside the boundary� and therefore� it is conditional�

However� this method includes no part of the imaginary axis �except for the origin�and so it is unstable for the model biconvection problem� Although several explicitmethods share this de�ciency �e�g�� AB�� RK��� several others do not �e�g�� leapfrog�Gazdag� RK�� RK��� see Figs� ��� and ���� Notice in particular that the third� andfourth�order Runge�Kutta methods� Fig� ���� include a portion of the imaginary axisout to ����i and ��

p�i� respectively�

Contours for unconditionally stable implicit methods

Fig� ���c shows the stability contour for the implicit Euler method� It is typical ofmany stability contours for unconditionally stable implicit methods� Notice that the

Page 148: Fundamentals of Computational Fluid Dynamics

���� NUMERICAL STABILITY CONCEPTS IN THE COMPLEX �H PLANE���

Figure ���� Stability contours for some explicit methods�

StableRegions

RK1

RK2

RK3

RK4

1.0

2.0

3.0

-1.0-2.0-3.0

R( h)

I( h)

λ

λ

Figure ���� Stability contours for Runge�Kutta methods�

Page 149: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� STABILITY OF LINEAR SYSTEMS

1.0

2.0

Unstable

a) 2nd Order Backward Implicit

Stable Outside

Unstable

b) Adams Type

Stable Outside

I( h)

R( h)

I( h)

R( h)

λ

λ

λ

λ1.0

1.0

1.02.0 2.0

2.0

3.0 4.0

Figure ���� Stability contours for the � unconditionally stable implicit methods�

method is stable for the entire range of complex �h that fall outside the boundary�This means that the method is numerically stable even when the ODE�s that it isbeing used to integrate are inherently unstable� Some other implicit unconditionallystable methods with the same property are shown in Fig� ���� In all of these casesthe imaginary axis is part of the stable region�

Not all unconditionally stable methods are stable in some regions where the ODE�sthey are integrating are inherently unstable� The classic example of a method thatis stable only when the generating ODE�s are themselves inherently stable is the

trapezoidal method� i�e�� the special case of the ��method for which � � ��� The

stability boundary for this case is shown in Fig� ���b� The boundary is the imaginaryaxis and the numerical method is stable for �h lying on or to the left of this axis�Two other methods that have this property are the two�step trapezoidal method

un� � un�� � h�u�n� � u�n��

�and a method due to Lees

un� � un�� ��

�h�u�n� � u�n � u�n��

�Notice that both of these methods are of the Milne type�

Contours for conditionally stable implicit methods

Just because a method is implicit does not mean that it is unconditionally stable�Two illustrations of this are shown in Fig� ��� One of these is the Adams�Moulton�rd�order method �no� � Table ����� Another is the �th�order Milne method givenby the point operator

un� � un�� ��

�h�u�n� � �u�n � u�n��

�and shown in Table ��� as no� ��� It is stable only for � � �i� when � � � p

��Its stability boundary is very similar to that for the leapfrog method �see Fig� ���b��

Page 150: Fundamentals of Computational Fluid Dynamics

���� FOURIER STABILITY ANALYSIS ���

Stable

I( h)

-1.0-2.0-3.0

1.0

2.0

3.0

λ

a) AM3

I( h)

1.0

2.0

3.0

λ

R( h)λ R( h)λ

Stableonly onImag Axis

b) Milne 4th Order

Figure ��� Stability contours for the � conditionally stable implicit methods�

� Fourier Stability Analysis

By far the most popular form of stability analysis for numerical schemes is the Fourieror von Neumann approach� This analysis is usually carried out on point operators andit does not depend on an intermediate stage of ODE�s� Strictly speaking it appliesonly to dierence approximations of PDE�s that produce O�E�s which are linearhave no space or time varying coe�cients and have periodic boundary conditions��

In practical application it is often used as a guide for estimating the worthiness ofa method for more general problems� It serves as a fairly reliable necessary stabilitycondition� but it is by no means a su�cient one�

����� The Basic Procedure

One takes data from a �typical� point in the �ow �eld and uses this as constantthroughout time and space according to the assumptions given above� Then oneimposes a spatial harmonic as an initial value on the mesh and asks the question�Will its amplitude grow or decay in time� The answer is determined by �nding theconditions under which

u�x� t� � et � ei�x ������

is a solution to the di�erence equation� where is real and �x lies in the range � �x � � Since� for the general term�

u�n�jm � e�t�t� � ei��xm�x� � e�t � ei�m�x � u�n�j

Another way of viewing this is to consider it as an initial value problem on an in�nite spacedomain�

Page 151: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� STABILITY OF LINEAR SYSTEMS

the quantity u�n�j is common to every term and can be factored out� In the remaining

expressions� we �nd the term e�t which we represent by �� thus�

� � e�t

Then� since et ��e�t

�n� �n� it is clear that

For numerical stability j�j � � ������

and the problem is to solve for the ��s produced by any given method and� as anecessary condition for stability� make sure that� in the worst possible combinationof parameters� condition ���� is satis�ed��

����� Some Examples

The procedure can best be explained by examples� Consider as a �rst example the�nite dierence approximation to the model diusion equation known as Richardson�smethod of overlapping steps� This was mentioned in Section ��� and given as Eq�����

u�n��j � u

�n���j � �

��t

�x�

�u�n�j� � �u

�n�j � u

�n�j��

�������

Substitution of Eq� ���� into Eq� ���� gives the relation

� � ��� � ���t

�x�

�ei��x � � � e�i��x

�or

�� �����t

�x���� cos �x�

� �z �

�b

� � � � ������

Thus Eq� ���� is a solution of Eq� ���� if � is a root of Eq� ����� The two roots of���� are

���� � �b�pb� � �

from which it is clear that one j�j is always � �� We �nd� therefore� that by theFourier stability test� Richardson�s method of overlapping steps is unstable for all �� and �t�

If boundedness is required in a �nite time domain� the condition is often presented as j�j �� �O��t��

Page 152: Fundamentals of Computational Fluid Dynamics

���� CONSISTENCY ���

As another example consider the �nite�dierence approximation for the modelbiconvection equation

u�n��j � u

�n�j � a�t

��x

�u�n�j� � u

�n�j��

�������

In this case

� � �� a�t

�x� i � sin �x

from which it is clear that j�j � � for all nonzero a and � Thus we have another�nite�dierence approximation that� by the Fourier stability test� is unstable for anychoice of the free parameters�

����� Relation to Circulant Matrices

The underlying assumption in a Fourier stability analysis is that the C matrix� deter�mined when the dierencing scheme is put in the form of Eq� ���� is circulant� Suchbeing the case� the ei�x in Eq� ���� represents an eigenvector of the system� and thetwo examples just presented outline a simple procedure for �nding the eigenvalues ofthe circulant matrices formed by application of the two methods to the model prob�lems� The choice of � for the stability parameter in the Fourier analysis� therefore�is not an accident� It is exactly the same � we have been using in all of our previousdiscussions� but arrived at from a dierent perspective�

If we examine the preceding examples from the viewpoint of circulant matricesand the semi�discrete approach� the results present rather obvious conclusions� Thespace dierencing in Richardson�s method produces the matrix s �Bp������ �� wheres is a positive scalar coe�cient� From Appendix B we �nd that the eigenvalues of thismatrix are real negative numbers� Clearly� the time�marching is being carried out bythe leapfrog method and� from Fig� ���� this method is unstable for all eigenvalues withnegative real parts� On the other hand� the space matrix in Eq� ���� is Bp���� � ���and according to Appendix B� this matrix has pure imaginary eigenvalues� However�in this case the explicit Euler method is being used for the time�march and� accordingto Fig� ���� this method is always unstable for such conditions�

�� Consistency

Consider the model equation for diusion analysis

�u

�t� �

��u

�x�������

Page 153: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� STABILITY OF LINEAR SYSTEMS

Many years before computers became available ���� � in fact�� Lewis F� Richardsonproposed a method for integrating equations of this type� We presented his methodin Eq� ��� and analyzed its stability by the Fourier method in Section ����

In Richardson�s time� the concept of numerical instability was not known� How�ever� the concept is quite clear today and we now know immediately that his approachwould be unstable� As a semi�discrete method it can be expressed in matrix notationas the system of ODE�s�

d�u

dt�

�x�B������ ���u � ��bc� �����

with the leapfrog method used for the time march� Our analysis in this Chapterrevealed that this is numerically unstable since the ��roots of B�������� are all realand negative and the spurious ��root in the leapfrog method is unstable for all suchcases� see Fig� ���b�

The method was used by Richardson for weather prediction� and this fact can nowbe a source of some levity� In all probability� however� the hand calculations �theonly approach available at the time� were not carried far enough to exhibit strangephenomena� We could� of course� use the �nd�order Runge�Kutta method to integrateEq� ��� since it is stable for real negative ��s� It is� however� conditionally stableand for this case we are rather severely limited in time step size by the requirement�t � �x�������

There are many ways to manipulate the numerical stability of algorithms� One ofthem is to introduce mixed time and space dierencing� a possibility we have not yetconsidered� For example� we introduced the DuFort�Frankel method in Chapter ��

u�n��j � u

�n���j �

���t

�x�

��u�n�j�� � �

��u�n��j � u

�n���j

�A� u�n�j�

� ������

in which the central term in the space derivative in Eq� ��� has been replaced by itsaverage value at two dierent time levels� Now let

� � ���t

�x�

and rearrange terms

�� � ��u�n��j � ��� ��u

�n���j � �

hu�n�j�� � u

�n�j�

iThere is no obvious ODE between the basic PDE and this �nal O�E� Hence� thereis no intermediate ��root structure to inspect� Instead one proceeds immediately tothe ��roots�

Page 154: Fundamentals of Computational Fluid Dynamics

���� CONSISTENCY ���

The simplest way to carry this out is by means of the Fourier stability analysisintroduced in Section ���� This leads at once to

�� � ��� � ��� ����� � ��ei��x � e�i��x

�or

�� � ���� � ��� cos�k�x�� ��� �� �

The solution of the quadratic is

� �� cos �x�

q�� �� sin� �x

� � �

There are �M ��roots all of which are � � for any real � in the range � � � ��This means that the method is unconditionally stable#

The above result seems too good to be true� since we have found an unconditionallystable method using an explicit combination of Lagrangian interpolation polynomials�

The price we have paid for this is the loss of con�sistency with the original PDE�

To prove this� we expand the terms in Eq� ��� in a Taylor series and reconstructthe partial dierential equation we are actually solving as the mesh size becomes verysmall� For the time derivative we have

��t

hu�n��j � u

�n���j

i� ��tu��n�j �

��t���tttu��n�j � � � �

and for the mixed time and space dierences

u�n�j�� � u

�n��j � u

�n���j � u

�n�j�

�x�� ��xxu��n�j �

��t

�x

��

��ttu��n�j �

���x���xxxxu��n�j �

���t�

��t

�x

��

��ttttu��n�j � � � � ���� �

Replace the terms in Eq� ��� with the above expansions and take the limit as�t � �x� � We �nd

�u

�t� �

��u

�x�� �r�

��u

�t�������

where

r � �t

�x

Page 155: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� STABILITY OF LINEAR SYSTEMS

Eq� ���� is parabolic� Eq� ���� is hyperbolic� Thus if �t� and �x� in such

a way that �t�x remains constant� the equation we actually solve by the method in

Eq� ��� is a wave equation� not a diusion equation� In such a case Eq� ��� is notuniformly consistent with the equation we set out to solve even for vanishingly smallstep sizes� The situation is summarized in Table ���� If �t� and �x� in such

a way that �t�x�

remains constant� then r� is O��t�� and the method is consistent�

However� this leads to a constraint on the time step which is just as severe as thatimposed by the stability condition of the second�order Runge�Kutta method shownin the table�

�nd�order Runge�Kutta DuFort�FrankelFor Stability

�t � �x��� �t � �

Conditionally Stable Unconditionally StableFor Consistency

Uniformly Consistent Conditionally Consistent�

with Approximates �u�t

� � ��u�x�

�u�t

� � ��u�x�

only if

��

�t�x

���

Therefore�t � �x

q�

Table ���� Summary of accuracy and consistency conditions for RK� andDu Fort�Frankel methods� � an arbitrary error bound�

� Problems

�� Consider the ODE

u� �du

dt� Au � f

with

A �

��� �� � �� � ��� �� �

� � ��

�� � f �

��� ��

��

Page 156: Fundamentals of Computational Fluid Dynamics

��� PROBLEMS ���

�a� Find the eigenvalues of A using a numerical package� What is the steady�state solution� How does the ODE solution behave in time�

�b� Write a code to integrate from the initial condition u� � � ��� �� ��T fromtime t � using the explicit Euler� implicit Euler� and MacCormack meth�ods� In all three cases� use h � �� for � time steps� h � �� for � time steps� h � �� for �� time steps and h � �� for � time steps�Compare the computed solution with the exact steady solution�

�c� Using the ��� relations for these three methods� what are the expectedbounds on h for stability� Are your results consistent with these bounds�

�� �a� Compute a table of the numerical values of the ��roots of the �nd�orderAdams�Bashforth method when � � i� Take h in intervals of � � from to � and compute the absolute values of the roots to at least � places�

�b� Plot the trace of the roots in the complex ��plane and draw the unit circleon the same plot�

�c� Repeat the above for the RK� method�

�� When applied to the linear convection equation� the widely known Lax�Wendromethod gives�

un�j � unj �

�Cn�unj� � unj��� �

�C�n�unj� � �unj � unj���

where Cn� known as the Courant �or CFL� number� is ah��x� Using Fourierstability analysis� �nd the range of Cn for which the method is stable�

�� Determine and plot the stability contours for the Adams�Bashforth methods oforder � through �� Compare with the Runge�Kutta methods of order � through��

�� Recall the compact centered ��point approximation for a �rst derivative�

��xu�j�� � ���xu�j � ��xu�j� ��

�x�uj� � uj���

By replacing the spatial index j by the temporal index n� obtain a time�marchingmethod using this formula� What order is the method� Is it explicit or implicit�Is it a two�step LMM� If so� to what values of �� �� and � �in Eq� ����� does itcorrespond� Derive the ��� relation for the method� Is it A�stable� Ao�stable�or I�stable�

Page 157: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� STABILITY OF LINEAR SYSTEMS

�� Write the ODE system obtained by applying the �nd�order centered dierenceapproximation to the spatial derivative in the model diusion equation withperiodic boundary conditions� Using Appendix B��� �nd the eigenvalues of thespatial operator matrix� Given that the ��� relation for the �nd�order Adams�Bashforth method is

�� � �� � ��h���� � �h�� �

show that the maximum stable value of j�hj for real negative �� i�e�� the pointwhere the stability contour intersects the negative real axis� is obtained with�h � ��� Using the eigenvalues of the spatial operator matrix� �nd the maxi�mum stable time step for the combination of �nd�order centered dierences andthe �nd�order Adams�Bashforth method applied to the model diusion equa�tion� Repeat using Fourier analysis�

�� Consider the following PDE�

�u

�t� i

��u

�x�

where i �p��� Which explicit time�marching methods would be suitable for

integrating this PDE� if �nd�order centered dierencing is used for the spa�tial dierences and the boundary conditions are periodic� Find the stabilitycondition for one of these methods�

� Using Fourier analysis� analyze the stability of �rst�order backward dierenc�ing coupled with explicit Euler time marching applied to the linear convectionequation with positive a� Find the maximum Courant number for stability�

�� Consider the linear convection with a positive wave speed as in problem � Applya Dirichlet boundary condition at the left boundary� No boundary condition ispermitted at the right boundary� Write the system of ODE�s which results from�rst�order backward spatial dierencing in matrix�vector form� Using AppendixB��� �nd the ��eigenvalues� Write the O�E which results from the applicationof explicit Euler time marching in matrix�vector form� i�e��

�un� � C�un � �gn

Write C in banded matrix notation and give the entries of �g� Using the ��� relation for the explicit Euler method� �nd the ��eigenvalues� Based onthese� what is the maximum Courant number allowed for asymptotic stability�Explain why this diers from the answer to problem � Hint� is C normal�

Page 158: Fundamentals of Computational Fluid Dynamics

Chapter

CHOICE OF TIME�MARCHING

METHODS

In this chapter we discuss considerations involved in selecting a time�marching methodfor a speci�c application� Examples are given showing how time�marching methodscan be compared in a given context� An important concept underlying much of thisdiscussion is sti�ness� which is de�ned in the next section�

��� Sti�ness De�nition for ODEs

����� Relation to ��Eigenvalues

The introduction of the concept referred to as �stiness� comes about from the nu�merical analysis of mathematical models constructed to simulate dynamic phenom�ena containing widely dierent time scales� De�nitions given in the literature arenot unique� but fortunately we now have the background material to construct ade�nition which is entirely su�cient for our purposes�

We start with the assumption that our CFD problem is modeled with su�cientaccuracy by a coupled set of ODE�s producing an A matrix typi�ed by Eq� ����Any de�nition of stiness requires a coupled system with at least two eigenvalues�and the decision to use some numerical time�marching or iterative method to solveit� The dierence between the dynamic scales in physical space is represented bythe dierence in the magnitude of the eigenvalues in eigenspace� In the followingdiscussion we concentrate on the transient part of the solution� The forcing functionmay also be time varying in which case it would also have a time scale� However�we assume that this scale would be adequately resolved by the chosen time�marchingmethod� and� since this part of the ODE has no eect on the numerical stability of

���

Page 159: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� CHOICE OF TIME�MARCHING METHODS

StableRegion

AccurateRegion

1

I( h)

R( h)

λ

λ

λh

Figure ��� Stable and accurate regions for the explicit Euler method�

the homogeneous part� we exclude the forcing function from further discussion in thissection�

Consider now the form of the exact solution of a system of ODE�s with a com�plete eigensystem� This is given by Eq� ���� and its solution using a one�root� time�marching method is represented by Eq� ���� For a given time step� the time integra�tion is an approximation in eigenspace that is dierent for every eigenvector �xm� Inmany numerical applications the eigenvectors associated with the small j�mj are wellresolved and those associated with the large j�mj are resolved much less accurately�if at all� The situation is represented in the complex �h plane in Fig� ��� In this�gure the time step has been chosen so that time accuracy is given to the eigenvectorsassociated with the eigenvalues lying in the small circle and stability without timeaccuracy is given to those associated with the eigenvalues lying outside of the smallcircle but still inside the large circle�

The whole concept of stiness in CFD arises from the fact that we often donot need the time resolution of eigenvectors associated with the large j�mj inthe transient solution� although these eigenvectors must remain coupled intothe system to maintain a high accuracy of the spatial resolution�

Page 160: Fundamentals of Computational Fluid Dynamics

���� STIFFNESS DEFINITION FOR ODES ���

����� Driving and Parasitic Eigenvalues

For the above reason it is convenient to subdivide the transient solution into twoparts� First we order the eigenvalues by their magnitudes� thus

j��j � j��j � � � � � j�M j ����

Then we write

TransientSolution

�pX

m��

cme�mt �xm �z �

Driving

�MX

m�p�

cme�mt �xm �z �

Parasitic

����

This concept is crucial to our discussion� Rephrased� it states that we can separateour eigenvalue spectrum into two groups one ��� � �p� called the driving eigenvalues�our choice of a time�step and marching method must accurately approximate the timevariation of the eigenvectors associated with these�� and the other� ��p� � �M �� calledthe parasitic eigenvalues �no time accuracy whatsoever is required for the eigenvectorsassociated with these� but their presence must not contaminate the accuracy of thecomplete solution�� Unfortunately� we �nd that� although time accuracy requirementsare dictated by the driving eigenvalues� numerical stability requirements are dictatedby the parasitic ones�

����� Sti�ness Classi�cations

The following de�nitions are somewhat useful� An inherently stable set of ODE�s issti if

j�pj j�M jIn particular we de�ne the ratio

Cr � j�M j � j�pjand form the categories

Mildly�sti Cr � � �

Strongly�sti � � � Cr � �

Extremely�sti � � � Cr � � �

Pathologically�sti � � � Cr

It should be mentioned that the gaps in the sti category de�nitions are intentionalbecause the bounds are arbitrary� It is important to notice that these de�nitionsmake no distinction between real� complex� and imaginary eigenvalues�

Page 161: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� CHOICE OF TIME�MARCHING METHODS

��� Relation of Sti�ness to Space Mesh Size

Many �ow �elds are characterized by a few regions having high spatial gradients ofthe dependent variables and other domains having relatively low gradient phenomena�As a result it is quite common to cluster mesh points in certain regions of space andspread them out otherwise� Examples of where this clustering might occur are at ashock wave� near an airfoil leading or trailing edge� and in a boundary layer�

One quickly �nds that this grid clustering can strongly aect the eigensystem ofthe resulting A matrix� In order to demonstrate this� let us examine the eigensystemsof the model problems given in Section ������ The simplest example to discuss relatesto the model diusion equation� In this case the eigenvalues are all real� negativenumbers that automatically obey the ordering given in Eq� ��� Consider the casewhen all of the eigenvalues are parasitic� i�e�� we are interested only in the convergedsteady�state solution� Under these conditions� the stiness is determined by the ratio�M���� A simple calculation shows that

�� � � ��

�x�sin�

��M � ��

�� �

���

�x�

���x

��

� ��

�M � � ��

�x�sin�

�� � ��

�x�

and the ratio is

�M��� � �

�x�� �

�M � �

��

The most important information found from this example is the fact that thestiness of the transient solution is directly related to the grid spacing� Furthermore�in diusion problems this stiness is proportional to the reciprocal of the space meshsize squared� For a mesh size M � � � this ratio is about � � Even for a mesh ofthis moderate size the problem is already approaching the category of strongly sti�

For the biconvection model a similar analysis shows that

j�M j � j��j � �

�x

Here the stiness parameter is still space�mesh dependent� but much less so than fordiusion�dominated problems�

We see that in both cases we are faced with the rather annoying fact that the morewe try to increase the resolution of our spatial gradients� the stier our equations tendto become� Typical CFD problems without chemistry vary between the mildly andstrongly sti categories� and are greatly aected by the resolution of a boundary layersince it is a diusion process� Our brief analysis has been limited to equispaced

Page 162: Fundamentals of Computational Fluid Dynamics

���� PRACTICAL CONSIDERATIONS FOR COMPARING METHODS ���

problems� but in general the stiness of CFD problems is proportional to the meshintervals in the manner shown above where the critical interval is the smallest one inthe physical domain�

��� Practical Considerations for Comparing Meth�

ods

We have presented relatively simple and reliable measures of stability and both thelocal and global accuracy of time�marching methods� Since there are an endlessnumber of these methods to choose from� one can wonder how this information isto be used to pick a �best� choice for a particular problem� There is no uniqueanswer to such a question� For example� it is� among other things� highly dependentupon the speed� capacity� and architecture of the available computer� and technologyin�uencing this is undergoing rapid and dramatic changes as this is being written�Nevertheless� if certain ground rules are agreed upon� relevant conclusions can bereached� Let us now examine some ground rules that might be appropriate� It shouldthen be clear how the analysis can be extended to other cases�

Let us consider the problem of measuring the e�ciency of a time�marching methodfor computing� over a �xed interval of time� an accurate transient solution of a coupledset of ODE�s� The length of the time interval� T � and the accuracy required of thesolution are dictated by the physics of the particular problem involved� For example�in calculating the amount of turbulence in a homogeneous �ow� the time intervalwould be that required to extract a reliable statistical sample� and the accuracywould be related to how much the energy of certain harmonics would be permittedto distort from a given level� Such a computation we refer to as an event�

The appropriate error measures to be used in comparing methods for calculatingan event are the global ones� Era� Er� and Er�� discussed in Section ������ ratherthan the local ones er�� era� and erp discussed earlier�

The actual form of the coupled ODE�s that are produced by the semi�discreteapproach is

d�u

dt� �F ��u� t�

At every time step we must evaluate the function �F ��u� t� at least once� This functionis usually nonlinear� and its computation usually consumes the major portion of thecomputer time required to make the simulation� We refer to a single calculation of thevector �F ��u� t� as a function evaluation and denote the total number of such evaluationsby Fev�

Page 163: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� CHOICE OF TIME�MARCHING METHODS

��� Comparing the E�ciency of Explicit Methods

����� Imposed Constraints

As mentioned above� the e�ciency of methods can be compared only if one accepts aset of limiting constraints within which the comparisons are carried out� The followassumptions bound the considerations made in this Section�

�� The time�march method is explicit�

�� Implications of computer storage capacity and access time are ignored� In somecontexts� this can be an important consideration�

�� The calculation is to be time�accurate� must simulate an entire event whichtakes a total time T � and must use a constant time step size� h� so that

T � Nh

where N is the total number of time steps�

����� An Example Involving Di�usion

Let the event be the numerical solution of

du

dt� �u ����

from t � to T � � ln� ���� with u� � � �� Eq� �� is obtained from our representa�tive ODE with � � ��� a � � Since the exact solution is u�t� � u� �e�t� this makesthe exact value of u at the end of the event equal to ���� i�e�� u�T � � ���� To theconstraints imposed above� let us set the additional requirement

The error in u at the end of the event� i�e�� the global error� must be � ��'�

We judge the most e�cient method as the one that satis�es these conditions andhas the fewest number of evaluations� Fev� Three methods are compared � explicitEuler� AB�� and RK��

First of all� the allowable error constraint means that the global error in the am�plitude� see Eq� ���� must have the property�����Er�e�T

���� � � �

Page 164: Fundamentals of Computational Fluid Dynamics

���� COMPARING THE EFFICIENCY OF EXPLICIT METHODS ���

Then� since h � T�N � � ln� �����N � it follows that����� ����ln������N��N������� � � �

where �� is found from the characteristic polynomials given in Table ���� The resultsshown in Table �� were computed using a simple iterative procedure�

Method N h �� Fev Er�Euler ��� � �� ����� ��� � ��� worstAB� �� � �� ����� �� � ����RK� � ����� �� �� � ���� best

Table ��� Comparison of time�marching methods for a simple dissipation problem�

In this example we see that� for a given global accuracy� the method with thehighest local accuracy is the most e�cient on the basis of the expense in evaluatingFev� Thus the second�order Adams�Bashforth method is much better than the �rst�order Euler method� and the fourth�order Runge�Kutta method is the best of all� Themain purpose of this exercise is to show the �usually� great superiority of second�orderover �rst�order time�marching methods�

����� An Example Involving Periodic Convection

Let us use as a basis for this example the study of homogeneous turbulence simulatedby the numerical solution of the incompressible Navier�Stokes equations inside a cubewith periodic boundary conditions on all sides� In this numerical experiment thefunction evaluations contribute overwhelmingly to the CPU time� and the number ofthese evaluations must be kept to an absolute minimum because of the magnitude ofthe problem� On the other hand� a complete event must be established in order toobtain meaningful statistical samples which are the essence of the solution� In thiscase� in addition to the constraints given in Section ����� we add the following�

The number of evaluations of �F ��u� t� is �xed�

Under these conditions a method is judged as best when it has the highest globalaccuracy for resolving eigenvectors with imaginary eigenvalues� The above constrainthas led to the invention of schemes that omit the function evaluation in the cor�rector step of a predictor�corrector combination� leading to the so�called incomplete

Page 165: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� CHOICE OF TIME�MARCHING METHODS

predictor�corrector methods� The presumption is� of course� that more e�cient meth�ods will result from the omission of the second function evaluation� An example isthe method of Gazdag� given in Section ��� Basically this is composed of an AB�predictor and a trapezoidal corrector� However� the derivative of the fundamentalfamily is never found so there is only one evaluation required to complete each cycle�The ��� relation for the method is shown as entry � in Table ����

In order to discuss our comparisions we introduce the following de�nitions�

Let a k�evaluation method be de�ned as one that requires k evaluations of�F ��u� t� to advance one step using that method�s time interval� h�

Let K represent the total number of allowable Fev�

Let h� be the time interval advanced in one step of a one�evaluation method�

The Gazdag� leapfrog� and AB� schemes are all ��evaluation methods� The secondand fourth order RK methods are �� and ��evaluation methods� respectively� For a ��evaluation method the total number of time steps� N � and the number of evaluations�K� are the same� one evaluation being used for each step� so that for these methodsh � h�� For a ��evaluation method N � K�� since two evaluations are used foreach step� However� in this case� in order to arrive at the same time T after Kevaluations� the time step must be twice that of a one�evaluation method so h � �h��For a ��evaluation method the time interval must be h � �h�� etc� Notice thatas k increases� the time span required for one application of the method increases�However notice also that as k increases the power to which �� is raised to arriveat the �nal destination decreases see the Figure below� This is the key to the truecomparison of time�march methods for this type of problem�

T uNk � � j j ����h���

k � � j �h� j �����h����

k � � j �h� j �����h����

Step sizes and powers of � for k�evaluation methods used to get to the same valueof T if evaluations are allowed�

In general� after K evaluations� the global amplitude and phase error for k�evaluation methods applied to systems with pure imaginary ��roots can be written�

Era � �� j���ik�h��jK�k ����

�See Eqs� �� � and �� ��

Page 166: Fundamentals of Computational Fluid Dynamics

���� COMPARING THE EFFICIENCY OF EXPLICIT METHODS ���

Er� � �T � K

ktan��

����ik�h���imaginary

����ik�h���real

�����

Consider a convection�dominated event for which the function evaluation is verytime consuming� We idealize to the case where � � i� and set � equal to one� Theevent must proceed to the time t � T � � � We consider two maximum evaluationlimits K � � and K � � and choose from four possible methods� leapfrog� AB��Gazdag� and RK�� The �rst three of these are one�evaluation methods and the lastone is a four�evaluation method� It is not di�cult to show that on the basis of localerror �made in a single step� the Gazdag method is superior to the RK� method inboth amplitude and phase� For example� for �h � �� the Gazdag method producesa j��j � �������� whereas for �h � � �which must be used to keep the number ofevaluations the same� the RK� method produces a j��j � ������� However� we aremaking our comparisons on the basis of global error for a �xed number of evaluations�

First of all we see that for a one�evaluation method h� � T�K� Using this� and thefact that � � �� we �nd� by some rather simple calculations� made using Eqs� �� and��� the results shown in Table ��� Notice that to �nd global error the Gazdag rootmust be raised to the power of � while the RK� root is raised only to the power of� !�� On the basis of global error the Gazdag method is not superior to RK� in eitheramplitude or phase� although� in terms of phase error �for which it was designed� itis superior to the other two methods shown�

K leapfrog AB� Gazdag RK��h� � �� � �� �� � ���� �����h� � �� � �� �� �� ���� ����

a� Amplitude� exact � �� �

K leapfrog AB� Gazdag RK��h� � �� � ���� ���� ��� ����h� � �� � ��� ��� ��� ���

b� Phase error in degrees�

Table ��� Comparison of global amplitude and phase errors for four methods�

�The �� root for the Gazdag method can be found using a numerical root �nding routine to tracethe three roots in the �plane� see Fig� �� e�

Page 167: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� CHOICE OF TIME�MARCHING METHODS

Using analysis such as this �and also considering the stability boundaries� theRK� method is recommended as a basic �rst choice for any explicit time�accuratecalculation of a convection�dominated problem�

��� Coping With Sti�ness

���� Explicit Methods

The ability of a numerical method to cope with stiness can be illustrated quite nicelyin the complex �h plane� A good example of the concept is produced by studyingthe Euler method applied to the representative equation� The transient solution isun � �� � �h�n and the trace of the complex value of �h which makes j� � �hj � �gives the whole story� In this case the trace forms a circle of unit radius centered at���� � as shown in Fig� ��� If h is chosen so that all �h in the ODE eigensystemfall inside this circle the integration will be numerically stable� Also shown by thesmall circle centered at the origin is the region of Taylor series accuracy� If some �hfall outside the small circle but stay within the stable region� these �h are sti� butstable� We have de�ned these �h as parasitic eigenvalues� Stability boundaries forsome explicit methods are shown in Figs� ��� and ����

For a speci�c example� consider the mildly sti system composed of a coupledtwo�equation set having the two eigenvalues �� � �� and �� � ��� If uncoupledand evaluated in wave space� the time histories of the two solutions would appear as arapidly decaying function in one case� and a relatively slowly decaying function in theother� Analytical evaluation of the time histories poses no problem since e����t quicklybecomes very small and can be neglected in the expressions when time becomes large�Numerical evaluation is altogether dierent� Numerical solutions� of course� dependupon ����mh��n and no j�mj can exceed one for any �m in the coupled system or elsethe process is numerically unstable�

Let us choose the simple explicit Euler method for the time march� The coupledequations in real space are represented by

u��n� � c���� � h�nx�� � c���� h�nx�� � �PS��

u��n� � c���� � h�nx�� � c���� h�nx�� � �PS�� ����

We will assume that our accuracy requirements are such that su�cient accuracy isobtained as long as j�hj � ��� This de�nes a time step limit based on accuracyconsiderations of h � � � for �� and h � �� for ��� The time step limit basedon stability� which is determined from ��� is h � � �� We will also assume thatc� � c� � � and that an amplitude less than � � is negligible� We �rst run ��time steps with h � � � in order to resolve the �� term� With this time step the

Page 168: Fundamentals of Computational Fluid Dynamics

���� COPING WITH STIFFNESS ���

�� term is resolved exceedingly well� After �� steps� the amplitude of the �� term�i�e�� ��� � h�n� is less than � � and that of the �� term �i�e�� ��� h�n� is ������Hence the �� term can now be considered negligible� To drive the �� � h�n term tozero �i�e�� below � ��� we would like to change the step size to h � �� and continue�We would then have a well resolved answer to the problem throughout the entirerelevant time interval� However� this is not possible because of the coupled presenceof ��� � h�n� which in just � steps at h � �� ampli�es those terms by � � �� faroutweighing the initial decrease obtained with the smaller time step� In fact� withh � � �� the maximum step size that can be taken in order to maintain stability�about ��� time steps have to be computed in order to drive e�t to below � �� Thusthe total simulation requires � � time steps�

���� Implicit Methods

Now let us re�examine the problem that produced Eq� �� but this time using anunconditionally stable implicit method for the time march� We choose the trapezoidalmethod� Its behavior in the �h plane is shown in Fig� ���b� Since this is also a one�root method� we simply replace the Euler � with the trapezoidal one and analyze theresult� It follows that the �nal numerical solution to the ODE is now represented inreal space by

u��n� � c�

��� � h

� � � h

�n

x�� � c�

��� ��h

� � ��h

�nx�� � �PS��

u��n� � c�

��� � h

� � � h

�n

x�� � c�

��� ��h

� � ��h

�nx�� � �PS�� ����

In order to resolve the initial transient of the term e����t� we need to use a step sizeof about h � � �� This is the same step size used in applying the explicit Eulermethod because here accuracy is the only consideration and a very small step sizemust be chosen to get the desired resolution� �It is true that for the same accuracywe could in this case use a larger step size because this is a second�order method�but that is not the point of this exercise�� After � time steps the �� term hasamplitude less than � � and can be neglected� Now with the implicit method wecan proceed to calculate the remaining part of the event using our desired step sizeh � �� without any problem of instability� with �� steps required to reduce theamplitude of the second term to below � �� In both intervals the desired solutionis second�order accurate and well resolved� It is true that in the �nal �� steps one��root is �� � � � ������� � � � ���� � ���� � � �� and this has no physical meaningwhatsoever� However� its in�uence on the coupled solution is negligible at the endof the �rst � steps� and� since � ���� � � ��n � �� its in�uence in the remaining �

Page 169: Fundamentals of Computational Fluid Dynamics

�� CHAPTER �� CHOICE OF TIME�MARCHING METHODS

steps is even less� Actually� although this root is one of the principal roots in thesystem� its behavior for t � � � is identical to that of a stable spurious root� Thetotal simulation requires ��� time steps�

���� A Perspective

It is important to retain a proper perspective on a problem represented by the aboveexample� It is clear that an unconditionally stable method can always be called uponto solve sti problems with a minimum number of time steps� In the example� theconditionally stable Euler method required � � time steps� as compared to about��� for the trapezoidal method� about three times as many� However� the Eulermethod is extremely easy to program and requires very little arithmetic per step� Forpreliminary investigations it is often the best method to use for mildly�sti diusiondominated problems� For re�ned investigations of such problems an explicit methodof second order or higher� such as Adams�Bashforth or Runge�Kutta methods� isrecommended� These explicit methods can be considered as eective mildly sti�stable methods� However� it should be clear that as the degree of stiness of theproblem increases� the advantage begins to tilt towards implicit methods� as thereduced number of time steps begins to outweigh the increased cost per time step�The reader can repeat the above example with �� � �� � � �� � ��� which is inthe strongly�sti category�

There is yet another technique for coping with certain sti systems in �uid dynamicapplications� This is known as the multigrid method� It has enjoyed remarkablesuccess in many practical problems however� we need an introduction to the theoryof relaxation before it can be presented�

��� Steady Problems

In Chapter � we wrote the O�E solution in terms of the principal and spurious rootsas follows�

un � c������n��x� � � � �� cm���m�n�

�xm � � � �� cM���M�n��xM � P�S�

�c������n��x� � � � �� cm���m�n�

�xm � � � �� cM���M�n��xM

�c������n��x� � � � �� cm���m�n�

�xm � � � �� cM���M�n��xM

�etc�� if there are more spurious roots ���

When solving a steady problem� we have no interest whatsoever in the transient por�tion of the solution� Our sole goal is to eliminate it as quickly as possible� Therefore�

Page 170: Fundamentals of Computational Fluid Dynamics

���� PROBLEMS ���

the choice of a time�marching method for a steady problem is similar to that for asti problem� the dierence being that the order of accuracy is irrelevant� Hence theexplicit Euler method is a candidate for steady diusion dominated problems� andthe fourth�order Runge�Kutta method is a candidate for steady convection dominatedproblems� because of their stability properties� Among implicit methods� the implicitEuler method is the obvious choice for steady problems�

When we seek only the steady solution� all of the eigenvalues can be considered tobe parasitic� Referring to Fig� ��� none of the eigenvalues are required to fall in theaccurate region of the time�marching method� Therefore the time step can be chosento eliminate the transient as quickly as possible with no regard for time accuracy�For example� when using the implicit Euler method with local time linearization� Eq������ one would like to take the limit h ��� which leads to Newton�s method� Eq����� However� a �nite time step may be required until the solution is somewhat closeto the steady solution�

�� Problems

�� Repeat the time�march comparisons for diusion �Section ����� and periodicconvection �Section ����� using �nd� and �rd�order Runge�Kutta methods�

�� Repeat the time�march comparisons for diusion �Section ����� and periodicconvection �Section ����� using the �rd� and �th�order Adams�Bashforth meth�ods� Considering the stability bounds for these methods �see problem � inChapter �� as well as their memory requirements� compare and contrast themwith the �rd� and �th�order Runge�Kutta methods�

�� Consider the diusion equation �with � � �� discretized using �nd�order centraldierences on a grid with � �interior� points� Find and plot the eigenvaluesand the corresponding modi�ed wavenumbers� If we use the explicit Euler time�marching method what is the maximum allowable time step if all but the �rsttwo eigenvectors are considered parasitic� Assume that su�cient accuracy isobtained as long as j�hj � ��� What is the maximum allowable time step if allbut the �rst eigenvector are considered parasitic�

Page 171: Fundamentals of Computational Fluid Dynamics

��� CHAPTER �� CHOICE OF TIME�MARCHING METHODS

Page 172: Fundamentals of Computational Fluid Dynamics

Chapter

RELAXATION METHODS

In the past three chapters� we developed a methodology for designing� analyzing�and choosing time�marching methods� These methods can be used to compute thetime�accurate solution to linear and nonlinear systems of ODE�s in the general form

d�u

dt� �F ��u� t� �����

which arise after spatial discretization of a PDE� Alternatively� they can be used tosolve for the steady solution of Eq� ���� which satis�es the following coupled systemof nonlinear algebraic equations�

�F ��u� � �����

In the latter case� the unsteady equations are integrated until the solution convergesto a steady solution� The same approach permits a time�marching method to be usedto solve a linear system of algebraic equations in the form

A�x � �b �����

To solve this system using a time�marching method� a time derivative is introducedas follows

d�x

dt� A�x��b �����

and the system is integrated in time until the transient has decayed to a su�cientlylow level� Following a time�dependent path to steady state is possible only if all ofthe eigenvalues of the matrix A �or �A� have real parts lying in the left half�plane�

Although the solution �x � A���b exists as long as A is nonsingular� the ODE given byEq� ��� has a stable steady solution only if A meets the above condition�

���

Page 173: Fundamentals of Computational Fluid Dynamics

��� CHAPTER � RELAXATION METHODS

The common feature of all time�marching methods is that they are at least �rst�order accurate� In this chapter� we consider iterative methods which are not timeaccurate at all� Such methods are known as relaxation methods� While they areapplicable to coupled systems of nonlinear algebraic equations in the form of Eq� ����our analysis will focus on their application to large sparse linear systems of equationsin the form

Ab�u� �f b � �����

where Ab is nonsingular� and the use of the subscript b will become clear shortly� Suchsystems of equations arise� for example� at each time step of an implicit time�marchingmethod or at each iteration of Newton�s method� Using an iterative method� we seekto obtain rapidly a solution which is arbitrarily close to the exact solution of Eq� ����which is given by

�u� � A��b�f b �����

�� Formulation of the Model Problem

����� Preconditioning the Basic Matrix

It is standard practice in applying relaxation procedures to precondition the basicequation� This preconditioning has the eect of multiplying Eq� ��� from the leftby some nonsingular matrix� In the simplest possible case the conditioning matrixis a diagonal matrix composed of a constant D�b�� If we designate the conditioning

matrix by C� the problem becomes one of solving for �u in

CAb�u� C�f b � �����

Notice that the solution of Eq� ��� is

�u � �CAb���C�f b � A��

b C��C�f b � A��b�f b ����

which is identical to the solution of Eq� ���� provided C�� exists�In the following we will see that our approach to the iterative solution of Eq� ���

depends crucially on the eigenvalue and eigenvector structure of the matrix CAb� and�equally important� does not depend at all on the eigensystem of the basic matrix Ab�For example� there are well�known techniques for accelerating relaxation schemes ifthe eigenvalues of CAb are all real and of the same sign� To use these schemes� the

Page 174: Fundamentals of Computational Fluid Dynamics

��� FORMULATION OF THE MODEL PROBLEM ���

conditioning matrix C must be chosen such that this requirement is satis�ed� Achoice of C which ensures this condition is the negative transpose of Ab�

For example� consider a spatial discretization of the linear convection equationusing centered dierences with a Dirichlet condition on the left side and no constrainton the right side� Using a �rst�order backward dierence on the right side �as inSection ����� this leads to the approximation

�x�u ��

��x

���������������

�������� �

�� ��� �

�� ��� �

��������u �

���������ua

�������

��������������������

The matrix in Eq� ��� has eigenvalues whose imaginary parts are much larger thantheir real parts� It can �rst be conditioned so that the modulus of each element is ��This is accomplished using a diagonal preconditioning matrix

D � ��x

��������� � � � �

������� ���� �

which scales each row� We then further condition with multiplication by the negativetranspose� The result is

A� � �AT�A� �

�������� �

�� ��� �

�� ��� ��

�������

�������� �

�� ��� �

�� ��� �

�������

���������� �

�� �� �� �

� �� �� � ��

������� ������

Page 175: Fundamentals of Computational Fluid Dynamics

��� CHAPTER � RELAXATION METHODS

If we de�ne a permutation matrix P � and carry out the process P T ��AT�A��P �which

just reorders the elements of A� and doesn�t change the eigenvalues� we �nd

�������� � � � � �

�������

���������� �

�� �� �� �

� �� �� � ��

�������

�������� �� � � �

�������

���������� �

� �� �� �� �

� �� �� ��

������� ������

which has all negative real eigenvalues� as given in Appendix B� Thus even whenthe basic matrix Ab has nearly imaginary eigenvalues� the conditioned matrix �AT

b Ab

is nevertheless symmetric negative de�nite �i�e�� symmetric with negative real eigen�values�� and the classical relaxation methods can be applied� We do not necessarilyrecommend the use of �AT

b as a preconditioner we simply wish to show that a broadrange of matrices can be preconditioned into a form suitable for our analysis�

����� The Model Equations

Preconditioning processes such as those described in the last section allow us toprepare our algebraic equations in advance so that certain eigenstructures are guar�anteed� In the remainder of this chapter� we will thoroughly investigate some simpleequations which model these structures� We will consider the preconditioned systemof equations having the form

A��� �f � ������

where A is symmetric negative de�nite�� The symbol for the dependent variable hasbeen changed to � as a reminder that the physics being modeled is no longer time

�A permutation matrix �de�ned as a matrix with exactly one � in each row and column and hasthe property that P T � P��� just rearranges the rows and columns of a matrix�

�We use a symmetric negative de�nite matrix to simplify certain aspects of our analysis� Relaxation methods are applicable to more general matrices� The classical methods will usually convergeif Ab is diagonally dominant� as de�ned in Appendix A�

Page 176: Fundamentals of Computational Fluid Dynamics

��� FORMULATION OF THE MODEL PROBLEM ���

accurate when we later deal with ODE formulations� Note that the solution of Eq������ �� � A���f � is guaranteed to exist because A is nonsingular� In the notation ofEqs� ��� and ����

A � CAb and �f � C�f b ������

The above was written to treat the general case� It is instructive in formulating theconcepts to consider the special case given by the diusion equation in one dimensionwith unit diusion coe�cient ��

�u

�t���u

�x�� g�x� ������

This has the steady�state solution

��u

�x�� g�x� ������

which is the one�dimensional form of the Poisson equation� Introducing the three�point central dierencing scheme for the second derivative with Dirichlet boundaryconditions� we �nd

d�u

dt�

�x�B������ ���u � ��bc�� �g ������

where ��bc� contains the boundary conditions and �g contains the values of the sourceterm at the grid nodes� In this case

Ab ��

�x�B������ ��

�fb � �g � ��bc� �����

Choosing C � �x�I� we obtain

B������ ���� � �f ������

where �f � �x��fb� If we consider a Dirichlet boundary condition on the left side andeither a Dirichlet or a Neumann condition on the right side� then A has the form

A � B����b� �

Page 177: Fundamentals of Computational Fluid Dynamics

�� CHAPTER � RELAXATION METHODS

�b � ������� � � � ����� s�T

s � �� or � � ���� �

Note that s � �� is easily obtained from the matrix resulting from the Neumannboundary condition given in Eq� ���� using a diagonal conditioning matrix� A tremen�dous amount of insight to the basic features of relaxation is gained by an appropriatestudy of the one�dimensional case� and much of the remaining material is devoted tothis case� We attempt to do this in such a way� however� that it is directly applicableto two� and three�dimensional problems�

�� Classical Relaxation

����� The Delta Form of an Iterative Scheme

We will consider relaxation methods which can be expressed in the following deltaform�

Hh��n� � ��n

i� A��n � �f ������

where H is some nonsingular matrix which depends upon the iterative method� Thematrix H is independent of n for stationary methods and is a function of n fornonstationary ones� The iteration count is designated by the subscript n or thesuperscript �n�� The converged solution is designated ��� so that

��� � A���f ������

����� The Converged Solution� the Residual� and the Error

Solving Eq� ���� for ��n� gives

��n� � �I � H��A���n �H���f � G��n �H���f ������

where

G � I � H��A ������

Hence it is clear that H should lead to a system of equations which is easy to solve�or at least easier to solve than the original system� The error at the nth iteration isde�ned as

�en � ��n � ��� � ��n � A���f ������

Page 178: Fundamentals of Computational Fluid Dynamics

��� CLASSICAL RELAXATION ���

where ��� was de�ned in Eq� ����� The residual at the nth iteration is de�ned as

�rn � A��n � �f ������

Multiply Eq� ���� by A from the left� and use the de�nition in Eq� ����� There resultsthe relation between the error and the residual

A�en ��rn � ������

Finally� it is not di�cult to show that

�en� � G�en �����

Consequently� G is referred to as the basic iteration matrix� and its eigenvalues� whichwe designate as �m� determine the convergence rate of a method�

In all of the above� we have considered only what are usually referred to as sta�tionary processes in which H is constant throughout the iterations� Nonstationaryprocesses in which H �and possibly C� is varied at each iteration are discussed inSection ����

����� The Classical Methods

Point Operator Schemes in One Dimension

Let us consider three classical relaxation procedures for our model equation

B������ ���� � �f ������

as given in Section ������ The Point�Jacobi method is expressed in point operatorform for the one�dimensional case as

��n��j �

h��n�j�� � ��n�j� � fj

i���� �

This operator comes about by choosing the value of ��n��j such that together with

the old values of �j�� and �j�� the jth row of Eq� ���� is satis�ed� The Gauss�Seidelmethod is

��n��j �

h��n��j�� � �

�n�j� � fj

i������

This operator is a simple extension of the point�Jacobi method which uses the mostrecent update of �j��� Hence the jth row of Eq� ���� is satis�ed using the new values of�j and �j�� and the old value of �j�� The method of successive overrelaxation �SOR�

Page 179: Fundamentals of Computational Fluid Dynamics

�� CHAPTER � RELAXATION METHODS

is based on the idea that if the correction produced by the Gauss�Seidel method tendsto move the solution toward ���� then perhaps it would be better to move further inthis direction� It is usually expressed in two steps as

$�j ��

h��n��j�� � �

�n�j� � fj

i��n��j � �

�n�j � �

h$�j � �

�n�j

i������

where � generally lies between � and �� but it can also be written in the single line

��n��j �

���n��j�� � ��� ���

�n�j �

���n�j� �

�fj ������

The General Form

The general form of the classical methods is obtained by splitting the matrix A inEq� ���� into its diagonal� D� the portion of the matrix below the diagonal� L� andthe portion above the diagonal� U � such that

A � L � D � U ������

Then the point�Jacobi method is obtained with H � �D� which certainly meetsthe criterion that it is easy to solve� The Gauss�Seidel method is obtained withH � ��L � D�� which is also easy to solve� being lower triangular�

�� The ODE Approach to Classical Relaxation

����� The Ordinary Di�erential Equation Formulation

The particular type of delta form given by Eq� ���� leads to an interpretation ofrelaxation methods in terms of solution techniques for coupled �rst�order ODE�s�about which we have already learned a great deal� One can easily see that Eq� ����results from the application of the explicit Euler time�marching method �with h � ��to the following system of ODE�s�

Hd��

dt� A��� �f ������

This is equivalent to

d��

dt� H��C

�Ab��� �f b

�� H���A��� �f � ������

Page 180: Fundamentals of Computational Fluid Dynamics

��� THE ODE APPROACH TO CLASSICAL RELAXATION ���

In the special case where H��A depends on neither �u nor t� H���f is also independentof t� and the eigenvectors of H��A are linearly independent� the solution can bewritten as

�� � c�e��t�x� � � � �� cMe

�M t�xM �z �error

���� ������

where what is referred to in time�accurate analysis as the transient solution� is nowreferred to in relaxation analysis as the error� It is clear that� if all of the eigenvaluesof H��A have negative real parts �which implies that H��A is nonsingular�� then thesystem of ODE�s has a steady�state solution which is approached as t��� given by

��� � A���f �����

which is the solution of Eq� ����� We see that the goal of a relaxation method is toremove the transient solution from the general solution in the most e�cient way pos�sible� The � eigenvalues are �xed by the basic matrix in Eq� ����� the preconditioningmatrix in ���� and the secondary conditioning matrix in ����� The � eigenvalues are�xed for a given �h by the choice of time�marching method� Throughout the remain�ing discussion we will refer to the independent variable t as �time�� even though notrue time accuracy is involved�

In a stationary method� H and C in Eq� ���� are independent of t� that is� theyare not changed throughout the iteration process� The generalization of this in ourapproach is to make h� the �time� step� a constant for the entire iteration�

Suppose the explicit Euler method is used for the time integration� For this method�m � � � �mh� Hence the numerical solution after n steps of a stationary relaxationmethod can be expressed as �see Eq� ����

��n � c��x��� � ��h�n � � � �� cm�xm�� � �mh�n � � � �� cM�xM�� � �Mh�n �z �error

���� ������

The initial amplitudes of the eigenvectors are given by the magnitudes of the cm�These are �xed by the initial guess� In general it is assumed that any or all of theeigenvectors could have been given an equally �bad� excitation by the initial guess�so that we must devise a way to remove them all from the general solution on anequal basis� Assuming that H��A has been chosen �that is� an iteration process hasbeen decided upon�� the only free choice remaining to accelerate the removal of theerror terms is the choice of h� As we shall see� the three classical methods have allbeen conditioned by the choice of H to have an optimum h equal to � for a stationaryiteration process�

Page 181: Fundamentals of Computational Fluid Dynamics

��� CHAPTER � RELAXATION METHODS

����� ODE Form of the Classical Methods

The three iterative procedures de�ned by Eqs� ��� � ���� and ���� obey no apparentpattern except that they are easy to implement in a computer code since all of thedata required to update the value of one point are explicitly available at the timeof the update� Now let us study these methods as subsets of ODE as formulated inSection ������ Insert the model equation ���� into the ODE form ����� Then

Hd��

dt� B������ ����� �f ���� �

As a start� let us use for the numerical integration the explicit Euler method

�n� � �n � h��n ������

with a step size� h� equal to �� We arrive at

H���n� � ��n� � B������ ����n � �f ������

It is clear that the best choice of H from the point of view of matrix algebra is�B������ �� since then multiplication from the left by �B�������� �� gives the cor�rect answer in one step� However� this is not in the spirit of our study� since multi�plication by the inverse amounts to solving the problem by a direct method withoutiteration� The constraint on H that is in keeping with the formulation of the threemethods described in Section ����� is that all the elements above the diagonal �orbelow the diagonal if the sweeps are from right to left� are zero� If we impose thisconstraint and further restrict ourselves to banded tridiagonals with a single constantin each band� we are led to

B���� �

�� ����n� � ��n� � B������ ����n � �f ������

where � and � are arbitrary� With this choice of notation the three methods presentedin Section ����� can be identi�ed using the entries in Table ����

TABLE ���� VALUES OF � and � IN EQ� ���� THAT

LEAD TO CLASSICAL RELAXATION METHODS

� � Method Equation

� Point�Jacobi ������ � Gauss�Seidel ������ ��

h� � sin

M � �

�iOptimum SOR �����

Page 182: Fundamentals of Computational Fluid Dynamics

��� EIGENSYSTEMS OF THE CLASSICAL METHODS ���

The fact that the values in the tables lead to the methods indicated can be veri�edby simple algebraic manipulation� However� our purpose is to examine the wholeprocedure as a special subset of the theory of ordinary dierential equations� In thislight� the three methods are all contained in the following set of ODE�s

d��

dt� B������ �

�� �

�B������ ����� �f

�������

and appear from it in the special case when the explicit Euler method is used for itsnumerical integration� The point operator that results from the use of the explicitEuler scheme is

��n��j �

���

���n��j�� �

��h� ���

�n�j��

�����h� ���

�n�j

��

��h

���n�j�

�� �h

�fj������

This represents a generalization of the classical relaxation techniques�

�� Eigensystems of the Classical Methods

The ODE approach to relaxation can be summarized as follows� The basic equationto be solved came from some time�accurate derivation

Ab�u� �f b � ������

This equation is preconditioned in some manner which has the eect of multiplicationby a conditioning matrix C giving

A��� �f � ������

An iterative scheme is developed to �nd the converged� or steady�state� solution ofthe set of ODE�s

Hd��

dt� A��� �f �����

This solution has the analytical form

��n � �en � ��� ������

where �en is the transient� or error� and ��� � A���f is the steady�state solution� Thethree classical methods� Point�Jacobi� Gauss�Seidel� and SOR� are identi�ed for theone�dimensional case by Eq� ���� and Table ����

Page 183: Fundamentals of Computational Fluid Dynamics

��� CHAPTER � RELAXATION METHODS

Given our assumption that the component of the error associated with each eigen�vector is equally likely to be excited� the asymptotic convergence rate is determinedby the eigenvalue �m of G �� I � H��A� having maximum absolute value� Thus

Convergence rate � j�mjmax � m � �� �� � � � �M ���� �

In this section� we use the ODE analysis to �nd the convergence rates of the threeclassical methods represented by Eqs� ��� � ����� and ����� It is also instructive toinspect the eigenvectors and eigenvalues in the H��A matrix for the three methods�This amounts to solving the generalized eigenvalue problem

A�xm � �mH�xm ������

for the special case

B������ ���xm � �mB���� �

�� ��xm ������

The generalized eigensystem for simple tridigonals is given in Appendix B��� Thethree special cases considered below are obtained with a � �� b � ��� c � �� d � ���e � ���� and f � � To illustrate the behavior� we take M � � for the matrix order�This special case makes the general result quite clear�

����� The Point�Jacobi System

If � � and � � � in Eq� ����� the ODE matrix H��A reduces to simply B��� ���� �

���The eigensystem can be determined from Appendix B�� since both d and f are zero�The eigenvalues are given by the equation

�m � �� � cos�

m

M � �

�� m � �� �� � � � �M ������

The ��� relation for the explicit Euler method is �m � � � �mh� This relation canbe plotted for any h� The plot for h � �� the optimum stationary case� is shown inFig� ���� For h � �� the maximum j�mj is obtained with m � �� Fig� ��� and forh � �� the maximum j�mj is obtained with m � M � Fig� ���� Note that for h � �� �depending on M� there is the possibility of instability� i�e� j�mj � �� � To obtain theoptimal scheme we wish to minimize the maximum j�mj which occurs when h � ��j��j � j�M j and the best possible convergence rate is achieved�

j�mjmax � cos�

M � �

�������

Page 184: Fundamentals of Computational Fluid Dynamics

��� EIGENSYSTEMS OF THE CLASSICAL METHODS ���

For M � � � we obtain j�mjmax � ������ Thus after � iterations the error contentassociated with each eigenvector is reduced to no more than ��� times its initial level�

Again from Appendix B��� the eigenvectors of H��A are given by

�xj � �xj�m � sin�j�

m

M � �

��� j � �� �� � � � �M ������

This is a very �well�behaved� eigensystem with linearly independent eigenvectors anddistinct eigenvalues� The �rst � eigenvectors are simple sine waves� For M � �� theeigenvectors can be written as

�x� �

�����������p����p���

���

������� � �x� �

��������

p���p���

�p���

�p���

������� � �x� �

��������� �� �

������� �

�x� �

��������

p���

�p��� p���

�p���

������� � �x �

�����������

�p����

�p������

������� ������

The corresponding eigenvalues are� from Eq� ����

�� � �� �

p�

� � � ���� � � �

�� � �� � �� � � ��

�� � �� � ���

�� � ��� �� � ����

� � ���p

�� � ����� � � �

������

From Eq� ����� the numerical solution written in full is

��n � ��� � c���� ���p

��h�n�x�

� c���� ��� �

��h�n�x�

Page 185: Fundamentals of Computational Fluid Dynamics

��� CHAPTER � RELAXATION METHODS

σm

1.0

0.0

-2.0 -1.0 0.0

h = 1.0

Μ = 5

Values are equal

m=1

m=2

m=3

m=4

m=5

Figure ���� The �� � relation for Point�Jacobi� h � ��M � ��

� c���� �� �h�n�x�

� c���� �� ��

��h�n�x�

� c��� �� �

p�

��h�n�x �����

����� The Gauss�Seidel System

If � and � are equal to � in Eq� ����� the matrix eigensystem evolves from the relation

B������ ���xm � �mB���� �� ��xm ������

which can be studied using the results in Appendix B��� One can show that the H��Amatrix for the Gauss�Seidel method� AGS � is

AGS � B������ �� �B������ �� �

Page 186: Fundamentals of Computational Fluid Dynamics

��� EIGENSYSTEMS OF THE CLASSICAL METHODS ���

σm

λmh

1.0

0.0

-2.0 -1.0 0.0

h < 1.0

Decreasing h

Approaches 1.0

Decreasing h

Figure ���� The �� � relation for Point�Jacobi� h � ���M � ��

σm

Exceeds 1.0 at h 1.072 / Ustable h > 1.072∼∼

1.0

0.0

-2.0 -1.0 0.0

h > 1.0

Increasing h

λmh

M = 5

Increasing h

Figure ���� The �� � relation for Point�Jacobi� h � ����M � ��

Page 187: Fundamentals of Computational Fluid Dynamics

�� CHAPTER � RELAXATION METHODS

�������������

�� ��� ���� ��� �� ���� ��� ���� �� ���� ��� ���� ���� �� ���� ������

���� � � � � � � � � � � � � � �

���M � � �

������������

��������M

���� �

The eigenvector structure of the Gauss�Seidel ODE matrix is quite interesting� If Mis odd there are �M � ���� distinct eigenvalues with corresponding linearly indepen�dent eigenvectors� and there are �M � ���� defective eigenvalues with correspondingprincipal vectors� The equation for the nondefective eigenvalues in the ODE matrixis �for odd M�

�m � �� � cos��m

M � �� � m � �� �� � � � �

M � �

�������

and the corresponding eigenvectors are given by

�xm ��cos

�m

M � �

��j��sin

�j�

m

M � �

��� m � �� �� � � � �

M � �

�������

The ��� relation for h � �� the optimum stationary case� is shown in Fig� ���� The�m with the largest amplitude is obtained with m � �� Hence the convergence rate is

j�mjmax ��cos

M � �

���������

Since this is the square of that obtained for the Point�Jacobi method� the error associ�ated with the �worst� eigenvector is removed in half as many iterations� For M � � �j�mjmax � ������ �� iterations are required to reduce the error component of theworst eigenvector by a factor of roughly ����

The eigenvectors are quite unlike the Point�Jacobi set� They are no longer sym�metrical� producing waves that are higher in amplitude on one side �the updated side�than they are on the other� Furthermore� they do not represent a common family fordierent values of M �

The Jordan canonical form for M � � is

X��AGSX � JGS �

����������

h���i h

���i ����

��� ���� �

���

���

���������������

Page 188: Fundamentals of Computational Fluid Dynamics

��� EIGENSYSTEMS OF THE CLASSICAL METHODS ���

σm

λ m

λm

1.0

0.0

-2.0 -1.0 0.0

h = 1.0

Μ = 5

-1.0-1.0

2 defective

h

Figure ���� The �� � relation for Gauss�Seidel� h � �� �M � ��

The eigenvectors and principal vectors are all real� For M � � they can be written

�x� �

�������������������������

������� � �x� �

��������

p���p���

�p����

�p����

������� � �x� �

���������

������� � �x� �

�������� ���

������� � �x �

�������� ����

������� ������

The corresponding eigenvalues are

�� � ����

�� � ����

�� � ��

������

�Defective� linked to�� Jordan block

������

The numerical solution written in full is thus

��n � ��� � c���� h

��n�x�

� c���� �h

��n�x�

Page 189: Fundamentals of Computational Fluid Dynamics

� CHAPTER � RELAXATION METHODS

c���� h�n � c�h

n

�#��� h�n�� � ch

�n�n� ��

�#��� h�n��

��x�

��c���� h�n � ch

n

�#��� h�n��

��x�

� c��� h�n�x ������

����� The SOR System

If � � � and ��� � x in Eq� ����� the ODE matrix is B������ x� �B������ ���One can show that this can be written in the form given below for M � �� Thegeneralization to any M is fairly clear� The H��A matrix for the SOR method�ASOR � B������ x� �B������ ��� is

x

����������x� x�

��x� � x� x� � �x� x� ��x� � x� x� � �x� � x� x� � �x� x� ��x � x� x� �x� � x� x� � �x� � x� x� � �x� x�

�� � x �� �x � x� x� �x� � x� x� � �x� � x� x� � �x�

������� �����

Eigenvalues of the system are given by

�m � �� ���pm � zm

��

� m � �� �� � � �M ������

where

zm � ����� �� � ��p�m����

pm � cos�m ��M � ���

If � � �� the system is Gauss�Seidel� If ������ ���pm � � zm and �m are complex�If � is chosen such that ��� � �� � ��p�� � � � is optimum for the stationary case�and the following conditions hold�

�� Two eigenvalues are real� equal and defective�

�� If M is even� the remaining eigenvalues are complex and occur in conjugatepairs�

�� If M is odd� one of the remaining eigenvalues is real and the others are complexoccurring in conjugate pairs�

Page 190: Fundamentals of Computational Fluid Dynamics

��� EIGENSYSTEMS OF THE CLASSICAL METHODS ��

One can easily show that the optimum � for the stationary case is

�opt � ���� � sin

M � �

������ �

and for � � �opt

�m � ��m � �

�xm � �j��m sin�j�

m

M � �

��������

where

�m ��opt

�pm � i

qp�� � p�m

�Using the explicit Euler method to integrate the ODE�s� �m � � � h � h��m� and ifh � �� the optimum value for the stationary case� the ��� relation reduces to thatshown in Fig� ���� This illustrates the fact that for optimum stationary SOR all thej�mj are identical and equal to �opt � �� Hence the convergence rate is

j�mjmax � �opt � � ������

�opt � ���� � sin

M � �

��For M � � � j�mjmax � ���� Hence the worst error component is reduced to lessthan ��� times its initial value in only � iterations� much faster than both Gauss�Seidel and Point�Jacobi� In practical applications� the optimum value of � may haveto be determined by trial and error� and the bene�t may not be as great�

For odd M � there are two real eigenvectors and one real principal vector� Theremaining linearly independent eigenvectors are all complex� For M � � they can bewritten

�x� �

�����������������������

������� � �x� �

����������������

������� � �x��� �

��������

p��� ���p���� i

p����

p���� i

p�����p

���� �ip

������

������� � �x �

���������

���

���

������� ������

The corresponding eigenvalues are

�� � ����

��� Defective linked to ��

�� � ��� � �p

�i���

�� � ��� � �p

�i���

� � ���� ������

Page 191: Fundamentals of Computational Fluid Dynamics

�� CHAPTER � RELAXATION METHODS

σm

λ m

λ m

λ m

1.0

0.0

-2.0 -1.0 0.0

h = 1.0

Μ = 5

-1.0-1.0

2 real defective

1 real

2 complex

hλ m

Figure ���� The �� � relation for optimum stationary SOR� M � �� h � ��

The numerical solution written in full is

��n � ��� � �c���� �h���n � c�nh��� �h���n����x�

� c���� �h���n�x�

� c���� �� � �p

�i�h���n�x�

� c���� �� � �p

�i�h���n�x�

� c��� �h���n�x ������

�� Nonstationary Processes

In classical terminology a method is said to be nonstationary if the conditioningmatrices� H and C� are varied at each time step� This does not change the steady�

state solution A��b�f b� but it can greatly aect the convergence rate� In our ODE

approach this could also be considered and would lead to a study of equations withnonconstant coe�cients� It is much simpler� however� to study the case of �xedH and C but variable step size� h� This process changes the Point�Jacobi methodto Richardson�s method in standard terminology� For the Gauss�Seidel and SORmethods it leads to processes that can be superior to the stationary methods�

The nonstationary form of Eq� ���� is

Page 192: Fundamentals of Computational Fluid Dynamics

��� NONSTATIONARY PROCESSES ��

��N � c��x�NYn��

�� � ��hn� � � � �� cm�xmNYn��

�� � �mhn�

� � � �� cM�xMNYn��

�� � �Mhn� � ��� ������

where the symbol ( stands for product� Since hn can now be changed at each step�the error term can theoretically be completely eliminated in M steps by taking hm �����m� for m � �� �� � � � �M � However� the eigenvalues �m are generally unknown andcostly to compute� It is therefore unnecessary and impractical to set hm � ����mfor m � �� �� � � � �M � We will see that a few well chosen h�s can reduce whole clustersof eigenvectors associated with nearby ��s in the �m spectrum� This leads to theconcept of selectively annihilating clusters of eigenvectors from the error terms aspart of a total iteration process� This is the basis for the multigrid methods discussedin Chapter � �

Let us consider the very important case when all of the �m are real and nega�tive �remember that they arise from a conditioned matrix so this constraint is notunrealistic for quite practical cases�� Consider one of the error terms taken from

�eN � ��N � ��� �MXm��

cm�xmNYn��

�� � �mhn� ������

and write it in the form

cm�xmPe��m� � cm�xmNYn��

�� � �mhn� �����

where Pe signi�es an �Euler� polynomial� Now focus attention on the polynomial

�Pe�N��� � �� � h����� � h��� � � � �� � hN�� ������

treating it as a continuous function of the independent variable �� In the annihilationprocess mentioned after Eq� ����� we considered making the error exactly zero bytaking advantage of some knowledge about the discrete values of �m for a particularcase� Now we pose a less demanding problem� Let us choose the hn so that themaximum value of �Pe�N��� is as small as possible for all � lying between �a and �bsuch that �b � � � �a � � Mathematically stated� we seek

max�b����a

j�Pe�N���j � minimum � with�Pe�N� � � � ��� �

Page 193: Fundamentals of Computational Fluid Dynamics

�� CHAPTER � RELAXATION METHODS

This problem has a well known solution due to Markov� It is

�Pe�N��� �

TN

���� �a � �b

�a � �b

TN

���a � �b�a � �b

� �����

where

TN�y� � cos�N arccos y� �����

are the Chebyshev polynomials along the interval �� � y � � and

TN�y� ��

�y �

qy� � �

�N�

�y �

qy� � �

�N�����

are the Chebyshev polynomials for jyj � �� In relaxation terminology this is generallyreferred to as Richardson�s method� and it leads to the nonstationary step size choicegiven by

hn�

���b � �a � ��b � �a� cos

��n� ��

�N

��� n � �� �� � � �N �����

Remember that all � are negative real numbers representing the magnitudes of �m inan eigenvalue spectrum�

The error in the relaxation process represented by Eq� ���� is expressed in termsof a set of eigenvectors� �xm� ampli�ed by the coe�cients cm

Q�� � �mhn�� With each

eigenvector there is a corresponding eigenvalue� Eq� ��� gives us the best choice of aseries of hn that will minimize the amplitude of the error carried in the eigenvectorsassociated with the eigenvalues between �b and �a�

As an example for the use of Eq� ���� let us consider the following problem�

Minimize the maximum error asso�ciated with the � eigenvalues in theinterval �� � � � �� using only �iterations�

�����

The three values of h which satisfy this problem are

hn � ��

��� cos

��n� ��

�������

Page 194: Fundamentals of Computational Fluid Dynamics

��� NONSTATIONARY PROCESSES ��

and the amplitude of the eigenvector is reduced to

�Pe����� � T���� � ���T���� �����

where

T���� �n

�� �p

�� � ���p

��o�� � �� ����

A plot of Eq� ��� is given in Fig� ��� and we see that the amplitudes of all theeigenvectors associated with the eigenvalues in the range �� � � � �� have beenreduced to less than about �' of their initial values� The values of h used in Fig� ���are

h� � �����p

��

h� � ����� �

h� � ���� �p

��

Return now to Eq� ����� This was derived from Eq� ���� on the condition that theexplicit Euler method� Eq� ����� was used to integrate the basic ODE�s� If insteadthe implicit trapezoidal rule

�n� � �n ��

�h���n� � ��n� �����

is used� the nonstationary formula

��N �MXm��

cm�xmNYn��

�BB�� ��

�hn�m

�� �

�hn�m

�CCA� ��� ���� �

would result� This calls for a study of the rational �trapezoidal� polynomial� Pt�

�Pt�N��� �NYn��

�BB�� ��

�hn�

�� �

�hn�

�CCA ������

under the same constraints as before� namely that

max�b����a

j�Pt�N���j � minimum � ������

with �Pt�N� � � �

Page 195: Fundamentals of Computational Fluid Dynamics

�� CHAPTER � RELAXATION METHODS

−2 −1.8 −1.6 −1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 0

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

λ

(Pe )

3 (λ)

−2 −1.8 −1.6 −1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 0−0.02

−0.015

−0.01

−0.005

0

0.005

0.01

0.015

0.02

λ

(Pe )

3 (λ)

Figure ���� Richardson�s method for � steps� minimization over �� � � � ���

Page 196: Fundamentals of Computational Fluid Dynamics

��� PROBLEMS ��

The optimum values of h can also be found for this problem� but we settle here forthe approximation suggested by Wachspress

hn� ��b

��a�b

��n�����N���

� n � �� �� � � � � N ������

This process is also applied to problem ���� The results for �Pt����� are shown inFig� ���� The error amplitude is about �!� of that found for �Pe����� in the sameinterval of �� The values of h used in Fig� ��� are

h� � �

h� �p

h� � �

�� Problems

�� Given a relaxation method in the form

H���n � A��n � �f

show that

��n � Gn��� � �I �Gn�A�� �f

where G � I � H��A�

�� For a linear system of the form �A� � A��x � b� consider the iterative method

�I � �A��$x � �I � �A��xn � �b

�I � �A��xn� � �I � �A��$x � �b

where � is a parameter� Show that this iterative method can be written in theform

H�xk� � xk� � �A� � A��xk � b

Determine the iteration matrix G if � � �����

�� Using Appendix B��� �nd the eigenvalues of H��A for the SOR method withA � B�� � ����� �� and � � �opt� �You do not have to �nd H��� Recall thatthe eigenvalues of H��A satisfy A�xm � �mH�xm�� Find the numerical values�not just the expressions� Then �nd the corresponding j�mj values�

Page 197: Fundamentals of Computational Fluid Dynamics

� CHAPTER � RELAXATION METHODS

−2 −1.8 −1.6 −1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 0

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

λ

(P

t )3 (

λ)

−2 −1.8 −1.6 −1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 0−2

−1.5

−1

−0.5

0

0.5

1

1.5

2x 10

−3

λ

(P

t )3 (

λ)

Figure ���� Wachspress method for � steps� minimization over �� � � � ���

Page 198: Fundamentals of Computational Fluid Dynamics

��� PROBLEMS ��

�� Solve the following equation on the domain � x � � with boundary conditionsu� � � � u��� � ��

��u

�x�� �x �

For the initial condition� use u�x� � � Use second�order centered dierenceson a grid with � cells �M � ���� Iterate to steady state using

�a� the point�Jacobi method�

�b� the Gauss�Seidel method�

�c� the SOR method with the optimum value of �� and

�d� the ��step Richardson method derived in Section ����

Plot the solution after the residual is reduced by �� �� and � orders of mag�nitude� Plot the logarithm of the L��norm of the residual vs� the number ofiterations� Determine the asymptotic convergence rate� Compare with the the�oretical asymptotic convergence rate�

Page 199: Fundamentals of Computational Fluid Dynamics

�� CHAPTER � RELAXATION METHODS

Page 200: Fundamentals of Computational Fluid Dynamics

Chapter ��

MULTIGRID

The idea of systematically using sets of coarser grids to accelerate the convergence ofiterative schemes that arise from the numerical solution to partial dierential equa�tions was made popular by the work of Brandt� There are many variations of theprocess and many viewpoints of the underlying theory� The viewpoint presented hereis a natural extension of the concepts discussed in Chapter ��

���� Motivation

� ���� Eigenvector and Eigenvalue Identi�cation with Space

Frequencies

Consider the eigensystem of the model matrix B������ ��� The eigenvalues andeigenvectors are given in Sections ����� and ������ respectively� Notice that as themagnitudes of the eigenvalues increase� the space�frequency �or wavenumber� of thecorresponding eigenvectors also increase� That is� if the eigenvalues are ordered suchthat

j��j � j��j � � � � � j�M j �� ���

then the corresponding eigenvectors are ordered from low to high space frequencies�This has a rational explanation from the origin of the banded matrix� Note that

��

�x�sin�mx� � �m� sin�mx� �� ���

and recall that

�xx�� ��

�x�B������ ���� � X

��

�x�D����

�X���� �� ���

���

Page 201: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� MULTIGRID

where D���� is a diagonal matrix containing the eigenvalues� We have seen that

X���� represents a sine transform� and X��� a sine synthesis� Therefore� the opera�

tion ��x�

D���� represents the numerical approximation of the multiplication of the

appropriate sine wave by the negative square of its wavenumber� �m�� One �ndsthat

�x��m �

�M � �

����� � � cos

�m

M � �

��� �m� � m �� M �� ���

Hence� the correlation of large magnitudes of �m with high space�frequencies is to beexpected for these particular matrix operators� This is consistent with the physics ofdiusion as well� However� this correlation is not necessary in general� In fact� thecomplete counterexample of the above association is contained in the eigensystem

for B��� � ��

���� For this matrix one �nds� from Appendix B� exactly the opposite

behavior�

� ���� Properties of the Iterative Method

The second key motivation for multigrid is the following�

Many iterative methods reduce error components corresponding to eigenvaluesof large amplitude more eectively than those corresponding to eigenvalues ofsmall amplitude�

This is to be expected of an iterative method which is time accurate� It is alsotrue� for example� of the Gauss�Seidel method and� by design� of the Richardsonmethod described in Section ���� The classical point�Jacobi method does not sharethis property� As we saw in Section ������ this method produces the same value of j�jfor �min and �max� However� the property can be restored by using h � �� as shownin Fig� ����

When an iterative method with this property is applied to a matrix with theabove correlation between the modulus of the eigenvalues and the space frequency ofthe eigenvectors� error components corresponding to high space frequencies will bereduced more quickly than those corresponding to low space frequencies� This is thekey concept underlying the multigrid process�

���� The Basic Process

First of all we assume that the dierence equations representing the basic partialdierential equations are in a form that can be related to a matrix which has certain

Page 202: Fundamentals of Computational Fluid Dynamics

����� THE BASIC PROCESS ���

basic properties� This form can be arrived at �naturally� by simply replacing thederivatives in the PDE with dierence schemes� as in the example given by Eq� �����or it can be �contrived� by further conditioning� as in the examples given by Eq� �����The basic assumptions required for our description of the multigrid process are�

�� The problem is linear�

�� The eigenvalues� �m� of the matrix are all real and negative�

�� The �m are fairly evenly distributed between their maximum and minimumvalues�

�� The eigenvectors associated with the eigenvalues having largest magnitudes canbe correlated with high frequencies on the dierencing mesh�

�� The iterative procedure used greatly reduces the amplitudes of the eigenvectors

associated with eigenvalues in the range between �� j�jmax and j�jmax�

These conditions are su�cient to ensure the validity of the process described next�Having preconditioned �if necessary� the basic �nite dierencing scheme by a pro�

cedure equivalent to the multiplication by a matrix C� we are led to the startingformulation

C�Ab��� � �f b� � �� ���

where the matrix formed by the product CAb has the properties given above� In Eq�

� ��� the vector �f b represents the boundary conditions and the forcing function� if

any� and ��� is a vector representing the desired exact solution� We start with some

initial guess for ��� and proceed through n iterations making use of some iterativeprocess that satis�es property � above� We do not attempt to develop an optimumprocedure here� but for clarity we suppose that the three�step Richardson methodillustrated in Fig� ��� is used� At the end of the three steps we �nd �r� the residual�where

�r � C�Ab��� �f b� �� ���

Recall that the �� used to compute �r is composed of the exact solution ��� and theerror �e in such a way that

A�e��r � �� ���

where

A � CAb �� ��

Page 203: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� MULTIGRID

If one could solve Eq� � �� for �e then

��� � ����e �� ���

Thus our goal now is to solve for �e� We can write the exact solution for �e in terms ofthe eigenvectors of A� and the � eigenvalues of the Richardson process in the form�

�e �M��Xm��

cm�xm�Y

n��

����mhn�� �MX

m�M���

cm�xm�Y

n��

����mhn��

�z �very low amplitude

�� �� �

Combining our basic assumptions� we can be sure that the high frequency content of�e has been greatly reduced �about �' or less of its original value in the initial guess��In addition� assumption � ensures that the error has been smoothed�

Next we construct a permutation matrix which separates a vector into two parts�one containing the odd entries� and the other the even entries of the original vector�or any other appropriate sorting which is consistent with the interpolation approxi�mation to be discussed below�� For a ��point example�������������

e�e�e�e�e�ee

�������������

�������������

� � � � � � �

������������

�������������

e�e�e�e�ee�e

������������

�ee�eo

�� P�e �� ����

Multiply Eq� � �� from the left by P and� since a permutation matrix has an inversewhich is its transpose� we can write

PA�P��P ��e � P�r �� ����

The operation PAP�� partitions the A matrix to form��� A� A�

A� A�

�� �ee�eo�

�re�ro

��� ����

Notice that

A��ee � A�

�eo � �re �� ����

Page 204: Fundamentals of Computational Fluid Dynamics

����� THE BASIC PROCESS ���

is an exact expression�At this point we make our one crucial assumption� It is that there is some connec�

tion between �ee and �eo brought about by the smoothing property of the Richardsonrelaxation procedure� Since the top half of the frequency spectrum has been removed�it is reasonable to suppose that the odd points are the average of the even points�For example

e� � �

��ea � e��

e� � �

��e� � e��

e � �

��e� � e�� or �eo � A�

��ee �� ����

e � �

��e� � eb�

It is important to notice that ea and eb represent errors on the boundaries where theerror is zero if the boundary conditions are given� It is also important to notice that weare dealing with the relation between �e and �r so the original boundary conditions andforcing function �which are contained in �f in the basic formulation� no longer appearin the problem� Hence� no aliasing of these functions can occur in subsequent steps�Finally� notice that� in this formulation� the averaging of �e is our only approximation�no operations on �r are required or justi�ed�

If the boundary conditions are Dirichlet� ea and eb are zero� and one can write forthe example case

A�� �

������ � � � � �

���� �� ����

With this approximation Eq� � ��� reduces to

A��ee � A�A

���ee � �re �� ����

or

Ac�ee ��re � �� ���

where

Ac � �A� � A�A��� �� ����

Page 205: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� MULTIGRID

The form of Ac� the matrix on the coarse mesh� is completely determined by thechoice of the permutation matrix and the interpolation approximation� If the originalA had been B�� � ����� ��� our ��point example would produce

PAP�� �

���������������

�� � ��� � �

�� � �

� ��� � ��

� � ��� ��

���������������

��� A� A�

A� A�

�� �� �� �

and Eq� � �� gives

A�z � ���� ����

��

���

A�z � ���� � �� �

� �

�� ���

A�

�z � �������� �

� ��

���� �

Acz � ���� �� ������ �� ���

��� ��

�� �� ����

If the boundary conditions are mixed Dirichlet�Neumann� A in the ��D modelequation is B����b� �� where �b � ������� ����������T � The eigensystem is given byEq� B���� It is easy to show that the high space�frequencies still correspond to theeigenvalues with high magnitudes� and� in fact� all of the properties given in Section� �� are met� However� the eigenvector structure is dierent from that given inEq� ���� for Dirichlet conditions� In the present case they are given by

xjm � sin

j

���m� ��

�M � �

�� m � �� �� � � � �M �� ����

and are illustrated in Fig� � ��� All of them go through zero on the left �Dirichlet�side� and all of them re�ect on the right �Neumann� side�

For Neumann conditions� the interpolation formula in Eq� � ��� must be changed�In the particular case illustrated in Fig� � ��� eb is equal to eM � If Neumann conditionsare on the left� ea � e�� When eb � eM � the example in Eq� � ��� changes to

A�� �

������ � � � � �

���� �� ����

Page 206: Fundamentals of Computational Fluid Dynamics

����� THE BASIC PROCESS ���

X

Figure � ��� Eigenvectors for the mixed Dirichlet�Neumann case�

The permutation matrix remains the same and both A� and A� in the partitionedmatrix PAP�� are unchanged �only A� is modi�ed by putting �� in the lower rightelement�� Therefore� we can construct the coarse matrix from

A�z � ���� ����

��

���

A�z � ���� � �� �

� �

�� ���

A�

�z � �������� �

� ��

���� �

Acz � ���� �� ������ �� ���

��� ����

�� �� ����

which gives us what we might have �expected��We will continue with Dirichlet boundary conditions for the remainder of this

Section� At this stage� we have reduced the problem from B������ ���e � �r on the

�ne mesh to ��B������ ���ee � �re on the next coarser mesh� Recall that our goal is

to solve for �e� which will provide us with the solution ��� using Eq� � ��� Given �eecomputed on the coarse grid �possibly using even coarser grids�� we can compute �eousing Eq� � ���� and thus �e� In order to complete the process� we must now determinethe relationship between �ee and �e�

In order to examine this relationship� we need to consider the eigensystems of Aand Ac�

A � X"X��� Ac � Xc"cX��c �� ����

For A � B�M � ����� �� the eigenvalues and eigenvectors are

�m � ����� cos

�m

M � �

��� �xm � sin

�j�

m

M � �

���

j � �� �� � � � �Mm � �� �� � � � �M �� ����

Page 207: Fundamentals of Computational Fluid Dynamics

�� CHAPTER ��� MULTIGRID

Based on our assumptions� the most di�cult error mode to eliminate is that withm � �� corresponding to

�� � ����� cos

M � �

��� �x� � sin

�j�

M � �

��� j � �� �� � � � �M �� ����

For example� with M � ��� �� � � � ����� If we restrict our attention to odd M �then Mc � �M ����� is the size of Ac� The eigenvalue and eigenvector corresponding

to m � � for the matrix Ac � ��B�Mc� ����� �� are

��c�� � ���� cos

��

M � �

��� ��xc�� � sin

�j�

M � �

��� j � �� �� � � � �Mc �� ���

For M � �� �Mc � ���� we obtain ��c�� � � � ���� � ������� As M increases�

��c�� approaches ���� In addition� one can easily see that ��xc�� coincides with �x� at

every second point of the latter vector� that is� it contains the even elements of �x��Now let us consider the case in which all of the error consists of the eigenvector

component �x�� i�e�� �e � �x�� Then the residual is

�r � A�x� � ���x� �� ����

and the residual on the coarse grid is

�re � ����xc�� �� �� �

since ��xc�� contains the even elements of �x�� The exact solution on the coarse gridsatis�es

�ee � A��c�re � Xc"

��c X��

c ����xc��

�� ����

� ��Xc"��c

������� ���

������� ����

� ��Xc

����������c��

���

������� ����

Page 208: Fundamentals of Computational Fluid Dynamics

����� THE BASIC PROCESS ���

���

��c����xc��

�� ����

� �

���xc�� �� ����

Since our goal is to compute �e � �x�� in addition to interpolating �ee to the �ne grid�using Eq� � ����� we must multiply the result by �� This is equivalent to solving

�Ac�ee � �re �� ����

or

�B�Mc � ����� ���ee � �re �� ����

In our case� the matrix A � B�M � ����� �� comes from a discretization of thediusion equation� which gives

Ab ��

�x�B�M � ����� �� �� ���

and the preconditioning matrix C is simply

C ��x�

�I �� ����

Applying the discretization on the coarse grid with the same preconditioning matrixas used on the �ne grid gives� since �xc � ��x�

C�

�x�cB�Mc � ����� �� �

�x�

�x�cB�Mc � ����� �� �

�B�Mc � ����� �� �� �� �

which is precisely the matrix appearing in Eq� � ���� Thus we see that the process isrecursive� The problem to be solved on the coarse grid is the same as that solved onthe �ne grid�

The remaining steps required to complete an entire multigrid process are relativelystraightforward� but they vary depending on the problem and the user� The reductioncan be� and usually is� carried to even coarser grids before returning to the �nest level�However� in each case the appropriate permutation matrix and the interpolationapproximation de�ne both the down� and up�going paths� The details of �ndingoptimum techniques are� obviously� quite important but they are not discussed here�

Page 209: Fundamentals of Computational Fluid Dynamics

� CHAPTER ��� MULTIGRID

���� A Two�Grid Process

We now describe a two�grid process for the linear problem A�� � �f � which can be easilygeneralized to a process with an arbitrary number of grids due to the recursive natureof multigrid� Extension to nonlinear problems requires that both the solution and theresidual be transferred to the coarse grid in a process known as full approximationstorage multigrid�

�� Perform n� iterations of the selected relaxation method on the �ne grid� startingwith �� � ��n� Call the result ������ This gives�

����� � Gn����n � �I �Gn�

� �A�� �f �� ����

where

G� � I � H��� A� �� ����

and H� is de�ned as in Chapter � �e�g�� Eq� ������ Next compute the residual based

on ������

�r��� � A����� � �f � AGn����n � A �I �Gn�

� �A�� �f � �f

� AGn����n � AGn�

� A�� �f �� ����

�� Transfer �or restrict� �r��� to the coarse grid�

�r��� � R���r

��� �� ����

In our example in the preceding section� the restriction matrix is

R�� �

��� � � �

�� �� ����

that is� the �rst three rows of the permutation matrix P in Eq� � ���� This type ofrestriction is known as �simple injection�� Some form of weighted restriction can alsobe used�

�� Solve the problem A��e��� � �r��� on the coarse grid exactly��

�e��� � A��� �r��� �� ����

�See problem � of Chapter ���Note that the coarse grid matrix denoted A� here was denoted Ac in the preceding section�

Page 210: Fundamentals of Computational Fluid Dynamics

����� A TWO�GRID PROCESS � �

Here A� can be formed by applying the discretization on the coarse grid� In the

preceding example �eq� � �� �� A� � ��B�Mc � ����� ��� It is at this stage that the

generalization to a multigrid procedure with more than two grids occurs� If this is thecoarsest grid in the sequence� solve exactly� Otherwise� apply the two�grid processrecursively�

�� Transfer �or prolong� the error back to the �ne grid and update the solution�

��n� � ����� � I���e��� �� ����

In our example� the prolongation matrix is

I�� �

�������������

��� �

��� ��� � ��� ��� � ���

�������������� ���

which follows from Eq� � ����

Combining these steps� one obtains

��n� � �I � I��A��� R�

�A�Gn����n � �I � I��A

��� R�

�A�Gn�� A�� �f � A�� �f �� ����

Thus the basic iteration matrix is

�I � I��A��� R�

�A�Gn�� �� �� �

The eigenvalues of this matrix determine the convergence rate of the two�grid process�

The basic iteration matrix for a three�grid process is found from Eq� � �� byreplacing A��

� with �I �G���A

��� � where

G�� � �I � I��A

��� R�

�A��Gn�� �� ����

In this expression n� is the number of relaxation steps on grid �� I�� and R�� are the

transfer operators between grids � and �� and A� is obtained by discretizing on grid�� Extension to four or more grids proceeds in similar fashion�

Page 211: Fundamentals of Computational Fluid Dynamics

� � CHAPTER ��� MULTIGRID

���� Problems

�� Derive Eq� � ����

�� Repeat problem � of Chapter � using a four�grid multigrid method togetherwith

�a� the Gauss�Seidel method�

�b� the ��step Richardson method derived in Section ����

Solve exactly on the coarsest grid� Plot the solution after the residual is reducedby �� �� and � orders of magnitude� Plot the logarithm of the L��norm of theresidual vs� the number of iterations� Determine the asymptotic convergencerate� Calculate the theoretical asymptotic convergence rate and compare�

Page 212: Fundamentals of Computational Fluid Dynamics

Chapter ��

NUMERICAL DISSIPATION

Up to this point� we have emphasized the second�order centered�dierence approxima�tions to the spatial derivatives in our model equations� We have seen that a centeredapproximation to a �rst derivative is nondissipative� i�e�� the eigenvalues of the as�sociated circulant matrix �with periodic boundary conditions� are pure imaginary�In processes governed by nonlinear equations� such as the Euler and Navier�Stokesequations� there can be a continual production of high�frequency components of thesolution� leading� for example� to the production of shock waves� In a real phys�ical problem� the production of high frequencies is eventually limited by viscosity�However� when we solve the Euler equations numerically� we have neglected viscouseects� Thus the numerical approximation must contain some inherent dissipation tolimit the production of high�frequency modes� Although numerical approximationsto the Navier�Stokes equations contain dissipation through the viscous terms� thiscan be insu�cient� especially at high Reynolds numbers� due to the limited grid res�olution which is practical� Therefore� unless the relevant length scales are resolved�some form of added numerical dissipation is required in the numerical solution ofthe Navier�Stokes equations as well� Since the addition of numerical dissipation istantamount to intentionally introducing nonphysical behavior� it must be carefullycontrolled such that the error introduced is not excessive� In this Chapter� we discusssome dierent ways of adding numerical dissipation to the spatial derivatives in thelinear convection equation and hyperbolic systems of PDE�s�

� �

Page 213: Fundamentals of Computational Fluid Dynamics

� � CHAPTER ��� NUMERICAL DISSIPATION

���� One�Sided First�Derivative Space Di�erenc�

ing

We investigate the properties of one�sided spatial dierence operators in the contextof the biconvection model equation given by

�u

�t� �a�u

�x������

with periodic boundary conditions� Consider the following point operator for thespatial derivative term

�a��xu�j ��a

��x���� � ��uj�� � ��uj � ��� ��uj��

��a

��x���uj�� � uj�� � ���uj�� � �uj � uj��� ������

The second form shown divides the operator into an antisymmetric component ��uj���uj�����x and a symmetric component ���uj�� � �uj � uj�����x� The antisym�metric component is the second�order centered dierence operator� With � � � theoperator is only �rst�order accurate� A backward dierence operator is given by � � �and a forward dierence operator is given by � � ���

For periodic boundary conditions the corresponding matrix operator is

�a�x ��a

��xBp���� �� ��� �� ��

The eigenvalues of this matrix are

�m ��a�x

���� cos

�� m

M

��� i sin

�� m

M

�!for m � � �� � � � �M� �

If a is positive� the forward dierence operator �� � ��� produces Re��m� � �the centered dierence operator �� � � produces Re��m� � � and the backwarddierence operator produces Re��m� � � Hence the forward dierence operator isinherently unstable while the centered and backward operators are inherently stable�If a is negative� the roles are reversed� When Re��m� � � the solution will eithergrow or decay with time� In either case� our choice of dierencing scheme producesnonphysical behavior� We proceed next to show why this occurs�

Page 214: Fundamentals of Computational Fluid Dynamics

����� THE MODIFIED PARTIAL DIFFERENTIAL EQUATION � �

���� The Modi�ed Partial Di�erential Equation

First carry out a Taylor series expansion of the terms in Eq� ����� We are lead to theexpression

��xu�j ��

��x

����x

��u

�x

�j

� ��x����u

�x�

�j

��x�

���u

�x�

�j

� ��x�

��

���u

�x�

�j

� � � �

�We see that the antisymmetric portion of the operator introduces odd derivativeterms in the truncation error while the symmetric portion introduces even derivatives�Substituting this into Eq� ���� gives

�u

�t� �a�u

�x�a��x

��u

�x�� a�x�

��u

�x��a��x�

��

��u

�x�� � � � ������

This is the partial dierential equation we are really solving when we apply theapproximation given by Eq� ���� to Eq� ����� Notice that Eq� ���� is consistent withEq� ����� since the two equations are identical when �x� � However� when we usea computer to �nd a numerical solution of the problem� �x can be small but it isnot zero� This means that each term in the expansion given by Eq� ���� is excited tosome degree� We refer to Eq� ���� as the modi�ed partial di�erential equation� Weproceed next to investigate the implications of this concept�

Consider the simple linear partial dierential equation

�u

�t� �a�u

�x� �

��u

�x�� �

��u

�x�� �

��u

�x�������

Choose periodic boundary conditions and impose an initial condition u � ei�x� Underthese conditions there is a wave�like solution to Eq� ���� of the form

u�x� t� � ei�xe�ris�t

provided r and s satisfy the condition

r � is � �ia� �� � i�� � ��

orr � ���� � ���� s � ��a � ���

The solution is composed of both amplitude and phase terms� Thus

u � e���������� �z �

amplitude

ei��x��a����t� �z �

phase

������

Page 215: Fundamentals of Computational Fluid Dynamics

� � CHAPTER ��� NUMERICAL DISSIPATION

It is important to notice that the amplitude of the solution depends only upon � and� � the coe�cients of the even derivatives in Eq� ����� and the phase depends only ona and �� the coe�cients of the odd derivatives�

If the wave speed a is positive� the choice of a backward dierence scheme �� � ��produces a modi�ed PDE with � � �� � and hence the amplitude of the solutiondecays� This is tantamount to deliberately adding dissipation to the PDE� Under thesame condition� the choice of a forward dierence scheme �� � ��� is equivalent todeliberately adding a destabilizing term to the PDE�

By examining the term governing the phase of the solution in Eq� ����� we seethat the speed of propagation is a � ��� Referring to the modi�ed PDE� Eq� ����we have � � �a�x���� Therefore� the phase speed of the numerical solution is lessthan the actual phase speed� Furthermore� the numerical phase speed is dependentupon the wavenumber � This we refer to as dispersion�

Our purpose here is to investigate the properties of one�sided spatial dierencingoperators relative to centered dierence operators� We have seen that the three�point centered dierence approximation of the spatial derivative produces a modi�edPDE that has no dissipation �or ampli�cation�� One can easily show� by using theantisymmetry of the matrix dierence operators� that the same is true for any cen�tered dierence approximation of a �rst derivative� As a corollary� any departurefrom antisymmetry in the matrix di�erence operator must introduce dissipation �orampli�cation� into the modi�ed PDE�

Note that the use of one�sided dierencing schemes is not the only way to in�troduce dissipation� Any symmetric component in the spatial operator introducesdissipation �or ampli�cation�� Therefore� one could choose � � ��� in Eq� ����� Theresulting spatial operator is not one�sided but it is dissipative� Biased schemes usemore information on one side of the node than the other� For example� a third�orderbackward�biased scheme is given by

��xu�j ��

��x�uj�� � �uj�� � �uj � �uj��

��

���x��uj�� � uj�� � uj� � uj��

� �uj�� � �uj�� � �uj � �uj� � uj��� ������

The antisymmetric component of this operator is the fourth�order centered dierenceoperator� The symmetric component approximates �x�uxxxx���� Therefore� thisoperator produces fourth�order accuracy in phase with a third�order dissipative term�

Page 216: Fundamentals of Computational Fluid Dynamics

����� THE LAX�WENDROFF METHOD � �

���� The Lax�Wendro� Method

In order to introduce numerical dissipation using one�sided dierencing� backwarddierencing must be used if the wave speed is positive� and forward dierencing mustbe used if the wave speed is negative� Next we consider a method which introducesdissipation independent of the sign of the wave speed� known as the Lax�Wendromethod� This explicit method diers conceptually from the methods considered pre�viously in which spatial dierencing and time�marching are treated separately�

Consider the following Taylor�series expansion in time�

u�x� t � h� � u � h�u

�t�

�h���u

�t�� O�h�� ������

First replace the time derivatives with space derivatives according to the PDE �inthis case� the linear convection equation �u

�t� a�u

�x� �� Thus

�u

�t� �a�u

�x�

��u

�t�� a�

��u

�x������

Now replace the space derivatives with three�point centered dierence operators� giv�ing

u�n��j � u

�n�j � �

ah

�x�u

�n�j� � u

�n�j��� �

�ah

�x

��

�u�n�j� � �u

�n�j � u

�n�j��� ������

This is the Lax�Wendro method applied to the linear convection equation� It is afully�discrete �nite�dierence scheme� There is no intermediate semi�discrete stage�

For periodic boundary conditions� the corresponding fully�discrete matrix operatoris

�un� � Bp

���

�� ah�x

�ah

�x

��� � �� �

ah

�x

��

��

��� ah

�x�

�ah

�x

����A �un

The eigenvalues of this matrix are

�m � ���ah

�x

�� ��� cos

�� m

M

��� i

ah

�xsin

�� m

M

�for m � � �� � � � �M � �

For j ah�xj � � all of the eigenvalues have modulus less than or equal to unity and hence

the method is stable independent of the sign of a� The quantity j ah�xj is known as the

Courant �or CFL� number� It is equal to the ratio of the distance travelled by a wavein one time step to the mesh spacing�

Page 217: Fundamentals of Computational Fluid Dynamics

� CHAPTER ��� NUMERICAL DISSIPATION

The nature of the dissipative properties of the Lax�Wendro scheme can be seenby examining the modi�ed partial dierential equation� which is given by

�u

�t� a

�u

�x� �a

���x� � a�h��

��u

�x�� a�h

��x� � a�h��

��u

�x�� � � �

This is derived by substituting Taylor series expansions for all terms in Eq� ���� andconverting the time derivatives to space derivatives using Eq� ���� The two leadingerror terms appear on the right side of the equation� Recall that the odd derivatives onthe right side lead to unwanted dispersion and the even derivatives lead to dissipation�or ampli�cation� depending on the sign�� Therefore� the leading error term in theLax�Wendro method is dispersive and proportional to

�a�

��x� � a�h����u

�x�� �a�x�

���� C�

n���u

�x�

The dissipative term is proportional to

�a�h

��x� � a�h��

��u

�x�� �a

�h�x�

��� C�

n���u

�x�

This term has the appropriate sign and hence the scheme is truly dissipative as longas Cn � ��

A closely related method is that of MacCormack� Recall MacCormack�s time�marching method� presented in Chapter ��

$un� � un � hu�n

un� ��

��un � $un� � h$u�n�� ����� �

If we use �rst�order backward dierencing in the �rst stage and �rst�order forwarddierencing in the second stage�� a dissipative second�order method is obtained� Forthe linear convection equation� this approach leads to

$u�n��j � u

�n�j � ah

�x�u

�n�j � u

�n�j���

u�n��j �

��u

�n�j � $u

�n��j � ah

�x�$u

�n��j� � $u

�n��j �� �������

which can be shown to be identical to the Lax�Wendro method� Hence MacCor�mack�s method has the same dissipative and dispersive properties as the Lax�Wendromethod� The two methods dier when applied to nonlinear hyperbolic systems� how�ever�

�Or viceversa for nonlinear problems� these should be applied alternately�

Page 218: Fundamentals of Computational Fluid Dynamics

����� UPWIND SCHEMES � �

���� Upwind Schemes

In Section ����� we saw that numerical dissipation can be introduced in the spatialdierence operator using one�sided dierence schemes or� more generally� by addinga symmetric component to the spatial operator� With this approach� the directionof the one�sided operator �i�e�� whether it is a forward or a backward dierence�or the sign of the symmetric component depends on the sign of the wave speed�When a hyperbolic system of equations is being solved� the wave speeds can be bothpositive and negative� For example� the eigenvalues of the �ux Jacobian for the one�dimensional Euler equations are u� u� a� u� a� When the �ow is subsonic� these areof mixed sign� In order to apply one�sided dierencing schemes to such systems� someform of splitting is required� This is avoided in the Lax�Wendro scheme� However�as a result of their superior �exibility� schemes in which the numerical dissipationis introduced in the spatial operator are generally preferred over the Lax�Wendroapproach�

Consider again the linear convection equation�

�u

�t� a

�u

�x� �������

where we do not make any assumptions as to the sign of a� We can rewrite Eq� �����as

�u

�t� �a � a��

�u

�x� a� �

a� jaj�

If a � � then a � a � and a� � � Alternatively� if a � � then a � anda� � a � � Now for the a �� � term we can safely backward dierence and for thea� �� � term forward dierence� This is the basic concept behind upwind methods�that is� some decomposition or splitting of the �uxes into terms which have positiveand negative characteristic speeds so that appropriate dierencing schemes can bechosen� In the next two sections� we present two splitting techniques commonly usedwith upwind methods� These are by no means unique�

The above approach to obtaining a stable discretization independent of the signof a can be written in a dierent� but entirely equivalent� manner� From Eq� ����� wesee that a stable discretization is obtained with � � � if a � and with � � �� ifa � � This is achieved by the following point operator�

�a��xu�j ���

��x�a��uj�� � uj�� � jaj��uj�� � �uj � uj��� �������

This approach is extended to systems of equations in Section �����In this section� we present the basic ideas of �ux�vector and �ux�dierence splitting�

For more subtle aspects of implementation and application of such techniques to

Page 219: Fundamentals of Computational Fluid Dynamics

�� CHAPTER ��� NUMERICAL DISSIPATION

nonlinear hyperbolic systems such as the Euler equations� the reader is referred tothe literature on this subject�

������ Flux�Vector Splitting

Recall from Section ��� that a linear� constant�coe�cient� hyperbolic system of partialdierential equations given by

�u

�t��f

�x�

�u

�t� A

�u

�x� �������

can be decoupled into characteristic equations of the form

�wi

�t� �i

�wi

�x� �������

where the wave speeds� �i� are the eigenvalues of the Jacobian matrix� A� and thewi�s are the characteristic variables� In order to apply a one�sided �or biased� spatialdierencing scheme� we need to apply a backward dierence if the wave speed� �i� ispositive� and a forward dierence if the wave speed is negative� To accomplish this�let us split the matrix of eigenvalues� "� into two components such that

" � " � "� �������

where

" �" � j"j

�� "� �

"� j"j�

�������

With these de�nitions� " contains the positive eigenvalues and "� contains the neg�ative eigenvalues� We can now rewrite the system in terms of characteristic variablesas

�w

�t� "

�w

�x�

�w

�t� "�w

�x� "��w

�x� ������

The spatial terms have been split into two components according to the sign of thewave speeds� We can use backward dierencing for the " �w

�xterm and forward

dierencing for the "� �w�x

term� Premultiplying by X and inserting the productX��X in the spatial terms gives

�Xw

�t��X"X��Xw

�x��X"�X��Xw

�x� �������

Page 220: Fundamentals of Computational Fluid Dynamics

����� UPWIND SCHEMES ���

With the de�nitions�

A � X"X��� A� � X"�X�� ����� �

and recalling that u � Xw� we obtain

�u

�t��Au

�x��A�u

�x� �������

Finally the split �ux vectors are de�ned as

f � Au� f� � A�u �������

and we can write

�u

�t��f

�x��f�

�x� �������

In the linear case� the de�nition of the split �uxes follows directly from the de�ni�tion of the �ux� f � Au� For the Euler equations� f is also equal to Au as a result oftheir homogeneous property� as discussed in Appendix C� Note that

f � f � f� �������

Thus by applying backward dierences to the f term and forward dierences to thef� term� we are in eect solving the characteristic equations in the desired manner�This approach is known as �ux�vector splitting�

When an implicit time�marching method is used� the Jacobians of the split �uxvectors are required� In the nonlinear case�

�f

�u� A�

�f�

�u� A� �������

Therefore� one must �nd and use the new Jacobians given by

A ��f

�u� A�� �

�f�

�u�������

For the Euler equations� A has eigenvalues which are all positive� and A�� has allnegative eigenvalues�

�With these de�nitions A� has all positive eigenvalues� and A� has all negative eigenvalues�

Page 221: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� NUMERICAL DISSIPATION

������ Flux�Di�erence Splitting

Another approach� more suited to �nite�volume methods� is known as �ux�dierencesplitting� In a �nite�volume method� the �uxes must be evaluated at cell bound�aries� We again begin with the diagonalized form of the linear� constant�coe�cient�hyperbolic system of equations

�w

�t� "

�w

�x� �������

The �ux vector associated with this form is g � "w� Now� as in Chapter �� weconsider the numerical �ux at the interface between nodes j and j � �� &gj���� as afunction of the states to the left and right of the interface� wL and wR� respectively�The centered approximation to gj���� which is nondissipative� is given by

&gj��� ��

��g�wL� � g�wR�� ������

In order to obtain a one�sided upwind approximation� we require

�&gi�j��� �

��i�wi�L if �i � �i�wi�R if �i �

�������

where the subscript i indicates individual components of w and g� This is achievedwith

�&gi�j��� ��

��i ��wi�L � �wi�R� �

�j�ij ��wi�L � �wi�R� ����� �

or

&gj��� ��

�" �wL � wR� �

�j"j �wL � wR� �������

Now� as in Eq� ������ we premultiply by X to return to the original variables andinsert the product X��X after " and j"j to obtain

X&gj��� ��

�X"X��X �wL � wR� �

�Xj"jX��X �wL � wR� �������

and thus

&fj��� ��

��fL � fR� �

�jAj �uL � uR� �������

where

jAj � Xj"jX�� �������

Page 222: Fundamentals of Computational Fluid Dynamics

����� ARTIFICIAL DISSIPATION ���

and we have also used the relations f � Xg� u � Xw� and A � X"X���In the linear� constant�coe�cient case� this leads to an upwind operator which is

identical to that obtained using �ux�vector splitting� However� in the nonlinear case�there is some ambiguity regarding the de�nition of jAj at the cell interface j � ����In order to resolve this� consider a situation in which the eigenvalues of A are all ofthe same sign� In this case� we would like our de�nition of &fj��� to satisfy

&fj��� �

�fL if all �i

�s � fR if all �i

�s � �������

giving pure upwinding� If the eigenvalues of A are all positive� jAj � A if they areall negative� jAj � �A� Hence satisfaction of Eq� ����� is obtained by the de�nition

&fj��� ��

��fL � fR� �

�jAj���j �uL � uR� �������

if Aj��� satis�es

fL � fR � Aj��� �uL � uR� �������

For the Euler equations for a perfect gas� Eq� ����� is satis�ed by the �ux Jacobianevaluated at the Roe�average state given by

uj��� �

p�LuL �

p�RuRp

�L �p�R

������

Hj��� �

p�LHL �

p�RHRp

�L �p�R

�������

where u and H � �e � p��� are the velocity and the total enthalpy per unit mass�respectively��

���� Arti�cial Dissipation

We have seen that numerical dissipation can be introduced by using one�sided dif�ferencing schemes together with some form of �ux splitting� We have also seen thatsuch dissipation can be introduced by adding a symmetric component to an antisym�metric �dissipation�free� operator� Thus we can generalize the concept of upwindingto include any scheme in which the symmetric portion of the operator is treated insuch a manner as to be truly dissipative�

�Note that the �ux Jacobian can be written in terms of u and H only see problem � at the endof this chapter�

Page 223: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� NUMERICAL DISSIPATION

For example� let

��axu�j �uj� � uj��

��x� ��sxu�j �

�uj� � �uj � uj����x

����� �

Applying �x � �ax � �sx to the spatial derivative in Eq� ����� is stable if �i � andunstable if �i � � Similarly� applying �x � �ax � �sx is stable if �i � and unstable if�i � � The appropriate implementation is thus

�i�x � �i�ax � j�ij�sx �������

Extension to a hyperbolic system by applying the above approach to the characteristicvariables� as in the previous two sections� gives

�x�Au� � �ax�Au� � �sx�jAju� �������

or

�xf � �axf � �sx�jAju� �������

where jAj is de�ned in Eq� ������ The second spatial term is known as arti�cialdissipation� It is also sometimes referred to as arti�cial diusion or arti�cial viscosity�With appropriate choices of �ax and �sx� this approach can be related to the upwindapproach� This is particularly evident from a comparison of Eqs� ����� and ������

It is common to use the following operator for �sx

��sxu�j �

�x�uj�� � �uj�� � �uj � �uj� � uj�� �������

where is a problem�dependent coe�cient� This symmetric operator approximates�x�uxxxx and thus introduces a third�order dissipative term� With an appropriatevalue of � this often provides su�cient damping of high frequency modes withoutgreatly aecting the low frequency modes� For details of how this can be implementedfor nonlinear hyperbolic systems� the reader should consult the literature� A morecomplicated treatment of the numerical dissipation is also required near shock wavesand other discontinuities� but is beyond the scope of this book�

���� Problems

�� A second�order backward dierence approximation to a �st derivative is givenas a point operator by

��xu�j ��

��x�uj�� � �uj�� � �uj�

Page 224: Fundamentals of Computational Fluid Dynamics

����� PROBLEMS ���

�a� Express this operator in banded matrix form �for periodic boundary condi�tions�� then derive the symmetric and skew�symmetric matrices that havethe matrix operator as their sum� �See Appendix A�� to see how to con�struct the symmetric and skew�symmetric components of a matrix��

�b� Using a Taylor table� �nd the derivative which is approximated by thecorresponding symmetric and skew�symmetric operators and the leadingerror term for each�

�� Find the modi�ed wavenumber for the �rst�order backward dierence operator�Plot the real and imaginary parts of ��x vs� �x for � �x � � UsingFourier analysis as in Section ������ �nd j�j for the combination of this spatialoperator with �th�order Runge�Kutta time marching at a Courant number ofunity and plot vs� �x for � �x � �

�� Find the modi�ed wavenumber for the operator given in Eq� ����� Plot the realand imaginary parts of ��x vs� �x for � �x � � Using Fourier analysisas in Section ������ �nd j�j for the combination of this spatial operator with�th�order Runge�Kutta time marching at a Courant number of unity and plotvs� �x for � �x � �

�� Consider the spatial operator obtained by combining second�order centered dif�ferences with the symmetric operator given in Eq� ������ Find the modi�edwavenumber for this operator with � � ����� ����� and ���� Plot the realand imaginary parts of ��x vs� �x for � �x � � Using Fourier analysisas in Section ������ �nd j�j for the combination of this spatial operator with�th�order Runge�Kutta time marching at a Courant number of unity and plotvs� �x for � �x � �

�� Consider the hyperbolic system derived in problem of Chapter �� Find thematrix jAj� Form the plus�minus split �ux vectors as in Section �������

�� Show that the �ux Jacobian for the ��D Euler equations can be written in termsof u and H� Show that the use of the Roe average state given in Eqs� ���� and����� leads to satisfaction of Eq� ������

Page 225: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� NUMERICAL DISSIPATION

Page 226: Fundamentals of Computational Fluid Dynamics

Chapter ��

SPLIT AND FACTORED FORMS

In the next two chapters� we present and analyze split and factored algorithms� Thisgives the reader a feel for some of the modi�cations which can be made to the basicalgorithms in order to obtain e�cient solvers for practical multidimensional applica�tions� and a means for analyzing such modi�ed forms�

���� The Concept

Factored forms of numerical operators are used extensively in constructing and ap�plying numerical methods to problems in �uid mechanics� They are the basis for awide variety of methods variously known by the labels �hybrid�� �time split�� and�fractional step�� Factored forms are especially useful for the derivation of practicalalgorithms that use implicit methods� When we approach numerical analysis in thelight of matrix derivative operators� the concept of factoring is quite simple to presentand grasp� Let us start with the following observations�

�� Matrices can be split in quite arbitrary ways�

�� Advancing to the next time level always requires some reference to a previousone�

�� Time marching methods are valid only to some order of accuracy in the stepsize� h�

Now recall the generic ODE�s produced by the semi�discrete approach

d�u

dt� A�u� �f ������

���

Page 227: Fundamentals of Computational Fluid Dynamics

�� CHAPTER ��� SPLIT AND FACTORED FORMS

and consider the above observations� From observation � �arbitrary splitting of A� �

d�u

dt� �A� � A���u� �f ������

where A � �A� � A�� but A� and A� are not unique� For the time march let us choosethe simple� �rst�order�� explicit Euler method� Then� from observation � �new data�un� in terms of old �un��

�un� � � I � hA� � hA���un � h�f � O�h�� ������

or its equivalent

�un� �h� I � hA��� I � hA��� h�A�A�

i�un � h�f � O�h��

Finally� from observation � �allowing us to drop higher order terms �h�A�A��un��

�un� � � I � hA��� I � hA���un � h�f � O�h�� ������

Notice that Eqs� ���� and ���� have the same formal order of accuracy and� inthis sense� neither one is to be preferred over the other� However� their numericalstability can be quite dierent� and techniques to carry out their numerical evaluationcan have arithmetic operation counts that vary by orders of magnitude� Both of theseconsiderations are investigated later� Here we seek only to apply to some simple casesthe concept of factoring�

���� Factoring Physical Representations � Time

Splitting

Suppose we have a PDE that represents both the processes of convection and dissi�pation� The semi�discrete approach to its solution might be put in the form

d�u

dt� Ac

�u � Ad�u � ��bc� ������

where Ac and Ad are matrices representing the convection and dissipation terms�respectively and their sum forms the A matrix we have considered in the previoussections� Choose again the explicit Euler time march so that

�un� � � I � hAd � hAc��un � h ��bc� � O�h�� ������

�Secondorder timemarching methods are considered later�

Page 228: Fundamentals of Computational Fluid Dynamics

����� FACTORING PHYSICAL REPRESENTATIONS TIME SPLITTING ���

Now consider the factored form

�un� � � I � hAd��� I � hAc��un � h ��bc�

�� � I � hAd � hAc��un � h ��bc� �z �

Original Unfactored Terms

� h�Ad

�Ac�un � ��bc�

� �z �

Higher Order Terms

�O�h�� ������

and we see that Eq� ���� and the original unfactored form Eq� ���� have identicalorders of accuracy in the time approximation� Therefore� on this basis� their selectionis arbitrary� In practical applications� equations such as ���� are often applied in apredictor�corrector sequence� In this case one could write

$un� � � I � hAc��un � h ��bc�

�un� � � I � hAd�$un� �����

Factoring can also be useful to form split combinations of implicit and explicittechniques� For example� another way to approximate Eq� ���� with the same orderof accuracy is given by the expression

�un� � � I � hAd����� I � hAc��un � h ��bc�

�� � I � hAd � hAc��un � h ��bc� �z �

Original Unfactored Terms

�O�h�� ������

where in this approximation we have used the fact that

� I � hAd��� � I � hAd � h�A�

d � � � �

if h � jjAdjj � �� where jjAdjj is some norm of �Ad�� This time a predictor�correctorinterpretation leads to the sequence

$un� � � I � hAc��un � h ��bc�

� I � hAd��un� � $un� ����� �

The convection operator is applied explicitly� as before� but the diusion operator isnow implicit� requiring a tridiagonal solver if the diusion term is central dierenced�Since numerical stiness is generally much more severe for the diusion process� thisfactored form would appear to be superior to that provided by Eq� ���� However�the important aspect of stability has yet to be discussed�

�We do not suggest that this particular method is suitable for use� We have yet to determine itsstability� and a �rstorder timemarch method is usually unsatisfactory�

Page 229: Fundamentals of Computational Fluid Dynamics

�� CHAPTER ��� SPLIT AND FACTORED FORMS

We should mention here that Eq� ���� can be derived for a dierent point of viewby writing Eq� ���� in the form

un� � unh

� Acun � Adun� � ��bc� � O�h��

Then� I � hAd�un� � � I � hAc�un � h ��bc�

which is identical to Eq� ���� �

���� Factoring Space Matrix Operators in ��D

������ Mesh Indexing Convention

Factoring is widely used in codes designed for the numerical solution of equationsgoverning unsteady two� and three�dimensional �ows� Let us study the basic conceptof factoring by inspecting its use on the linear ��D scalar PDE that models diusion�

�u

�t�

��u

�x����u

�y��������

We begin by reducing this PDE to a coupled set of ODE�s by dierencing the spacederivatives and inspecting the resulting matrix operator�

A clear description of a matrix �nite�dierence operator in �� and ��D requires somereference to a mesh� We choose the � � � point mesh� shown in the Sketch ������In this example Mx� the number of �interior� x points� is � and My� the number of�interior� y points is �� The numbers �� � �� � � � � � �� represent the location in themesh of the dependent variable bearing that index� Thus u�� represents the value ofu at j � � and k � ��

� � � �My � �� �� �� �� �k � �� �� �� �� �� � �� �� �� �� �

� � � �� j � � � Mx

Mesh indexing in ��D�

�������

�This could also be called a � � � point mesh if the boundary points �labeled � in the sketch�were included� but in these notes we describe the size of a mesh by the number of interior points�

Page 230: Fundamentals of Computational Fluid Dynamics

����� FACTORING SPACE MATRIX OPERATORS IN ��D ���

������ Data Bases and Space Vectors

The dimensioned array in a computer code that allots the storage locations of thedependent variable�s� is referred to as a data�base� There are many ways to lay outa data�base� Of these� we consider only two� ���� consecutively along rows that arethemselves consecutive from k � � to My� and ���� consecutively along columns thatare consecutive from j � � to Mx� We refer to each row or column group as aspace vector �they represent data along lines that are continuous in space� and labeltheir sum with the symbol U � In particular� ��� and ��� above are referred to as x�vectors and y�vectors� respectively� The symbol U by itself is not enough to identifythe structure of the data�base and is used only when the structure is immaterial orunderstood�

To be speci�c about the structure� we label a data�base composed of x�vectors withU �x� � and one composed of y�vectors with U �y�� Examples of the order of indexingfor these space vectors are given in Eq� ����� part a and b�

������ Data Base Permutations

The two vectors �arrays� are related by a permutation matrix P such that

U �x� � PxyU�y� and U �y� � PyxU

�x� �������

wherePyx � PT

xy � P��xy

Now consider the structure of a matrix �nite�dierence operator representing ��point central�dierencing schemes for both space derivatives in two dimensions� Whenthe matrix is multiplying a space vector U � the usual �but ambiguous� representationis given by Axy� In this notation the ODE form of Eq� ����� can be written �

dU

dt� AxyU � ��bc� �������

If it is important to be speci�c about the data�base structure� we use the notationA�x�xy or A�y�

xy� depending on the data�base chosen for the U it multiplies� Examplesare in Eq� ����� part a and b� Notice that the matrices are not the same althoughthey represent the same derivative operation� Their structures are similar� however�and they are related by the same permutation matrix that relates U �x� to U �y�� Thus

A�x�xy � Pxy � A�y�

xy � Pyx �������

�Notice that Ax�y and U � which are notations used in the special case of space vectors� are

subsets of A and �u� used in the previous sections�

Page 231: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� SPLIT AND FACTORED FORMS

A�x�xy � U �x� �

�����������������������������

x j o jx x j o j

x x j o jx j o j

o j x j oo j x x j o

o j x x j oo j x j o

j o j xj o j x xj o j x xj o j x

����������������������������

����������������������������

a�Elements in ��dimensional� central�dierence� matrixoperator� Axy� for ��� mesh shown in Sketch ������Data base composed of My x�vectors stored in U �x��

Entries for x� x� for y � o� for both � �

A�y�xy � U �y� �

�������������������������������

o j x j jo o j x j j

o j x j j

x j o j x jx j o o j x j

x j o j x j

j x j o j xj x j o o j xj x j o j x

j j x j oj j x j o oj j x j o

������������������������������

������������������������������

b� Elements in ��dimensional� central�dierence� matrixoperator� Axy� for ��� mesh shown in Sketch ������Data base composed of Mx y�vectors stored in U �y��

Entries for x� x� for y � o� for both � �

�������

Page 232: Fundamentals of Computational Fluid Dynamics

����� FACTORING SPACE MATRIX OPERATORS IN ��D ���

������ Space Splitting and Factoring

We are now prepared to discuss splitting in two dimensions� It should be clear thatthe matrix A

�x�xy can be split into two matrices such that

A�x�xy � A�x�

x � A�x�y �������

where A�x�x and A�x�

y are shown in Eq� ������ Similarily

A�y�xy � A�y�

x � A�y�y ������

where the split matrices are shown in Eq� ������

The permutation relation also holds for the split matrices so

A�x�y � PxyA

�y�y Pyx

and

A�x�x � PxyA

�y�x Pyx

The splittings in Eqs� ����� and ���� can be combined with factoring in themanner described in Section ����� As an example ��rst�order in time�� applying theimplicit Euler method to Eq� ����� gives

U�x�n� � U �x�

n � hhA�x�x � A�x�

y

iU

�x�n� � h ��bc�

or hI � hA�x�

x � hA�x�y

iU

�x�n� � U �x�

n � h ��bc� � O�h�� �������

As in Section ����� we retain the same �rst order accuracy with the alternative

hI � hA�x�

x

ihI � hA�x�

y

iU

�x�n� � U �x�

n � h ��bc� � O�h�� ����� �

Write this in predictor�corrector form and permute the data base of the second row�There results

hI � hA�x�

x

i$U �x� � U �x�

n � h ��bc�hI � hA�y�

y

iU

�y�n� � $U �y� �������

Page 233: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� SPLIT AND FACTORED FORMS

A�x�x � U �x� �

�����������������������������

x x j jx x x j j

x x x j jx x j j

j x x jj x x x jj x x x jj x x j

j j x xj j x x xj j x x xj j x x

����������������������������

� U �x�

A�x�y � U �x� �

�����������������������������

o j o jo j o j

o j o jo j o j

o j o j oo j o j o

o j o j oo j o j o

j o j oj o j oj o j oj o j o

����������������������������

� U �x�

The splitting of A�x�xy�

�������

Page 234: Fundamentals of Computational Fluid Dynamics

����� FACTORING SPACE MATRIX OPERATORS IN ��D ���

A�y�x � U �y� �

�������������������������������

x j x j jx j x j j

x j x j j

x j x j x jx j x j x j

x j x j x j

j x j x j xj x j x j xj x j x j x

j j x j xj j x j xj j x j x

������������������������������

� U �y�

A�y�y � U �y� �

�������������������������������

o o j j jo o o j j j

o o j j j

j o o j jj o o o j jj o o j j

j j o o jj j o o o jj j o o j

j j j o oj j j o o oj j j o o

������������������������������

� U �y�

The splitting of A�y�xy�

�������

Page 235: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� SPLIT AND FACTORED FORMS

���� Second�Order Factored Implicit Methods

Second�order accuracy in time can be maintained in a certain factored implicit meth�ods� For example� apply the trapezoidal method to Eq� ����� where the derivativeoperators have been split as in Eq� ����� or ����� Let the data base be immaterial

and the ��bc� be time invariant� There results�I � �

�hAx � �

�hAy

�Un� �

�I �

�hAx �

�hAy

�Un � h ��bc� � O�h�� �������

Factor both sides giving� �I � �

�hAx

��I � �

�hAy

�� �

�h�AxAy

�Un�

�� �

I ��

�hAx

��I �

�hAy

�� �

�h�AxAy

�Un � h ��bc� � O�h�� �������

Then notice that the combination ��h

��AxAy��Un� � Un� is proportional to h� sincethe leading term in the expansion of �Un� � Un� is proportional to h� Therefore� wecan write�

I � �

�hAx

��I � �

�hAy

�Un� �

�I �

�hAx

��I �

�hAy

�Un � h ��bc� � O�h���������

and both the factored and unfactored form of the trapezoidal method are second�orderaccurate in the time march�

An alternative form of this kind of factorization is the classical ADI �alternatingdirection implicit� method usually written�

I � �

�hAx

�$U �

�I �

�hAy

�Un �

�hFn�

I � �

�hAy

�Un� �

�I �

�hAx

�$U �

�hFn� � O�h�� �������

For idealized commuting systems the methods given by Eqs� ����� and ����� dieronly in their evaluation of a time�dependent forcing term�

���� Importance of Factored Forms in � and � Di�

mensions

When the time�march equations are sti and implicit methods are required to permitreasonably large time steps� the use of factored forms becomes a very valuable tool

�A form of the Douglas or PeacemanRachford methods�

Page 236: Fundamentals of Computational Fluid Dynamics

����� IMPORTANCE OF FACTORED FORMS IN � AND � DIMENSIONS ���

for realistic problems� Consider� for example� the problem of computing the timeadvance in the unfactored form of the trapezoidal method given by Eq� ������

I � �

�hAxy

�Un� �

�I �

�hAxy

�Un � h ��bc�

Forming the right hand side poses no problem� but �nding Un� requires the solutionof a sparse� but very large� set of coupled simultaneous equations having the matrixform shown in Eq� ����� part a and b� Furthermore� in real cases involving the Euleror Navier�Stokes equations� each symbol �o� x� � represents a � � � block matrix withentries that depend on the pressure� density and velocity �eld� Suppose we were tosolve the equations directly� The forward sweep of a simple Gaussian elimination �lls�

all of the � � � blocks between the main and outermost diagonal �e�g� between and o in Eq� ����� part b��� This must be stored in computer memory to be used to�nd the �nal solution in the backward sweep� If Ne represents the order of the smallblock matrix �� in the ��D Euler case�� the approximate memory requirement is

�Ne �My� � �Ne �My� �Mx

�oating point words� Here it is assumed that My � Mx� If My � Mx� My and Mx

would be interchanged� A moderate mesh of � � � points would require over ��million words to �nd the solution� Actually current computer power is able to coperather easily with storage requirements of this order of magnitude� With computingspeeds of over one giga�op�� direct solvers may become useful for �nding steady�statesolutions of practical problems in two dimensions� However� a three�dimensionalsolver would require a memory of approximatly

N�e �M�

y �M�z �Mx

words and� for well resolved �ow �elds� this probably exceeds memory availability forsome time to come�

On the other hand� consider computing a solution using the factored implicit equa�tion ������ Again computing the right hand side poses no problem� Accumulate theresult of such a computation in the array �RHS�� One can then write the remainingterms in the two�step predictor�corrector form�

I � �

�hA�x�

x

�$U �x� � �RHS��x��

I � �

�hA�y�

y

�U

�y�n� � $U �y� ������

�For matrices as small as those shown there are many gaps in this ��ll�� but for meshes ofpractical size the �ll is mostly dense�

�The lower band is also computed but does not have to be saved unless the solution is to berepeated for another vector�

One billion �oatingpoint operations per second�

Page 237: Fundamentals of Computational Fluid Dynamics

�� CHAPTER ��� SPLIT AND FACTORED FORMS

which has the same appearance as Eq� ����� but is second�order time accurate� The�rst step would be solved using My uncoupled block tridiagonal solvers�� Inspectingthe top of Eq� ������ we see that this is equivalent to solving My one�dimensionalproblems� each with Mx blocks of order Ne� The temporary solution $U �x� would thenbe permuted to $U �y� and an inspection of the bottom of Eq� ����� shows that the �nalstep consists of solving Mx one�dimensional implicit problems each with dimensionMy�

���� The Delta Form

Clearly many ways can be devised to split the matrices and generate factored forms�One way that is especially useful� for ensuring a correct steady�state solution in aconverged time�march� is referred to as the �delta form� and we develop it next�

Consider the unfactored form of the trapezoidal method given by Eq� ������ and

let the ��bc� be time invariant��I � �

�hAx � �

�hAy

�Un� �

�I �

�hAx �

�hAy

�Un � h ��bc� � O�h��

From both sides subtract �I � �

�hAx � �

�hAy

�Un

leaving the equality unchanged� Then� using the standard de�nition of the dierenceoperator ��

�Un � Un� � Un

one �nds �I � �

�hAx � �

�hAy

��Un � h

hAxyUn � ��bc�

i� O�h�� �������

Notice that the right side of this equation is the product of h and a term that isidentical to the right side of Eq� ������ our original ODE� Thus� if Eq� ����� converges�it is guaranteed to converge to the correct steady�state solution of the ODE� Now wecan factor Eq� ����� and maintain O�h�� accuracy� We arrive at the expression�

I � �

�hAx

��I � �

�hAy

��Un � h

hAxyUn � ��bc�

i� O�h�� ����� �

This is the delta form of a factored� �nd�order� ��D equation�

A block tridiagonal solver is similar to a scalar solver except that small block matrix operationsreplace the scalar ones� and matrix multiplications do not commute�

Page 238: Fundamentals of Computational Fluid Dynamics

����� PROBLEMS ���

The point at which the factoring is made may not aect the order of time�accuracy�but it can have a profound eect on the stability and convergence properties of amethod� For example� the unfactored form of a �rst�order method derived from theimplicit Euler time march is given by Eq� ������ and if it is immediately factored�the factored form is presented in Eq� ���� � On the other hand� the delta form of theunfactored Eq� ����� is

�I � hAx � hAy��Un � hhAxyUn � ��bc�

iand its factored form becomes��

�I � hAx��I � hAy��Un � hhAxyUn � ��bc�

i�������

In spite of the similarities in derivation� we will see in the next chapter that theconvergence properties of Eq� ���� and Eq� ����� are vastly dierent�

��� Problems

�� Consider the ��D heat equation�

�u

�t� �

��u

�x� � x � �

Let u� � t� � and u��� t� � � so that we can simplify the boundary conditions�Assume that second order central dierencing is used� i�e��

��xxu�j ��

�x��uj�� � �uj � uj��

The uniform grid has �x � � and interior points�

�a� Space vector de�nition

i� What is the space vector for the natural ordering �monotonically in�creasing in index�� u��� � Only include the interior points�

ii� If we reorder the points with the odd points �rst and then the evenpoints� write the space vector� u��� �

iii� Write down the permutation matrices��P���P����

��Notice that the only di�erence between the O�h�� method given by Eq� ��� � and the O�h�

method given by Eq� ��� � is the appearance of the factor �� on the left side of the O�h�� method�

Page 239: Fundamentals of Computational Fluid Dynamics

�� CHAPTER ��� SPLIT AND FACTORED FORMS

iv� The generic ODE representing the discrete form of the heat equationis

du���

dt� A�u

��� � f

Write down the matrix A�� �Note f � � due to the boundary condi�tions� Next �nd the matrix A� such that

du���

dt� A�u

���

Note that A� can be written as

A� �

���D UT

U D

��De�ne D and U �

v� Applying implicit Euler time marching� write the delta form of theimplicit algorithm� Comment on the form of the resulting implicitmatrix operator�

�b� System de�nition

In problem �a� we de�ned u���� u���� A�� A�� P��� and P�� which partitionthe odd points from the even points� We can put such a partitioning touse� First de�ne extraction operators

I�o� �

��������������

� � � �

��������������

��� I� �

� �

��

I�e� �

��������������

� � � �

��������������

��� � �

� I�

��

Page 240: Fundamentals of Computational Fluid Dynamics

����� PROBLEMS ���

which extract the odd even points from u��� as follows� u�o� � I�o�u��� andu�e� � I�e�u����

i� Beginning with the ODE written in terms of u���� de�ne a splittingA� � Ao � Ae� such that Ao operates only on the odd terms� and Ae

operates only on the even terms� Write out the matrices Ao and Ae�Also� write them in terms of D and U de�ned above�

ii� Apply implicit Euler time marching to the split ODE� Write down thedelta form of the algorithm and the factored delta form� Comment onthe order of the error terms�

iii� Examine the implicit operators for the factored delta form� Commenton their form� You should be able to argue that these are now trangu�lar matrices �a lower and an upper�� Comment on the solution processthis gives us relative to the direct inversion of the original system�

Page 241: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� SPLIT AND FACTORED FORMS

Page 242: Fundamentals of Computational Fluid Dynamics

Chapter ��

LINEAR ANALYSIS OF SPLIT

AND FACTORED FORMS

In Section ��� we introduced the concept of the representative equation� and usedit in Chapter � to study the stability� accuracy� and convergence properties of time�marching schemes� The question is� Can we �nd a similar equation that will allowus to evaluate the stability and convergence properties of split and factored schemes�The answer is yes � for certain forms of linear model equations�

The analysis in this chapter is useful for estimating the stability and steady�stateproperties of a wide variety of time�marching schemes that are variously referredto as time�split� fractional�step� hybrid� and �approximately� factored� When thesemethods are applied to practical problems� the results found from this analysis areneither necessary nor su�cient to guarantee stability� However� if the results indicatethat a method has an instability� the method is probably not suitable for practicaluse�

���� The Representative Equation for Circulant

Operators

Consider linear PDE�s with coe�cients that are �xed in both space and time and withboundary conditions that are periodic� We have seen that under these conditionsa semi�discrete approach can lead to circulant matrix dierence operators� and wediscussed circulant eigensystems� in Section ���� In this and the following sectionwe assume circulant systems and our analysis depends critically on the fact that allcirculant matrices commute and have a common set of eigenvectors�

�See also the discussion on Fourier stability analysis in Section ����

���

Page 243: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� LINEAR ANALYSIS OF SPLIT AND FACTORED FORMS

Suppose� as a result of space dierencing the PDE� we arrive at a set of ODE�sthat can be written

d�u

dt� Aap

�u �Abp�u� �f�t� ������

where the subscript p denotes a circulant matrix� Since both matrices have the sameset of eigenvectors� we can use the arguments made in Section ����� to uncouple theset and form the M set of independent equations

w�� � ��a � �b��w� � g��t�

���

w�m � ��a � �b�mwm � gm�t�

���

w�M � ��a � �b�MwM � gM�t� ������

The analytic solution of the m�th line is

wm�t� � cme��a�b�mt � P�S�

Note that each �a pairs with one� and only one�� �b since they must share a commoneigenvector� This suggests �see Section ����

The representative equation for split� circulant systems is

du

dt� ��a � �b � �c � � � ��u � ae�t ������

where �a � �b � �c � � � � are the sum of the eigenvalues in Aa � Ab � Ac � � � � thatshare the same eigenvector�

���� Example Analysis of Circulant Systems

������ Stability Comparisons of Time�Split Methods

Consider as an example the linear convection�diusion equation�

�u

�t� a

�u

�x� �

��u

�x�������

�This is to be contrasted to the developments found later in the analysis of �D equations�

Page 244: Fundamentals of Computational Fluid Dynamics

����� EXAMPLE ANALYSIS OF CIRCULANT SYSTEMS ���

If the space dierencing takes the form

d�u

dt� � a

��xBp���� � ���u �

�x�Bp������ ���u ������

the convection matrix operator and the diusion matrix operator� can be representedby the eigenvalues �c and �d� respectively� where �see Section �������

��c�m �ia

�xsin �m

��d�m � � ��

�x�sin� �m

�������

In these equations �m � �m �M � m � � � � � � � � M � � � so that � �m � � �Using these values and the representative equation ����� we can analyze the stabilityof the two forms of simple time�splitting discussed in Section ����� In this section werefer to these as

�� the explicit�implicit Euler method� Eq� ���� �

�� the explicit�explicit Euler method� Eq� ����

� The Explicit�Implicit Method

When applied to Eq� ����� the characteristic polynomial of this method is

P �E� � ��� h�d�E � �� � h�c�

This leads to the principal � root

� �� � i

ah

�xsin �m

� � �h�

�x�sin� �m

where we have made use of Eq� ���� to quantify the eigenvalues� Now introduce thedimensionless numbers

Cn �ah

�x� Courant number

R� �a�x

�� mesh Reynolds number

and we can write for the absolute value of �

j�j �

q� � C�

n sin� �m

� � �Cn

R�sin� �m

� � �m � � ������

Page 245: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� LINEAR ANALYSIS OF SPLIT AND FACTORED FORMS

0 4 8

R∆

C n

0

0.4

0.8

1.2

C n R∆= 2/

Explicit-Implicit

0 4 8

R∆

C n

0

0.4

0.8

1.2

Explicit-Explicit

C n

R∆= 2/C n

R∆= /2

Figure ����� )Stability regions for two simple time�split methods�

A simple numerical parametric study of Eq� ���� shows that the critical range of�m for any combination of Cn and R� occurs when �m is near �or � �� From thiswe �nd that the condition on Cn and R� that make j�j � � is

h� � C�

n sin� i

��� � �

Cn

R�sin�

��As � this gives the stability region

Cn ��

R�

which is bounded by a hyperbola and shown in Fig� �����

� The Explicit�Explicit Method

An analysis similar to the one given above shows that this method produces

j�j �q

� � C�n sin� �m

�� �

Cn

R�

sin� �m�

�� � �m � �

Again a simple numerical parametric study shows that this has two critical rangesof �m� one near � which yields the same result as in the previous example� and the

Page 246: Fundamentals of Computational Fluid Dynamics

����� EXAMPLE ANALYSIS OF CIRCULANT SYSTEMS ���

other near � o� which produces the constraint that

Cn ��

�R� for R� � �

The resulting stability boundary is also shown in Fig� ����� The totaly explicit�factored method has a much smaller region of stability when R� is small� as weshould have expected�

������ Analysis of a Second�Order Time�Split Method

Next let us analyze a more practical method that has been used in serious compu�tational analysis of turbulent �ows� This method applies to a �ow in which there isa combination of diusion and periodic convection� The convection term is treatedexplicitly using the second�order Adams�Bashforth method� The diusion term isintegrated implicitly using the trapezoidal method� Our model equation is again thelinear convection�diusion equation ���� which we split in the fashion of Eq� ����� Inorder to evaluate the accuracy� as well as the stability� we include the forcing func�tion in the representative equation and study the eect of our hybrid� time�marchingmethod on the equation

u� � �cu � �du � ae�t

First let us �nd expressions for the two polynomials� P �E� and Q�E�� The char�acteristic polynomial follows from the application of the method to the homogeneousequation� thus

un� � un ��

�h�c��un � un��� �

�h�d�un� � un�

This produces

P �E� � ��� �

�h�d�E

� � �� ��

�h�c �

�h�d�E �

�h�c

The form of the particular polynomial depends upon whether the forcing function iscarried by the AB� method or by the trapezoidal method� In the former case it is

Q�E� ��

�h��E � �� �����

and in the latter

Q�E� ��

�h�E� � E� ������

Page 247: Fundamentals of Computational Fluid Dynamics

�� CHAPTER ��� LINEAR ANALYSIS OF SPLIT AND FACTORED FORMS

Accuracy

From the characteristic polynomial we see that there are two ��roots and they aregiven by the equation

� �� �

�h�c �

�h�d �

s�� �

�h�c �

�h�d

��

� �h�c

��� �

�h�d

���

�� �

�h�d

� ����� �

The principal ��root follows from the plus sign and one can show

�� � � � ��c � �d�h ��

���c � �d�

�h� ��

���d � �c�

�d � ��c�d � ��c

�h�

From this equation it is clear that ���

� � ����c � �d�

� does not match the coe�cient

of h� in ��� soer� � O�h��

Using P �e�h� and Q�e�h� to evaluate er� in Section ������ one can show

er� � O�h��

using either Eq� ��� or Eq� ����� These results show that� for the model equation�the hybrid method retains the second�order accuracy of its individual components�

Stability

The stability of the method can be found from Eq� ���� by a parametric study of cnand R� de�ned in Eq� ����� This was carried out in a manner similar to that usedto �nd the stability boundary of the �rst�order explicit�implicit method in Section������� The results are plotted in Fig� ����� For values of R� � � this second�ordermethod has a much greater region of stability than the �rst�order explicit�implicitmethod given by Eq� ���� and shown in Fig� �����

���� The Representative Equation for Space�Split

Operators

Consider the ��D model� equations

�u

�t�

��u

�x����u

�y��������

�The extension of the following to D is simple and straightforward�

Page 248: Fundamentals of Computational Fluid Dynamics

����� THE REPRESENTATIVE EQUATION FOR SPACE�SPLIT OPERATORS���

R∆

0 4 8

0.4

0.8

1.2

Cn

Stable

Figure ����� )Stability regions for the second�order time�split method�

and

�u

�t� ax

�u

�x� ay

�u

�y� �������

Reduce either of these� by means of spatial dierencing approximations� to the coupledset of ODE�s�

dU

dt� �Ax � Ay�U � ��bc� �������

for the space vector U � The form of the Ax and Ay matrices for three�point centraldierencing schemes are shown in Eqs� ����� and ����� for the � � � mesh shownin Sketch ������ Let us inspect the structure of these matrices closely to see how wecan diagonalize �Ax � Ay� in terms of the individual eigenvalues of the two matricesconsidered separately�

First we write these matrices in the form

A�x�x �

���B BB

�� A�x�y �

��� $b� � I $b� � I$b�� � I $b� � I $b� � I

$b�� � I $b� � I

��where B is a banded matrix of the form B�b��� b�� b��� Now �nd the block eigenvector

Page 249: Fundamentals of Computational Fluid Dynamics

�� CHAPTER ��� LINEAR ANALYSIS OF SPLIT AND FACTORED FORMS

matrix that diagonalizes B and use it to diagonalize A�x�x � Thus���X

��

X��

X��

�����B B

B

�����X X

X

�� �

���""

"

��where

" �

�������

����

��

����Notice that the matrix A�x�

y is transparent to this transformation� That is� if weset X � diag�X�

X��

��� $b� � I $b� � I$b�� � I $b� � I $b� � I

$b�� � I $b� � I

��X �

��� $b� � I $b� � I$b�� � I $b� � I $b� � I

$b�� � I $b� � I

��One now permutes the transformed system to the y�vector data�base using the per�mutation matrix de�ned by Eq� ������ There results

Pyx �X��hA�x�x � A�x�

y

iX � Pxy ������

�� � I�� � I

�� � I�� � I

�����

������$B

$B$B

$B

����� �������

where $B is the banded tridiagonal matrix B�$b���$b��$b��� see the bottom of Eq� ������Next �nd the eigenvectors $X that diagonalize the $B blocks� Let $B � diag� $B� and$X � diag� $X� and form the second transformation

$X�� $B $X �

�����$"

$"$"

$"

���� � $" �

��� $��$��

$��

��This time� by the same argument as before� the �rst matrix on the right side ofEq� ����� is transparent to the transformation� so the �nal result is the completediagonalization of the matrix Axy�h

$X�� � Pyx �X��ihA

�x�xy

ihX � Pxy � $X

i�������

��I � $"

��I � $"

��I � $"

��I � $"

����� �������

Page 250: Fundamentals of Computational Fluid Dynamics

����� THE REPRESENTATIVE EQUATION FOR SPACE�SPLIT OPERATORS���

It is important to notice that�

The diagonal matrix on the right side of Eq� ����� contains every possible com�bination of the individual eigenvalues of B and $B�

Now we are ready to present the representative equation for two dimensional sys�tems� First reduce the PDE to ODE by some choice� of space dierencing� Thisresults in a spatially split A matrix formed from the subsets

A�x�x � diag�B� � A�y�

y � diag� $B� �������

where B and $B are any two matrices that have linearly independent eigenvectors �thisputs some constraints on the choice of dierencing schemes��

Although Ax and Ay do commute� this fact� by itself� does not ensure the prop�erty of �all possible combinations�� To obtain the latter property the structure ofthe matrices is important� The block matrices B and $B can be either circulant ornoncirculant in both cases we are led to the �nal result�

The ��D representative equation for model linear systems is

du

dt� ��x � �y�u � ae�t

where �x and �y are any combination of eigenvalues from Ax and Ay� a and � are�possibly complex� constants� and where Ax and Ay satisfy the conditions in ������

Often we are interested in �nding the value of� and the convergence rate to� thesteady�state solution of the representative equation� In that case we set � � anduse the simpler form

du

dt� ��x � �y�u � a �������

which has the exact solution

u�t� � ce��x�y�t � a

�x � �y������

�We have used point central di�erencing in our example� but this choice was for convenienceonly� and its use is not necessary to arrive at Eq� � ����

Page 251: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� LINEAR ANALYSIS OF SPLIT AND FACTORED FORMS

���� Example Analysis of ��D Model Equations

In the following we analyze four dierent methods for �nding a �xed� steady�statesolution to the ��D representative equation ������ In each case we examine

�� The stability�

�� The accuracy of the �xed� steady�state solution�

�� The convergence rate to reach the steady�state�

������ The Unfactored Implicit Euler Method

Consider �rst this unfactored� �rst�order scheme which can then be used as a referencecase for comparison with the various factored ones� The form of the method is givenby Eq� ������ and when it is applied to the representative equation� we �nd

��� h �x � h �y�un� � un � ha

from which

P �E� � ��� h �x � h �y�E � �

Q�E� � h �������

giving the solution

un � c

�� h �x � h �y

�n� a

�x � �y

Like its counterpart in the ��D case� this method�

�� Is unconditionally stable�

�� Produces the exact �see Eq� ����� steady�state solution �of the ODE� for anyh�

�� Converges very rapidly to the steady�state when h is large�

Unfortunately� however� use of this method for ��D problems is generally impracticalfor reasons discussed in Section �����

Page 252: Fundamentals of Computational Fluid Dynamics

����� EXAMPLE ANALYSIS OF ��D MODEL EQUATIONS ���

������ The Factored Nondelta Form of the Implicit Euler

Method

Now apply the factored Euler method given by Eq� ���� to the ��D representativeequation� There results

��� h �x���� h �y�un� � un � ha

from which

P �E� � ��� h �x���� h �y�E � �

Q�E� � h ����� �

giving the solution

un � c

��� h �x���� h �y�

�n� a

�x � �y � h�x�y

We see that this method�

�� Is unconditionally stable�

�� Produces a steady state solution that depends on the choice of h�

�� Converges rapidly to a steady�state for large h� but the converged solution iscompletely wrong�

The method requires far less storage then the unfactored form� However� it is notvery useful since its transient solution is only �rst�order accurate and� if one tries totake advantage of its rapid convergence rate� the converged value is meaningless�

������ The Factored Delta Form of the Implicit Euler Method

Next apply Eq� ����� to the ��D representative equation� One �nds

��� h �x���� h �y��un� � un� � h��xun � �yun � a�

which reduces to

��� h �x���� h �y�un� ��� � h��x�y

�un � ha

and this has the solution

un � c

� � h��x�y

��� h �x���� h �y�

�n� a

�x � �y

This method�

Page 253: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� LINEAR ANALYSIS OF SPLIT AND FACTORED FORMS

�� Is unconditionally stable�

�� Produces the exact steady�state solution for any choice of h�

�� Converges very slowly to the steady�state solution for large values of h� sincej�j � � as h���

Like the factored nondelta form� this method demands far less storage than the un�factored form� as discussed in Section ����� The correct steady solution is obtained�but convergence is not nearly as rapid as that of the unfactored form�

������ The Factored Delta Form of the Trapezoidal Method

Finally consider the delta form of a second�order time�accurate method� Apply Eq����� to the representative equation and one �nds�

�� �

�h�x

���� �

�h�y

��un� � un� � h��xun � �yun � a�

which reduces to��� �

�h�x

���� �

�h�y

�un� �

�� �

�h�x

��� �

�h�y

�un � ha

and this has the solution

un � c

�����

� ��

�h�x

��� �

�h�y

��

�� �

�h�x

���� �

�h�y

����n

� a

�x � �y

This method�

�� Is unconditionally stable�

�� Produces the exact steady�state solution for any choice of h�

�� Converges very slowly to the steady�state solution for large values of h� sincej�j � � as h���

All of these properties are identical to those found for the factored delta form of theimplicit Euler method� Since it is second order in time� it can be used when timeaccuracy is desired� and the factored delta form of the implicit Euler method can beused when a converged steady�state is all that is required� A brief inspection of eqs������ and ����� should be enough to convince the reader that the ��s produced bythose methods are identical to the � produced by this method�

�In practical codes� the value of h on the left side of the implicit equation is literally switched

from h to ��h�

Page 254: Fundamentals of Computational Fluid Dynamics

����� EXAMPLE ANALYSIS OF THE ��D MODEL EQUATION ���

���� Example Analysis of the ��D Model Equation

The arguments in Section ���� generalize to three dimensions and� under the condi�tions given in ����� with an A�z�

z included� the model ��D cases� have the followingrepresentative equation �with � � ��

du

dt� ��x � �y � �z�u � a �������

Let us analyze a �nd�order accurate� factored� delta form using this equation� Firstapply the trapezoidal method�

un� � un ��

�h���x � �y � �z�un� � ��x � �y � �z�un � �a�

Rearrange terms���� �

�h��x � �y � �z�

�un� �

�� �

�h��x � �y � �z�

�un � ha

Put this in delta form���� �

�h��x � �y � �z�

��un � h���x � �y � �z�un � a�

Now factor the left side���� �

�h�x

���� �

�h�y

���� �

�h�z

��un � h���x � �y � �z�un � a� �������

This preserves second order accuracy since the error terms

�h���x�y � �x�z � �y�z��un and

h��x�y�z

are both O�h��� One can derive the characteristic polynomial for Eq� ������ �nd the� root� and write the solution either in the form

un � c

����� ��

�h��x � �y � �z� �

�h���x�y � �x�z � �y�z�� �

h��x�y�z

�� �

�h��x � �y � �z� �

�h���x�y � �x�z � �y�z�� �

h��x�y�z

���n

� a

�x � �y � �z�������

�Eqs� � ��� and � ���� each with an additional term�

Page 255: Fundamentals of Computational Fluid Dynamics

��� CHAPTER ��� LINEAR ANALYSIS OF SPLIT AND FACTORED FORMS

or in the form

un � c

�����

� ��

�h�x

��� �

�h�y

��� �

�h�z

�� �

�h��x�y�z�

�� �

�h�x

���� �

�h�y

���� �

�h�z

����n

� a

�x � �y � �z�������

It is interesting to notice that a Taylor series expansion of Eq� ����� results in

� � � � h��x � �y � �z� ��

�h���x � �y � �z�

� �������

��

�h�h��z � ���y � ��x� �

����y � ��x�y � ���y

�� ��y � ��x�

�y � ���x�y � ��x

i� � � �

which veri�es the second order accuracy of the factored form� Furthermore� clearly�if the method converges� it converges to the proper steady�state�

With regards to stability� it follows from Eq� ����� that� if all the ��s are real andnegative� the method is stable for all h� This makes the method unconditionally stablefor the ��D di�usion model when it is centrally dierenced in space�

Now consider what happens when we apply this method to the biconvection model�the ��D form of Eq� ����� with periodic boundary conditions� In this case� centraldierencing causes all of the ��s to be imaginary with spectrums that include bothpositive and negative values� Remember that in our analysis we must consider everypossible combination of these eigenvalues� First write the � root in Eq� ����� in theform

� �� � i�� � � i�

�� i�� � � i�

where �� � and � are real numbers that can have any sign� Now we can always �ndone combination of the ��s for which �� and � are both positive� In that case sincethe absolute value of the product is the product of the absolute values

j�j� ���� ��� � �� � ���

��� ��� � ��� ���� �

and the method is unconditionally unstable for the model convection problem�From the above analysis one would come to the conclusion that the method rep�

resented by Eq� ����� should not be used for the ��D Euler equations� In practicalcases� however� some form of dissipation is almost always added to methods that areused to solve the Euler equations and our experience to date is that� in the presenceof this dissipation� the instability disclosed above is too weak to cause trouble�

�However� we already knew this because we chose the delta form�

Page 256: Fundamentals of Computational Fluid Dynamics

����� PROBLEMS ���

���� Problems

�� Starting with the generic ODE�

du

dt� Au � f

we can split A as follows� A � A� �A� �A� �A�� Applying implicit Euler timemarching gives

un� � unh

� A�un� � A�un� � A�un� � A�un� � f

�a� Write the factored delta form� What is the error term�

�b� Instead of making all of the split terms implicit� leave two explicit�

un� � unh

� A�un� � A�un � A�un� � A�un � f

Write the resulting factored delta form and de�ne the error terms�

�c� The scalar representative equation is

du

dt� ��� � �� � �� � ���u � a

For the fully implicit scheme of problem �a� �nd the exact solution to theresulting scalar dierence equation and comment on the stability� conver�gence� and accuracy of the converged steady�state solution�

�d� Repeat �c for the explicit�implicit scheme of problem �b�

Page 257: Fundamentals of Computational Fluid Dynamics

�� CHAPTER ��� LINEAR ANALYSIS OF SPLIT AND FACTORED FORMS

Page 258: Fundamentals of Computational Fluid Dynamics

Appendix A

USEFUL RELATIONS AND

DEFINITIONS FROM LINEAR

ALGEBRA

A basic understanding of the fundamentals of linear algebra is crucial to our develop�ment of numerical methods and it is assumed that the reader is at least familar withthis subject area� Given below is some notation and some of the important relationsbetween matrices and vectors�

A�� Notation

�� In the present context a vector is a vertical column or string� Thus

�v �

�����v�v����vm

����and its transpose �v

Tis the horizontal row

�vT

� �v�� v�� v�� � � � � vm� � �v � �v�� v�� v�� � � � � vm�T

�� A general m�m matrix A can be written

A � �aij� �

�����a�� a�� � � � a�ma�� a�� � � � a�m

� � �

am� am� � � � amm

����

���

Page 259: Fundamentals of Computational Fluid Dynamics

�� APPENDIX A� USEFUL RELATIONS ANDDEFINITIONS FROM LINEAR ALGEBRA

�� An alternative notation for A is

A �h�a���a�� � � � ��am

iand its transpose AT is

AT �

��������aT

�aT

�����aT

m

�������� The inverse of a matrix �if it exists� is written A�� and has the property that

A��A � AA�� � I� where I is the identity matrix�

A�� De�nitions

�� A is symmetric if AT � A�

�� A is skew�symmetric or antisymmetric if AT � �A�

�� A is diagonally dominant if aii � Pj ��i jaijj � i � �� �� � � � � m and aii �

Pj ��i jaijj

for at least one i�

�� A is orthogonal if aij are real and ATA � AAT � I

�� %A is the complex conjugate of A�

�� P is a permutation matrix if P�v is a simple reordering of �v�

�� The trace of a matrix isP

i aii�

� A is normal if ATA � AAT �

�� det�A� is the determinant of A�

� � AH is the conjugate transpose of A� �Hermitian��

��� If

A ��a bc d

�then

det�A� � ad� bc

and

A�� ��

det�A�

�d �b�c a

Page 260: Fundamentals of Computational Fluid Dynamics

A��� ALGEBRA ���

A�� Algebra

We consider only square matrices of the same dimension�

�� A and B are equal if aij � bij for all i� j � �� �� � � � � m�

�� A � �B � C� � �C � A� � B� etc�

�� sA � �saij� where s is a scalar�

�� In general AB � BA�

�� Transpose equalities�

�A � B�T � AT � BT

�AT �T � A

�AB�T � BTAT

�� Inverse equalities �if the inverse exists��

�A����� � A

�AB��� � B��A��

�AT ��� � �A���T

�� Any matrix A can be expressed as the sum of a symmetric and a skew�symmetricmatrix� Thus�

A ��

�A � AT

��

�A� AT

A�� Eigensystems

�� The eigenvalue problem for a matrix A is de�ned as

A�x � ��x or �A� �I��x �

and the generalized eigenvalue problem� including the matrix B� as

A�x � �B�x or �A� �B��x �

�� If a square matrix with real elements is symmetric� its eigenvalues are all real�If it is asymmetric� they are all imaginary�

Page 261: Fundamentals of Computational Fluid Dynamics

���APPENDIX A� USEFUL RELATIONS ANDDEFINITIONS FROM LINEAR ALGEBRA

�� Gershgorin�s theorem� The eigenvalues of a matrix lie in the complex plane inthe union of circles having centers located by the diagonals with radii equal tothe sum of the absolute values of the corresponding o�diagonal row elements�

�� In general� an m �m matrix A has n�x linearly independent eigenvectors withn�x � m and n� distinct eigenvalues ��i� with n� � n�x � m�

�� A set of eigenvectors is said to be linearly independent if

a � �xm � b � �xn � �xk � m � n � k

for any complex a and b and for all combinations of vectors in the set�

�� If A posseses m linearly independent eigenvectors then A is diagonalizable� i�e��

X��AX � "

where X is a matrix whose columns are the eigenvectors�

X �h�x�� �x�� � � � � �xm

iand " is the diagonal matrix

" �

�������� � � �

��� � �

������

� � � � � � � � � �m

�����If A can be diagonalized� its eigenvectors completely span the space� and A issaid to have a complete eigensystem�

�� If A has m distinct eigenvalues� then A is always diagonalizable� and witheach distinct eigenvalue there is one associated eigenvector� and this eigenvectorcannot be formed from a linear combination of any of the other eigenvectors�

� In general� the eigenvalues of a matrix may not be distinct� in which case thepossibility exists that it cannot be diagonalized� If the eigenvalues of a matrixare not distinct� but all of the eigenvectors are linearly independent� the matrixis said to be derogatory� but it can still be diagonalized�

�� If a matrix does not have a complete set of linearly independent eigenvectors�it cannot be diagonalized� The eigenvectors of such a matrix cannot span thespace and the matrix is said to have a defective eigensystem�

Page 262: Fundamentals of Computational Fluid Dynamics

A��� EIGENSYSTEMS ���

� � Defective matrices cannot be diagonalized but they can still be put into a com�pact form by a similarity transform� S� such that

J � S��AS �

������J� � � �

J�� � �

������

� � � � � � � � � Jk

�����where there are k linearly independent eigenvectors and Ji is either a Jordansubblock or �i�

��� A Jordan submatrix has the form

Ji �

���������

�i � � � �

�i �� � �

���

�i� � �

���� � � � � � �

� � � �i

��������

��� Use of the transform S is known as putting A into its Jordan Canonical form�A repeated root in a Jordan block is referred to as a defective eigenvalue� Foreach Jordan submatrix with an eigenvalue �i of multiplicity r� there exists oneeigenvector� The other r�� vectors associated with this eigenvalue are referredto as principal vectors� The complete set of principal vectors and eigenvectorsare all linearly independent�

��� Note that if P is the permutation matrix

P �

��� � � �

�� � P T � P�� � P

then

P��

���� � � � �

��P �

���� � � � �

��

��� Some of the Jordan subblocks may have the same eigenvalue� For example� the

Page 263: Fundamentals of Computational Fluid Dynamics

���APPENDIX A� USEFUL RELATIONS ANDDEFINITIONS FROM LINEAR ALGEBRA

matrix ���������������

����� ��� �

��

���� �

�� ���

���� �

��

���

��������������is both defective and derogatory� having�

� eigenvalues

� distinct eigenvalues

� Jordan blocks

� linearly independent eigenvectors

� principal vectors with ��

� principal vector with ��

A�� Vector and Matrix Norms

�� The spectral radius of a matrix A is symbolized by ��A� such that

��A� � j�mjmax

where �m are the eigenvalues of the matrix A�

�� A p�norm of the vector �v is de�ned as

jjvjjp �

�� MXj��

jvjjp�A��p

�� A p�norm of a matrix A is de�ned as

jjAjjp � maxx���

jjAvjjpjjvjjp

Page 264: Fundamentals of Computational Fluid Dynamics

A��� VECTOR AND MATRIX NORMS ���

�� Let A and B be square matrices of the same order� All matrix norms must havethe properties

jjAjj � � jjAjj � implies A �

jjc � Ajj � jcj � jjAjjjjA � Bjj � jjAjj� jjBjjjjA �Bjj � jjAjj � jjBjj

�� Special p�norms are

jjAjj� � maxj�������MPM

i�� jaijj maximum column sum

jjAjj� �q��A

T � A�

jjAjj� � maxi���������MPM

j�� jaijj maximum row sum

where jjAjjp is referred to as the Lp norm of A�

�� In general ��A� does not satisfy the conditions in �� so in general ��A� is not atrue norm�

�� When A is normal� ��A� is a true norm� in fact� in this case it is the L� norm�

� The spectral radius of A� ��A�� is the lower bound of all the norms of A�

Page 265: Fundamentals of Computational Fluid Dynamics

���APPENDIX A� USEFUL RELATIONS ANDDEFINITIONS FROM LINEAR ALGEBRA

Page 266: Fundamentals of Computational Fluid Dynamics

Appendix B

SOME PROPERTIES OF

TRIDIAGONAL MATRICES

B�� Standard Eigensystem for Simple Tridiagonals

In this work tridiagonal banded matrices are prevalent� It is useful to list some oftheir properties� Many of these can be derived by solving the simple linear dierenceequations that arise in deriving recursion relations�

Let us consider a simple tridiagonal matrix� i�e�� a tridiagonal with constant scalarelements a�b� and c� see Section ���� If we examine the conditions under which thedeterminant of this matrix is zero� we �nd �by a recursion exercise�

det�B�M � a� b� c�� �

if

b � �pac cos

�m

M � �

�� � m � �� �� � � � �M

From this it follows at once that the eigenvalues of B�a� b� c� are

�m � b � �pac cos

�m

M � �

�� m � �� �� � � � �M �B���

The right�hand eigenvector of B�a� b� c� that is associated with the eigenvalue �msatis�es the equation

B�a� b� c��xm � �m�xm �B���

and is given by

�xm � �xj�m ��a

c

�j � �� sin

�j�

m

M � �

��� m � �� �� � � � �M �B���

���

Page 267: Fundamentals of Computational Fluid Dynamics

�� APPENDIX B� SOME PROPERTIES OF TRIDIAGONAL MATRICES

These vectors are the columns of the right�hand eigenvector matrix� the elements ofwhich are

X � �xjm� ��a

c

�j � �� sin

�jm

M � �

��

j � �� �� � � � �Mm � �� �� � � � �M �B���

Notice that if a � �� and c � ��

�a

c

�j � �� � e

i�j��� � �B���

The left�hand eigenvector matrix of B�a� b� c� can be written

X�� ��

M � �

�c

a

�m� �� sin

�mj

M � �

��

m � �� �� � � � �Mj � �� �� � � � �M

In this case notice that if a � �� and c � �

�c

a

�m� �� � e

�i�m��� � �B���

B�� Generalized Eigensystem for Simple Tridiag�

onals

This system is de�ned as follows��������b ca b c

a b� � � ca b

�������

��������x�x�x����xM

������� � �

��������e fd e f

d e� � � fd e

�������

��������x�x�x����xM

�������In this case one can show after some algebra that

det�B�a� �d� b� �e� c� �f � � �B���

if

b� �me � �q

�a� �md��c� �mf� cos�

m

M � �

�� � m � �� �� � � � �M �B��

If we de�ne�m �

m

M � �� pm � cos �m

Page 268: Fundamentals of Computational Fluid Dynamics

B��� THE INVERSE OF A SIMPLE TRIDIAGONAL ���

�m �eb� ��cd � af�p�m � �pm

q�ec� fb��ea� bd� � ��cd� af�pm��

e� � �fdp�m

The right�hand eigenvectors are

�xm �

a� �md

c� �mf

�j � ��

sin �j�m� �m � �� �� � � � �Mj � �� �� � � � �M

These relations are useful in studying relaxation methods�

B�� The Inverse of a Simple Tridiagonal

The inverse of B�a� b� c� can also be written in analytic form� Let DM represent thedeterminant of B�M � a� b� c�

DM � det�B�M � a� b� c��

De�ning D� to be �� it is simple to derive the �rst few determinants� thus

D� � �

D� � b

D� � b� � ac

D� � b� � �abc �B���

One can also �nd the recursion relation

DM � bDM�� � acDM�� �B�� �

Eq� B�� is a linear O�E the solution of which was discussed in Section ���� Itscharacteristic polynomial P �E� is P �E� � bE � ac� and the two roots to P ��� � result in the solution

DM ��p

b� � �ac

���b �

pb� � �ac

�M�

�b�

pb� � �ac

�M����

M � � �� �� � � � �B����

where we have made use of the initial conditions D� � � and D� � b� In the limitingcase when b� � �ac � � one can show that

DM � �M � ��

�b

�M

b� � �ac

Page 269: Fundamentals of Computational Fluid Dynamics

�� APPENDIX B� SOME PROPERTIES OF TRIDIAGONAL MATRICES

Then for M � �

B�� ��

D�

�����D� �cD� c�D� �c�D�

�aD� D�D� �cD�D� c�D�

a�D� �aD�D� D�D� �cD�

�a�D� a�D� �aD� D�

����and for M � �

B�� ��

D

�������D� �cD� c�D� �c�D� c�D�

�aD� D�D� �cD�D� c�D�D� �c�D�

a�D� �aD�D� D�D� �cD�D� c�D�

�a�D� a�D�D� �aD�D� D�D� �cD�

a�D� �a�D� a�D� �aD� D�

������The general element dmn is

Upper triangle�

m � �� �� � � � �M � � n � m � �� m � �� � � � �M

dmn � Dm��DM�n��c�n�m�DM

Diagonal�n � m � �� �� � � � �M

dmm � DM��DM�m�DM

Lower triangle�

m � n � �� n � �� � � � �M n � �� �� � � � �M � �

dmn � DM�mDn����a�m�n�DM

B�� Eigensystems of Circulant Matrices

B���� Standard Tridiagonals

Consider the circulant �see Section ������ tridiagonal matrix

Bp�M � a� b� c� � �B����

Page 270: Fundamentals of Computational Fluid Dynamics

B��� EIGENSYSTEMS OF CIRCULANT MATRICES ���

The eigenvalues are

�m � b � �a � c� cos�

� m

M

�� i�a� c� sin

�� m

M

�� m � � �� �� � � � �M � �

�B����

The right�hand eigenvector that satis�es Bp�a� b� c��xm � �m�xm is

�xm � �xj�m � ei j ���m�M� � j � � �� � � � �M � � �B����

where i � p��� and the right�hand eigenvector matrix has the form

X � �xjm� � eij

�� mM

��

j � � �� � � � �M � �m � � �� � � � �M � �

The left�hand eigenvector matrix with elements x� is

X�� � �x�mj� ��

Me�im

�� jM

��

m � � �� � � � �M � �j � � �� � � � �M � �

Note that both X and X�� are symmetric and that X�� � �MX�� where X� is the

conjugate transpose of X�

B���� General Circulant Systems

Notice the remarkable fact that the elements of the eigenvector matrices X and X��

for the tridiagonal circulant matrix given by eq� B��� do not depend on the elementsa� b� c in the matrix� In fact� all circulant matrices of order M have the same set oflinearly independent eigenvectors� even if they are completely dense� An example ofa dense circulant matrix of order M � � is�����

b� b� b� b�b� b� b� b�b� b� b� b�b� b� b� b�

���� �B����

The eigenvectors are always given by eq� B���� and further examination shows thatthe elements in these eigenvectors correspond to the elements in a complex harmonicanalysis or complex discrete Fourier series�

Although the eigenvectors of a circulant matrix are independent of its elements�the eigenvalues are not� For the element indexing shown in eq� B��� they have thegeneral form

�m �M��Xj��

bjei���jm�M�

of which eq� B��� is a special case�

Page 271: Fundamentals of Computational Fluid Dynamics

��� APPENDIX B� SOME PROPERTIES OF TRIDIAGONAL MATRICES

B�� Special Cases Found From Symmetries

Consider a mesh with an even number of interior points such as that shown in Fig�B��� One can seek from the tridiagonal matrix B��M � a� b� a� � the eigenvector subsetthat has even symmetry when spanning the interval � x � � For example� we seekthe set of eigenvectors �xm for which

����������

b aa b a

a� � �

� � � aa b a

a b

���������

�����������

x�x�������x�x�

����������� �m

�����������

x�x�������x�x�

����������

This leads to the subsystem of order M which has the form

B�M � a��b� a��xm �

������������

b aa b a

a� � �

� � � aa b a

a b � a

������������xm � �m�xm �B����

By folding the known eigenvectors of B��M � a� b� a� about the center� one can showfrom previous results that the eigenvalues of eq� B��� are

�m � b � �a cos

���m� ��

�M � �

�� m � �� �� � � � �M �B����

Page 272: Fundamentals of Computational Fluid Dynamics

B��� SPECIAL CASES INVOLVING BOUNDARY CONDITIONS ���

and the corresponding eigenvectors are

�xm � sin�j��m� ��

�M � �

��

j � �� �� � � � �M

Imposing symmetry about the same intervalbut for a mesh with an odd number of points�see Fig� B��� leads to the matrix

B�M � �a� b� a� �

����������

b aa b a

a� � �

� � � aa b a

�a b

���������

By folding the known eigenvalues of B��M �� � a� b� a� about the center� one can showfrom previous results that the eigenvalues ofeq� B��� are

Line of Symmetry

x � x � � � � � � �

j � � � � � � � �M �

j � � � �M

a� An even�numbered mesh

Line of Symmetry

x � x � � � � � �

j � � � � � � �M �

j � � � �M

b� An odd�numbered mesh

Figure B�� � Symmetrical folds forspecial cases

�m � b � �a cos

���m� ��

�M

�� m � �� �� � � � �M

and the corresponding eigenvectors are

�xm � sin

�j��m� ��

�M

�� j � �� �� � � � �M

B�� Special Cases Involving Boundary Conditions

We consider two special cases for the matrix operator representing the ��point centraldierence approximation for the second derivative ����x� at all points away from theboundaries� combined with special conditions imposed at the boundaries�

Page 273: Fundamentals of Computational Fluid Dynamics

��� APPENDIX B� SOME PROPERTIES OF TRIDIAGONAL MATRICES

Note� In both cases

m � �� �� � � � �Mj � �� �� � � � �M

�� � � cos��� � �� sin������

When the boundary conditions are Dirichlet on both sides�

���������� �

� �� �� �� �

� �� �� ��

��������m � �� � � cos

�m

M � �

��xm � sin

hj�

m M � �

�i �B���

When one boundary condition is Dirichlet and the other is Neumann �and a diagonalpreconditioner is applied to scale the last equation��

���������� �

� �� �� �� �

� �� �� ��

��������m � �� � � cos

���m� ��

�M � �

��xm � sin

�j�

��m� �� �M � �

�� �B����

Page 274: Fundamentals of Computational Fluid Dynamics

Appendix C

THE HOMOGENEOUS

PROPERTY OF THE EULER

EQUATIONS

The Euler equations have a special property that is sometimes useful in constructingnumerical methods� In order to examine this property� let us �rst inspect Euler�stheorem on homogeneous functions� Consider �rst the scalar case� If F �u� v� satis�esthe identity

F ��u� �v� � �nF �u� v� �C���

for a �xed n� F is called homogeneous of degree n� Dierentiating both sides withrespect to � and setting � � � �since the identity holds for all ��� we �nd

u�F

�u� v

�F

�v� nF �u� v� �C���

Consider next the theorem as it applies to systems of equations� If the vectorF �Q� satis�es the identity

F ��Q� � �nF �Q� �C���

for a �xed n� F is said to be homogeneous of degree n and we �nd

�F

�q

�Q � nF �Q� �C���

���

Page 275: Fundamentals of Computational Fluid Dynamics

���APPENDIX C� THE HOMOGENEOUS PROPERTY OF THE EULER EQUATIONS

Now it is easy to show� by direct use of eq� C��� that both E and F in eqs� ���� and���� are homogeneous of degree �� and their Jacobians� A and B� are homogeneousof degree �actually the latter is a direct consequence of the former��� This beingthe case� we notice that the expansion of the �ux vector in the vicinity of tn which�according to eq� ��� � can be written in general as�

E � En � An�Q�Qn� � O�h��

F � Fn � Bn�Q�Qn� � O�h�� �C���

can be written

E � AnQ � O�h��

F � BnQ � O�h�� �C���

since the terms En � AnQn and Fn � BnQn are identically zero for homogeneousvectors of degree �� see eq� C��� Notice also that� under this condition� the constantterm drops out of eq� ��� ��

As a �nal remark� we notice from the chain rule that for any vectors F and Q

�F �Q�

�x�

�F

�Q

��Q

�x� A

�Q

�x�C���

We notice also that for a homogeneous F of degree �� F � AQ and

�F

�x� A

�Q

�x�

�A

�x

�Q �C��

Therefore� if F is homogeneous of degree ��

�A

�x

�Q � �C���

in spite of the fact that individually ��A��x� and Q are not equal to zero�

�Note that this depends on the form of the equation of state� The Euler equations are homogeneous if the equation of state can be written in the form p � f��� where is the internal energyper unit mass�

Page 276: Fundamentals of Computational Fluid Dynamics

Bibliography

��� D� Anderson� J� Tannehill� and R� Pletcher� Computational Fluid Mechanics andHeat Transfer� McGraw�Hill Book Company� New York� ����

��� C� Hirsch� Numerical Computation of Internal and External Flows� volume ����John Wiley * Sons� New York� ���

���