P. 1
Numerical Methods in Heat, Mass and Momentum Transfer - Y. M-Otimo

Numerical Methods in Heat, Mass and Momentum Transfer - Y. M-Otimo

|Views: 41|Likes:
Published by fabioalfaia8085

More info:

Published by: fabioalfaia8085 on Nov 05, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/05/2011

pdf

text

original

Sections

  • Mathematical Modeling
  • 1.1 Conservation Equations
  • 1.1.1 Discussion
  • 1.1.2 Conservation Form
  • 1.2 Governing Equations
  • 1.2.1 The Energy Equation
  • 1.2.2 The Momentum Equation
  • 1.2.3 The Species Equation
  • 1.3 The General Scalar Transport Equation
  • 1.4 Mathematical Classification of Partial Differential Equations
  • 1.4.1 Elliptic Partial Differential Equations
  • 1.4.2 Parabolic Partial Differential Equations
  • 1.4.3 Hyperbolic Partial Differential Equations
  • 1.4.4 Behavior of the Scalar Transport Equation
  • 1.5 Closure
  • Numerical Methods
  • 2.1 Overview
  • 2.2 Mesh Terminology and Types
  • 2.2.1 Regular and Body-fitted Meshes
  • 2.2.2 Structured, Block Structured, and Unstructured Meshes
  • 2.2.3 Conformal and Non-Conformal Meshes
  • 2.2.4 Cell Shapes
  • 2.2.5 Node-Based and Cell-Based Schemes
  • 2.3 Discretization Methods
  • 2.3.1 Finite Difference Methods
  • 2.3.2 Finite Element Methods
  • 2.3.3 Finite Volume Method
  • 2.4 Solution of Discretization Equations
  • 2.4.1 Direct Methods
  • 2.4.2 Iterative Methods
  • 2.5 Accuracy, Consistency, Stability and Convergence
  • 2.5.1 Accuracy
  • 2.5.2 Consistency
  • 2.5.3 Stability
  • 2.5.4 Convergence
  • 2.6 Closure
  • The Diffusion Equation: A First Look
  • 3.1 Two-Dimensional Diffusion in Rectangular Domain
  • 3.1.1 Discretization
  • 3.1.2 Discussion
  • 3.2 Boundary Conditions
  • 3.2.1 Dirichlet Boundary Condition
  • 3.2.2 Neumann Boundary Condition
  • 3.2.3 Mixed Boundary Condition
  • 3.3 Unsteady Conduction
  • 3.3.1 The Explicit Scheme
  • 3.3.2 The Fully-Implicit Scheme
  • 3.3.3 The Crank-Nicholson Scheme
  • 3.4 Diffusion in Polar Geometries
  • 3.5 Diffusion in Axisymmetric Geometries
  • 3.6 Finishing Touches
  • 3.6.1 Interpolation of Γ
  • 3.6.2 Source Linearization and Treatment of Non-Linearity
  • 3.6.3 Under-Relaxation
  • 3.7 Discussion
  • 3.8 Truncation Error
  • 3.8.1 Spatial Truncation Error
  • 3.8.2 Temporal Truncation Error
  • 3.9 Stability Analysis
  • 3.10 Closure
  • The Diffusion Equation: A Closer Look
  • 4.1 Diffusion on Orthogonal Meshes
  • 4.2 Non-Orthogonal Meshes
  • 4.2.1 Discussion
  • 4.2.2 Secondary Gradient Calculation
  • 4.2.3 Discrete Equation for Non-Orthogonal Meshes
  • 4.3 Boundary Conditions
  • 4.4 Gradient Calculation
  • 4.4.1 Structured Meshes
  • 4.4.2 Unstructured Meshes
  • 4.5 Influence of Secondary Gradients on Coefficients
  • 4.6 Implementation Issues
  • 4.6.1 Data Structures
  • 4.6.2 Overall Solution Loop
  • 4.7 Closure
  • Convection
  • 5.1.1 Central Differencing
  • 5.1.2 Upwind Differencing
  • 5.2 Convection-Diffusion on Non-Orthogonal Meshes
  • 5.2.1 Central Difference Approximation
  • 5.2.2 Upwind Differencing Approximation
  • 5.3.1 An Illustrative Example
  • 5.3.2 False Diffusion and Dispersion
  • 5.4 First-Order Schemes Using Exact Solutions
  • 5.4.1 Exponential Scheme
  • 5.4.2 Hybrid Scheme
  • 5.4.3 Power Law Scheme
  • 5.5 Unsteady Convection
  • 5.5.1 1D Finite Volume Discretization
  • 5.5.2 Central Difference Scheme
  • 5.5.3 First Order Upwind Scheme
  • 5.5.4 Error Analysis
  • 5.5.5 Lax-Wendroff Scheme
  • 5.6 Higher-Order Schemes
  • 5.6.1 Second-Order Upwind Schemes
  • 5.6.2 Third-Order Upwind Schemes
  • 5.6.3 Implementation Issues
  • 5.7 Higher-Order Schemes for Unstructured Meshes
  • 5.8 Discussion
  • 5.9 Boundary Conditions
  • 5.9.1 Inflow Boundaries
  • 5.9.2 Outflow Boundaries
  • 5.9.3 Geometric Boundaries
  • 5.10 Closure
  • Fluid Flow: A First Look
  • 6.1 Discretization of the Momentum Equation
  • 6.2 Discretization of the Continuity Equation
  • 6.3 The Staggered Grid
  • 6.4 Discussion
  • 6.5 Solution Methods
  • 6.6 The SIMPLE Algorithm
  • 6.6.1 The Pressure Correction Equation
  • 6.6.2 Overall Algorithm
  • 6.6.3 Discussion
  • 6.6.4 Boundary Conditions
  • 6.6.5 Pressure Level and Incompressibility
  • 6.7 The SIMPLER Algorithm
  • 6.7.1 Overall Algorithm
  • 6.7.2 Discussion
  • 6.8 The SIMPLEC Algorithm
  • 6.9 Optimal Underrelaxation for SIMPLE
  • 6.10 Discussion
  • 6.11 Non-Orthogonal Structured Meshes
  • 6.12 Unstructured Meshes
  • 6.13 Closure
  • Fluid Flow: A Closer Look
  • 7.1 Velocity and Pressure Checkerboarding
  • 7.1.1 Discretization of Momentum Equation
  • 7.1.2 Discretization of Continuity Equation
  • 7.1.3 Pressure Checkerboarding
  • 7.1.4 Velocity Checkerboarding
  • 7.2 Co-Located Formulation
  • 7.3 The Concept of Added Dissipation
  • 7.4 Accuracy of Added Dissipation Scheme
  • 7.5 Discussion
  • 7.6 Two-DimensionalCo-LocatedVariable Formulation
  • 7.6.1 Discretization of Momentum Equations
  • 7.6.2 Momentum Interpolation
  • 7.7 SIMPLE Algorithm for Co-Located Variables
  • 7.7.1 Velocity and Pressure Corrections
  • 7.7.2 Pressure Correction Equation
  • 7.7.3 Overall Solution Procedure
  • 7.7.4 Discussion
  • 7.8 Underrelaxation and Time-Step Dependence
  • 7.9 Co-Located Formulation for Non-Orthogonal and Unstructured Meshes
  • 7.9.1 Face Normal Momentum Equation
  • 7.9.2 Momentum Interpolation for Face Velocity
  • 7.10 The SIMPLE Algorithm for Non-Orthogonal and Unstructured Meshes
  • 7.10.1 Discussion
  • 7.11 Closure
  • Linear Solvers
  • 8.1 Direct vs Iterative Methods
  • 8.2 Storage Strategies
  • 8.3 Tri-Diagonal Matrix Algorithm
  • 8.4 Line by line TDMA
  • 8.5 Jacobi and Gauss Seidel Methods
  • 8.6 General Iterative Methods
  • 8.7 Convergence of Jacobi and Gauss Seidel Methods
  • 8.8 Analysis Of Iterative Methods
  • 8.9 Multigrid Methods
  • 8.9.1 Coarse Grid Correction
  • 8.9.2 Geometric Multigrid

Draft Notes ME 608

Numerical Methods in Heat, Mass, and Momentum Transfer

Instructor: Jayathi Y. Murthy School of Mechanical Engineering Purdue University

Spring 2002

 

c 1998 J.Y. Murthy and S.R. Mathur. All Rights Reserved

2

Contents
1 Mathematical Modeling 1.1 Conservation Equations . . . . . . . . . . . . . . . . . . . . 1.1.1 Discussion . . . . . . . . . . . . . . . . . . . . . . 1.1.2 Conservation Form . . . . . . . . . . . . . . . . . . 1.2 Governing Equations . . . . . . . . . . . . . . . . . . . . . 1.2.1 The Energy Equation . . . . . . . . . . . . . . . . . 1.2.2 The Momentum Equation . . . . . . . . . . . . . . 1.2.3 The Species Equation . . . . . . . . . . . . . . . . . 1.3 The General Scalar Transport Equation . . . . . . . . . . . . 1.4 Mathematical Classification of Partial Differential Equations 1.4.1 Elliptic Partial Differential Equations . . . . . . . . 1.4.2 Parabolic Partial Differential Equations . . . . . . . 1.4.3 Hyperbolic Partial Differential Equations . . . . . . 1.4.4 Behavior of the Scalar Transport Equation . . . . . . 1.5 Closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 9 11 12 12 12 13 13 13 14 14 16 17 17 19 21 21 23 23 23 25 25 28 29 29 30 31 33 33 34 35 35 35

2 Numerical Methods 2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Mesh Terminology and Types . . . . . . . . . . . . . . . . . . 2.2.1 Regular and Body-fitted Meshes . . . . . . . . . . . . 2.2.2 Structured, Block Structured, and Unstructured Meshes 2.2.3 Conformal and Non-Conformal Meshes . . . . . . . . 2.2.4 Cell Shapes . . . . . . . . . . . . . . . . . . . . . . . 2.2.5 Node-Based and Cell-Based Schemes . . . . . . . . . 2.3 Discretization Methods . . . . . . . . . . . . . . . . . . . . . 2.3.1 Finite Difference Methods . . . . . . . . . . . . . . . 2.3.2 Finite Element Methods . . . . . . . . . . . . . . . . 2.3.3 Finite Volume Method . . . . . . . . . . . . . . . . . 2.4 Solution of Discretization Equations . . . . . . . . . . . . . . 2.4.1 Direct Methods . . . . . . . . . . . . . . . . . . . . . 2.4.2 Iterative Methods . . . . . . . . . . . . . . . . . . . . 2.5 Accuracy, Consistency, Stability and Convergence . . . . . . . 2.5.1 Accuracy . . . . . . . . . . . . . . . . . . . . . . . . 2.5.2 Consistency . . . . . . . . . . . . . . . . . . . . . . . 3

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . .5 Influence of Secondary Gradients on Coefficients .1. . . . 3. . .6. . . . . . . . . . . . . .3 Boundary Conditions . . . . . .6.2 Discussion . . . . . .2 The Fully-Implicit Scheme . . . .2 Unstructured Meshes . .4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Neumann Boundary Condition . . . . . . . . . . . .3. .2 Temporal Truncation Error . . . .2. . . . . . . . . . . . . 3. .2. . . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . . . . . .1 Diffusion on Orthogonal Meshes . . .3. . . . . . . . . 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 The Crank-Nicholson Scheme . . . . . . .6 Implementation Issues . . . . 3. . . . .1 Interpolation of Γ . . . . . . . . . . . . . . . . . . . . . . . . 4. . 4 The Diffusion Equation: A Closer Look 4. .8 Truncation Error . . . . . . . . . . . . . . . . .2 Boundary Conditions . . . . . . .2 Overall Solution Loop . . . . . 3. . . . . . . . . .2. . . 36 36 36 37 37 39 40 41 42 43 44 45 47 48 50 50 53 55 55 57 57 59 59 59 61 62 65 67 67 71 74 74 75 76 79 79 81 86 87 87 88 89 3 The Diffusion Equation: A First Look 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . . .2. . . . .1 The Explicit Scheme . . . . . . . . . . . . . . . . . . . . . .4 Gradient Calculation . . . . . . . . . . . . .4. . . . . 3. .2. . . . . . . . . . . .2. . 4. . .1 Two-Dimensional Diffusion in Rectangular Domain . . . . . 3. . . . . . .8. . . . . . .1 Dirichlet Boundary Condition .2 Source Linearization and Treatment of Non-Linearity 3. . . . . .1 Data Structures . . . . . 4. . . . . . . . . . . . . . . . . . . . . .5. .1. . . . . . . 4. . . . . . . . . . . . .7 Closure . . . . . . . .4 Diffusion in Polar Geometries . . . . . . . . . . . . . . . . . . . . . . 3. . . . . .6 Finishing Touches . . . . . . . . . 3. . . . . . . . . . . . . .1 Discretization . . . . .5 Diffusion in Axisymmetric Geometries . . .9 Stability Analysis . . . .2 Secondary Gradient Calculation . . . . . . . . . . 3. . . . . . . .10 Closure . . . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . . . . 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2. . . . . . . . 4. . . .1 Structured Meshes . . . . . . . . . 3. . . . . . . .3 Mixed Boundary Condition . . . . Closure . . 3. . . . . 4. . . . . . . . . 4. . . . . . . . . . . . . .1 Spatial Truncation Error . . . .8. . . 3. . . .7 Discussion . . . . . . . . . . . 4. . . . . 3. . . . . . . . . 4 . . . . .5. 3. .6. . . . . . . .6. . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. . . . . . . . . . . . 3. . . . . . . . . . . . . . . . . .3 Discrete Equation for Non-Orthogonal Meshes 4. . . . . . . . . . . . . . . . . . . . . .3 Stability . . . . . . . . . 4. . . . . . . . . . . 4. . .3 Unsteady Conduction . . . . . . . . . . . . . . . . . . . . . . .3 Under-Relaxation . . . .6 2. . . . . . . . . . . . .4 Convergence . . . . . . . .2 Non-Orthogonal Meshes . . . .1 Discussion . . . . . . . 3. . . . . . . . . . .

1 Inflow Boundaries . . . . . . . . . . . 5.6. . . . . . . . . . . . . . . 5. .1 Second-Order Upwind Schemes .6 Higher-Order Schemes . . .2 Third-Order Upwind Schemes . . . . . . . . . . . . . .1. . . . . . .4. . . 6. . . . . .1. . . . . . . 6 Fluid Flow: A First Look 6. . . . . . . . . . . . . . . . . .2 Discretization of the Continuity Equation . . . . . . . . . .2 Overall Algorithm .5. . . . . .3 Power Law Scheme . 5. . . . . .9. . . . .6. . . . .4 Boundary Conditions . . . . 5 91 91 93 95 96 97 97 98 98 99 102 102 104 105 105 107 107 108 109 110 112 112 113 114 114 115 116 116 117 118 119 121 121 123 125 126 127 129 131 132 132 133 134 135 136 . .6. . . . . . . .1 Overall Algorithm . . 5. . . . . . . .9 Boundary Conditions . . . . .8 Discussion . .3 Discussion . 5. . . .5 Pressure Level and Incompressibility 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 Higher-Order Schemes for Unstructured Meshes . . .2 Hybrid Scheme . . . .2 Central Difference Scheme . . . 5. .5 Lax-Wendroff Scheme . .1 Two-Dimensional Convection and Diffusion in A Rectangular Domain 5. . . . . . . . . . . . 5. . .10 Closure . . . . . . . . . . . . . . . . . . 6. 5. . . . . . . . . . .1 Exponential Scheme .5. . . . . . . . . . . . . . . . . . . . . . .6. . . . . . .4 Error Analysis . . . . .1 1D Finite Volume Discretization . . . . . . .4. . . . . . .6. . . . . . . . . . .5 Solution Methods .1 An Illustrative Example . . . . . . . . . . . .4 First-Order Schemes Using Exact Solutions . . . .6. . . . . . . . . . . 5. . . . . . . . . . . .5. . . . . . .2 Upwind Differencing Approximation .5. . . 6. . . . . . . . . . . . . . 6. . . . . .5. . . . . . . . . . . . . . . . . . . . . .1 The Pressure Correction Equation . . . . . . .2 Upwind Differencing . . . .3 First Order Upwind Scheme . . . . . . . . . .1 Discretization of the Momentum Equation . . . . . . . . . . . . . . . . . . . .3. . 5. . . 5. . . . . . . . . . . . .7 The SIMPLER Algorithm . . .1 Central Difference Approximation . . . . . . . . . . 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5. . . . . . . . 5. .3 The Staggered Grid . . 6. . . . . . . . . . . .3 Geometric Boundaries . . . . . . . . . . . .6. . . . . . 6. . 5. . . .4 Discussion . . 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7. 6. . . . . .2. . .3 Accuracy of Upwind and Central Difference Schemes . . . . . . . 6. . . . . . . . . . 5. .6. . . . . . . . . . . 5. . . . . . . . . . . . . . . . . . . . 5. . . . . . . . . . . . 5. . . . . . . 5. . .9. . . . . . .6 The SIMPLE Algorithm . . . . . . . . . . .2 Outflow Boundaries . . . 6. . . . . . . . . . . . . .1 Central Differencing . 5. . . . . . . . . . 6. . . . . 5.9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5. . . . . . . . . . . . . . .5 Convection 5. . . . . . . . . . . .2 Convection-Diffusion on Non-Orthogonal Meshes . 5. . . . . . .3 Implementation Issues . . . . . . . . . . 5. . . . . . . . . . . 5. . . . . . 5.5 Unsteady Convection . . . . . . . . . . . . . . . 5. . .3. . . . . . . . . . . . . . . . . . . .2 False Diffusion and Dispersion . . . . . . . . . . .2. .4. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Pressure Checkerboarding . . The SIMPLEC Algorithm . . .9. . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Storage Strategies . . . . . 7. 7. .7.8 Analysis Of Iterative Methods . .10 6. . . . . .7 Convergence of Jacobi and Gauss Seidel Methods 8. . . . . . . . . . . . . . . . . . . . . . 8. . . . . . . . . . . . . . . .8 Underrelaxation and Time-Step Dependence . . . . . . . . . . . . . . . . . . . .2 Discretization of Continuity Equation . . . . . . . . . . . . . . . . .2 Pressure Correction Equation . . . . .12 6. . . . .7. . . . . .9. . . 7. . . . . . . . . . . . . . . . . . . . . . . . . . . .7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. .10. Unstructured Meshes . 6 . . . .1 Velocity and Pressure Corrections . . . . . . . . . . . . . . . . . .4 Accuracy of Added Dissipation Scheme . 7. . . . . . . . . . . .1. . . . . . . . . . . Non-Orthogonal Structured Meshes .6 General Iterative Methods . . . . .9 Co-Located Formulation for Non-Orthogonal and Unstructured Meshes 7. . . . .10 The SIMPLE Algorithm for Non-Orthogonal and Unstructured Meshes 7. . . . . . . . . . . . . . . . . 8.1 Direct vs Iterative Methods . . . .1 Velocity and Pressure Checkerboarding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 6. . . . . . . . 7. . . Closure . . . . . . . .2 Momentum Interpolation . . . .3 Tri-Diagonal Matrix Algorithm . . . . . . .7 SIMPLE Algorithm for Co-Located Variables . . . . . . . . . . . . . . . . . . . .11 Closure . 8. . . . . . . . . . .7. . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . . . 7. . . . . . . . . 8 Linear Solvers 8. . . . .6. . . . . . . . . . . . .4 Velocity Checkerboarding . . . . . . . .2 Discussion . 8. . . . . . 7. . . . . . .1 Discussion . 7. 7. . . . . . . . . . . . .2 Co-Located Formulation . . . . . . . . . . . .13 6. .5 Discussion . . . . . . . . . . . . . . . .6. . . . . . . 7. . 137 137 138 139 140 142 142 145 145 146 147 147 148 148 150 151 152 153 153 153 154 155 156 157 157 158 159 161 162 163 164 165 167 168 168 170 171 173 173 175 178 180 181 181 7 Fluid Flow: A Closer Look 7. . . . . . . . . . . . . . . 8. . . . 7. 7. . . .1 Face Normal Momentum Equation . . . . Optimal Underrelaxation for SIMPLE Discussion . . .9. . . .9. 8. . . . . . . . . . . . . . . . . . . . . . .1 Discretization of Momentum Equations . . . . . . . . . . .1 Discretization of Momentum Equation . . . . . .3 Overall Solution Procedure . . . . . . 8. . .5 Jacobi and Gauss Seidel Methods . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . . .2 Momentum Interpolation for Face Velocity . . . . . . . .1. . . . 7. 7. . . . . . 7. . . . . . . . . . . .2 Geometric Multigrid . . .4 Line by line TDMA . . .1 Coarse Grid Correction . . . . 8. . . .1. . . . .9 Multigrid Methods . . . . . . .9 6. . . . . . . .8 6. . . . 7. . . . . . .6 Two-Dimensional Co-Located Variable Formulation . .3 The Concept of Added Dissipation . . . . . .7.4 Discussion . . . . . . . . 8. . 7.6. . . . . .

. . . 8. . . . . . . . . . .9. . . . . . . . . . . . . .9. . . . . . . . . . . . . . 185 186 189 192 7 . . . . . . . . . . .3 Algebraic Multigrid . . .9. . . . . . . . . . .4 Agglomeration Strategies .10 Closure . . . . . . . . . 8. . . . . . .8.5 Cycling Strategies and Implementation Issues 8. . . . . . .

8 .

which may be momentum per unit mass. We want to express the variation of φ in the control volume over time. the momentum equations express the conservation of linear momentum. the energy equation expresses the conservation of total energy. heat transfer..1 Conservation Equations Typical governing equations describing the conservation of mass. it is necessary to describe the associated physics in mathematical terms.i. momentum. For example. The equation for conservation of chemical species expresses the conservation of the mass of the species in terms of its mass fraction Let us consider a specific quantity φ .e..1. Nearly all the physical phenomena of interest to us in this book are governed by principles of conservation and are expressed in terms of partial differential equations expressing these principles.1) 9 £ ¢ Accumulation of φ in the control volume over time ∆t ¡ ¡ Net influx of φ into control volume Net generation of φ . the momentum equation expresses the principle of conservation of linear momentum in terms of the momentum per unit mass. Consider a control volume of size ∆x ∆y ∆z shown in Figure 1. For example.e. and other related physical phenomena. velocity.Chapter 1 Mathematical Modeling In order to simulate fluid flow. or any other such quantity. In this chapter we derive a typical conservation equation and examine its mathematical properties. or chemical species are written in terms of specific quantities . energy. quantities expressed on a per unit mass basis. Let us assume that φ is governed by a conservation principle that states inside control volume (1. i. or the energy per unit mass. 1.

and convection due to the motion of fluid. Let Jx represent the flux of φ coming into the control volume through face x. Let us consider the remaining term.1: Control Volume The accumulation of φ in the control volume over time ∆t is given by t ∆t S∆ ∆t (1.4) (1. The net influx of φ into the control volume over time ∆t is We have not yet said what physical mechanisms cause the influx of φ . In many cases.5) (1. The net generation of φ inside the control volume over time ∆t is given by  £ ¦ ¥ © ¨ §¥ ¦ ¥ ρφ ∆ ¤ ¥ ¤ £  ρφ ∆ t (1.∆y Jx Jx+ ∆x ∆z ∆x Figure 1. ρ is the density of the fluid. the diffusion flux may be written as The convective flux may be written as 10 ¢  Jconvection x © ¢  Jdiffusion x Γ ∂φ ∂x ρ uφ  ¨ ©  ¨ © ∆x  ¨ © £  Jx Jx ∆y∆z∆t Jy Jy ∆y ∆x∆z∆t Jz Jz ∆z ∆x∆y∆t (1. and J x ∆x the flux leaving the face x ∆x. Similar fluxes exist on the y and z faces respectively. φ is transported by two primary mechanisms: diffusion due to molecular collision. the net influx of φ into the control volume. S is also sometimes called the source term. For physical phenomena of interest to us.3) where S is the generation of φ per unit volume. ∆ is the volume of the control volume (∆x ∆z) and t is time.6) ¡ ¨ ¡ Here.2) ∆y .

7) x ∆x ¦ ¤ Jy Jy ∆y ∆y S (1. We should get the same final governing differential equation regardless of the shape of the volume chosen to do the derivation.where ρ u x is the mass flux through the control volume face at x. we can. the velocity field is given by the vector V and diffusive flux may be written as ui vj wk. Though we have chosen hexahedral control volume on which to do conservation. in principle. and dividing by ∆ ∆t Equation 1.1 may be written as ∆t Taking the limit ∆x ∆y ∆z ∆t It is convenient to write Equation 1. Thus the net convective (1.9 as S or.8) ∂ Jz ∂z S (1. 11 £ &¦ ¢ ∇ ρ Vφ ∇ Γ∇φ ¤% % ∂ ρφ ∂t S £   £  £    ¢ $¦ ¤ £ #¦ £¦ ¤ ¤ £ "¦ ¤ £ !¦ ¤ ∂ ρφ ∂t ∂ ρ uφ ∂x ∂ ρ vφ ∂y ∂ ρ wφ ∂z ∂ ∂φ Γ ∂x ∂x ∂ ∂φ Γ ∂z ∂z £ © © © ¢ ∂ ρφ ∂t ¢ ρφ t ∆t ρφ t 0.1. Accumulating terms.9) ∂ ∂φ Γ ∂y ∂y (1. in vector notation 1. choose any shape. Similar expressions may be written for the y and z directions respectively.1 Discussion It is worth noting the following about the above derivation: The differential form is derived by considering balances over a finite control volume. we get £  ¨ ©  £  ¨ ©  £  ¨ ©  Jx Jx ∆x Jz Jz ∆z ∆x ∆z ∂ Jx ∂x ∂ Jy ∂y ¨  © ∆x ¥  ¢ ¦ ¤ © ¨¦ ¤ ¦ ¤    ¨ Jx ρ uφ  ©  ¢ Jx ρ uφ ∂φ ∂x ∂φ Γ ∂x Γ £ £ x ¢ Here.10) ' ' .

The generation term in Equation 1.1. By using the continuity equation. Numerical methods that are developed with the divergence form as a starting point can be made to reflect the conservation property exactly if care is taken. S would be the generation of energy per unit volume per unit time. For simplicity.10 for example.13) ∂t 12 £ £ "¦ % £ ¤% % ¢ (¦ ¢ ¤% % ∂ ρφ ∂t ρ V ∇φ ¢ % £¦ £¦ ¤ ¤ £ £ ' ' The conservation equation is written in terms of a specific quantity φ . 1.12 can be made to approximate conservation in some limiting sense.10 represents the conservative or divergence form of the conservation equation.10 The divergence of J represents the net efflux per unit volume of J. the energy equation may be written in terms of the specific enthalpy h as ∂ ρh ∇ ρ Vh ∇ k∇T Sh (1. For this case. is the generation of φ per unit volume per unit time. but not exactly.1. or momentum per unit mass (m/s) or some similar quantity.12) . as well as other transport equations.2 Governing Equations The governing equations for fluid flow.1 The Energy Equation The general form of the energy equation is quite elaborate. though it can also be cast into the general form of Equation 1. in the absence of generation. the divergence of the flux is zero: where J = Jx i Jy j Jz k. The non-conservative form does not have a direct interpretation of this sort. 1.2 Conservation Form Equation 1. let us assume low-speed flow and negligible viscous dissipation. which may be energy per unit mass (J/kg). Equation 1.10. we may write the nonconservative form of Equation 1. The conservation equation is written on a per unit volume per unit time basis. Let us now consider some specific cases of the conservation equation for φ . ∇ J 0 (1. If φ were energy per unit mass. the conservative form is a direct statement about the conservation of φ in terms of the physical fluxes (convection and diffusion).11) Γ∇ ∇φ ∇Γ ∇φ S (1. may be represented by the conservative form. This form is characterized by the fact that in steady state. Thus.2.10. Those that start from Equation 1. heat and mass transfer.

Again we see that Equation 1. with φ Y i . with φ u. For ideal gases and incompressible substances.13 may be written as ∇ ρ Vh Comparing Equation 1. Γ Γi . We see that Equation 1.10 shows that the energy equation can be cast into the form of the general conservation equation. Γ k C p and S Sh .2. heat and mass transfer can be cast into a single general form which we shall call the general scalar transport equation: If numerical methods can be devised to solve this equation.16 has the same form as the general conservation equation 1. If Fick’s law is assumed valid. The equation for the conservation of mass for a chemical specie i may be written in terms of its mass fraction. where Yi is defined as the mass of species i per mass of mixture.2.10.17) (1.17 has the same form as the general conservation equation 1. the governing conservation equation is Γi is the diffusion coefficient for Yi in the mixture and R i is the rate of formation of Yi through chemical reactions. heat. 1. dh C p dT (1. Yi . 1. and ∂ p ∂ x is pressure gradient. Su contains those parts of the stress tensor not appearing directly in the diffusion term. we will have a framework within which to solve the equations for flow.10. 13 £ &¦ ¢ $¦ ∇ ρ Vφ ∇ Γ∇φ ¤% ¤% ∂ ρφ ∂t S ¢ £ !¦ ¢ ¢ $¦ ∇ ρ VYi ∇ Γi ∇Yi ¤% ¢ ¤% £¦ ¤ £ ∂ ρ Yi ∂t Ri £ ) © ¢ £ ¢ ©¦ ¢ ¢ 0¦ ∇ ρ Vu ∇ µ ∇u ¤% ¤% £ ∂ ρu ∂t ∂p ∂x Su ) ¢ ¢ £  % ¢ (¦ ¤% £ ∂ ρh ∂t ¢ ∇ k ∇h Cp Sh (1.14) so that Equation 1.15 with Equation 1.2 The Momentum Equation The momentum equation for a Newtonian fluid in the direction x may be written as Here.where k is the thermal conductivity and T is the temperature. Γ µ and S ∂ p ∂ x S u.15) ) ¢ (1. and S Ri .3 The Species Equation Consider the transport of a mixture of chemical species.16) (1.18) .3 The General Scalar Transport Equation We have seen that the equations governing fluid flow. 1. with φ h. and mass transfer.

The behavior of Equation 1.e. or the generation term S φ are functions of φ . If 0. 1. The governing equation and boundary conditions are given by with T 0 T L For constant k. It cannot be either higher or lower than the boundary temperatures.21) (1. T x is bounded by the temperatures on the boundaries. If 0 the If PDE is called hyperbolic. In the absence of source terms. 2. It is desirable when devising numerical schemes that these basic properties be reflected in the characteristics of the scheme. These are 1. Let us consider typical examples of each type of equation.b. The temperature at any point x in the domain is influenced by the temperatures on both boundaries.2.c. If the properties ρ and Γ. the solution is given by T x T0 This simple problem illustrates important properties of elliptic PDEs.19) 2 31 (1.1 Elliptic Partial Differential Equations Let us consider steady heat conduction in a one-dimensional slab.4 Mathematical Classification of Partial Differential Equations The general scalar transport equation is a second-order partial differential equation (PDE) governing the spatial and temporal variation of φ . 14 ¦ © ¤ £ ¢  ∂ ∂T k ∂x ∂x 0 T0 TL TL T0 L x 4 31 ¢ £ £ £ © ¦ ¤ ¢6¦ ¢ 5¦ ¤ ¤ ¢ £ ¢1  ¢ $¦ ¤ 1 £ £ aφxx bφxy cφyy d φx eφy fφ g 0 (1. as shown in Figure 1.20) 0 the PDE is called elliptic.4.y). It is instructive to consider a general second-order PDE given by The coefficients a.1. we examine the behavior of this equation.22) (1.23) .19 may be classified according to the sign on the discriminant b2 4ac (1. Ignoring non-linearities for the moment. but not of φ itself.d. f and g are functions of the coordinates (x. it is non-linear. the PDE is called parabolic.

x L Figure 1.2: Conduction in a One-Dimensional Slab 15 .

The boundary temperature T0 influences the temperature T(x. not past temperatures. The initial and boundary conditions are ¢ ∂T ∂t α ∂ 2T ∂ x2 (1. If k. The initial conditions only affect future temperatures. and may affect different spatial points to different degrees. ρ and C p are constant. Here. Only initial conditions are required (i.26) 123 (1.25) α n2 π 2 t L2   ¤  ¤¤ ¢ 8¦  ¤ ¦ where α given by k ρ C p is the thermal diffusivity.2. the axial direction in a pipe flow. Equation 1. for example conditions at t ∞.13 may be written in terms of the temperature T as T 0t T Lt Using a separation of variables technique. The amount of influence decreases with time. 6. We do not need to know the future to solve this problem! 3. 5. we may write the solution to this problem as n 1 0 We note the following about the solution: 1.24) ¤) ¢ (1. 16 DBDBC   ¢ B ¢    ¢ Bn 2 L A ©¦ ¤  where L Ti x T0 sin nπ x dx n L @   9 £ T xt T0 ∑ Bn sin ∞ ¢5¦ ¢7¦ ¢ 5¦ T x0 Ti x T0 T0 nπ x e L ¦ ¤ (1. conditions at t 0). It is clear from this problem that the variable t behaves very differently from the variable x. The temperature is bounded by its initial and boundary conditions in the absence of source terms. just as with elliptic PDE’s. whereas the variable x admits two-way influences. for example.t) at every point in the domain.27) ¦  ¤ . t is sometimes referred to as the marching or parabolic direction. 4. A steady state is reached for t ∞.2 Parabolic Partial Differential Equations Consider unsteady conduction in the slab in Figure 1. It also recovers its elliptic spatial behavior. No final conditions are required..e. Spatial variables may also behave in this way. The variation in t admits only one-way influences. 2.1.4. the solution becomes independent of Ti x 0 . The initial conditions influence the temperature at every point in the domain for all future times.

For example.1.29) T x You can convince yourself that Equation 1. the fluid upstream of the channel entrance is held at temperature T0 .30) or to put it another way T xt Ti for t T0 for t The solution is essentially a step in T traveling in the positive x direction with a velocity U. 1. as shown in Figure 1. with the diffusion terms tending to bring in elliptic influences. U. For t 0. The elliptic diffusion equation is recovered if we assume steady state and there is no flow. and the unsteady and convection terms bringing in parabolic or hyperbolic influences. The same problem solved for unsteady state exhibits parabolic behavior. The inlet boundary condition propagates with a finite speed. as shown in Figure 1. . U. The solution to this problem is T xt T x Ut 0 (1.4.31) x U. 17 ) ¢ 3. In most engineering situations.4.28 is hyperbolic by differentiating it once with respect to either t or x and finding the discriminant. The properties ρ and C p are constant and k 0. It is sometimes useful to consider particular coordinates to be elliptic or parabolic. is a constant. The velocity of the fluid. Conditions downstream of the domain do not affect the solution in the domain. The governing equations and boundary conditions are given by: with T x0 0t Ti T0 (1. The inlet boundary condition is not felt at point x until t ¢ $¦ x U x U ¦ G¦  E 2 ¢5¦  F ¢ 5¦  ¤ ¤ © ¤ ¢ ¤ ¢ C¤ 8¦  ¤ £ !¦ ¢ ∂ ρCp T ∂t ∂ ρ C pUT ∂x 0 E 4 ¢ 5¦  ¤ ¤ ¢ (1.28) (1.3. We should note the following about the solution: 1. also U 0.3 Hyperbolic Partial Differential Equations Let us consider the one-dimensional flow of a fluid in a channel. The upstream boundary condition (x 0) affects the solution in the domain. it is useful in parabolic problems to think about time as the parabolic coordinate and to think of space as the elliptic coordinate.10) has much in common with the partial differential equations we have seen here.4. The convection side of the scalar transport equation exhibits hyperbolic behavior.4 Behavior of the Scalar Transport Equation The general scalar transport equation we derived earlier (Equation 1. 2. the equation exhibits mixed behavior.

3: Convection of a Step Profile T0 T t=0 Ti t = x 1 /U x 1 t=x 2 /U x x 2 Figure 1.4: Temperature Variation with Time 18 .T0 T Ti x U Figure 1.

diffusion and source terms. These sets can also be analyzed in terms similar to the discussion above. When we study fluid flow in greater detail. we will not do that here. parabolic and hyperbolic equations. convection. as opposed to a single scalar transport equation. The ideal numerical scheme should be able to reproduce these influences correctly. 19 .Though it is possible to devise numerical methods which exploit the particular nature of the general scalar transport equation in certain limiting cases. heat and other specific quantities have a common form embodied in the general scalar transport equation. 1.5 Closure In this chapter. we will have to deal with coupled sets of equations. we begin to understand the behavior of these different terms in determining the behavior of the computed solution. This equation has unsteady. We have seen that the conservation equations governing the transport of momentum. These conservation equations are derived by writing balances over finite control volumes. we have seen that many physical phenomena of interest to us are governed by conservation equations. We will concentrate on developing numerical methods which are general enough to handle the mixed behavior of the general transport equation. By studying the behavior of canonical elliptic.

20 .

aims to provide us with values of φ at a discrete number of points in the domain. These points are called grid points. we prescribe how φ varies in the local neighborhood surrounding a grid point. The numerical solution. consistency. and identify the main components of the solution method. The process of converting our governing transport equation into a set of equations for the discrete values of φ is called the discretization process and the specific methods employed to bring about this conversion are called discretization methods. on the other hand.e.1 Overview Our objective here is to develop a numerical method for solving the general scalar transport equation. The development of numerical methods focuses on both the derivation of the discrete set of algebraic equations. That is. Fundamental to the development of a numerical method is the idea of discretization. In this chapter. Mesh generation divides the domain of interest into elements or cells. A typical mesh is shown in Figure 2. Most widely used methods for discretization require local profile assumptions. depending on the method. we examine numerical methods for solving this type of equation. as well as a method for their solution. An analytical solution to a partial differential equation gives us the value of φ as a function of the independent variables (x y z t).. and associates with each element or cell one or more discrete 21    . The discrete values of φ are typically described by algebraic equations relating the values at grid points to each other. but not over the entire domain.Chapter 2 Numerical Methods In the previous chapter. We also examine ways of characterizing our numerical methods in terms of accuracy. This is accomplished by means of mesh generation. though we may also see them referred to as nodes or cell centroids. stability and convergence. to make profile assumptions.1. The conversion of a differential equation into a set of discrete algebraic equations requires the discretization of space. we saw that physical phenomena of interest to us could be described by a general scalar transport equation. In arriving at these discrete equations for φ we will be required to assume how φ varies between grid points i. 2.

e. and not on the methods employed to solve the discrete set (i. (For some non-linear problems. No matter what discretization method is employed. The path to solution determines whether we are successful in obtaining a solution.) Since we wish to get an answer to the original differential equation. i. the path to solution). all well-behaved discretization methods should tend to the exact solution when a large enough number of grid points is employed. it is appropriate to ask whether our algebraic equation set really gives us this. and how much time and effort it will cost us. the path to solution can determine which of several possible solutions is obtained.1: An Example of a Mesh values of φ .Cell Vertex Figure 2.e. We should also distinguish between the discretized equations and the methods employed to solve them. For our purposes. its closeness to the exact solution. depends only on the discretization process. 22 . For simplicity. A well-behaved numerical scheme will tend to the exact solution as the number of grid points is increased. The rate at which it tends to the exact solution depends on the type of profile assumptions made in obtaining the discretization. the departure of the discrete solution from the exact solution is expected to be large. we shall not pursue this line of investigation here. When the number of grid points is small.. But it does not determine the final answer. It is these values of φ we wish to compute. let us say that the accuracy of the numerical solution..

. which meet at nodes or vertices. These meshes are also sometimes called orthogonal meshes. the face is a surface surrounded by edges.g. as shown in Figure 2. When the physics at the boundary are important in determining the solution. and Unstructured Meshes The meshes shown in Figure 2. A variety of mesh types are encountered in practice. We shall use the terminology shown in Figure 2. the mesh is divided into blocks. Block Structured. e. and the 23 . The grid lines are orthogonal to each other.2: Mesh Terminology 2. A cell is surrounded by faces.1 Regular and Body-fitted Meshes In many cases. the domains of interest are irregularly shaped and regular meshes may not suffice.2 in describing our meshes. If regular grids are used in these geometries. and conform to the boundaries of the domain. in flows dominated by wall shear. faces and edges are the same. Here. These are described below. every interior vertex in the domain is connected to the same number of neighbor vertices. These shapes can be meshed by regular grids.4. In three dimensions. Here. Figure 2.2.5 shows a block-structured mesh. cubes. 2. spheres.Node (Vertex) Cell Centroid Cell Face Figure 2.2 Structured.3(b).(We shall use the terms mesh and grid interchangeably in this book). An example is shown in Figure 2. cylinders.2 Mesh Terminology and Types The physical domain is discretized by meshing or gridding it. stair stepping occurs at domain boundaries. as shown in Figure 2. Associated with each cell is the cell centroid. however. such an approximation of the boundary may not be acceptable. our interest lies in analyzing domains which are regular in shape: rectangles. and curve to conform to the irregular geometry.3 are examples of structured meshes.3(a). grid lines are not necessarily orthogonal to each other. 2. For many practical problems. In two dimensions. The fundamental unit of the mesh is the cell (sometimes called the element). Here.2.

(a) (b) Figure 2.3: Regular and Body-Fitted Meshes Figure 2.4: Stair-Stepped Mesh 24 .

Block Figure 2. structured quadrilaterals and hexahedra are well-suited for flows with a dominant direction. make it easier to mesh very complex geometries. each vertex is connected to an arbitrary number of neighbor vertices. Here.6 shows an unstructured mesh. Though mesh structure imposes restrictions.5 and 2. However. such as boundary-layer flows.3 Conformal and Non-Conformal Meshes An example of a non-conformal mesh is shown in Figure 2.2. triangles and tetrahedra are increasingly being used. the arrangement of the blocks themselves is not necessarily structured. unstructured meshes are becoming necessary to handle complex geometries. and mesh generation techniques for their generation are rapidly reaching maturity.6 are conformal meshes. Here.2. As of this writing. Figure 2. and as a result. there are no general 25 .5: Block-Structured Mesh mesh within each block is structured.2.3. the vertices of a cell or element may fall on the faces of neighboring cells or elements. the meshes in Figures 2. Methods for generating good-quality structured meshes for quadrilaterals and hexahedra have existed for some time now. In contrast. 2.7. Unstructured meshes impose fewer topological restrictions on the user. Here.4 Cell Shapes Meshes may be constructed using a variety of cell shapes. 2. as computational fluid dynamics is becoming more widely used for analyzing industrial flows. More recently. The most widely used are quadrilaterals and hexahedra.

Cell Vertex Figure 2.6: Unstructured Mesh 26 .

7: Non-Conformal Mesh 27 .Figure 2.

(e) Prism. and the choice will depend 28 . This fact must be taken into account in deciding whether a given mesh provides adequate resolution for a given problem. are called cell-based schemes. (c) Quadrilateral. For example. For structured and block-structured meshes composed of quadrilaterals or hexahedra. the number of cells is approximately equal to the number of nodes. Those which store them at the cell centroid. (b) Tetrahedron. transitioning to tetrahedra in the free-stream. on average. prisms are used in boundary layers. and (f) Pyramid purpose techniques for generating unstructured hexahedra. (d) Hexahedron. both schemes have advantages and disadvantages. for example. we will develop numerical methods capable of using all these cell shapes. or associate them with the cell. there may be quite a big difference in the number of nodes and cells in the mesh. For triangles. 2. there are twice as many cells as nodes. and the spatial resolution of both storage schemes is similar for the same mesh.5 Node-Based and Cell-Based Schemes Numerical methods which store their primary unknowns at the node or vertex locations are called node-based or vertex-based schemes.8: Cell Shapes: (a) Triangle. Another recent trend is the use of hybrid meshes. and many finite volume methods are cell-based.2. In this book. Finite element methods are typically node-based schemes. For other cell shapes.(a) (b) (c) (d) (e) (f) Figure 2. From the point of view of developing numerical methods.

3 gives 2 By adding the two equations together.3) n ¦ ¦ C¤ 4 ¤ (2.3 Discretization Methods So far. 2.9: Hybrid Mesh in Boundary Layer on what we wish to achieve. but have not said specifically what method we will use to convert our general transport equation to a set of discrete algebraic equations.2) (2. Referring to the one-dimensional mesh shown in Figure 2.1 Finite Difference Methods Finite difference methods approximate the derivatives in the governing differential equation using truncated Taylor series expansions. we have alluded to the discretization method. Consider a one-dimensional scalar transport equation with a constant diffusion coefficient and no unsteady or convective terms: d 2φ Γ 2 S 0 (2.1) dx We wish to discretize the diffusion term. we can write 2 29 ¦ ¦ C¤ £ ¤ © £ ¢  d2φ dx2 φ1 φ3 2φ2 ∆x2 ¦ ¦ H¤ £ ¤ © ¢  dφ dx φ3 φ1 2∆x O ∆x 2 O ∆x 2 ¦ ¤ £    £  ¢ φ3 φ2 ∆x O ∆x 2  ¦ ¤ dφ dx ∆x 2 2 d2φ dx2 £  2  © ¢ φ1 φ2 ∆x O ∆x  ¦ ¤ 3 3 dφ dx  ¦ £  ¤   ¦ ¤ £ ∆x 2 2 ¢ £ d2φ dx2 (2.Flow Triangles Quadrilaterals Boundary Layer Figure 2.10.4) (2. 2.3. Subtracting Equations 2. A number of popular methods are available for doing this.5) . we write 2 and 2 The term O ∆x 3 indicates that the terms that follow have a dependence on ∆x where n 3.2 from Equation 2.

1.10 requires that the residual R become zero in a weighted sense.1 2 3 ∆x ∆x Figure 2. we (2.7) ¦ ¤ (2. Equation 2.6 and 2.10: One-Dimensional Mesh By including the diffusion coefficient and dropping terms of O ∆x can write φ φ3 2φ2 d2φ Γ 1 Γ dx2 2 ∆x2 The source term S is evaluated at the point 2 using S φ2 Substituting Equations 2.2 Finite Element Methods We consider again the one-dimensional diffusion equation. the Galerkin finite element method. 2. By obtaining an equation like this for every point in the mesh. In order to generate a set of discrete equations we use a family of 30 ¢ W Rdx ¢ £ d2φ dx2 S R 0 £ ¦ ¤ £ ¦ ¤ ¢ 2Γ φ ∆x 2 2 Γ φ ∆x 2 1  S2 Γ φ ∆x 2 3 S2 ¦ ¦ C¤ ¤ 2 or smaller. Though they yield discrete equations that look similar to other methods for simple cases.9) (2.1 exactly.3. Since φ is only an approximation.8) (2.1. Finite difference methods do not explicitly exploit the conservation principle in deriving discrete equations. This equation set may be solved by a variety of methods which we will discuss later in the book. for example on unstructured meshes.7 into Equation 2. we obtain an set of algebraic equations in the discrete values of φ . it does not satisfy Equation 2.10) .6) © £  ¢ ¢  A  (2.1 gives the equation This is the discrete form of Equation 2. they are not guaranteed to do so in more complicated cases. Let us look at a popular variant. so that there is a residual R: We wish to find a φ such that domain W is a weight function. Let φ be an approximation to φ . and Equation 2. There are different kinds of finite element methods.

11. i 1 2 N.10. assume how φ varies between nodes. denoted by W .12 over the cell P. Alternatively we may start with the differential equation and integrate it over the control volume.13) 0 (2. P and E.3 Finite Volume Method The finite volume method (sometimes called the control volume method) divides the domain in to a finite number of non-overlapping cells or control volumes over which conservation of φ is enforced in a discrete sense. with cells as shown in Figure 2. as in Equation 1. We now turn to a method which employs conservation as a tool for developing discrete equations. Thus far. This yields e w w so that e w w We note that this equation can also be obtained by writing a heat balance over the cell P from first principles. The cell faces are denoted by w and e. rather than a single weight function.3. Let us store discrete values of φ at cell centroids.11) (2. The Galerkin finite element method requires that the weight and shape functions be the same.9 in the previous chapter. we assume a shape function for φ . Let us assume the face areas to be unity. We focus on the cell associated with P.11 results in a set of algebraic equations in the nodal values of φ which may be solved by a variety of methods.weight functions Wi . Further. Let us examine the discretization process by looking at one-dimensional diffusion with a source term: Consider a one-dimensional mesh. 2. where N is the number of grid points. we require domain The weight functions Wi are typically local in that they are non-zero over element i.14) ..12) Sdx 0 (2. i. For example we may assume that φ assumes a piece-wise linear profile between points 1 and 2 and between points 2 and 3 in Figure 2. We should note here that because the Galerkin finite element method only requires the residual to be zero in some weighted sense.e. we have made no approximation. Performing the integration in Equation 2. Thus. 31 ¢ A £   ©  Γ dφ dx Γ dφ dx e Sdx ¢ A £  d dφ Γ dx dx dx ¢ £  dφ d Γ dx dx S IBDBC  ¢ B 0 e ¢   DBDBC  ¢ B A A  Wi Rdx 0 i 12 N (2. It is possible to start the discretization process with a direct statement of conservation on the control volume. but are zero everywhere else in the domain. We start by integrating Equation 2. Typically this variation is also local. it does not enforce the conservation principle in its original form.

∆x

W w

P

E e

δ xw

δ xe

Figure 2.11: Arrangement of Control Volumes We now make a profile assumption, i.e., we make an assumption about how φ varies between cell centroids. If we assume that φ varies linearly between cell centroids, we may write Γw φP φW Γe φE φP S∆x 0 (2.15) δ xe δ xw Here S is the average value of S in the control volume. We note that the above equation is no longer exact because of the approximation in assuming that φ varies in a piecewise linear fashion between grid points. Collecting terms, we obtain

where

Equations similar to Equation 2.16 may be derived for all cells in the domain, yielding a set of algebraic equations, as before; these may be solved using a variety of direct or iterative methods. We note the following about the discretization process. 1. The process starts with the statement of conservation over the cell. We then find cell values of φ which satisfy this conservation statement. Thus conservation is guaranteed for each cell, regardless of mesh size. 32

¢

b

¢

¢

aW aP

¢

aE

Γe δ xe

Γw δ xw aE aW S∆x

£

£ ¦ ) ¦ ¤¤ )

£

¢

aP φP

aE φE

aW φW

b

¢

£  ¦© ¤ 

©

¦

¦ ¤ ©

¤

(2.16)

(2.17)

2. Conservation does not guarantee accuracy, however. The solution for φ may be inaccurate, but conservative. 3. The quantity Γd φ dx e is diffusion flux on the e face. The cell balance is written in terms of face fluxes. The gradient of φ must therefore be evaluated at the faces of the cell. 4. The profile assumptions for φ and S need not be the same. We will examine additional properties of this discretization in the next chapter.

2.4 Solution of Discretization Equations
All the discretization methods described here result in a set of discrete algebraic equations which must be solved to obtain the discrete values of φ . These equations may be linear (i.e. the coefficients are independent of φ ) or they may be non-linear (i.e. the coefficients are functions of φ ). The solution techniques are independent of the discretization method, and represent the path to solution. For the linear algebraic sets we will encounter in this book, we are guaranteed that there is only one solution, and if our solution method gives us a solution, it is the solution we want. All solution methods (i.e. all paths to solution) which arrive at a solution will give us the same solution for the same set of discrete equations. For non-linear problems, we do not have this guarantee, and the answer we get may depend on factors like the initial guess, and the actual path to solution. Though this is an important issue in computing fluid flows, we will not address it here. Solution methods may be broadly classified as direct or iterative. We consider each briefly below.

2.4.1 Direct Methods
Using one of the discretization methods described previously, we may write the resulting system of algebraic equations as

T is a vector consisting of the discrete where A is the coefficient matrix, φ φ 1 φ2 values of φ , and B is the vector resulting from the source terms. Direct methods solve the equation set 2.18 using the methods of linear algebra. The simplest direct method is inversion, whereby φ is computed from

A solution for φ is guaranteed if A 1 can be found. However, the operation count for the inversion of an N N matrix is O N 2 . Consequently, inversion is almost never employed in practical problems. More efficient methods for linear systems are available. For the discretization methods of interest here, A is sparse, and for structured meshes it is banded. For certain types of equations, for example, for pure diffusion, the

¦ ¤ S S ¢

R DBDBC  Q¢ B P

φ

A 1B

33

¢

¦ )

¡

¤

©

B

(2.18)

(2.19)

matrix is symmetric. Matrix manipulation can take into account the special structure of A in devising efficient solution techniques for Equation 2.18. We will study one such method, the tri-diagonal matrix algorithm (TDMA), in a later chapter. Direct methods are not widely used in computational fluid dynamics because of large computational and storage requirements. Most industrial CFD problems today involve hundreds of thousands of cells, with 5-10 unknowns per cell even for simple problems. Thus the matrix A is usually very large, and most direct methods become impractical for these large problems. Furthermore, the matrix A is usually non-linear, so that the direct method must be embedded within an iterative loop to update nonlinearities in A. Thus, the direct method is applied over and over again, making it all the more time-consuming.

2.4.2 Iterative Methods
Iterative methods are the most widely used solution methods in computational fluid dynamics. These methods employ a guess-and-correct philosophy which progressively improves the guessed solution by repeated application of the discrete equations. Let us consider an extremely simple iterative method, the Gauss-Seidel method. The overall solution loop for the Gauss-Seidel method may be written as follows: 1. Guess the discrete values of φ at all grid points in the domain. 2. Visit each grid point in turn. Update φ using

The neighbor values, φ E and φW are required for the update of φ P . These are assumed known at prevailing values. Thus, points which have already been visited will have recently updated values of φ and those that have not will have old values. 3. Sweep the domain until all grid points are covered. This completes one iteration. 4. Check if an appropriate convergence criterion is met. We may, for example, require that the maximum change in the grid-point values of φ be less than 0 1 %. If the criterion is met, stop. Else, go to step 2. The iteration procedure described here is not guaranteed to converge to a solution for arbitrary combinations of a P , aE and aW . Convergence of the process is guaranteed for linear problems if the Scarborough criterion is satisfied. The Scarborough criterion requires that

aE

aW

aP

1 1

for all grid points for at least one grid point (2.21)

Matrices which satisfy the Scarborough criterion have diagonal dominance. We note that direct methods do not require the Scarborough criterion to be satisfied to obtain a 34

B

¢

φP

¦ £

£

¤

aE φE

aW φW aP

b

(2.20)

F2 T £T T T T T

aW and b can be computed on the fly if desired. The order of a discretization method is n if its truncation error is O ∆x n . we expect the truncation error to decrease by a factor of four. In a later chapter. The Gauss-Seidel scheme can be implemented with very little storage. Sometimes we may come across schemes 35 ¦ ¦ C¤ ¤ ¦ ¦ ¦ C¤ ¤ ¤ ) ¦ ¦ H¤ ¤ .5.This simply says that if d 2 φ dx2 is represented by the first term in Equation 2. Consistency. we can always obtain a solution to our linear set of equations as long as our coefficient matrix is not singular. Also. However. we turn to certain important properties of numerical methods.2 Consistency A consistent numerical method is one for which the truncation error tends to vanish as the mesh becomes finer and finer. The truncation error of a discretization scheme is the largest truncation error of each of the individual terms in the equation being discretized. Stability and Convergence In this section. as shown by Equation 2. The truncation error associated with the diffusion term using the finite difference method is O ∆x 2 . we are guaranteed that the error will decrease more rapidly with mesh refinement than with a discretization method of lower order. The coefficients a P . If the coefficients depend on φ . we do not know the exact solution. we expect the truncation error to decrease as ∆x 2 . the Gauss-Seidel scheme is rarely used in practice for solving the systems encountered in CFD. If we double the x-direction mesh. Nevertheless. (For unsteady problems. both spatial and temporal truncation errors must be considered). All that is required is storage for the discrete values of φ at the grid points. The rate of convergence of the scheme decreases to unacceptably low levels if the system of equations is large.solution.5. 2. the iterative nature of the scheme makes it particularly suitable for non-linear problems. we will use a multigrid method to accelerate the rate of convergence of this scheme and make it usable as a practical tool. Thus. 2.5. if we refine the mesh. In most cases. but is not an indicator of how high the error is on the current mesh. We are guaranteed this if the truncation error is some power of the mesh spacing ∆x (or ∆t). Thus.1 Accuracy Accuracy refers to the correctness of a numerical solution when compared to an exact solution. It is important to understand that the truncation error tells us how fast the error will decrease with mesh refinement. they may be updated using prevailing values of φ as the iterations proceed. since the entire coefficient matrix for the domain is not required when updating the value of φ at any grid point. even methods of very high order may yield inaccurate results on a given mesh.5. 2. It is therefore more useful to talk of the truncation error of a discretization method. aE .5 Accuracy. the terms that are neglected are of O ∆x 2 .

It is also possible to speak of the stability of time-marching schemes. 2. An unstable time-marching scheme would not be able to reach steady state in an unsteady heat conduction problem. make a formal analysis difficult. However. we obtain a discretized set of algebraic equations which must be solved. and its use in obtaining solutions that are essentially invariant with further refinement. By this. and properties. and study the properties of the discretizations it produces when applied to diffusion problems. In reality the practitioner of CFD must rely on experience and intuition in devising stable solution methods. We have learned that there are a number of different philosophies for discretizing the scalar transport equation. as well as coupling between multiple governing equations. Here.where the truncation error of the method is O ∆x ∆t . Here. this is most convenient for linear problems. Stability analysis allow us to determine whether errors in the solution remain bounded as time marching proceeds.3 Stability The previous two properties refer to the behavior of the discretization method. Stability is a property of the path to solution. we consider the finite volume method in more detail. For steady state problems.6 Closure In this chapter. When solving unsteady problems. 36 ¦ ) ¤ . Consistency is a very important property. 2. Without it. we have no guarantee that mesh refinement will improve our solution. for example.4 Convergence We distinguish between two popular usages of the term convergence. we have presented a broad overview of discretization and introduced terminology associated with numerical methods. and is usually too difficult for most realistic problems. In the next chapter. Depending on the properties of the method. solution errors may be amplified or damped. boundary conditions. for example (assuming that a steady state exists). By this we mean that our iterative method has successfully obtained a solution to our discrete algebraic equation set. We may choose to solve this set using an iterative method. An iterative solution method is unstable or divergent if it fails to yield a solution to the discrete set. We may also speak of convergence to mesh independence.5. 2. Of these. only the finite volume method enforces conservation on each cell. It is possible to analyze iterative and time marching methods using stability analysis. and thus ensures that both local and global conservation are guaranteed no matter how coarse the mesh. consistency is not guaranteed unless ∆x is decreased faster than ∆t. We shall use the term in both senses in this book. or that we have obtained convergence using a particular method.5. non-linearities in the governing equations. we mean the process of mesh refinement. we will use numerical methods which compute the solution at discrete instants of time. We may say that an iterative method has converged to a solution. using the solution at one or more previous time steps as initial conditions.

Chapter 3 The Diffusion Equation: A First Look In this chapter we turn our attention to an important physical process. Diffusion operators are common in heat.10. The methodology we develop in this chapter will allow us to examine more complicated mesh types and physics in later chapters.1) ∇ J S In Cartesian geometries. From Equation 1.1 Two-Dimensional Diffusion in Rectangular Domain Let us consider the steady two-dimensional diffusion of a scalar φ in a rectangular domain. 3.3) .2) ∂ i ∂x ¢ % ∂ j ∂y (3. We consider the discretization and solution of the scalar transport equation for both steady and unsteady diffusion problems. When Γ is constant and S is non-zero. the equation defaults to the familiar Laplace equation.1 is written in conservative or divergence form. 37 £ ¢ ∇ © ¢ £ ¢ where J Jx i Jy j is the diffusion flux vector and is given by J Γ∇φ (3. the governing scalar transport equation may be written as (3. and other physics. the Poisson equation is obtained. the gradient operator is given by We note that Equation 3. radiation. When Γ is constant and S is zero. mass and momentum transfer and can also be used to model electrostatics. We will attempt to relate the properties of our discrete equations with the behavior of the canonical partial differential equations we studied previously. namely diffusion.

N A n δy W A w A S δx w ∆x δ xe s P Ae δy E n ∆y s Figure 3.1: Two-Dimensional Control Volume 38 .

8) ¥ ¢ %   9 ∑ Jf Af S∆ e w ¥ ¢ ¦ % ¤ £ ¦ % ¤ £ ¦ % ¤ £ ¦ % ¤ J A J A J A ¥ V A ¢ J dA Sd J A ¥ S∆ V A W¥ % V A ¢ % A % % % % ∇ Jd Sd (3. we make one more round of profile assumptions.4) (3. As in the previous chapter.1 Discretization The arrangement of cells under consideration is shown in Figure 3. The vectors are positive pointing outwards from the cell P. We begin the process of discretization by integrating Equation 3.1.6) (3. we focus on cell P and its neighbors. so that it may be represented by its value at the face centroid. We have made no approximations thus far. Thus. N and S. we apply the divergence theorem to yield A ∆ The first integral represents the integral over the control surface A of the cell. An and As . Equation 3.1 over the cell P: ∆ ∆ Next. We now make a profile assumption about the flux vector J. We also assume that the mean value of the source term S over the control volume is S. Discrete values of φ are stored at cell centroids. We assume that J varies linearly over each face of the cell P. Aw .w.5) (3. The volume of the cell P is ∆ ∆x ∆y. The faces e.10) ¢ U¥ ¡ (3.1. We assume that φ varies linearly between cell centroids. W.7) (3. the cells E.3.9 may be written as ¢ J w Aw 39 © ¢ J e Ae φE φP δx e φ φW Γw ∆y P δx w ¦ ¤ © ¦ ¤ © Γe ∆y   ¢ J w Aw   © ¢ J e Ae ∂φ ∂x ∂φ Γw ∆y ∂x Γe ∆y © ¢ Aw ¢ Ae ∆y i ∆y i (3. We also store the diffusion coefficient Γ at cell centroids. Further The transport in the other directions may be written analogously. more compactly f ewns The face areas Ae and Aw are given by The other area vectors may be written analogously. e w n s or. Thus. In order to complete the discretization process. n and s are associated with area vectors A e .9) .

3. This does not mean these schemes are wrong – it means they do not have a property we would like to have if at all possible. We say that S has been linearized. We will see later how general forms of S can be written in this way. In our case they are all positive.12 into Equation 3.14) £ £ £ £ £ ¢ S SC SP φ (3. This has physical meaning. overall conservation in the calculation domain is not guaranteed unless the diffusion transfer from one cell enters the next cell. For example.Similar expressions may be written for the other fluxes. 2. W .10. and S. However. the subscript nb denotes the cell neighbors E. The coefficients a P and anb are all of the same sign. 3.12) Substituting Equations 3. We write the volume-averaged source term S in the cell P as S SC SP φP (3. in writing the balance for cell E.2 Discussion We make the following important points about the discretization we have done so far: 1.11) ¢ ¦ ¤ ¦ ¤ £ ¢ ¢ F (3. N. (The solution to our elliptic partial differential equation also has this property).1. 40 £ ¢ ¢ b aP φP ∑ anb φnb b © £ £ ¢ aP ¢ aS £ ¦ ¤ ¢ aN ¦ ¤ ¢ aW aN aS SP ∆x∆y (3. If the temperature at E is increased. Many higher order schemes do not have this property.8 and 3. not decrease.13) where aE Γe ∆y δx e Γw ∆y δx w Γn ∆x δy n Γs ∆x δy s aE aW SC ∆x∆y Equation 3. Let us assume that the source term S has the form with SP 0. Thus conservation over individual control volumes is guaranteed. we would expect the temperature at P to increase.15) .6 yields a discrete equation for φP : aP φP aE φE aW φW aN φN aS φS b (3. we must ensure that the flux used on the face e is J e .13 may be written in a more compact form as nb Here. and that it is discretized exactly as in Equation 3.10. The discrete equation expresses a balance of discrete flux (the J’s) and the source term.

Equation 3. If for example S is a temperature source.17) Y¢ ¢ S∆ (3. we store discrete values of φ at the centroids of boundary faces. If SP 0 and aP ∑nb anb . as before. When S 0. S increases indefinitely. The solution can be made unique by specifying boundary conditions on φ which fix the value of φ at some point on the boundary. We control this behavior in the numerical scheme by insisting that S P be kept negative. it is always bounded by them. By extension. Equation 3. This also has physical meaning. Discrete values of φ are stored at cell centroids. we notice that φ and φ C are solutions to Equation 3.18) .2 Boundary Conditions A typical boundary control volume is shown in Figure 3.13.11 be negative. The boundary area vector A b is given by Ab ∆y i (3. When SP 0.1. and points outward from the cell P as shown.2. φ P is always bounded by the boundary values of φ .20) 41 ¥ J A J A J A J A £ ¢ ¦ % ¤ £ ¦ % ¤ £ ¦ % ¤ £ ¦ % ¤   © ¢ © ¢ ¢ φP ∑ ¢ ¢ X¦ ) ¤ ¢ ¢ 4. Thus Jb Γb ∇φb (3. 5. we do not want a situation where as T increases. The amount of overshoot is determined by the magnitude of S C and SP with respect to the a nb ’s. φP need not be bounded in this manner. A boundary control volume is one which has one or more faces on the boundary. but this is perfectly physical. Integrating the governing transport equation over the cell P as before yields b e n s The fluxes on the interior faces are discretized as before.3. We notice that this property is also shared by our canonical elliptic equation.19) Let us assume that the boundary flux J b is given by the boundary face centroid value. we have aP ∑ anb nb (3. Since φP is the weighted sum of its neighbor values. Let us consider the discretization process for a near-boundary control volume centered about the cell centroid P with a face on the boundary. We require that S P in Equation 3.13 may then be written as nb where ∑nb anb aP 1. This is also true of the original differential equation. The boundary face centroid is denoted by b. and can overshoot or undershoot its boundary values. 3.16) anb φ aP nb (3. In addition. The face area vector of the boundary face is A b .

we write The specification of boundary conditions involves either specifying the unknown boundary value φb .1 Dirichlet Boundary Condition The boundary condition is given by Using φb given in Equation 3.22. 3.24) .18 yields the following discrete equation for boundary cell P: 42 £ £ £ ¢ aP φP aE φE aN φN %  ¢ ¢ % J b Ab ∆yΓb φb φb given aS φS  ¦ ¤ ©  ¢ % J b Ab ∆yΓb ∇φb (3.2.A b b δx b P e E Figure 3. or alternatively. the boundary flux J b . and including J b Ab in Equation 3.2: Boundary Control Volume so that Assuming that φ varies linearly between b and P.21) φP φb δx b (3.22) (3.23)  b (3. Let us consider some common boundary conditions next.

where

We note the following important points about the above discretization: 1. At Dirichlet boundaries, a P aE aN aS . This property ensures that the Scarborough criterion is satisfied for problems with Dirichlet boundary conditions. 2. φP is guaranteed to be bounded by the values of φ E , φN , φS and φb if SC and SP are zero. This is in keeping with the behavior of the canonical elliptic partial differential equation we encountered earlier.

3.2.2 Neumann Boundary Condition
Here, we are given the normal gradient of φ at the boundary:
b

We are in effect given the flux J b at Neumann boundaries: q b given ∆y directly in Equation 3.18 to yield the following We may thus include discrete equation for the boundary cell P:

where

We note the following about the discretization at the boundary cell P: 43

¢

¢

aP b

¢

aS 

£ © £ £ ¦ ¤

¢

aN

¦ ¤

¢

aE

Γe ∆y δx e Γn ∆x δy n Γs ∆x δy s aE aN aS SP ∆x∆y qb given ∆y SC ∆x∆y

£

£

£

¦ ¤

¢

aP φP

aE φE 

© ¢ %

J b Ab

qb given ∆y

aN φN 

¢ % ¦

Γ∇φ

i

qb given

aS φS

¦

©

£

£

£

£ ¤ 4

£

¦

¤

©

¢

¢

aP b

¢

ab

£ ¦ ¤

¢

aS

¦ ¤

¢

aN

¦ ¤

¢

aE

Γe ∆y δx e Γn ∆x δy n Γs ∆x δy s Γb ∆y δx b aE aN aS ab ab φb SC ∆x∆y

¦ ¤

SP ∆x∆y (3.25)

(3.26)

(3.27) 

©

¤

b

(3.28)

(3.29)

2. If both q b given and S are zero, φ P is bounded by its neighbors. Otherwise, φ P can exceed (or fall below) the neighbor values of φ . This is admissible. If heat were being added at the boundary, for example, we would expect the temperature in the region close to the boundary to be higher than that in the interior. 3. Once φP is computed, the boundary value, φ b may be computed using Equation 3.22: qb given Γb δ xb φP φb (3.30) Γb δ xb

3.2.3 Mixed Boundary Condition
The mixed boundary condition is given by

J b Ab Using Equation 3.22 we may write Γb We may thus write φb as

Using Equation 3.34 to eliminate φ b from Equation 3.33 we may write

We are now ready to write the discretization equation for the boundary control volume P. Substituting the boundary flux from Equation 3.35 into Equation 3.18 given the following discrete equation for φ P :

44

£

£

£

¢

aP φP

aE φE

aN φN

aS φS

¦

¢

Req

hb Γb δ xb hb Γb δ xb

¦

) £ ) ¤¤

where

¦

©

© ¢ %

J b Ab

Req φ∞

φP ∆y

¦

¤

¢

φb

¦

hb φ∞ hb

Γb δ xb φP Γb δ xb

¦

©

hb φ∞

¤

) £ ) ¤¤ £

© ¢ 

φP φb δ xb

¦ © ¤ © ¢ %

© 

¢

Since Ab

∆yi, we are given that

¢ % ¦

Γ∇φ

b

i

hb φ∞

φ

hb φ∞

φ ∆y

φb

¦

¢

¦ © ¤

¦ ) ) ¤ £¤ 

¢

¤

©

¦

£

1. aP

£ ¤ ¢
aE

aN

aS at Neumann boundaries if S

0. 

(3.31)

(3.32)

(3.33)

(3.34)

(3.35)

(3.36)

b

(3.37)

where

We note the following about the above discretization: aE aN aS for the boundary cell P if S 0. Thus, mixed boundaries 1. aP are like Dirichlet boundaries in that the boundary condition helps ensure that the Scarborough criterion is met. 2. The cell value φ P is bounded by its neighbor values φ E , φN and φS , and the external value, φ ∞ . 3. The boundary value, φ b , may be computed from Equation 3.34 once a solution has been obtained. It is bounded by φ P and φ∞ , as shown by Equation 3.34.

3.3 Unsteady Conduction
Let us now consider the unsteady counterpart of Equation 3.1:

We are given initial conditions φ x y 0 . As we saw in a previous chapter, time is a “marching” coordinate. By knowing the initial condition, and taking discrete time steps ∆t, we wish to obtain the solution for φ at a each discrete time instant. In order to discretize Equation 3.39, we integrate it over the control volume as usual. We also integrate it over the time step ∆t, i.e., from t to t ∆t.

Applying the divergence theorem as before, we obtain
∆ ∆t A

∆t ∆

V A

ρφ d

ρφ

P∆

45

£

The superscripts 1 and 0 in the first integral denote the values at the times t respectively. Let us consider each term in turn. If we assume that

¥

V A A ¢

¥ ¦ ¤ `¥ ¢

%

A A £ Q¥  ¦ ¤ © ¦ ¤  V A

V A A

∆t ∆

∆t ∆

∆t ∆

ρφ

1

ρφ

0

d

J dAdt

Sd dt

¥

V A A ¢

¥ % V A A £

∂ ρφ d dt ∂t

∇ Jd dt

£

¢ %

¦   ¤ £ !¦ ¤

∂ ρφ ∂t

∇ J

S

¢

£

¥ ¦ ¤

¢

b

Req ∆yφ∞

SC ∆x∆y

©

£

£

£

¢

¢

ab aP

¢

aS

¦ ¤

¢

aN

¦ ¤

¢

aE

Γe ∆y δx e Γn ∆x δy n Γs ∆x δy s Req ∆y aE aN

¦ ¤

aS

ab

SP ∆x∆y (3.38)

¦

£

£ ¤ 4

(3.39)

Sd dt

(3.40)

(3.41) ∆t and t

(3.42)

45) £  V A % % % % % A (3.43) %   9 A  ¢ ¥ ∑ J f A f dt (3. The values at time t are represented as before with the superscript 0.48) (3.we may write the unsteady term as ∆ We now turn to the flux term. If we assume as before that the flux on a face is represented by its centroid value. interpolating S between t and one: £  V A A ∆t ∆ ∆t and t using a weighting factor f between zero 1 f SC SPφP 0 ∆t ¥  Sd dt SC SP φP ∆ dt ¥  SC SP φ d SC SP φP ∆ £ Let us now examine the source term. we may write and ∆ we have ∆t For simplicity. Let us assume that it can be interpolated between time instants t ∆t and t using a factor f between zero and one: ∆t J Adt f J1 A 1 f J0 A ∆t Proceeding as before. we obtain the following discrete equation for φ : nb nb 46 b ¢ aP φP ∑ anb f φnb 1 0 f φnb b a0 P 1 f ∑ anb ¥  ¦ © ¤ © W£ £  ¦ © ¤ £ a ¥  ¢  ¥  SC SP φP ∆ dt f SC SP φP 1 ∆ ∆t £ ¦ © ¤ £ £ Again. Linearizing S as S C ing that £  A ¢ £  W¥  ¢ ¢ J 0 Aw w © ¢ J 0 Ae e ¦ ¤ © ¦ ¤ © ¢ J 1 Aw w 0 0 φE φP δx e 0 0 φP φW Γw ∆y δx w © ¢ J 1 Ae e 1 1 φE φP δx e 1 1 φ φW Γw ∆y P δx w Γe ∆y ¦ ¤ © ¦ ¤ © Γe ∆y SPφ and further assum(3.51) . let us drop the superscript 1 and let the un-superscripted value represent the value at time t ∆t.50) 0 φP (3.47) £ £  A ∆ ∆t (3.46) (3.49) £  % ¦ © £ % ¤  ¦ © ¦ ¤ ¤ ¥ ρφ 1 P ρφ 0 P (3. Collecting terms and dividing through by ∆t. we may write the term as ∆t f e w n s We are now required to make a profile assumption about how the flux J varies with time. making linear profile assumptions for φ between grid points.44) (3.

53 contains values exclusively from the previous time t. it is possible for us to evaluate the right hand side completely. Thus. This means that the flux and source terms are evaluated using values exclusively from the previous time step. we obtain the following discrete equations: nb nb and We notice the following about the discretization: 1. In this limit. N and S. and find the value of φ P at time t ∆t.53) (3. Further nb It is useful to examine the behavior of Equation 3.W . we obtain the explicit scheme.where nb denotes E. given the condition at time t.54) . 3. 47 £ ¥  ¢ b £  ¢ aP ¢ a0 P ¢ aS ¥ ¦ ¤ ¢ aN ¦ ¤ ¢ aW ¦ ¤ ¢ aE Γe ∆y δx e Γw ∆y δx w Γn ∆x δy n Γs ∆x δy s ρ∆ ∆t a0 P 0 SC 0 0 SP φP ∆ b © a £ £ ¦ ¤ ¢ aP φP 0 ∑ anbφnb b a0 P ∑ anb 0 φP ¥  ¢ b f SC ¦ © ¤ £ ¦ © ¤ £ © £ c¥  ¢ aP ¢ a0 P ¢ aS ¥ ¦ ¤ ¢ aN ¦ ¤ ¢ aW ¦ ¤ ¢ aE Γe ∆y δx e Γw ∆y δx w Γn ∆x δy n Γs ∆x δy s ρ∆ ∆t f ∑ anb ¦ ¤ f SP ∆ a0 P 1 1 0 f SC 0 0 f SP φP ∆ (3.1 The Explicit Scheme If we set f 0.51 for a few limiting cases. The right hand side of Equation 3.3.52) ¢ (3.

When ∆t ∞.55) P When a0 ∑nb anb . 3.59) . 0 a0 φP P E ¦ ¤ F ¦ ¤ ¦ ¤ F 2 ¦ ¤ ¦ ¤ 2 ¢ nb (3.57) (3. This dependence on ∆x 2 is very restrictive in practice. This is also true when steady state is reached through time marching.51. It requires that the forward time step be limited by the square of the mesh size.. this restriction can be shown . We can avoid this by requiring a 0 ∑nb anb . and is frequently used in CFD practice. The explicit scheme corresponds to the assumption that φ P prevails over the entire time step. However. We will see later in the chapter that the explicit scheme has a truncation error of O ∆t . two. This type of scheme is very simple and convenient. It requires us to take smaller and smaller time steps as our mesh is refined. and constant properties. 3. F ∆t 2 1 in Equation 3.2.2 The Fully-Implicit Scheme nb 48 £ £ ¢ aP φP ∑ anbφnb b ¢ The fully-implicit scheme is obtained by setting f we obtain the following discrete equation for φ P .and three-dimensional cases to be.58) (3. In this limit. for one-. 5.3. we see that the discrete equation for steady state is recovered. we see that an increase in φ at the previous time instant can cause P a decrease in φ at the current instant. respectively ∆t ρ ∆x 2Γ ρ ∆x 4Γ ρ ∆x 6Γ 2 ∆t and 2 This condition is sometimes called the von Neumann stability criterion in the literature. P For a uniform mesh.56) (3. i. We do not need to solve a set of linear algebraic equations to find φ P . Thus. we are assured that our solution upon reaching steady state is the same as that we would have obtained if we had solved a steady problem in the first place. the error reduces only linearly with time-step refinement. when 0 φP φP . 0 4.e. We see that the term multiplying 0 φP can become negative when a0 ∑ anb (3. Thus. This type of behavior is not possible with a parabolic partial differential equation. it suffers from a serious drawback. leading to very long computational times.

it is a first-order accurate scheme.with nb We note the following important points about the implicit scheme: 1. we recover the discrete algebraic set governing steady diffusion. In the absence of source terms. However. a P ∑nb anb a0 . 49 £ £ ¥ ¢ ¢ b SC ∆ £ c¥ © ¢ aP ¢ a0 P ¢ aS ¥ ¦ ¤ ¢ aN ¦ ¤ ¢ aW ¦ ¤ ¢ aE Γe ∆y δx e Γw ∆y δx w Γn ∆x δy n Γs ∆x δy s ρ∆ ∆t ∑ anb ¦ ¤ SP ∆ a0 P (3. physical plausibility does not imply accuracy – it is possible to get plausible but inaccurate answers if our time steps are too big. φP φP . We can take as big a time step as we wish without getting an unrealistic φ P . 5. The fully-implicit scheme corresponds to assuming that φ P prevails over the entire time step... The solution at time t ∆t requires the solution of a set of algebraic equations. Though the coefficients it produces have useful properties. We will see later in this chapter that the truncation error of the fully-implicit scheme is O ∆t . the Scarborough criterion is satisfied. 4. Because of this property. There is no time step restriction on the fully-implicit scheme. Also. This is in keeping with the behavior of canonical parabolic partial differential equation. 0 i. We may consider 0 φP to be the time neighbor of φ P . if we reach steady state by time marching.e. i. as ∆t erning steady state diffusion.60) ¦ ¤ ¢ . As with the explicit scheme. the rate of error reduction with time step is rather slow. we P are guaranteed that φ P is bounded by the values of its spatial neighbors at t ∆t and by the value at point P at the previous time. Also. ∞. we recover the discrete equations gov3.e. 6. £ 2.

any value of f different from one will have this property. 2.61) B © 2 . A typical control volume is shown in Figure 3. The Crank-Nicholson scheme essentially makes a linear assumption about the variation of φP with time between t and t ∆t. Let us consider two-dimensional polar geometries next. The control volume is located in the r θ plane and is bounded by surfaces of constant r and θ . 50 ¢ f¥ ¥  ¦ ¦ C¤ ¤ £ ¢ b 0 5 SC 0 SC 0 0 SP φP ∆ £ e¥ £!¦ £ ¤  B B © B ¢ aP ¢ a0 P ¢ aS ¥ ¦ ¤ ¢ aN ¦ ¤ ¢ aW ¦ ¤ ¢ aE Γe ∆y δx e Γw ∆y δx w Γn ∆x δy n Γs ∆x δy s ρ∆ ∆t 0 5 ∑ anb 0 5SP ∆ a0 P (3. our B  0 0 5 ∑ anb φP (3. We will see later in this chapter that though this leads to a possibility of negative coefficients for large time steps. the error in the our solutions can be reduced more rapidly with time-step refinement than the other schemes we have encountered thus far. leading to the P possibility of unphysical solutions. The volume of the control volume is ∆ r P ∆θ ∆r. The grid point P is located at the cell centroid. 3. it may be used to describe diffusive transport in other coordinate systems as well. For a0 0 5 ∑nb anb the term multiplying φ P becomes negative. With this value of f .1 is written in vector form.3 The Crank-Nicholson Scheme nb nb with nb We note the following about the Crank-Nicholson scheme: 0 1. Indeed much of our derivation thus far can be applied with little change to other systems. the scheme has a truncation error of O ∆t 2 . Consequently.4 Diffusion in Polar Geometries Since Equation 3.3.3.3.62) b B © d£ £  a B £ ¦ ¤ ¢ aP φP ∑ anb 0 5φnb 0 0 5φnb b a0 P B ¢ The Crank-Nicholson Scheme is obtained by setting f discrete equation becomes 0 5. if used with care. Indeed.

We also assume steady diffusion.1 over the control volume as before.63) (3. so that all transport is confined to the r θ plane.6: e w n s The face area vectors are given by We recall that the diffusive flux J is given by For polar geometries the gradient operator is given by ∇ 51 £ ∂ er ∂r © ¢ J © ¢ ¢ An As rn ∆θ er rs ∆θ er Γ∇φ 1 ∂ e r ∂θ θ   © ¢ ¢ Ae Aw ∆r eθ e ∆r eθ w ¥ J A J A J A J A S∆ © ¢ ¦ % ¤ £ ¦ % ¤ £ ¦ % ¤ £ ¦ % ¤ ¢ ¢ ) (3. though the unsteady counterpart is easily derived. Integrating Equation 3.δθw N δ rn n P W w δ rs s S ∆θ e r e E δθe ∆r e θ Figure 3.3: Control Volume in Polar Geometry We assume ∂ φ ∂ x 0.64) (3.65) (3.66) . and applying the divergence theorem yields Equation 3.

Thus the fluxes on the faces are given by Assuming that φ varies linearly between grid points yields The source term may be written as Collecting terms.70) (3.67) (3.71) .69) b (3. we may write the discrete equation for the cell P as where aE We note the following about the above discretization: 52 ¥ © £ ¢ ¢ aP b ¢ aS ¥ £ £ ¦ ¤ ¢ aN ¦ ¤ ¢ aW Γe ∆r re δ θ e Γw ∆r rw δ θ w Γn rn ∆θ δr n Γs rs ∆θ δr s aE aW aN SC ∆ aS SP ∆ £ £ £ ¦ ¤ ¦ ¤ £ ¢ ¢ aP φP aE φE aW φW ¥ ¦ £ ¤ SC ¢ J s As © ¢ J n An ¢ J w Aw SP φP ∆ aN φN ¦ ¤ © ¦ ¤ © ¦ ¤ © © ¢ J e Ae φE φP re δ θ e φ φW Γw ∆r P rw δ θ w φP φ Γn rn ∆θ N δr n φP φS Γs rs ∆θ δr s ¦ ¤ © Γe ∆r   ¢ J s As aS φS   © ¢ J n An   ¢ J w Aw   © ¢ J e Ae 1 ∂φ re ∂ θ e 1 ∂φ Γw ∆r rw ∂ θ w ∂φ Γn rn ∆θ ∂r n ∂φ Γs rs ∆θ ∂r s Γe ∆r % % % % % % % % (3.68) (3.

We assume steady conduction. Because the control volume faces are aligned with the coordinate directions. The polar coordinate system is orthogonal.. for example). The face area vectors are given by Aw An For axisymmetric geometries the gradient operator is given by 53   ¢ J s As   © ¢ J n An   ¢ J w Aw   © ¢ J e Ae ∂φ ∂x e ∂φ Γw rw ∆r ∂x w ∂φ Γn rn ∆x ∂r n ∂φ Γs rs ∆x ∂r s Γe re ∆r £ ∂ er ∂r Thus the fluxes on the faces are given by ¢ ∇ © ¢ As © ¢ ¢ ¢ Ae re ∆r i rw ∆r i rn ∆x er rs ∆x er (3.72) ∂ i ∂x (3. for example) is perpendicular the face (e. The integration of the conservation equation over the control volume and the application of the divergence theorem results in a control volume balance equation.e. and is located in the r x plane. 3.4. the line joining the cell centroids (P and E. e r and eθ are always perpendicular to each other. Regardless of the shape of the control volume. Since the problem is axisymmetric. 2. A typical control volume is shown in Figure 3.e. As a result. i. 3. The only differences are in the form of the face area vectors and the gradient operator for the coordinate system.73) (3. i. the flux normal to the face can be written purely in terms of the cell centroid φ values for the two cells sharing the face. The latter manifests itself in the expressions for the distances between grid points. the basic process is the same. The volume of the control volume is ∆ rP ∆r∆x.5 Diffusion in Axisymmetric Geometries A similar procedure can be used to derive the discrete equation for axisymmetric geometries.. We will see in the next chapter that additional terms appear when the mesh is non-orthogonal. when the line joining the cell centroids is not perpendicular to the face. ∂ φ ∂ θ 0. The grid point P is located at the cell centroid.74) ¢ ) © % % % % ¢ W¥ .1. regardless of the shape of the control volume.

76) b (3.4: Control Volume in Axisymmetric Geometry Assuming that φ varies linearly between grid points yields The source term may be written as Collecting terms. we may write the discrete equation for the cell P as aP φP aE φE aW φW 54 aN φN aS φS £ £ ¥ ¦ £ £ ¤ SC ¢ J s As SP φP ∆ © ¢ J n An ¢ £ J w Aw © ¢ J e Ae φE φP δx e φP φW Γw rw ∆r δx w φN φP Γn rn ∆x δr n φ φS Γs rs ∆x P δr s ¦ ¤ © ¦ ¤ © ¦ ¤ © ¦ ¤ © Γe re ∆r % % % % (3.N n W w δr P e δr n E ∆r s s S ∆x er i r x Figure 3.75) (3.77) ¢ .

Let us assume locally one-dimensional diffusion. we may write φE φP Je (3. this is a perfectly adequate interpolation.1 Interpolation of Γ We notice in our discretization that the diffusion flux is evaluated at the face of the control volume. Referring to the notation in Figure 3. When φ is used to represent energy or temperature.80) (3. 3. As a result.81) 0 5∆xP ΓP 0 5∆xE ΓE Thus.where 3. We deal with these below. step jumps in Γ may be encountered at conjugate boundaries. we must find a way to interpolate Γ to the face. an equivalent interface diffusion coefficient may be defined as 55 B £ B ¢ δ xe Γe 0 5∆xP ΓP 0 5∆xE ΓE ) H¦ ¦ ¤ ¢ B ¦ © ¤ £ B £ H¦ ) ¦ ¤ © ¤ B ¤ © ¢ ¢ ¢ b SC ∆ 0 5∆xE δx e ¥ © £ ¢ aP ¢ aS ¥ £ £ ¦ ¤ ¢ aN ¦ ¤ ¢ aW ¢ aE Γe re ∆r δx e Γw rw ∆r δx w Γn rn ∆x δr n Γs rs ∆x δr s aE aW ¦ ¤ ¦ ¤ aN aS SP ∆ (3. Since we store Γ at cell centroids.5. Let J e be the magnitude of the flux vector J e .82) .6. we must specify the face value of the diffusion coefficient Γ. It is useful to devise an interpolation procedure which accounts for these jumps. Our desire is to represent the interface flux correctly. it is possible to simple interpolate Γ linearly as: Γe fe ΓP 1 fe ΓE (3. In this limit.79) where fe As long as Γe is smoothly varying.78) (3.6 Finishing Touches A few issues remain before we have truly finished discretizing our diffusion equation.

nothing special need be done to treat conjugate interfaces. We may write Γe as ΓP Equation 3. with different diffusion coefficients stored at cell centroids.5: Diffusion Transport at Conjugate Boundaries The term δ xe Γe may be seen as a resistance to the diffusion transfer between P and E. corresponding to a distance of 0 5∆x E . the face e lies midway between P and E. we get Γe 2ΓE .84) . This is as expected since the high-diffusion coefficient region does not offer any resistance.δx e P J e E e ∆x P ∆ xE Figure 3. and the effective resistance is that offered by the cell E. It is important to realize that the use of harmonic mean interpolation for discontinuous diffusion coefficients is exact only for one-dimensional diffusion. i. the discontinuity in temperature gradient at the conjugate interface is correctly captured.83) (3. In the limit ΓP ΓE . The properties of this interpolation may be better understood if we consider the case f e 0 5. We simply treat solid and fluid cells as a part of the same domain.e. In this case. Nevertheless.. With harmonic-mean interpolation. With this type of interpolation. its use for multi-dimensional situations has an important advantage.83 represents a harmonic mean interpolation for Γ. 56 B £ ¢ Γe 2ΓP ΓE ΓP ΓE B ¢  £  © g¢ Γe 1 fe fe ΓE S ¢ h ) 1 (3.

for example. However. SC and SP are evaluated using prevailing values of φ . the resulting algebraic set is also non-linear. In radiative heat transfer in participating media. the coefficients a P . resulting in a negative S P . 57 i   ¢ SP i  ©i ¢ SC S ∂S ∂φ ¦i © ¤ i  i i  ∂S ∂φ i £  3£ i ¢ ¢ S SC SP φ (3. For most problems of interest to us. We write a Taylor series expansion for S about its prevailing value Sφ : S ∂S S S φ φ (3. we often employ under-relaxation. we may get large oscillations in the temperature computed during the first few iterations. In this method. From a numerical viewpoint. The source term S may also be a function of φ . For example.3 Under-Relaxation When using iterative methods for obtaining solutions or when iterating to resolve nonlinearities. this type of dependence is not always guaranteed. in diffusion problems. We said previously that the source term S could be written in the form We now examine how this can be done when S is a non-linear function of φ . the source term in the energy equation contains fourth powers of the temperature. and allows us to satisfy the Scarborough criterion. In an explosion or a fire. Let the prevailing value of φ be called φ . Here.87) . ∂ S ∂ φ is negative. it is frequently necessary to control the rate at which variables are changing during iterations. They are updated as φ is updated by iteration. There are many ways to treat non-linearities.2 Source Linearization and Treatment of Non-Linearity Our goal is to reduce our differential equation to a set of algebraic equations in the discrete values of φ .85) 4 ) i q¦ ) ¤ ¦ pi ¤ 8i ¢ φ (3.3. When the scalar transport is non-linear. the diffusion coefficient may be a function of φ . In such cases.6. This ensures that the source tends to decrease as φ increases. It aids in the convergence of iterative solution techniques.6. and increases the temperature further. a negative SP makes aP ∑nb anb in our discretization.86) ∂φ so that Here. making it difficult for the iteration to proceed. anb . for example. Non-linearity can arise from a number of different sources. we will treat non-linearities through Picard iteration. for example. 3. (The counter-measure is provided by the fact that the fuel is eventually consumed and the fire burns out). such as in the case of temperature-dependent thermal conductivity. and our initial guess is far from the solution. ∂ S ∂ φ is the gradient evaluated at the prevailing value φ . This is the value that exists at the current iteration. the application of a high temperature (the lighting of a match) causes energy to be released. When we have a strong non-linearity in a temperature source term. providing a stabilizing effect.

Let the current iterate of φ be φ P . we expect to compute a value of φP of ∑nb anb φnb b φP (3.89 implies. With α 1. the original discrete equation is recovered. The change in φP from one iteration to the next is given by We wish to make φP change only by a fraction α of this change. A low value keeps the solution close to the initial guess. We know that φP satisfies nb so that after the system has been solved for the current iteration. Thus. This allows us to satisfy the Scarborough criterion. 4. want φ P to change as much as Equation 3.92) F F . however. when φ P φP . 58 i i ¢ ¦ H¦ © C¤ ) ¤ i © £ £ 4 ) ) 4 ¢ aP φ α P ∑ anbφnb  £i ¢ φP φP α b 1  i © £ ∑nb anb φnb aP i © £ ∑nb anb φnb aP b £ £ ¢ aP φP ¢ i ∑ anb φnb b (3. we will for the most part be using α 1. 3. 2. A value close to unity allows the solution to move quickly towards convergence.92: 1. we may write nb α We note the following about Equation 3. Thus Collecting terms. on how strong the non-linearities are. but keeps the solution from diverging. The terms a P α and 1 α α a p φP represent the effect of the unsteady terms. on grid size and so on. When the iterations converge to a solution. So we are assured that under-relaxation is only a change in the path to solution. but may be more prone to divergence.88) φP (3. Though over-relaxation (α 1) is a possibility.e.89) aP We do not. i.91) α aP φP (3.. we are assured that a P α ∑nb anb . We use intuition and experience in choosing an appropriate value. and not in the discretization itself.90) b φP (3. The initial guess acts as the initial condition. The optimum value of α depends strongly on the nature of the system of equations we are solving. We note the similarity of under-relaxation to time-stepping. both under-relaxed and un-underrelaxed equations yield the same final solution.

We expand φ x as P P 59 £  £  £   r¦ © x xP © © φ x φP  ¦  ¦ x xP 2! x xP 3! O ∆x P  ¦ ¤ dφ dx 2 d 2φ dx2 3 d3φ dx3 ¦ ¤ H¦ ) © ¦ ¤ ¤ ¥ ¦ ¤ £ ¤ ¦ ) ¤ ¤ ¥ ¦ ¤ ¤ £ ¢ X¦ ¤ 4 (3. The source term S∆ was written as SC SP φP ∆ . we shall use the simple Gauss-Seidel scheme to solve our equation set. We have seen that our diffusion equation can be discretized to yield coefficients that guarantee physical plausibility for the orthogonal meshes we have considered here. and far better iteration schemes exist. Thus d φ dx e was written as φE φP δ x e .93) . we will see in the next chapter that it cannot usually be obtained when meshes are non-orthogonal or unstructured. We will consider a one-dimensional control volume and a uniform grid. We have thus far not addressed the issue of solving the discretization equations.1 Spatial Truncation Error In coming up with our spatial approximations we made the following assumptions: 1. our discretized equation set is ready for solution. The gradient at the face was computed by assuming that φ varies linearly between cell centroids. 3.i. For the moment. These will be covered in a later chapter.e. the mean flux through the face e was represented by the face centroid value.8. for example) was represented by the face centroid value. Item 3 involves an approximation to the face gradient.6 and the function φ x in the control volume. This is admittedly slow for large meshes. This property is very useful in a numerical scheme. The face flux (J e .. 3. However. That is. 2. Mean Value Approximation Consider the control volume in Figure 3.7 Discussion At this point.3.8 Truncation Error We now examine the various profile assumptions we have made in the course of discretizing our diffusion equation to quantify the truncation error of our finite volume scheme. Items 1 and 2 essentially involve the same approximation: that of representing the mean value of a variable by its centroid value. Let us examine each of these approximations in turn. 3. the cell centroid value φP was used to represent the mean φ value in the cell.

96) (3. or indeed to any variable being represented by its centroid value. Equation 3.95 may be written as xw Dividing through by ∆x we get xw Thus. If φ x is linear. we see that the centroid value φ P represents the mean value with a truncation error of O ∆x 2 .93 over the control volume.6. For a constant φ . Gradient Approximation e e O ∆x ∆x 2 4 e e O ∆x 4 Subtracting the second equation from the first and dividing by ∆x yields ∆x O ∆x e 60  ¦ ¤ £ © ¢  dφ dx φE φP 2  φP φe dφ dx ∆x 8 2 d2φ dx2 ∆x 3 48 d3φ dx3  φE φe ∆x 2 dφ dx ∆x 8 2 d2φ dx2 ∆x 3 48 d3φ dx3 e e (3. we have xw xe P xw so that xw O ∆x 4 For a uniform mesh.99) © Let us now examine the truncation error in representing the gradient d φ dx φP δ x e .Integrating Equation 3.95) (3. all derivatives of order higher than d φ dx are zero. Referring to Figure 3. all derivatives are zero. φ φ P is true exactly.97) . For these two cases. The same analysis can be applied to the face flux J e .98) (3. we write: e as φE ¤ ¦ ) ¤ ¢ ¦ ¤ ©   ¦ ¤  ¦ £  ¤ £  ¦ £   ¤ ©  ¢ ¦ ¤ £  ¦ ¤ £ ¢  ¦ £   £ ¤ ) A  ¢ φ 1 ∆x φ x dx ¢ ¦ ¤ xe φP O ∆x  ¦ ¤ £  φ x dx £ ¦ ¤ ¢ ¦ ¤ xe ∆x φP 1 24 ∆x 3 O ∆x P 2  ¦ ¤ d2φ dx2    ¦ 1 6 xe xP 3 xw xP 3 d2φ dx2 P 4    ¦ © © ¦   ¦ ¤ © ¢ φ x dx ∆x φP 1 2 xe xP 2 ¤  ¦ ¤ £ © © ¦ © ¤ ¤ £ £ ¦ ¤ ¦ ¤ xe xw £ x O ∆x xP 2  ¦ ¤ 4 xw 2 P xw d φ dx2 xP 2 dx 2! ¦ © A  ¦ © A  ¤ d£  ¤ A  £ A ¢ φ x dx φP dx ¤ ¦ ¤ xe xe dφ dx xe x xP dx (3.94) ¦ ¦ H¤ ¤ A A ¦ ¤ H¦ ) dφ dx P (3.

The spatial assumptions are as described above. Let us examine the truncation error implicit in item 3. ∆t are assumed to prevail over the time ¦ ¦ C¤ ¤ ¦ ¤ ) ¦ H¤ ¤ A ¦ ¤ ¦ ¤ ¦ C¤ ¤ ¦ ¤ C¦ C¤ ) ¦ ¦ ¦ C¦¤ ¤ C¤ ¤ ¦ ¦ H¤ ¤ (3. We see that all the approximations in a steady diffusion equation are O ∆x 2 . 3. The flux and source terms from time t step ∆t.6: Uniform Arrangement of Control Volumes Thus the assumption that φ varies linearly between grid points leads to a truncation error of O ∆x 2 in d φ dx. The first assumption is equivalent to the mean value assumption analyzed above and engenders a spatial error of O ∆x 2 . leaving a formal truncation error of O ∆x on d φ dx. The gradient approximations is O ∆x 2 only for uniform meshes. In effect.2 Temporal Truncation Error Let us consider the fully-implicit scheme.100) .8. So the discretization scheme has a truncation error of O ∆x 2 .∆x W w P e E ∆x ∆x Figure 3. we wish to evaluate a term of the type S t dt 61 t0 ¦¤ t1 ¦ ¦ C¤ ¤ £ 3. The mean-value approximation is O ∆x 2 even for a non-uniform mesh. 0 P in the unsteady term are assumed to 2. We have already seen that the other spatial assumptions result in a truncation error of O ∆x 2 . the O ∆x 2 terms in the Taylor series expansion do not cancel upon subtraction. For non-uniform meshes. The profile assumptions made in discretizing the unsteady diffusion equation using this scheme are 1. The cell centroid values ρφ 1 and ρφ P represent the average value for the cell.

. we perform a von Neumann stability analysis. we may want to determine whether taking successive time steps cause the errors in the solution to grow. for an unsteady heat conduction problem. from t 0 to t1 . ¦ ¤ £ ¦ ¦ C¤ ¤   £  © ¢ ¢ ¦¤ t1 S S1 dS dt O ∆t  ¦ ¤  £ S t dt ¢ ¦¤ t1 S1 ∆t dS dt t1 t t0 t1 dt O ∆t 1 ∆t 2  ¦ ¤ £  ©  A  1  A  3£ St S1 t t1 £  © dS dt t t1 2 O ∆t  ¦ ¤ 3 3 2  3£  ©   1 d2S dt 2 1  2 A ¢ (¦ ¤ (3. For simplicity. The discretized diffusion equation may be written as: and ¢ aP ¢ a0 P ¢ aW 62 ¦ ¤ ¢ aE Γe δx e Γw δx w ρ ∆x ∆t a0 P  © © ¦ ¤ £ ¢ aP φP 0 aE φE 0 aW φW a0 P aE 0 aW φP (3.104) (3. For example.105) ¦ ¤ Thus the temporal truncation error of the fully implicit scheme is O ∆t . We may consider any time-stepping scheme to be an iterative scheme.103) . if one exists. its value at t1 . we get t0 Integrating and dividing by ∆t we get 1 ∆t S t dt t0 3.e. i.102) (3. Stability can be understood in two ways. we ask whether a particular marching scheme is stable..e. a way of obtaining a steady state solution. i.Expanding S(t) about S 1 . We state without proof that the truncation error of the explicit scheme is also O ∆t and that of the Crank-Nicholson scheme is O ∆t 2 . For unsteady problems. For steady state problems. we wish to analyze a particular iterative method for stability.e. we wish to determine whether the path to solution is stable. i. Let us consider the stability of the explicit scheme. This similarity between iteration and time-stepping is not surprising. let us consider a one-dimensional case with constant properties and no source term.9 Stability Analysis In this section.101) (3. we have Integrating over the time step ∆t.

112) rather than the summation in Equation 3. we may exploit the principle of superposition. obtained using a computer with infinite precision. we must contend with round-off error. Therefore. Since Φ P is the exact solution. our error is damped in the process of time marching. and therefore. Let this finite-precision solution be given by φ . and λ m is given by L is the width of the domain.104.104. and the un-superscripted values represent the values at time t ∆t. the solution is oscillatory in time. Since the diffusion equation for constant Γ and zero S is linear. If σ m is complex.107 cancel.113) . Thus. it satisfies Equation 3. leaving 0 0 0 (3. Equation 3. and if σ m is real and less than zero.112 into Equation 3. and the time dependence by eσmt .110) (3.109) (3. If σm is real and greater than zero .111) (3.104 yields As before.107) (3.106) We ask the following question: Will the explicit scheme cause our error ε to grow. we get 63 © a0 P aE aW eσmt eiλm x t S s  © £t ¨s   £ ¢ t ¨s aP eσm t ∆t eiλm x eσmt aE eiλm ¦ ε x t ∆t ε xt IBDBC   ¢ B ¦ £ ¤ ¤  ¢ ¢ λm mπ L m 012 DBIBH   ¢ B ε xt ∑ eσmt eiλm x m 012 M M x ∆x aW eiλm x ∆x   © £ © © ©  £ £ £ £ ¢ $¦  ¤ ¢ £ ¢ 8¦ aP ΦP εP aE Φ0 E 0 εE 0 aW ΦW 0 εW a0 P aE aW £  Φ0 P   £ © ¢   £ ¤ 0 εP (3. and our scheme is unstable. However. our error grows with time step. If it is less than one. and our scheme is stable. By exact we mean that it is the solution to the discrete equation. the Φ and ε terms superscripted 0 represent the values at the time step t.108.106 into Equation 3.109. the Φ terms in Equation 3. all real computers available to us have finite precision.109 essentially presents the spatial dependence of the error by the sum of periodic functions e iλm x . or will the process of time-stepping keep the error within bounds? Substituting Equation 3. we can examine the stability consequences of a single error term ε eσmt eiλm x (3.Let Φ represent the exact solution to Equation 3. the error grows with time.108) aP εP aE εE aW εW a0 aE aW εP P Let us expand the error ε in an infinite series m where σm may be either real or complex. The error ε is given by ε φ Φ (3. Substituting Equation 3. We wish to find the amplification factor If the amplification factor is greater than one. the error is damped.

121) .123) 2Γ We recognize this criterion to be the same as Equation 3. If.120) (3.Dividing through by a P eσmt eiλm x we get 2 we get eσm ∆t 1 4Γ∆t β sin2 2 ρ ∆x 2 We recognize that the amplification factor is ε x t ∆t ε xt We require that or If 1 4Γ∆t ρ ∆x 2 0. Thus 1 2Γ∆t ρ ∆x 2 (3.116) (3.117) (3.115) © © a0 P aE aP aW 4Γ∆t ρ ∆x 2 S £ £ F u¦ t s ¢ eσm ∆t aE iλm ∆x e aP aW e aP iλm ∆x (3. we require This is always guaranteed since all terms are positive.119) (3. Using an error expansion of the type (3.122) ρ ∆x 2 or ρ ∆x 2 ∆t (3. 1 4Γ∆t 0.114) 4sin2 β 2 (3.124) ε xyt eσmt eiλm x eiλn y 64 © ¤ F ¦ ¤ © T T F ¦ ¦ £ ¤ ¤ T T ¦ ¤ © ¢ ¢ ¦ ¦ £ ¤ ¤ eσm ∆t 1 ε x t ∆t ε xt 1 4Γ∆t ρ ∆x 2 ¦ ¤ F F ¦ ¤ E ¦ ¤ 4Γ∆t ρ ∆x 2 0 © ¢ ¦ ¤ © ¢ ¢ 0¦   ¤ ¢ S £ 4 ¦ t s © ¤ ¢ Using β λm ∆x and the identities eiλm ∆x e iλm ∆x S £ e 2 cos β  ¦ ¤ ©  £   ¦ ¤ ¢ eσm ∆t Γ∆t ρ ∆x eiλm ∆x iλm ∆x 2 1 1 ) ¢ ) ¢ ¢ For a uniform mesh a E aW Γ ∆x and a0 P ρ ∆x ∆t.56.118) (3. we require ρ ∆x 2 4Γ∆t 2 (3. on the other hand.

using a similar analysis. realizing that the coupled nonlinear equations we really want to solve will probably have much stringent restrictions. We have also seen how to handle non-linearities. and that if we use the fully-implicit scheme. which the von Neumann stability analysis classifies as unconditionally stable. The von Neumann analysis yields a time-step limitation required to keep round-off errors bounded. that the fully-implicit and Crank-Nicholson schemes are unconditionally stable. the von Neumann stability analysis tells us that the oscillations in our solution will remain bounded. In this case. we will address the issue of mesh non-orthogonality and understand the resulting complications. For uniform meshes. This happens in the case of the Crank-Nicholson scheme. It is possible to get bounded but unphysical solutions.we may derive an equivalent criterion for two-dimensional uniform meshes (∆x ∆y) as ρ ∆x 2 ∆t (3. it is possible to get unphysical results. polar and axisymmetric geometries. Von Neumann stability analysis is a classic tool for analyzing the stability of linear problems. It is also possible to show. We have also see how to conduct a stability analysis for the explicit scheme as applied to the diffusion equation. we see right away that it would be substantially more complicated to do the above analysis if Γ were a function of φ . For these. We have seen that our discretization guarantees physically plausible solutions for both steady and unsteady problems. Though the von Neumann stability analysis and our heuristic requirement of positive coefficients have yielded the same criterion in the case of the explicit scheme. or if we had non-linear source terms. we must rely on intuition and experience for guidance. we know that for ρ ∆x ∆t 0 5 ∑nb anb . we have shown that our spatial discretization is formally second-order accurate. It becomes very difficult to use when we solve coupled non-linear equations such as the Navier-Stokes equations. In the next chapter. 65 ¢ B 2 ) ¦ ¤ F . we use von Neumann stability analysis to give us guidance on the baseline behavior of idealized systems. our temporal discretization is first-order accurate. we should not conclude that the two will always yield identical results. However. but it cannot guarantee that they will be physically plausible. However. In practice.10 Closure In this chapter. 3.125) 4Γ A similar analysis may also be done to obtain the criterion for three-dimensional situations. we have completed the discretization of the diffusion equation on regular orthogonal meshes for Cartesian.

66 .

we saw how to discretize the diffusion equation for regular (orthogonal) meshes composed of quadrilaterals. Consider the steady diffusion equation: where J We focus on the cell C0. We shall consider the mesh to be orthogonal if the line joining the centroids of adjacent cells is orthogonal to the shared face f . We will also address the special issues associated with the computation of gradients on unstructured meshes. 4. In this chapter. both structured and unstructured. equilateral triangles. we address non-orthogonal meshes. Regardless of the shape of the cells.1 Diffusion on Orthogonal Meshes Let us consider a mesh consisting of convex polyhedra. as shown in Figure 4.1) (4. A detail of the cells C0 and C1 is shown in Figure 4.Chapter 4 The Diffusion Equation: A Closer Look In the last chapter.1. any face f in the mesh is shared by only two neighbor cells. To discretize Equation 4.1.2. we get A ∆ 0 67 ¥ V A ¢ J dA Sd ¥ V A W¥ % ¢ ¢ % ∇ J S (4.3) ∆ 0 ∆ 0 Applying the divergence theorem.4) . and particularly. We will see that non-orthogonality leads to extra terms in our discrete equations which destroy some of the properties we had particularly prized in our discretization scheme. This is guaranteed for the equilateral triangular mesh in the figure. we integrate it over the control volume C0 as before: ∇ Jd Sd (4.2) Γ∇φ © ¢ % V A A (4.

1: Orthogonal Mesh y Af ∆ξ x C0 C1 eη e ξ Figure 4.2: Arrangement of Cells in Orthogonal Mesh ef fac 68 .f C0 C1 Figure 4.

10) .5) (4.2. let us make a linear profile assumption for the variation of φ ξ between the centroids of cells C0 and C1. We see that if the mesh is orthogonal. Consider the coordinate directions ξ and η in Figure 4. let us assume that S S C SP φ0 as before. The unit vector e ξ is aligned with the line joining the centroids. Further. the normal diffusion transport J f A f only depends on the gradient of φ in the coordinate direction ξ and not on η . Because the mesh is orthogonal. Thus f The summation in the first term is over all the faces of the control volume C0. as we saw in the previous chapter. as shown in Figure 4.6) ¢ % ) % (4. We realize that since cell centroid values of φ are available along the eξ direction. and φ 0 and φ1 are the discrete values of φ at the cell centroids. We must take an alternative approach.7) (4. We see from Figure 4. the unit vectors are perpendicular to each other. We may write the face flux vector J f in the coordinate system ξ η as The area vector A f may be written as Therefore We see that if the line joining the centroids is perpendicular to the face. Also. This is easy to arrange for a rectangular mesh. 69 © ¢ Jf Af Γf Af  φ1 φ0 ∆ξ ¦ ¤  ©   ) © ¢ Jf Af ¢ Af A f eξ Γf Af ∂φ ∂ξ f  £  © ¢ Jf Γf ∂φ e ∂ξ ξ ∂φ e ∂η η ©  © © ) % ¢ Jf Γ f ∇φ Γf f ∂φ i ∂x ∂φ j ∂y ¥  £  ¦ ¤ % ∑Jf Af SC SPφ0 ∆ 0 f £ ¢ £  ¢ (4. Thus where ∆ξ is the distance between the cell centroids. we need cell centroid values of φ which are suitably placed along the x and y axes.2 that such values are not available for the mesh under consideration.2.We now make a profile assumption. and A f is the area vector on the face f pointing outwards from cell C0.9) (4. it is easy for us to write ∂ φ ∂ ξ . As before. The unit vector e η is tangential to the face f . In order to evaluate ∂ φ ∂ x and ∂ φ ∂ y at the face f . We assume that J can be approximated by its value at the centroid of the face f .8) (4. the diffusion transport normal to the face f can be written purely in terms of values of φ at the centroids of the cells sharing the face.

The scheme is conservative because we use the conservation principle to derive the discrete equations. It is possible to solve the discrete equation set using the Gauss-Seidel iterative scheme. We are thus guaranteed that φ P is bounded by its face neighbors when S 0. Thus overall conservation is guaranteed.So far we have looked at the transport through a single face f . though it is usually difficult to generate orthogonal meshes without some type of structure. In the development above. We have not made any assumptions about mesh structure. a P ∑nb anb . 5. whatever profile assumptions are used to evaluate J f are used consistently for both cells C0 and C1. P. we get a wellbehaved set of discrete equations. The above development holds for three dimensional situations. M is the number of face neighbors. 3. 7. If the cell is a triangle. and M 3 in the above equation. All we have required is that the cell be a polyhedron and that line joining the cell centroids be orthogonal to the face. there are three face neighbors.5 and summing over all the faces of the cell C0 yields an equation of the form (4. Substituting Equation 4. the cell centroid may not fall inside the cell.10 into Equation 4. but these do not appear in the discretization. nb denotes the face neighbors of the cell under consideration.12) . It is worth noting here that J f should be thought of as belonging to the face f rather that to either cell C0 or C1. That is. We note the following: 1. It is necessary for the mesh to consist of convex polyhedra. As with our orthogonal rectangular mesh in the previous chapter. We need not make the assumption of two-dimensionality. 2. interpolation of Γ f and linearization of source terms may be carried over unchanged. Thus. which does not place any restrictions on the number of neighbors. 6. The cell P shares vertices with other cells. The face flux J f leaves one cell and enters the adjacent cell. 8.11) aP φP ∑ anb φnb b nb where ∆ξ nb In the above equations. In the absence of source terms. All the development from the previous chapter regarding unsteady flow. 70 ¢ ¢ ¥ ¢ b SC ∆ 0 ¥ © ¢ aP ∑ anb nb SP ∆ 0 DBIBH  ¢ B    ¢ ¢ anb Γf Af nb £ ¢ 12 M (4. 4. the “neighbor” cells are those which share faces with the cell under consideration. we have not used the fact that cell under consideration is a triangle. If the cells are not convex.

we consider the steady diffusion equation and focus on the cell C0. the flux at the face centroid. it is rarely possible to use orthogonal meshes in industrial geometries because of their complexity. We integrate the equation over the control volume C0 and apply the divergence theorem as before. with unstructured meshes.2 Non-Orthogonal Meshes In practice. As before. The area vector A f is given by A f Ax i Ay j (4. the procedure is the same as that for an orthogonal mesh. We consider this mesh to be nonorthogonal because the line joining the cell centroids C0 and C1 is not perpendicular to the face f . since the mesh is not 71 ¥  ) £ ¢ ) % ∑Jf Af £  ¢ ¢ % ∇ J S (4. prevails over the face f .b A f y e C0 ∆η η eξ C1 ∆ξ face f x a Figure 4.14) © . Assuming that J f .3: Non-Orthogonal Mesh 4.3.15) As before. Consider the cells C0 and C1 shown in Figure 4. However. The unit vector e η is tangential to the face. Our interest therefore lies in developing methods which can deal with non-orthogonal meshes. writing J f in terms of ∂ φ ∂ x and ∂ φ ∂ y is not useful since we do not have cell centroid values of φ along these directions. The unit vector e ξ is parallel to the line joining the centroids.13) SC SPφ0 ∆ 0 (4. Let us consider instead the coordinate system ξ η on the face f . we obtain: f Thus far. We will start by looking at general non-orthogonal meshes and derive expressions for structured meshes as a special case. and preferably.

As usual.16) f (4.21) . e ξ and eη are not orthogonal to each other.20) (4. we may write J f A f as In order to express ∂ φ ∂ x and ∂ φ ∂ y in terms of ξ and η . xξ denote ∂ x ∂ ξ and so on.orthogonal.18) (4. we get Therefore Furthermore. we may write The unit vectors e ξ and eη may be written as ¢ eη ¦ © ¤ £ ¦ © ¤ ¢ eξ xb 72 ¦ © © x1 ¤ £ ¦ ¦ © © ¦ ©¤ ¢ ¢ Ax Ay ¤ ¢ yη x 0 i y1 ∆ξ x a i yb ∆η © ¢ xη © ¢ yξ © ¢ xξ x1 x0 ∆ξ y1 y0 ∆ξ xb xa ∆η yb ya ∆η yb ya xb xa v Γf £ A x yξ A y xξ y0 j ya j (4.19) φξ f φη f (4.22)  b     © © a  ¤ © © ¢ Jf Af Γf ©v A x yη © ¢ v where ¢ φy xξ yη £v © ¢ φx φξ xη ©v φξ yη £ ) ¢ φη φx xη £ ¢ φξ φx xξ φy yξ φy yη φη yξ φη xξ xη yξ A y xη  £  ) © ¢ Jf Af % % % ) ) © Γf ∂φ Ax ∂x ∂φ Ay ∂y (4. Writing J f in terms of the ξ η coordinate system seems promising since we have cell centroid values aligned along the ξ direction. Solving for φ x and φy . we start be writing where φξ denotes ∂ φ ∂ ξ .17) (4.

30) .24) ∆η (4. Using the equations 4.28) (4. we shall consider only the φξ term. we define Af Af © ¢   φξ φ1 φ0 ∆ξ % A f eξ A f eξ f f  £   % % © ¢ Jf Af Γf φξ Γf eξ eη φη  % % Af Af % © © © ¢ ¢ ¢ b % v φη φη φη ∆η φη 2 ξ e eη A f eξ Af Af A f eξ eξ eη Af Af f ) ¦x © © £ A x yξ A y xξ y1 y0 yb ya x1 x0 xb A f eξ ∆η ¤¦ % % % % ¦ ¤ % ) % w £ © ¤¦ © ¤ ¤ !¦ ¢  ¢  φξ ©v A x yη A y xη φξ φξ A x yb ya A x xb xa A f eξ ∆η Af Af A eξ ) €yx¦ © ¤ © % % ) % ©¦ © w ¤ © © x1 x0 yb ya ∆ξ ∆η A f eξ © © xξ yη ¢ ∆η Af (4.21.20 may be written as The φη term in Equation 4. We recognize that Now. we may write f 73 © ∆ξ A f eξ £ % © ¢ Jf Af  % Therefore Γf Af Af φ1 φ0  % f A f eξ  Γf eξ eη φη  % % ¢  Furthermore.20 may be written as Collecting terms.25) xa ∆ξ (4.23) v % © ¢ ¢ ¢ v © a (4.26) (4. Assuming that φ varies linearly between cell centroids. we may write f We now need profile assumptions for φ .where ∆ξ is the distance between the centroids and ∆η is the distance between the vertices a and b. we may write xη yξ y1 y0 xb xa ∆ξ ∆η ∆η The φξ term in Equation 4. let us examine the Jacobian . For the moment.27) (4.29) (4.

For orthogonal meshes. there is no particular difficulty. Thus.2. In three dimensions. from Equation 4. For three-dimensional situations on structured meshes.4. the computation of the gradient ∂ φ ∂ η poses no particular problem. For unstructured meshes. with no unique mesh directions.8. or alternatively. the term A f A f A f eξ reduces to A f for an orthogonal mesh. In three dimensions. We should note however that the ξ direction is uniquely defined as the centroid-to-centroid direction. it not possible to define the η direction uniquely. we are assured that our formulation defaults to the right expression when the mesh is orthogonal. Therefore f is zero for orthogonal meshes.2 Secondary Gradient Calculation For structured meshes. the problem may be boiled down to either finding the φ a and φb by interpolation and thus finding ∂ φ ∂ η . Precisely how this is done will depend on whether our mesh is structured or unstructured.32) . 4. We call the term involving ∂ φ ∂ ξ the primary gradient or the primary diffusion term. however. The term f is called the secondary gradient or the secondary diffusion term. η and ζ . unlike for orthogonal meshes. Furthermore. again.4(a) consists of mesh lines of ξ c and η c which form the faces of the cell. For unstructured meshes.2. We must devise a method by which ∂ φ ∂ η can be computed on the face f . These values in turn may be interpolated from neighboring cell-centroid values. we write so that the secondary gradient term is given by Γ f ∇φ Af ∆ξ A f eξ 74 f f % ¦ ¤ %% £ % ¦ ¤ © © © ¢ %  © ¢ Jf Af ∆ξ A f eξ φ1 φ0 Γ f ∇φ f Af ∆ξ A f eξ Γf Af Af ∇φ f % ¦ ¤ %% £ % ¦ ¤  Γf Af Af Γf Af Af ∇φ eξ ∆ξ ¦ % ¤ q¦ % ) f eξ ∆ξ (4. the flux cannot be written in terms of ∂ φ ∂ ξ alone – an additional gradient. The face f is in general an n-sided polyhedron. resulting in secondary gradient terms involving ∂ φ ∂ η and ∂ φ ∂ ζ . These tangential gradients may be written in terms of values of φ at the points a. a cell is bounded by faces of constant ξ . finding ∂ φ ∂ η at the cells C0 and C1 and interpolating these values to the face f . and the two tangential directions η and ζ would have to be chosen arbitrarily. We see that. c and d shown in Figure 4.31) ) ) )  % ¤ ) %  ) ) ) ¢ % ) ¢ ) % ) (4. b. In two dimensions. it is possible to write ∂ φ ∂ η in terms of φ a and φb in two dimensions since the coordinate direction η can be uniquely defined. The secondary gradient term is a little problematic to compute since we do not have any cell centroid values of φ available in the η direction. The structured mesh shown in the x-y plane in Figure 4. ∂ φ ∂ η is involved.4(b). The gradient ∇φ may be decomposed in these three non-orthogonal directions. e ξ eη is zero since the line joining the centroids is perpendicular to the face.1 Discussion We have thus far derived an expression for the quantity J f A f for the face f .

33) (4. However. Thus the problem of computing the secondary gradient is reduced to the problem of computing the face gradient of φ . It is often more convenient to store ∇φ at the cells C0 and C1. we may find an average as ∇φ f The unstructured mesh formulation can of course be applied to structured meshes. its computation is addressed in a later section. It is possible to compute ∇φ f directly at the face using the methods we will present in a later section.4: Definition of Face Tangential Directions in (a) Two Dimensions and (b) Three Dimensions Equation 4. Assuming that the gradient of φ in each cell is a constant.32 writes the secondary gradient term as the difference of the total transport through the face f and the transport in the direction e ξ .η = constant b C0 C1 a ξ = constant c b ζ η ξ a d face f (a) (b) Figure 4.2.3 Discrete Equation for Non-Orthogonal Meshes The discretization procedure at the face f can be repeated for each of the faces of the cell C0. it is usually simpler and less expensive to exploit mesh structure when it exists.34) . 4. The resulting discrete equation may be written in the form nb 75 £ ¢ aP φP ∑ anbφnb £ ∇φ0 ∇φ1 2 b ¦ ¤ ¢ ¦ ¤ ¦ ¤ (4. Both terms require the face gradient ∇φ f .

where ∆ξ A f eξ SP

As before, nb denotes the cell neighbors of the cell under consideration, P. The quantities Γ f , eξ , ∆ξ , A f and f correspond to the face f shared by the cell P and the neighbor cell nb. We see that the primary terms result in a coefficient matrix which has the same structure as for orthogonal meshes. The above discretization ensures that a P ∑nb anb if S 0. However, we no longer have the guarantee that φ P is bounded by its cell neighbors. This is because the secondary gradient term, f , involves gradients of φ which must be evaluated from the cell centroid values by interpolation. As we will see later, this term can result in the possibility of spatial oscillations in the computed values of φ . Though the formulation has been done for steady diffusion, the methods for unsteady diffusion outlined in the previous chapter are readily applicable here. Similarly the methods for source term linearization and under-relaxation are also readily applicable. The treatment of interfaces with step jumps in Γ requires a modest change, which we leave as an exercise to the reader.

4.3 Boundary Conditions
Consider the cell C0 with the face b on the boundary, as shown in Figure 4.5. The cell value φ0 is stored at the centroid of the cell C0. As with regular meshes, we store a discrete value φb at the centroid of the boundary face b. The boundary area vector A b points outwards from the cell C0 as shown. The cell balance for cell C0 is given as before by (4.36) ∑ J f A f Jb Ab SC SP φ0 ∆ 0
f

Here the summation over f in the first term on the left hand side is over all the interior faces of cell C0, and the second term represents the transport of φ through the boundary face. We have seen how the interior fluxes are discretized. Let us now consider the boundary term J b Ab . The boundary transport term is written as

We define the direction ξ to be the direction connecting the cell centroid to the face centroid, as shown in Figure 4.5, and the direction η to be tangential to the boundary 76

© ¢ %

J b Ab

Γb ∇φ

b

Ab

¢

¥ 



% ¦ ¤

£  ¢ %

£ %



¢

b

¢

aP

∑ anb
nb

nb

0

SC ∆

0


nb

f

nb

IBDBC  ¢ B

¢

anb 

 © ¥  ‚¥% © b % a %

Γf Af Af

nb

12

M

(4.35)

%

¢

(4.37)

A d e η C0

b

b

e

ξ

∆ξ

b c

Figure 4.5: Boundary Control Volume for Non-Orthogonal Mesh face. Decomposing the flux J b in the ξ and η directions as before, we obtain

b

As before, we define the secondary diffusion term
b

We note that if eξ and eη are perpendicular to each other, b is zero. Thus, the total transport across the boundary face b is given by

As before we make a linear profile assumption for the variation of φ between points C0 and b. This yields

As with interior faces, we are faced with the question of how to compute φ η at the face b. For structured meshes, and two-dimensional unstructured meshes, we may use interpolation to obtain the vertex values φ c and φd in Figure 4.5. For three-dimensional unstructured meshes, however, the boundary face tangential directions are not uniquely 77

£

©

%

J b Ab

Γb Ab Ab φ ∆ξ b Ab eξ b

φ0



£   

%

%

¦ ¤ © ¢ %

© ¢ %

J b Ab

Γb

Ab Ab φξ Ab e ξ

b

 



%

%

Γf

Ab Ab e e φ Ab e ξ ξ η η

b

b

b 

% 

%

%

¢



© ¢ %

J b Ab

Γb

Γf

%

£   %%

Ab Ab φξ Ab e ξ

Ab Ab e e φ Ab e ξ ξ η η 

%

b

(4.38)

(4.39)

(4.40)

(4.41)

defined. Consequently, we write the boundary secondary gradient term as the difference of the total and primary terms:
b

Γb ∇φ

b

Ab

we may write the secondary gradient term at the boundary as
b

Γb ∇φ

0

Ab

We will see in a later section how the cell gradient ∇φ 0 is computed. Having seen how to discretize the boundary flux, we now turn to the application of boundary conditions. Dirichlet Boundary Condition At Dirichlet boundaries, we are given the value of φ b

Using φb given in Equation 4.41 and including J b Ab in the boundary cell balance yields a discrete equation of the following form:

nb

where ∆ξ A f eξ

0

nb

0

f

nb

nb

Here, nb denotes the interior cell neighbors of the cell under consideration, P. The quantities Γ f , eξ , ∆ξ , A f and f correspond to the face f shared by the cell P and the neighbor cell nb. In the a b term, eξ corresponds to the direction shown in Figure 4.5. As with interior cells, we see that the primary terms result in a coefficient matrix which has the same structure as for orthogonal meshes. The above discretization ensures that aP ∑nb anb if S 0. However, we no longer have the guarantee that φ P

78

© 

¢

¢

b

SC ∆

ab φb given



¢

aP

¢

ab

∑ anb

Γb Ab Ab ∆ξ b Ab eξ ab

nb

SP

DBIBH  ¢ B

¢

anb

 £   © ¥ ‚¥%  © £ % ¦ ¤ % b % a %

Γf Af Af

nb

£

¢

aP φP

∑ anb φnb

% 

¢

φb

φb given

¦ ¤ ¦ ¤ % ¦ ¤ %%

¦ ¤ ¢ ¦ ¤
∇φ
b

Further assuming that

∇φ

0

Γb ∆ξ

Ab Ab ∇φ b Ab e ξ

¦ ¤ % ¦ ¤ %%
b

¦ ¤ £ % ¦ ¤ ¦ ¤ £ % ¦ ¤

© ¢ © ¢

 

Γb ∆ξ

Ab Ab ∇φ b Ab e ξ

eξ ∆ξ

b

(4.42)

(4.43)

0

eξ ∆ξ

b

(4.44)

(4.45)

4 

b

(4.46)

12

M

b

(4.47)

49) dx P 2∆x This expression is usually referred to as the “central difference” approximation for the first derivative. For example. for example the grid shown in Fig. Equivalent discrete equations for Neumann and mixed boundary conditions may be derived starting with Equation 4. this term can cause spatial oscillations in the computed values of φ . Consider.41 and following the procedures in the previous chapter. a linear profile assumption for the variation of φ between cell centers results in the following expression for the derivative at the cell face ∆x f In the same manner we can write the derivative at a cell center using the values at the two adjacent cells. For simplicity. where we use central difference approximations to write the derivatives in the transformed 79 © © ¢ ƒƒ ƒƒ ¢ ƒ ƒƒ ∂φ ∂x ∂φ ∂y φE φW 2∆x φN φS 2∆y © © ƒ ƒƒ ¢ ƒ dφ dx φE φP (4. This is because the secondary gradient terms. we restrict the following development to equispaced grids.6. We leave this as an exercise for the reader. 4. velocity derivatives are required to compute the production term in turbulence models or to compute the strain rate for non-Newtonian viscosity models. we can compute the derivatives by applying the same principle along the respective coordinate directions. As we will see later. In this section. φE φW dφ (4.is bounded by its cell neighbors. for non-orthogonal grids we need to determine gradients of φ at the cell face centroids to compute the secondary diffusion term. f and b .4.48) (4.1 Structured Meshes For a one-dimensional problem. 4.50) (4. 4. involve gradients of φ which must be evaluated from the cell centroid values by interpolation.51)  ƒ ƒƒ ¢ ƒ ƒ  .4 Gradient Calculation As we saw in the previous section. Gradients are also required in many other cases. For Cartesian grids in multiple dimensions. Using the central difference approximation introduced earlier we can write P P The procedure is similar in case of general non-orthogonal structured grids. we will learn about techniques for evaluating gradients for different types of mesh topologies.

55) ∂η f ∆η For Cartesian grids.7 shows a non-orthogonal mesh in the x sponding transformed mesh in the ξ η plane. We write y plane and the corre- P P Knowing the cell gradients.55) is useful because it suggests one way of obtaining derivatives at faces for general unstructured grid where we no longer have 80 ¢ φa 4 £ £ £ φP φE φSE ƒ 2 ƒƒ © ƒƒ ƒ ƒ ƒƒ ¢ ƒ ƒ ƒƒ ¢ ƒ ∂φ ∂η £ ∂φ ∂η P © © ¢ ƒƒ ƒƒ ¢ ƒ ƒƒ ƒ ∂φ ∂ξ ∂φ ∂η φE φW 2∆ξ φN φS 2∆η ∂φ ∂η E φS © © (4.54) (4.N b W P a NE E ∆y S SE ∆x Figure 4. it is easy to show that the two approximations are equivalent if the nodal values are obtained by linear interpolation. for a uniform mesh f An alternative approach would be to write the face derivative in terms of the values at the nodes a and b φb φa ∂φ (4. Figure 4. we can compute the face value required in the secondary diffusion term (Equation 4.6: Arrangement of Cells in Cartesian Mesh coordinates. For an equispaced Cartesian grid this means that the nodal value φ a is The second interpretation (Equation 4.52) (4.56) .29) by averaging. For example.53) (4.

not just derivatives in the plane of the cell face. we assume that the gradient in the cell is constant. Therefore we need to seek other ways of calculating derivatives that are applicable for arbitrary grids. Thus.η = constant N W b P E ∆ξ S ∆η a SE NE W N b P a S NE E ∆η SE ξ = constant y η ∆ξ x ξ Figure 4. we can use Equation 4. Also. However.55 for the face f shown in Figure 4. To obtain a discrete version of Equation 4. This yields 81 A ¥ ¢ ∇φ 1 ∆ 0∑ f A f¥ ¢ V A ¥ ∇φ d A φ dA (4. This is because in 3D we no longer have unique directions in the plane of the face to use a finite-difference approximation.57) A φ dA f (4. as we commented earlier.58) . Gradient Theorem Approach One approach is suggested by the gradient theorem which states that for any closed volume ∆ 0 surrounded by surface A ∆ 0 where dA is the outward-pointing incremental area vector. The nodal values in this case are obtained by some averaging procedure over the surrounding cells. we make our usual round of profile assumptions.57. 4.7: Structured Mesh in (a) Physical Space and (b) Mapped Space orthogonal directions to apply the finite-difference approximation.3.2 Unstructured Meshes The method outlined above is applicable for arbitrary unstructured grids in two dimensions. extension to three dimensions is not straightforward.4. First. in many instances we need to know all three components of the derivative at cell centers.

8 we can write φ1 ∇φ1 ∆r1 (4.61) 2 This suggests an iterative approach for computing successively better approximations to the gradients. φf Least Squares Approach The idea here is to compute the gradient at a cell such that it reconstructs the solution in the neighborhood of the cell. While this practice involves the smallest possible stencil. we can compute the face average value using the gradients computed from the previous iteration and use these face values to compute new values of the gradients. it is not mandatory that we use the same control volume for computing the gradient that we use for applying the discrete conservation laws. During each iteration.60. so as to avoid undershoots and overshoots in the solution. We would like the value of φ computed at the centroid of cell C1 in Figure 4. the gradients used to reconstruct face values are also limited to the bounds dictated by suitable neighbor values. including non-conformal grids. φ f before we can use this formula. In addition. The simple approximation is to use the average of the two cells values sharing the face: (4. as we will see in the next chapter. Note that in applying the gradient theorem we used the cell around the point C0 as the integration volume.60) 2 The advantage of this approach is that it is applicable for arbitrary cell shapes. this increases the effective stencil with increasing iterations and can lead to oscillatory results. However.9 to be equal to φ 1 .59 and 4. In the next section we learn about the use of another approach that can use a bigger stencil. By assuming a locally linear variation of φ . The gradient resulting from the use of the cell as the integration volume involves values of φ only at the face neighbors and is not always the most optimal solution. specially in node-based discretization algorithms. therefore only one or two iterations are typically used. All the operations involved in this procedure are face-based just like the operations involved in the discretization of the transport equations and do not require any additional grid connectivity. Once we have obtained the derivative by using Equations 4. from Figure 4. this procedure is easily extended to three-dimensional cases. Thus we can write 1 φ A (4. we can improve on our initial approximation of the face average by reconstructing from the cell.59) ∇φ ∆ 0∑ f f f We still need to define the face value. consider cell C0. Thus. Other integration volumes are often used. In practice.Next. we approximate the integral over a cell face by the face centroid value times the face area.62) . we write 82 ¢ % £ φ0 ∇φ0 ∆r1 φ1 ¦ % φ0 ∇φ0 ∆r0 £ ¤ !¦ % £ ¢ φf £ ¥ ¢ φ0 φ1 £ ¤ ¢ (4. Also. For example.

. For a cell C j the equation reads ∂φ ∂φ ∆x j ∆y j φ j φ0 (4. . ‰‰ˆ †‡ ¡ Here M is the J 2 matrix ¢ Md φ © © ƒ ƒƒ ¢ ƒ ƒ ƒƒ ¢ ƒ ƒ ƒƒ £ ƒ ƒ ƒƒ £ ƒ ∆x1 ∂φ ∂x ∆y1 ∂φ ∂y £ ¢ ∆r1 ∆x1 i ∆y1 j (4.65) ∂x 0 ∂y 0 It is convenient to assemble all the equations in a matrix form as follows ∆xJ 83 ∆yJ ‘ „†† …¢ M ‰ ∆x1 ∆x2 .66) (4.C1 ∆r 1 C0 ∆r 0 Figure 4. . .62 as 0 0 We require that the same be true at all other cells surrounding cell C0.64) (4. ∆y1 ∆y2 .67) .8: Arrangement of Cells in Unstructured Mesh Here ∆r1 s the vector from the centroid of cell 0 to the centroid of cell 1 We rewrite Equation 4.63) φ1 φ0 (4.

From Equation 4..68) (4.e. .C2 C3 ∆r 3 ∆r 2 C0 ∆r 4 ∆r 1 C1 C4 Figure 4. φ0 φ0 ‰‰ ˆ‰ —— — “••– ”’ d ∂φ ∂y 0 ‘ — — ‰ ˆ‰ — (4. a solution for which the RMS value of the difference between the neighboring cell values and the reconstructed values is minimized.9: Least Squares Calculation of Cell Gradient and d is the vector of the components of gradients of φ at cell C0 ∂φ ∂x 0 and φ is the vector of differences of φ Equation 4. i.69) . We can only hope to find a solution that fits the data in the best possible way. Since in general J is larger than 2 this is an over-determined system. . Physically. this means that we cannot assume a linear profile for φ around the cell C0 such that it exactly reconstructs the known solution at all of its neighbors.65 we know that the difference in the reconstructed value and the cell value 84 ˜ φJ φ0 ‘ “•• ’ •– φ ˜ ˜ φ1 φ2 .66 represents J equations in two unknowns.

ie..71) (4. and does not require a structured mesh.73) MT φ Bx Cy i jf ˜ h˜ d ™ g ’ —— ’ — k —— ’ — Let ∂φ ∂x 0 a and ∂φ ∂y 0 b.72) (4. for the solution to exist the matrix M must be non-singular. the components of the gradient at cell C0. In practical implementations.66 by the transpose of the matrix M MT M is a 2 2 matrix that can be easily inverted analytically to yield the required gradient ∇φ . It is easy to show that this equation set is the same as that obtained by multiplying Equation 4. Mathematically. We note that it places no restrictions on cell shape. It also does not require us to choose only face neighbors for the reconstruction. At corner 85 ™ ™ ’ φ A ’ MT Md ’ ’ ∂R ∂a ∂R ∂b 0 0 (4. it should have linearly independent columns and its rank must be greater than or equal to 2. Physically this implies that we must involve at least 3 non-collinear points to compute the gradient. Recall that the standard way of solving the problem is to differentiate R with respect to a and b and set the result to zero..for cell C j is given by 0 i The sum of the squares of error over all the neighboring cells is j Our objective is to find a and b such that R is minimized.e. the inversion only needs to be done once. Another way of understanding this requirement is to note that assuming a linear variation means that φ is expressed as Since this involves three unknowns.75) . we would compute a matrix of weights for each cell. We should note here that since M is purely a function of geometry. viz. The least squares approach is easily extended to three dimensions.71 can then be written as R ∑ a∆x j ’ R ∑ R2j j b∆y j φj φ0 2 f —— ˜ e˜ —— d ™ ——— — ’ Rj ∆x j ∂φ ∂x ∆y j ∂φ ∂y φj φ0 (4. The gradient for any scalar can then be computed easily by multiplying the matrix with the difference vector φ . Equation 4. i. we need at least three points at which φ is specified in order to determine the gradient.70) (4. This gives us two equations in the two unknowns.74) (4.

76) (4. Thus. and the influence of neighbors with negative coefficients is relatively small.boundaries.5 Influence of Secondary Gradients on Coefficients We noted earlier that the presence of secondary gradient terms introduces the possibility that φP may not be bounded by its neighbors even when S 0. we no longer have the absolute guarantee of boundedness and positivity that we had with orthogonal meshes. 86 ’ q ™ ˜ p o rq n ™ p o ’ t m so that ∂φ ∂η 0 5 φN φNE 0 5 φS 2∆η ™ ™ ™ ’ φb φP φE ™ ™ ™ ’ φa φP φE φSE φS 4 φNE φN 4 φSE ’ For a uniform non-orthogonal mesh with ∆ξ ∆η . for example. As we noted before. Here we examine this assertion in somewhat greater detail. φNE . This requires storing additional mesh connectivity information. φS and φSE do not all have the same sign in the above expression. The magnitude of the secondary gradient terms is proportional to e ξ eη . To computed the secondary gradient term.7.77) (4. we may write ˜ ’ n ∂φ ∂η φb φa ∆η ’ m f l d (4. it may not be possible to obtain a sufficient number of face neighbor cells. When ∂ φ ∂ η f is included in the cell balance as a part of the secondary gradient term for the face. For most good quality meshes. we must find the gradient ∂ φ ∂ η f . similar terms result from other calculation methods as well.78) f l d s . the corresponding cells share vertices with point P. These terms are hidden in f . These are not face neighbors. it effectively introduces additional neighbors – φ NE and φSE . Consequently it is possible for an increase in one of the neighbor φ ’s to result in a decrease in φ P . For simplicity. let us consider the calculation of secondary gradient the term on the structured mesh shown in Figure 4. we may wish to involve more cells near cell C0 to get a better estimate of the gradient. Even though we have adopted a particular gradient calculation method here. for good quality meshes. this term is nearly zero. We are no longer guaranteed that φ P is bounded by its neighbors when S 0. one way to find this is to write f f We note that φN . However. Notice that they do not all have positive coefficients. 4. our discussions in the previous chapter about coefficient positivity and boundedness of φ hold in large measure. and we may be forced to reconstruct at cells sharing vertices with cell C0 in addition to the usual complement of face neighbors. In other cases.

This is because the face flux leaves one cell and enters the other. This association of the flux with the face and not the cell makes a face-based data structure a convenient one for implementing finite volume schemes. whereby the diffusive flux of φ out of cell C0 enters cell C1 without modification. as in Equation 4. Such an interpretation is in keeping with the conservation idea. If the cell gradient is available. Calculations based on the gradient theorem are amenable to a face-based calculation procedure. depending on the calculation stencil chosen.e. the face value of the gradient may be found by averaging. The secondary gradient terms may then be computed during the visit to the face since they are also associated with the face. 87 s ˜ s ™ u b0 b0 t t u u u ’ (4.80) f f v . the face flux J f is most conveniently construed as belonging to the face f rather than to either of the cells sharing the face.79) anb ∆ξ A f eξ for the face and make the assignment: a10 a01 anb anb A visit to all the faces in the list completes the calculation of the neighbor coefficients anb for all the cells in the domain. Each face would carry a pointer or index to each of the two cells that share it.4. a P for all cells may be computed by visiting each cell. Each face contributes a secondary gradient term to the b term for cells C0 and C1: b1 b1 Notice that the secondary gradient term is added to one cell and subtracted from the other.. Thus.6. The influence of cell C1 on the equation for cell C0 is given by a 01 . i.61 may also be implemented in a face-based manner. In a typical implementation. computing SP ∆ and summing a nb . Once the coefficient calculation is complete.33.1 Data Structures For both structured and unstructured meshes. Here. the influence of cell C0 on the equation for cell C1 is given by a 10 . It is also useful to carry a linked list or array of cells. cells C0 and C1. we would carry a linked list or array of faces. the face value is computed using Equation 4.59 for each of the cells sharing the face. as well as the contribution to the sum in Equation 4. and using it for the cell balance in cells C0 and C1 in turn.60 during the visit to the face. we compute the coefficient Γf Af Af (4. Similarly the SC contribution to b may also be computed. The reconstruction procedure described by Equation 4.6 Implementation Issues 4. The least-squares approach for gradient calculation may be implemented by a mixture of face and cell-based manipulations. Not all gradient calculation procedures are amenable to a purely face-based implementation. We can ensure this by thinking of J f as belonging to the face.

Check for convergence. For c w ’ 3. they are not relevant since the secondary gradient terms are held constant during the Gauss-Seidel iteration. 1. find b0 and b1 by adding/subtracting secondary gradient contributions to C0 and C1.6.2 Overall Solution Loop It is convenient to compute and store cell gradients prior to coefficient calculation. for example. The Gauss-Seidel solver may perform a number of inner iterations to obtain the solution to the nominally linear system. Since the Scarborough criterion is satisfied by the primary diffusion terms when Dirichlet boundary conditions are present. We refer to one pass through the above loop as an outer iteration. we are guaranteed convergence of the Gauss-Seidel solver during any outer iteration. At this point the coefficient calculation is complete. Find φ f by averaging neighbor cell values φ 0 and φ1 . A comment on the Scarborough criterion is appropriate here. only one outer iteration (with sufficient inner iterations of the linear solver) would be required to obtain the converged solution. Add gradient contribution to cells C0 and C1. A visit to all faces completes the cell gradient calculation. the overall solution loop takes the following nominal form. Find f . 88 v ˜ Find aP ∑nb anb Find b b SC ∆ v ™ ’ ’ w ’ 4. many outer iterations are required for convergence. 5. For non-linear problems. During an outer iteration. In our deferred calculation procedure. Therefore. 6. If iterations are converged. the above procedure employs a deferred computation of secondary gradient terms.4. such as a Gauss-Seidel solver. Find a01 and a10 . For non-orthogonal meshes. many outer iterations would be required. Guess φ at all cell centroids and at boundary face centroids as necessary. we make one call to a linear solver. Else go to 2. the secondary gradient terms remain fixed during an outer iteration. stop. even though the negative coefficients they introduce tend to violate the Scarborough criterion. even for linear problems. For linear problems on orthogonal meshes. For f 1 n faces s x y x y x y 1 n faces 1 n cells SP ∆ . Using the gradient theorem to compute cell gradients. For f w ’ 2. Solve for φ at cell centroids using a linear solver such as Gauss-Seidel iteration. Consequently.

and involves a balance of diffusive fluxes on the faces of the cell with the source inside the cell. and therefore. To compute this term. the solution of a complete scalar transport equation. However. we have seen how much of the calculation is amenable to a face-based data structure. Finally. we have seen how to discretize the diffusion equation on non-orthogonal meshes. we address the discretization of the convective term. we require face gradients of φ . both structured and unstructured.7 Closure In this chapter. The overall idea is the same as for regular meshes. We have seen how cell gradients may be computed for structured and unstructured meshes.4. we have seen that the face fluxes may no longer be written purely in terms of the neighbor cell values if the mesh is non-orthogonal. 89 . In the next chapter. which may be averaged from cell gradients. an extra secondary gradient term appears.

90 .

i. As before.e. i. We will address the calculation of the fluid flow in later chapters. the fluid flow would have to be computed. Once we have addressed this term. let us assume that ∆x and ∆y are constant. We seek to determine how the scalar φ is transported in the presence of a given fluid flow field.4) .1 over the cell of interest. and is given by As before.3) z Sd (5. we will have developed a tool for solving the complete scalar transport equation..1) (5. For the sake of clarity. In reality.Chapter 5 Convection In this chapter. We will address both regular and non-orthogonal meshes. and the special problems associated with it. we will assume that the fluid flow is known. we turn to the remaining term in the general transport equation for the scalar φ . namely the convection term. we integrate Equation 5.1. the velocity vector V is known at all the requisite points in the domain. The domain has been discretized using a regular Cartesian mesh.2) (5. so that 91 { ∆ ∆ v ’ |v t { ∇ Jd z ™ ’ V ui ˜ ’ J ρ Vφ ’ t ∇J S Γ∇φ vj (5. as it is sometimes called in the literature. P.1 Two-Dimensional Convection and Diffusion in A Rectangular Domain Let us consider a two-dimensional rectangular domain such as that shown in Figure 5. of course. 5. The equation governing steady scalar transport in the domain is given by where J is given by Here. the mesh is uniform in each of the directions x and y. We will see how to difference this term in the framework of the finite volume method. we store discrete values of φ at cell centroids.e. In the development that follows.. or the convection-diffusion equation. ρ is the density of the fluid and V is its velocity.

we assume S SC SP φP as before.5) SC SP φP ∆ P (5. Also. n and s of the cell P. J e Ae .1: Convection on a Cartesian Mesh Applying the divergence theorem. and that the face centroid value is representative of the face average.8) .9) n ˜ f d ’ t J e Ae ρ uφ e ∆y Γe ∆y tm ˜ ’ ’ ˜ ’ Aw ’ Ae ∆y i ∆y i ∆x j ∆x j (5.N n W w s V S P e E ∆y ∆x Figure 5. Let us now consider one of the transport terms. we write A As usual.7) ∂φ ∂x e v q ™ p ’ t ™ t ™ t ™ t J e Ae J w Aw Jn An J s As v ’ t z ™ ’ J dA S∆ P (5.6) (5. w.8 that the convection component has the form Fe φe 92 (5. we assume that J is constant over each of the faces e. This is given by We see from Equation 5. Thus with An As Thus far the discretization process is identical to our procedure in previous chapters. say.

where Fe ρ u e ∆y (5.1.13) (5.12) (5. Collecting the convection and diffusion terms on all faces. we shall assume that Fe is given. we may write so that the convective transport through the face is Fe 2 Similar expressions may be written for the convective contributions on other faces.1 Central Differencing The problem of discretizing the convection term reduces to finding an interpolation for φe from the cell centroid values of φ . δ x.15) b .15. collecting terms. Once φ e is determined. it is referred to as the cell Peclet number.14) (5. We note with trepidation that φ E and φP appear with the same sign in Equation 5. We already know how to write the face gradient. We note that the face value. We turn now to different methods for writing the face value φ e in terms of the cell centroid values. 5. If it is based on a cell length scale. The quantity is called the Peclet number. One approximation we can use is the centraldifference approximation. and measures the relative importance of convection and diffusion in the transport of φ . For the purposes of this chapter. is required to determine the transport due to convection at the face. it is then simply a matter of doing the same operation on all the faces. we may write the following discrete equation for the cell P: nb 93 ™ ’ aP φP ∑ anbφnb f ™ d φE ™ ’ φe φE ’ f l d ’ Pe F D f d ’ De Γe ∆y δx e ρ uδ x Γ φP 2 φP f ˜ d De φE f d ’ φP (5. φ e . we assume that φ varies linearly between grid points. Here. and the face gradient ∂ φ ∂ x e . We have seen that the diffusive term on the face e may be written as where Similar diffusion terms can be written for other faces as well.11) ˜ (5. For a uniform mesh. We see that writing the face flux J e requires two types of information: the face value φe . and writing the discrete equation for the cell P.10) is the mass flow rate through the face e.

For a given velocity field and physical properties we can meet this Peclet number criterion 94 } } ’ f ™ d ’ ~ f ˜ ~ ~ ™ l ˜ d Fe Fw d d ’ ’ Fn Fs d ’ Fw d ’ Fe ρ u w ∆y ρ v n ∆x ρ v s ∆x (5. aN becomes negative. Similarly for Fn 2Dn . since the equation violates the Scarborough criterion.17) } } l ’ } } ’ . we are guaranteed positive coefficients.18) (5. Let us consider the case when the velocity vector V ui vj is such that u 0 and v 0. For Fe 2De . the face Peclet numbers Pee Fe De 2 and Pen Fn Dn 2 are required for uniform meshes. If the underlying flow field satisfies the continuity equation. we are not guaranteed that φ P is bounded by its neighbors. we would expect this term to be zero. These negative coefficients mean that though a P ∑nb anb for S 0.where nb In the above equations. For u 0 and v 0. That is. The term represents the net mass outflow from the cell P.19) Fn f f f f f d ’ Ds f d ’ Dn ’ Dw f d f d ’ ’ v ’ b SC ∆ P De ∆y δx e ∆y Γw δx w ∆x Γn δy n ∆x Γs δy s ρ u e ∆y Γe Fs ™ P f ˜ ˜ d ™ v ˜ ’ aP ∑ anb ™ ’ aS Ds ˜ ’ ~ aN Dn ™ ’ aW Dw ˜ ’ aE De Fe 2 Fw 2 Fn 2 Fs 2 SP ∆ Fe Fw Fn Fs (5. we see that as long as Fe 2De and Fn 2Dn . we see that aE becomes negative. (Similar behavior would occur with a W and aS if the velocity vector reverses sign). and physically plausible behavior. we are not guaranteed the convergence of the Gauss-Seidel iterative scheme. Furthermore.

1. we write These expressions essentially say that the value of φ on the face is determined entirely by the mesh direction from which the flow is coming to the face. We now consider an alternative differencing procedure call the upwind differencing scheme.14. We will see in later sections that though the upwind scheme produces a coefficient matrix that guarantees physically plausible results and is ideally suited for iterative linear solvers. Consequently. we are guaranteed that φP is bounded by its neighbors. we may write the following discrete equation for cell P: nb where nb Here b otherwise We see that the upwind scheme yields positive coefficients. For many practical situations. it can smear discontinuous profiles of φ even in the absence of diffusion.20) b Fw Fn Fs (5. however. the face value of φ is set equal to the upwind cell centroid value. and the storage and computational requirements may be too large to afford.20 in the cell balance for cell P. Thus. we realize that the reason we encounter negative coefficients is the arithmetic averaging in Equation 5. 5.22) . We will examine other higher order differencing schemes which do not have this characteristic. In this scheme. and the diffusion term discretization in Equation 5.11.23) ™ P f ˜ ’ aP ∑ anb ™ ™ ’ ’ aN aS Dn Ds Max Fn 0 Max Fs 0 SP ∆ ˜ d ™ v ˜  w €  w ˜€  w €  w ˜€ ™ ™ ’ ’ aE aW De Max Fe 0 Dw Max Fw 0 Fe ™ ’ aP φP ∑ anbφnb ~  ’ ’ φe φP if Fe φE if Fe 0 0 (5.by reducing the grid size sufficiently. for face e in Figure 5. Using Equation 5. Similar expressions may be written on the other faces. 95 ’ } ’ ’ ’ ‚ w € Max a b v ’ b SC ∆ P a if a b (5.2 Upwind Differencing When we examine the discretization procedure described above. and a P ∑nb anb if the flow field satisfies the continuity equation and S 0. the resulting mesh may be very fine.1.

counterparts of the central difference and upwind schemes are easily derived.2 Convection-Diffusion on Non-Orthogonal Meshes For non-orthogonal meshes.A f V C0 eξ C1 ∆ξ Figure 5.2.29) φ φ0 f ∆ξ A f eξ 1 96 ™ s q t f d ’ Ff ρV f Af t f d ˜ ˜ p tt t f d ’ t Jf Af ρV Af φf Γ f ∇φ f d ˜ f d ’ Jf ρ Vφ Γ f ∇φ v q v q ™ ™ p ’ t p ’ t z ˜ J dA SC SP φ0 ∆ 0 (5.27) (5. and apply the divergence theorem to get A face f As before. we assume that the flux on the face may be written in terms of the face centroid value. We have already seen in the previous chapter that the diffusion transport at the face may be written as: Γf Af Af (5.28) .The flux is given by f The transport of φ at the face f may thus be written as f We define the face mass flow rate as This is the mass flow rate out of the cell C0.2: Convection on a Non-Orthogonal Mesh 5.25) ∑ J f A f SC SP φ0 ∆ 0 f where the summation is over the faces f of the cell. so that (5.24) f (5. We start with the integration of the convection-diffusion equation as usual. both structured and unstructured. integrate it over the cell C0 shown in Figure 5.26) f Af (5.

Defining we write the net transport across the face f as We note that.2. The simplest central difference approximation is to write With this approximation. if the Peclet number Pe f 2.32) ∑ Ff f nb (5. Using this approximation in the discrete cell balance we get nb 97 ™ ’ aP φP ∑ anbφnb } ’ φf φ0 if Ff 0 φ1 otherwise b } l i sg ~ ˜ v ’ } ’ b SC ∆ ∑ ™ v ˜ ’ aP ∑ anb ˜ ’ anb Df Ff 2 SP ∆ 0 ™ ’ aP φP ∑ anbφnb ™ ’ φf φ0 φ1 2 b f ™ s q ˜ p ˜ ’ t Jf Af Ff φ f D f φ1 t ’ Df Γf Af Af ∆ξ A f eξ t (5.2 Upwind Differencing Approximation Under the upwind differencing approximation. ie. If F f 0.35) . and is expected to be zero if the underlying flow field satisfies mass balance. it is possible to get negative coefficients using central differencing. 5. just as with structured meshes. As before. the quantity ∑ f Ff is the sum of the outgoing mass fluxes for the cell. the following discrete equation is obtained: nb where nb 0 nb We see that. the convective transport of φ at the face requires the evaluation of the face value φ f . we may find φ f through either a central difference or an upwind approximation.34) } (5.30) φ0 f (5. as with regular meshes. we expect a nb 0 if Ff D f 2.31) (5. 5.2.1 Central Difference Approximation As with regular meshes.

37) m d2φ dx2 O ∆x 3 (5.3. as we will see in the next section. Let us assume a uniform mesh.1 An Illustrative Example Consider convection of a scalar φ over the square domain shown in Figure 5.40 when Fe 0.where As with structured meshes.41) .42) 98 ™ n 2 e i f dg ’ o ™ o ’ ’ f d ˜ ™ ’ φe φP φE ∆x 8 2 f d ™ m } ’ φe φP O ∆x d2φ dx2 O ∆x 3 i f dg ™ n n ™ n n ™ ’ φE φe ∆x 2 dφ dx 1 2 ∆x 2 2 d2φ dx2 O i f dg ™ n m n m ™ n m n m ˜ ’ φP φe ∆x 2 dφ dx 1 2 ∆x 2 2 m m ’ m b ’ aP ∑ anb nb SC ∆ i sg ˜ v ™ v ˜ ™  w ˜€ SP ∆ 0 0 ’ anb Df Max Ff 0 ∑ Ff f nb ∑ nb f (5.3 Accuracy of Upwind and Central Difference Schemes Let us consider the truncation error associated with the upwind and central difference schemes. we see that the discretization for unstructured meshes yields a coefficient structure that is very similar to that for regular meshes.39. Thus. this comes at the cost of accuracy. we see that the a nb is always guaranteed positive.38) ∆x 3 (5. but. In both cases. as shown in Figure 5.39) (5. the central difference scheme introduces the possibility of negative coefficients for cell Peclet numbers greater than 2 for uniform meshes. we may write e e e e From Equation 5. 5. Adding Equations 5. We see that upwind differencing is only first order accurate.38. The flow field in the domain is given by V 1 0i 1 0j (5. we see that Recall that we use Equation 5.4. dividing by two.40) (5.38 and 5.3. we get We see that the central difference approximation is second-order accurate. The upwind scheme produces positive coefficients. 5. Using a Taylor series expansion about point e. and rearranging terms. The left and bottom boundaries are held at φ 0 and φ 1 respectively.

we expect a diffusion layer in which 0 φ 1. Pe ∞. We consider the case Pe ∞. The central difference scheme. Using ’ ~ ~ ’ l ƒ ƒ ’ d ’ k „ „ (5.3. We compute the steady convection-diffusion problem in the domain using 13 16 quadrilateral cells to discretize the domain. we obtain the following discrete form } ’f d ™f ∂ ρ uφ ∂x ∂ ρ vφ ∂y 0 0. For Γ 0. In this problem.3: One-Dimensional Control Volume so the velocity vector is aligned with the diagonal as shown. The main drawback of the first order upwind scheme is that it is very diffusive. since the cell Peclet number is infinite no matter how fine the mesh. i. on the other hand. To understand the reasons behind this we develop a model equation for the scheme. For other values of Pe.5).∆x WW W w P e E ∆x ∆x Figure 5.44) . The flow is governed by the domain Peclet number Pe ρ V L Γ. v upwind differencing. We see that the upwind scheme smears the phi profile so that there is a diffusion layer even when there is no physical diffusion. with u 0. shows unphysical oscillations in the value of phi..e.2 False Diffusion and Dispersion We can gain greater insight into the behavior of the upwind and central difference schemes through the use of model equations. the solution is φ 1 below the diagonal and φ 0 above the diagonal. Figure 5. We wish to compute the distribution of φ in the domain using the upwind and central difference schemes for. and ρ constant.43) (5. The diffusion layer is wider for smaller Pe.5 shows the predicted φ values along the vertical centerline of the domain (x=0. it is not possible to control these oscillations by refining the mesh. 5. Consider case of steady two-dimensional convection with no diffusion: ∆y 99 ’ ™ ˜ ρu ρv ˜ φP φW ∆x φP φS 0 } Consider the case of a constant velocity field.

4: Convection and Diffusion in a Square Domain 1.2 0.5 0.5: Variation of φ Along Vertical Centerline 100 .6 0.8 1.V φ=0 V y x φ = 1.0 φ 0.0 0.5 1.0 y Figure 5.0 L Figure 5.0 Exact Upwind Scheme Central Difference -0.4 0.5 0.

The left hand side of Equation 5.50 is our original differential equation and the right hand side represents the truncation error.50 is O ∆x .1. false or numerical diffusion (or viscosity. we get ∂φ ∆y 2 ∂ 2 φ ∆y 3 ∂ 3 φ ∂y 2! ∂ y2 3! ∂ y3 All derivatives in the above equations are evaluated at P.48) (5.50) (5.49) (5.47) (5. in the context of momentum equations). The same analysis for the two-dimensional central difference scheme starts with Equation 5. It is interesting to compare Equation5.46) (5.Consider the computational domain shown in Figure 5. Thus we see that although we are trying to solve a pure convection problem. This phenomenon is variously called artificial.51) (5.50 looks similar to the diffusion term in the convection-diffusion equation. Rearranging. Equation 5. In case of the upwind scheme.43 and the discrete equation Expanding φW and φE about φP using a Taylor series.44 and rearranging we obtain ™ f d ™ f d ˜ ’ ˜ φP φS O oo HCo ™ f d ™ f d ˜ ’ ˜ φP φW ∆x ∂φ ∂x ∆x ∂ 2 φ 2! ∂ x2 ∆x 2 ∂ 3 φ 3! ∂ x3 oo HCo ™ f d ˜ f d ™ ˜ ’ φS φP ∆y oo CHo ™ ∆y 2 f d ˜ f d ™ ˜ ’ φW φP ∆x ∂φ ∂x ∆x 2 ∂ 2 φ 2! ∂ x2 ∆x 3 ∂ 3 φ 3! ∂ x3 (5. as expected for a first-order scheme.Expanding φ W and φS about φP using a Taylor series.1). It represents the continuous equation that our finite-volume numerical scheme is effectively modeling. The differential equation derived in this manner is referred to as the equivalent or modified equation.The leading term in Equation 5. the artificial diffusion coefficient is proportional to the grid size so we would expect its effects to decrease as we refine the grid.52) . we get 101 oo CHo ™ f d ˜ f d ™ ˜ ’ φW φP ∆x ∂φ ∂x ∆x 2 ∂ 2 φ 2! ∂ x2 ∆x 3 ∂ 3 φ 3! ∂ x3 ’ ™ ˜ ρu ρv ˜ φE φW 2∆x φN φS 2∆y 0 i f dg ™ n For simplicity let us consider the case when u v and ∆x to ∂φ ∂φ ρ u∆x ∂ 2 φ ∂ 2 φ ρu ρv ∂x ∂y 2 ∂ x2 ∂ y2 ∆y. We find that the leading order error term in Equation 5.50 with the one dimensional form of the convection-diffusion equation (Equation 5. but it is always present.50 reduces ∆x 2 O i f dg ’ ™ i f dg ™ ™ ’ m ™ ’ f d ™ ’ ρu ™ ∂φ ∂x ρv ∂φ ∂y ρ u∆x ∂ 2 φ 2 ∂ x2 ρ v∆x ∂ 2 φ 2 ∂ y2 O ∆x 2 oo CCo ∂φ ∆y ∂ 2 φ ∆y 2 ∂ 3 φ ∆y ∂y 2! ∂ y2 3! ∂ y3 Using the above expressions in Eq 5.45) (5. applying the upwind scheme means that effectively we are getting the solution to a problem with some diffusion.

. Their behavior in multi-dimensional situations has the same characteristics as the upwind scheme. These schemes use local profile assumptions which are approximations to the exact solution to a local convection-diffusion equation. we consider the case when u and 5. 5.55) (5.4. rather than discretizing them separately. the effective equation we solve using the central difference scheme contains a third derivative term on the right hand side. Though we set out to solve a pure convection equation.56) (5.54) (5. whereas the central-difference scheme tends to be dispersive. for the oscillatory behavior of φ . Thus.4 First-Order Schemes Using Exact Solutions A number of first-order schemes for the convection-diffusion equation have been published in the literature which treat the convection and diffusion terms together.58) . 5.1 Exponential Scheme The one-dimensional convection diffusion equation with no source term may be written as ∂ ∂ ∂φ ρ uφ Γ 0 (5. Substituting Equations 5. This term is responsible for dispersion. as expected in a second order scheme. the upwind scheme leads to false or artificial diffusion which tends to smear sharp gradients. We present these here for historical completeness.51 we get v and ∆x ∆y.55 into Equation 5.53) (5.A similar procedure in the y-direction yields We see that the leading truncation term is O ∆x 2 . i. we get f d ™ ˜ ˜ ™ ’ φE φP ∆x ∆x 3 ∂ 3 φ 3! ∂ x3 (5.57) ∂x ∂x ∂x The boundary conditions are 102 ’ ’ ’ ’ φ φ φ0 atx φL atx 0 L i f dg ™ n ’ n f ™ d m ˜f ˜ ’ ρu d ™ ∂φ ∂x ρv ∂φ ∂y ρ u∆x2 3! ∂ 3φ ∂ x3 ’ m ’ As before.e.54 ∂ 3φ ∂ y3 oo HCo ™ f d ™ ’ φN φS 2∆y ∂φ ∂y ∆y 2 ∂ 3 φ 3! ∂ y3 oo CHo ™ O ∆x 3 f d ™ ’ φE φW 2∆x ∂φ ∂x ∆x 2 ∂ 3 φ 3! ∂ x3 oo CCo ™ f d ˜ ∂φ ∆x 2 ∂ 2 φ ∂x 2! ∂ x2 Subtracting the two equations.

Consider the one-dimensional mesh shown in Figure 5.The exact solution to the problem is where Pe is the Peclet number given by We wiish to use this exact solution in making profile assumptions.63) t dφ dx e (5. We will use this profile to evaluate both φ and d φ dx at the face.65) (5.3 and the convection-diffusion equation: We wish to obtain a discrete equation for point P. for this 1-D case that we may write As before. Thus Here Pee A similar expression may be written for the w face.61) (5.61 over the cell P yields (5. φw and the gradients d φ dx e and d φ dx w . Integrating Equation 5.64) w t f l d f l d (5. Collecting terms yields the following discrete equation for φ P : 103 ™ ™ ’ aP φP aE φE aW φW ’ ρ u e δ xe Γe n ˜f d ™ f d ’ ’ t J e Ae ˜ Fe φP φP φE exp Pee 1 Fe De b n ™ f fl d d …˜ m ’ J w Aw ρ uφ w Γw n m ˜ f d ’ J e Ae ρ uφ e Γe m ˜ ’ Aw ’ Ae i i dφ dx v q ’ n ™ p ’ t ˜f ∂ ρ uφ ∂x ∂ ∂φ Γ ∂x ∂x m ’ Pe ˜f d ˜ f l f Cd d ρ uL Γ ’ φ φ0 φL φ0 exp Pe x L 1 exp Pe 1 d ˜ ™ t ˜ (5.66) .60) S (5.62) J e Ae J w Aw SC SP φP ∆ P Assuming.59. We assume that φ x may be taken from Equation 5.59) (5. we must make profile assumptions to write φ e .

4. For the case of S 0.6. it will yield the exact solution regardless of mesh size or Peclet number. 5. It is possible to show that for these general situations the scheme is only first-order accurate. for one-dimensional situations.71) De The overall discrete equation for the cell P is given by aP φP aE φE aW φW b 104 † ™ ˜ ~  ˜ } ™ ˜ 1 Pee at Pee 2 ’ ˜ „ Pee for Pee „ ˜ ˜ ’ ˜ ’ „ „ aE De aE De aE De 0 for Pee ˜f d ’ aE De Pe exp Pee 1 ∞ ∞ 0 (5. this is not true when a source term exists or when the situation is multi-dimensional. Because exponentials are expensive to compute. The coefficient aE in the exponential scheme may be written as A plot of aE De is shown in Figure 5.6. researchers have created schemes which approximate the behavior of the coefficients obtained using the exponential scheme. Thus aE 0 for Pee 2 De aE Pee 1 for 2 Pee 2 De 2 aE Pee for Pee 2 (5.68) l ’ (5.where This scheme always yields positive coefficients and bounded solutions. These include the hybrid and power law schemes which are described below.2 Hybrid Scheme The hybrid scheme seeks to approximate the behavior of the discrete coefficients from the exponential scheme by reproducing their limiting behavior correctly.70) f l ’ ’ ’ ’ ’ aP b ’ aW v™ ˜ d ™ v ˜ ˜f l d f l d ˜f l d Fe ’ aE Fe exp Fe De 1 Fw exp Fw Dw exp Fw Dw 1 aE aW SP∆ P SC ∆ P Fw (5. It shows the following limiting behavior: The hybrid scheme models a E De using the three bounding tangents shown in Figure 5.69) . Of course.

while reproducing its behavior closely.Pe e /2 -5 -4 -3 -2 -1 0 1 1 Pe e Exact a E / D e =0 2 3 4 5 Figure 5.73) ’ l Fe (5.1) then takes the 105  ˜w € ’ aE De Max 0 1 0 1 Fe De 5 Max 0 f ™  nƒ ƒ o ˜ w € m l ’ ’ aP b ’ aW v ˜ d ™ v ˜ ™ ™  w w €  w ˜ w ˜€ ’ aE Fe 0 2 Fw Max Fw Dw 0 2 aE aW SP ∆ P Fe SC ∆ P Max Fe De l Fw (5.5 Unsteady Convection Let us now focus our attention on unsteady convection.4.74) .3 Power Law Scheme Here. 5.a 6 a / D = -Pe E e e E / De 5 4 3 2 a E /D = e 1 .6: Variation of a E De (Adapted from Patankar(1980)) where 5. The convection-diffusion equation (Equation 5. rather than to use the bounding tangents as the hybrid scheme does. For simplicity we will set ρ to be unity and Γ 0. The power-law expressions for aE De may be written as: This expression has the advantage that it is less expensive to compute that the exponential scheme. the objective is to curve-fit the a E De curve using a fifth-order polynomial.

5 0. Let us consider a domain of length L and let the initial solution be given by a spatial function φ 0 ..25 1. Many different approaches 106 o ’ ’fw d ’fw d ’ f ˜ d o ’fw d φ xt φ0 x f d ’f w d φ x0 φ0 x ’ ™ (5.5 0. historically it has been one of the most widely studied equations in CFD.25 t=0.75 is also known as the linear advection or linear wave equation. We see that the profiles have merely shifted to the right by 0 25u.0 φ 0.5 -0.75 appears to be quite simple. It is termed linear because the convection speed u is not a function of the convected quantity φ .0 x/L x/L Figure 5.75) ∂t ∂x Equation 5.76) ut (5. i.8 1. To complete the specification of the problem we need to define the initial and boundary conditions. One is a single sine wave and the other is a square wave. without distorting or smearing the profile. We saw in a previous chapter that mathematically this is classified as a hyperbolic equation.7 shows the initial solution as well as the solution at t 0 25. For these reasons. Consider the convection of two initial profiles by a convection velocity u 1 in a domain of length L.0 φ 0. Figure 5.0 0.7.e.0 1. form The exact solution to this problem is given by In other words.8 1.2.6 0.5 1. non-linear. Even though Equation 5.2 0.0 -1. as shown in Figure 5.6 0.0 -0.0 t=0 0.4 0.2 0.4 0. We will use these examples to determine whether our discretization schemes are able to predict this translation accurately. The boundary conditions for both problems are φ 0 t φ Lt 0.77) ˜ .0 0.5 t=0 t=0. coupled equations that govern high speed flows.7: Exact solutions for linear convection of (a) sine wave (b) square wave ∂ φ ∂ uφ 0 (5. the exact solution is simply the initial profile translated by a distance ut.0 0. it is important because it provides a great deal of insight into the treatment of the more complex.

Since the equation is hyperbolic in the time coordinate and the solution only depends on the past and not the future. and the terms carrying the superscript “0” denote the value at the previous time level.have been developed for its numerical solution but in this book we will concentrate mostly on modern techniques that form the basis of solution algorithms for the Euler and Navier-Stokes equations. as per our convention. 107 ’ f ˜ d ™ ˜ φP 0 φP 0 0 φE φW 2∆x ’f ˜ d „ ™ n ∂φ ∂t u φe ∆x φw ’f ˜ d ™ n m m 0 (5.78) ∂t P Since u is constant. Often.1 1D Finite Volume Discretization For simplicity let us examine the discretization of Equation 5. Thus the scheme described above is second-order accurate in space and firstorder accurate in time. explicit time discretization is first order accurate in time. shows that it is unconditionally unstable. We have shown from a truncation error analysis that the central difference scheme is second-order accurate in space. iterating for non-linearities. starting with the initial solution. In some instances we might be interested in the transient evolution of the solution. An alternative to iterations is to use time-marching. As such it is not usable but there are several important lessons one can learn from this. With the general framework in hand. 5. In the previous chapsteady-state solution (i. we may rearrange the equation to write P Since for the linear problem the velocity u is known everywhere.75. let’s look at some specific schemes. and to obtain the steady state solution as the culmination of an unsteady process. in the explicit scheme.5. We assume a uniform mesh with a cell width ∆x as shown in Figure 5. only the 0) is of interest. 5. the un-superscripted values denote the values at the current time.80) . As we noted earlier. we are interested in two kinds of problems. the problem of determination of the face flux simply reduces to the determination of the face values φ . using time marching..2 Central Difference Scheme Using the explicit scheme we developed in a previous chapter.79) 0 (5.75 over the cell P yields ∂φ ∆x ue φe uw φw 0 (5. we may write ∆t u where. Integrating Equation 5. the solution as ∂ φ ∂t ter we saw that we could obtain the steady-state solution by solving a sparse system of nominally linear algebraic equations. φ P for every cell is only a function of the (known) solution at the previous time level. however. it would seem logical to devise methods that yield the solution at successive instants in time. however. In general.e.3.5. Applying the von-Neumann stability analysis to this scheme.

5. However.The first point to note is that the instability is not caused by either the spatial or the temporal discretization alone but by the combination of the two. Stability analysis reveals that the scheme is stable as long as ∆t 0 u 1 (5. We may rewrite the scheme in the following form: u∆t We see that aW is negative for u 0 and a E is negative for u 0.84) ∆x ∆t The quantity ν u ∆x is known as the Courant or CFL number (after Courant. it requires the solution of a linear equation set at each time step. This is easily seen by writing Equation 5. To 108 ™ f ˜ d ’ φP 1 0 ν φP νφW ’ f ˜ d † † ™ ˜ φP 0 φP 0 φP 0 φW ∆x 0 ~ ™ f } ’ φP φE φW 2∆x ’ f ˜ d ˜ d ™ ˜ φP 0 φP φE φW 2∆x 0 (5.82) (5.83) ’ (5.81) 0 φP (5. However. It is interesting to note that our heuristic requirement of all spatial and temporal neighbor coefficients being positive is also met when the above condition is satisfied. This limits the time step and makes the use of time marching with explicit schemes undesirable for steady state problems.83 in the form We therefore the expect the scheme to also be monotone when it is stable. Explicit schemes usually have a stability limit which dictates the maximum Courant number that can be used. Indeed.85) . the Scarborough criterion is not satisfied. To see how well the upwind scheme performs for unsteady problems let us apply it to the problem of convection of single sine and square waves we described above. Since the scheme is implicit. Friedrichs and Lewy [1. we get very different behavior if we simply using an implicit temporal discretization while retaining the central difference scheme for the spatial term: ∆t u It is easy to show that the resulting implicit scheme is unconditionally stable. making it difficult to use iterative solvers. The solution is therefore not guaranteed to be bounded by the spatial and temporal neighbor values.5. 2]) who first analyzed the convergence characteristics of such schemes.3 First Order Upwind Scheme Using the upwind difference scheme for spatial discretization and an explicit time discretization. it is important to realize that stability does not guarantee physical plausibility in the solution. we obtain the following scheme ∆t u We have shown that the upwind differencing scheme is only first-order accurate and that the explicit scheme is also only first-order accurate.

0 0.25. which is now a function of the Courant number.5 First Order Upwind 1.5 0. as expected. The exact solution. We also observe that the profiles in both examples are monotonic.8. We compare the resulting solutions at t 0 25 with the exact solutions in Figure 5.8 1. 5. Note also that for ν 1 the numerical viscosity of the upwind scheme would be negative. Using ν 0 5.5 -0.86) . is the initial profile translated to the right by a distance of 0.8 are smoothened.0 0.0 -0. We know that physically the effect of diffusion (or viscosity) is to smoothen out the gradients. the peak amplitude has decreased but nowhere has the solution exceeded the initial bounds.5 -1.5 ν = 0.2 0.0 φ 0. we apply the explicit scheme for 25 time steps. We can now appreciate the physical reason behind 109 oo HCo ™ } f ˜ d ’ ™ o ’ o ’ ∂φ ∂t u ∂φ ∂x u∆x 1 2 ν ∂ 2φ ∂ x2 (5.83) using techniques similar those we used for steady state to obtain We see that.0 φ 0.0 0.4 Error Analysis We can develop a model equation for the transient form of the upwind scheme (Equation 5. the transient form of the upwind scheme also suffers from numerical dissipation.0 x/L x/L Figure 5.0 Exact Solution First Order Upwind Exact Solution 1.6 0. This is because the artificial viscosity also damps out any errors that might arise during the course of time marching (or iterations) and prevents these errors from growing. In case of the sine wave. Our numerical solution is similarly shifted but we note that the sharp discontinuities in either the slope of the variable itself have been smoothened out considerably.6 0.5 0.4 0. Although this results in a loss of accuracy.8: First order upwind solutions for linear convection of (a) sine wave (b) square wave compute this numerical solution we use an equispaced solution mesh of 50 cells. this same artificial dissipation is also responsible for the stability of our scheme.2 0.2. just like steady state.0 1.5. The numerical diffusion present in the upwind scheme acts in a similar manner and this is why we find the profiles in Figure 5.0 0.4 0.5 ν = 0.8 1.

If φ is a physical variable such as species concentration or the turbulence kinetic energy that is always supposed to be positive. when it is violated the numerical viscosity will be negative and thus cause any errors to grow. The principle idea is to remove the negative artificial diffusion of the explicit central difference scheme by adding an equal amount of positive diffusion. The corresponding modified equation is ∂φ ∂φ u2 ∆t ∂ 2 φ u (5. The modified equation for the Lax-Wendroff scheme is 110 f d ™ f u ˜ d f d ˜ ’ ™ ∂φ ∂t ∂φ ∂t u ∆x 6 2 1 ν2 ∂ 3φ ∂ x3 O ∆x ’ f †ƒ ƒ ™f d˜ d ˜f ˜ d ™ ˜ φP 0 φP 0 0 φE φW 2∆x 0 u2 ∆t φE 2 0 0 2φP φW ∆x 2 oo HCo oo CHo ™ ™ ’ ˜ ’ ’ ™ ™ ™ (5. as in previous chapters.81 has the following modified equation ∂φ ∂φ u2 ∆t ∂ 2 φ u ∂t ∂x 2 ∂ x2 Thus this scheme is stable but also suffers from artificial diffusion.88) 0 (5. We also note that the solution in this case exceeds the initial bounds. Discretizing the second derivative using linear profiles assumptions. It can also be shown that the implicit version (Equation 5. Such non-monotonic behavior is even more pronounced in the presence of discontinuities. Stability analysis shows that it is stable for ν 1.9(b). such behavior could cause a lot of difficulties in our numerical procedure. At some locations it is higher than one while in other places it is negative.90) 3 (5. The reasons for this behavior can once again be understood by examining the truncation error.5. However. the most important is the Lax-Wendroff scheme since it forms the basis of several wellknown schemes used for solution of Euler and compressible Navier-Stokes equations. Let us now analyze the explicit central difference scheme (Equation 5.91) .5 Lax-Wendroff Scheme A large number of schemes have been developed to overcome the shortcomings of the explicit central difference scheme that we discussed in the previous section.87) ∂t ∂x 2 ∂ x2 This scheme has a negative artificial viscosity in all cases and therefore it is not very surprising that it is unconditionally unstable. we obtain the following explicit equation for cell P ∆t u It is possible to show that this scheme is second order accurate in both space and time. as shown in Figure 5. That is. Of these. 5.89) ∂t ∂x 2 ∂ x2 rather than the original convection equation. we seek to solve ∂φ ∂φ u2 ∆t ∂ 2 φ u (5.80) we saw earlier. we see that it resolves the smoothly varying regions of the profile much better than the upwind scheme (see Figure 5. in regions of slope discontinuity we see spurious “wiggles”.9(a)).the CFL condition. Applying it to the sine wave convection problem.

this 111 f f d ’ fŠ ˜ d ˜ ™ ˆ ˜ fŠ ˜ d ˜ ™ ˆ φE φP u∆t φ 2∆x E φP φP φW u∆t φ 2∆x P φW ˜ d ˜ ™ ˆ ˜ yŠf ˜ d ˜ ˆ ™ ‰‡ ™ ∆t 0 ‹ ’ uyŠf ˜ φP 0 φP u ∆x 0 φE 0 φP u∆t 0 φ 2∆x E 0 φP 0 φP 0 φW u∆t 0 φ 2∆x P 0 φW 0 (5. second-order schemes work very well. the effect of numerical dispersion is to cause phase errors between the different frequencies.0 x/L x/L Figure 5. The errors produced by second-order terms are dispersive in nature whereas those produced by first-order schemes are dissipative.90 in the following form 2 2 We recognize the terms in square brackets as the face flux definitions for the e and w faces respectively.5 0.0 0. This becomes more clear if we re-arrange Equation 5.5 ν = 0.0 -0.5 -1. For smooth profiles that contain few frequencies.92) . However. This is characteristic of second-order schemes and is the reason why wiggles in the solution do not get damped. in case of discontinuities (which are composed of many frequencies).0 Exact Solution Lax-Wendroff Exact Solution 1.0 1.0 φ 0.0 0.5 Lax-Wendroff 1.5 -0.9: Lax-Wendroff solutions for linear convection of (a) sine wave (b) square wave The leading order term is proportional to the third derivative of φ and there is no diffusion like term.0 0.8 1. on the other hand.6 0.6 0.2. All the numerical schemes we saw in previous sections were derived by separate profile assumptions for the spatial and temporal variations.5 ν = 0. In wave-mechanics terms.0 φ 0.0 0.4 0.8 1.5 0. The first order upwind scheme. the equation that is satisfied at convergence is given by 2 2 The consequence of this is that the final answer we obtain depends on the time-step size ∆t ! Although the solution still has a spatial truncation error of O ∆x 2 . dispersion refers to the phenomenon that alters the frequency content of a signal and dissipation refers to the reduction in amplitude. The Lax-Wendroff scheme is different in that the spatial profile assumption is tied to the temporal discretization. the lack of numerical diffusion preserves the amplitude.2 0. does not alter the phase differences but damps all modes. If we are using this scheme for computing a steady state solution.4 0.2 0.

we write a Taylor series expansion for φ in the neighborhood of the upwind point P: 5. to derive a set of upwind weighted higherorder schemes.94) ’ (5.dependence on the time step is clearly not physical. backward or central difference formula to give us three different second-order schemes. such as linear or quadratic. This is equivalent to retaining the first two terms of the expansion.96) ∂x 2∆x we obtain ™ ’ φe φP 4 112 q ˜ p φE f d ˜ ™ ’ ’ φe φP ∆x ∂ φ 2 ∂x φW f d ™ ™ f ˜ d ™ x xP f ˜ d ™ lf d ’f d φ x φP ∂φ ∂x ’ φe φP x xP 2! } (5.6. We will see in later chapters that similar path dependence of the converged solution can occur even in iterative schemes if we are not careful. Evaluating Equation 5.94 at x e xP ∆x 2. If we write ∂ φ using ∂x φE φW ∂φ (5.97) . we obtain This assumption has a truncation error of O ∆x 2 . These higher-order schemes aim to obtain at least a second-order truncation error. Instead of assume a constant profile assumption for φ . 5.93) } 2 ∂ 2φ ∂ x2 O ∆x 3 (5. In this particular case. by using higher-order interpolation.6 Higher-Order Schemes We have seen thus far that both the upwind and central difference schemes have severe limitations. the profile of φ is essentially constant. we have assume that. On our one∂x dimensional grid we can represent the derivative at P using either a forward. That is.95) (5. Thus far. for the purposes of writing the face value φ e . and the latter due to dispersion. In order to write φ e in terms of cell centroid values. Therefore there has been a great deal of research to improve the accuracy of the upwind scheme. the former due to artificial diffusion.1 Second-Order Upwind Schemes We may derive a second-order upwind scheme by making a linear profile assumption. for Fe 0. If Fe 0. while controlling the severity of spatial oscillations. we may use higher-order profile assumptions. the resulting error in the final solution maybe small since stability requirements restrict the time step size. we must write ∂ φ in terms of cell centroid values.

102) (5.98) (5.100) (5. 113 f ˜ ™ d ˜f ™ ˜f ™ d ™ d ’ φe q ˜ p φE φP ™ 4 φE φW 8 ™ ™ ’ ’ φe φP 2φP q ˜ p q ˜ p φE φW f d ∆x 2 φE φW 8 2φP f d ™ q ˜ ™ p ’ ∂ 2φ ∂ x2 φE φW 2φP O ∆x2 f d ™q ˜ p ’ ∂φ ∂x φE φW 2∆x ™ f ˜ d ™ x xP ∂φ ∂x O ∆x2 f ˜ d ’f d φ x φP ∂φ ∂x x q ™ 4 4 xP 2! 2 and f ∂ 2φ ∂ x2 ∂ 2φ .101) Using (5. we may write 2 This scheme is called the QUICK scheme (Quadratic Upwind Interpolation for Convective Kinetics) [3].or.105) . ∂ x2 ˜ d ˜ p ˜ ™ ’ ’ ™ ’ φe φP q ˜ p l φP φW φE φP (5.99) (5.6. We can emphasize this by introducing a curvature factor C such that 1 φe φ φP C φE φW 2φP (5. This scheme may be viewed as a parabolic correction to linear interpolation for φ e .103) (5. 5.104) (5. If we write ∂ φ using ∂x φP φW ∂φ ∂x ∆x we obtain φP φW φe φP 2 This scheme is referred to in the literature as the Beam-Warming scheme. we get This scheme is referred to as the Fromm scheme in the literature. adding and subtracting φ P 4.106) 2 E and C=1/8.2 Third-Order Upwind Schemes We may derive third-order accurate schemes by retaining the second derivative in the Taylor series expansion: and using cell-centroid values to write the derivatives and we may write Re-arranging.

for example. and φP in Figure 5. The second term is a correction term. we have no guarantee that the outer iterations will themselves converge. We present here a second-order accurate upwind scheme suitable for unstructured meshes. the extent of the resulting spatial oscillations is substantially smaller than those obtained through the central difference scheme.6. Thus. κ 0 the Fromm scheme and κ 1 2 the QUICK scheme. This presents a big problem for unstructured meshes since no such line structure exists. we must typically know the values φW . the first term on the right hand side represents the upwind flux. κ 1 yields the Beam-Warming scheme. and involves the values φWW . φP and φE . It is sometimes necessary to use good initial guesses and underrelaxation strategies to obtain convergence. Consequently. it is important to ensure that the Scarborough criterion is satisfied by the nominally linear equations presented to the iterative solver.108) ’ f ’ ˜ df ™ d ™f ˜ Œ ™ Œ d ˜ fŒ ™ Œ d m ’ ˜ df ˜ d ™ ’ φe φP 1 κ φP φW 1 κ φE φP (5. a similar stencil is required for φw . 5.3. In order to write φe . typical implementations of higher-order schemes use deferred correction strategies whereby the higher order terms are included as corrections to an upwind flux. For κ 1 we get the familiar central difference scheme. and the resulting solution satisfies the QUICK scheme. 5. We see from the signs of the terms in Equation 5. we are assured that the iterative solver will converge every outer iteration. while retaining at least second-order accuracy.7 Higher-Order Schemes for Unstructured Meshes All the higher-order schemes we have seen so far assume line structure.107) } ˜ ’ l . At convergence. φ P φP . φW . Just as with non-linear problems.107 that it is possible to produce negative coefficients in our discrete equation using these higher-order schemes. Since the upwind scheme gives us coefficients that satisfy the Scarborough criterion.3 Implementation Issues If iterative solvers are used to solve the resulting set of discrete equations. and represents the difference between the QUICK and upwind fluxes. Higher-order schemes for unstructured meshes are an area of active research and new ideas continue to emerge . However. The upwind term is included in the calculation of the coefficients a p and anb while the correction term is included in the b term. For the QUICK scheme.The second. the convective transport Fe φe for Fe 0 is written as Here. It is evaluated using the prevailing value of φ . we can no longer write the face value purely in terms of cell centroid values on either side of the face.and third-order schemes we have seen here may be combined into a single expression for φ e using 4 4 Here. 114 Œ ’ ™ ’ Fe φe Fe φP Fe 2 nŒ ˜ fŒ φE φP φE φW 8 2φP φP (5.

10 φ f φ0 ∇φ 0 ∆r0 O ∆r0 2 As with structured meshes. We have already seen in the previous chapter several methods for the calculation of the cell centered gradient. All the schemes we have seen employ linear coefficients.e. require outer iterations unless a deferred correction strategy is adopted. in principle.10. ∆r is given by To find the face value φ f . we evaluate Equation 5.109 at ∆r ure 5. the problem now turns to the evaluation of ∇φ 0 .95. These schemes typically employ non-linear coefficients which are adjusted to ensure adjacent 115 f d f d ’ q ˜ p ™ q ˜ p ’ f ƒ ƒd ™ t f d ™ ’ f w d 0 φ xy φ0 ∇φ ∆r y O ∆r 2 (5. whereas the central difference and higher-order differencing schemes exhibit non-monotonicity to varying degrees. 5. the discrete coefficients are independent of φ .8 Discussion We have touched upon a number of different first and second-order schemes for discretizing the convection term. as shown in Fig(5. for linear problems. we do not.110) ∆r 0 . we may write φ using a Taylor series expansion about the upwind cell centroid: Here.111) } f ƒ ƒd ™ t f d ™ ’ .A f V f ∆r C1 0 C0 Figure 5.10: Schematic for Second-Order Scheme Our starting point is the multi-dimensional equivalent of Equation 5.109) ∆r x x0 i y0 j (5. Any of these methods may be used to provide ∇φ 0 . Thus. A number of researchers have sought to control the spatial oscillations inherent in higher-order schemes by limiting cell gradients so as to ensure monotonicity. We have seen that all the schemes we have discussed here have drawbacks. The first-order schemes are diffusive. i. referring to Figure 5.. If F f 0.

and geometric boundaries. we classified boundaries according to what information was specified. We have already seen how to deal with the interior fluxes J f . 5. and writing the diffusion flux as in the previous chapter.114) φgiven b (5. Vb Ab 0 (5. velocity etc. At Dirichlet boundaries. Though we do not address this class of discretization scheme here.11. The geometric boundaries in such a problem would be the external walls of the manifold as well the surfaces of any components inside the manifold.112) SP φ0 ∆ 0 (5.9 Boundary Conditions When dealing with the diffusion equation.115) .cell values are smoothly varying [4]. while analyzing the exhaust manifold of an automobile we might not include the combustion chamber and external airflow but then we must specify information about the temperature. 116 ™ s i ˜ t ’ t J b Ab ˜ g tt ’ Using φb φgiven .113) Ab (5. The dashed line shows the inflow boundary. the gradient of φ was specified. We must then supply the appropriate information that represents the part of the universe that we are not considering but that is essential to solve the problem we are considering.1 Inflow Boundaries At inflow boundaries. ρ Vb Ab φgiven Γb Ab Ab φ0 ∆ξ Ab eξ t f d ˜ t ’ t J b Ab ρ Vb Ab φb Γb ∇φ b v q ™ p |’ t ™ t J b Ab ∑Jf Af ’ φ φgiven SC † t ’ V Vb . The discrete equation for the cell is given by f The summation in the second term is over the interior faces of the cell. as well the value of φ Consider the boundary cell shown in Fig 5. Flow boundaries occur in a problem because we cannot include the entire universe in our computational domain and are forced to consider only a subset. For example. For convection problems we must further distinguish between flow boundaries where flow enters or leaves the computational domain.9. We consider each in turn. we are given the inlet velocity distribution. they nevertheless represent an important arena of research. of the flow as it leaves the combustion chamber and enters our computational domain. 5. the value of φ itself was specified whereas at Neumann boundaries. Flow boundaries may further be classified as inflow and outflow boundaries. The boundary flux may J b is given by This boundary flux may be incorporated into the cell balance for the cell C0.

we have assumed that the 117 ’ } t t t ’ t ’ t J b Ab ρ Vb Ab φb .116) ˜ 0 (5.118) Jb Ab ρ Vb Ab φ0 Thus.118. we may write φ b φ0 . the diffusive component of the flux normal to the boundary is zero. such as that shown in Figure 5. if we were solving for temperature in an exhaust manifold where the fluid was cooled because of conduction through the walls.11: Cell Near Inflow Boundary 5.113. we do not require the value of φ to be specified – it is determined by the physical processes in the domain. Using a first-order upwind scheme. Indeed. For example.12 is given by Equation 5.117) . we assume That is. There are two key implicit assumptions in writing Equation 5. the net boundary flux at the outflow boundary is The cell balance for cell near an outflow boundary.9. and convected to the boundary by the exiting flow. This result makes physical sense. so that (5. we would certainly need to know the temperature of the fluid where it entered the domain but the temperature at the outlet would be determined as part of the solution and thus cannot be specified a priori. Vb Ab ’ t f d b Γb ∇φ Ab 0 (5.Ab Vb b e ξ C0 ∆ξ Inflow Boundary Figure 5. Thus.2 Outflow Boundaries At outflow boundaries. at outflow boundaries. The first is that convective flux is more important than diffusive flux.

either from another numerical simulation or from experimental observations. then we would expect that a lower temperature downstream of the our domain would cause a lower temperature inside the domain as well. 5. Outlet boundaries should be placed such that the conditions downstream have no influence on the solution. we would have to specify the φ values associated with the incoming portions of the flow for the problem to be well-posed. If we choose location A as the the outflow boundary. located well past the recirculation zone. we cut across the recirculation bubble. For the exhaust manifold example.3 Geometric Boundaries At geometric boundaries. These are not usually available to us. the normal component of the velocity is zero: ’ t Vb Ab 0 (5. The second assumption is that the flow is directed out of the domain at all points on the boundary. Location B.9. Consider the flow past a backward-facing step. such as the external walls of an exhaust manifold. Inflow boundaries should be placed at locations where we have sufficient data. as shown in Figure 5.119) 118 . It is very important to place flow boundaries at the appropriate location.A b C0 b Vb Figure 5. If the flow rate was not sufficiently high compared to the diffusion.13. this means that the flow rate is high enough so that conditions downstream of our boundary do not affect the solution inside the domain. is a much better choice for an outflow boundary.12: Cell Near Outflow Boundary local grid Peclet number at the outflow face is infinitely large. In this situation.

We have also examined a class of upwindweighted second-order and third–order schemes. We have seen that the convection term requires the evaluation of φ at the faces of the cell for both structured and unstructured meshes. we are typically given either Dirichlet. we have addressed the discretization of the convection-diffusion equation.10 Closure In this chapter. All these higher-order schemes yield solutions which can have spatial oscillations. In the next chapter we shall turn to the task of computing the flow and pressure fields. If the face value is interpolated using a central difference scheme. 119 f d ˜ ’ Jb Γb ∇φ b (5. In developing these schemes for convection.13: Recirculation At Domain Boundary Consequently the boundary flux J b is purely diffusive and given by At geometric boundaries. We have already shown how these may be discretized in a previous chapter. we have assumed that the flow field is known. Neumann or mixed boundary conditions.A B Figure 5. though the solution is bounded. 5. we have seen that our solution may have spatial oscillations for high Peclet numbers. smears discontinuities.120) . The upwind scheme on the other hand.

120 .

the stress tensor term has been split so that a portion of the normal stress appears in the diffusion term. Let us assume for the moment that the velocity vector V and the pressure p are stored at the cell centroids.3) (6. Let us also assume steady state. We shall also see how to develop formulations suitable for unstructured meshes. The momentum equations have the same form as the general scalar equation. 6.1) (6. especially for incompressible flows. The primary obstacle is the fact that the pressure field is unknown. The extra equation available for its determination is the continuity equation. We shall examine how to deal with this coupling.1.Chapter 6 Fluid Flow: A First Look We have thus far considered convection and diffusion of a scalar in the presence of a known flow field. The momentum equations in the x and y directions may be written as: In the above equations. for simplicity. and as such we know how to discretize them.1 Discretization of the Momentum Equation Consider the two-dimensional rectangular domain shown in Figure 6. we shall examine the particular issues associated with the computation of the flow field. The calculation of the flow field is complicated by the coupling between these two equations.4) . In this chapter.2) m dt dt 2 ∂ µ∇ V 3 ∂x (6. The reader may wish to confirm that 121 f t d ˜ n ™ n ™ ’ Sv fv ∂ ∂v µ ∂y ∂y ∂ ∂u µ ∂x ∂y m m and 2 ∂ µ∇ V 3 ∂y f t d ˜ n ™ n ™ ’ Su fu ∂ ∂u µ ∂x ∂x ∂ ∂v µ ∂y ∂x ™ ™ tt ˜f ˜f m dt dt ’ f ’ f ∇ ρ Vu ∇ ρ Vv ∇ µ ∇u ∇ µ ∇v ∇p i ∇p j Su Sv (6. and the rest is contained in S u and Sv . Let us. assume a Newtonian fluid though the issues raised here apply to other rheologies as well.

we write A The face area vectors are Thus. we get Assuming that the pressure at the face centroid represents the mean value on the face.and v-momentum equations may be written as ’ a P vP ∑ anbvnb nb nb 122 ™ f ˜ d ™ ™ f ˜ d ™ ’ aP uP ∑ anbunb pw pe ∆y ps pn ∆x f ˜ d ’ t ˜ j ∑ pf Af ps pn ∆x f ˜ d ’ t ˜ i ∑ pf Af t ˜ Wv ’ { t ˜ i ∇pd pw ˜ ’ As ˜ ’ ’ Aw An ’ Ae ’ { ∆ pdA ’ Wv f ∇pd ∑ pf Af ∆yi ∆yi ∆xj ∆xj (6. for the discrete u. f u and f v contain the body force components in the x and y directions respectively.8) pe ∆y (6. the pressure gradient term is ∆ which in turn is given by f Similarly.6) i ∑ pf Af f (6. Let us consider the pressure gradient term. We see that Equations 6.1 and 6. as well as a source term (S u or Sv ) which contains the body force term.9) (6.momentum equation. the discrete u. which we have written separately. we integrate the governing equations over the cell volume. Each momentum equation contains a pressure gradient term.7) z z z z pdA A (6.Here. as well as remnants of the stress tensor term.2 have the same form as the general scalar transport equation.11) . and as such we know how to discretize most of the terms in the equation. Applying the gradient theorem. the pressure gradient term is f Completing the discretization. This results in the integration of the pressure gradient over the control volume.10) bu bv (6. for the discrete v-momentum equation.5) (6. In deriving discrete equations.

the pressure field must be computed.13) . pn and ps . If we assume that the pressure varies linearly between cell centroids.14) 123 q ˜ p ’ f dt ’ f ps pn ∆x pS pN ∆x q ˜ p ’ f ˜ d ˜ d pw pe ∆y ™ ’ ps 2 ™ ’ pn pN 2 pP (6. we thus know how to discretize the momentum equations. 6.12) ™ ’ pw pW ™ ’ pe pE pP 2 pP pP pW pE ∆y (6.N n W w s S P e E ∆y ∆x Figure 6. and the extra equation we need for its computation is the continuity equation.2 Discretization of the Continuity Equation For steady flow.1: Orthogonal Mesh The next step is to find the face pressures p e . However. for a uniform grid 2 pS Therefore the pressure gradient terms in the momentum equations become Given a pressure field. pw . Let us examine its discretization next. which takes the form ∇ ρV 0 (6. the continuity equation. we may write.

we may write the discrete continuity equation as ρ u e ∆y ρu w ∆y ρ v n ∆x t t f d ’ `v f d t { ’ t ∇ ρV d z z z ρ V dA (6. This means that if a checkerboarded pressure field were imposed on the mesh during iteration. the tendency towards checkerboarding manifests itself in unphysical wiggles in the velocity and pressure fields. In practice. we get ∆ A Assuming that the ρ V on the face is represented by its face centroid value. Under these circumstances.18) 0 (6. we may write ρ V dA ∑ ρ V f A f (6. Instead.7. the checkerboarding would persist in the final solution.16) A f We do not have the face velocities available to us directly. and must interpolate the cell centroid values to the face. we may assume P e w ρv n ρv P 2 Gathering terms.19) . If the continuity equation were consistent with this pressure field as well.13) involves pressures that are 2∆x apart on the mesh. Consequently. it would persist at convergence. We should emphasize that these wiggles are a property of the spatial discretization and would be obtained regardless of the method used to solve the discrete equations. The same is true for the v-momentum equation. the final pressure and velocity fields would exhibit checkerboarding.Integrating over the cell P and applying the divergence theorem.15) ρ v s ∆x 0 (6. Since the pressure gradient is not given a priori.17) (6. it is possible to create pressure fields whose gradients exactly compensate the checkerboarding of momentum transport implied by the checkerboarded velocity field.2 can be sustained by the continuity equation. We see also that the pressure gradient term in the u-momentum equation (Equation 6. boundary conditions and physical properties. If the momentum equations can sustain this pattern. 124 ’ f h˜ d f d ™ f ˜ d f d ρu ∆y ρu ∆y f d f d f d ρu ρu ρv ρv W P ρv N ∆x f d ™ f d ™ f d ™ f d ™ f d ’ f d ’ f d ’ f d ’ f d ρu ρu ρu E 2 ρu P 2 ρv N 2 ρ v S ∆x ’ f h˜ d f d ™ f h˜ d f d ™ ’ Using V ui vj and Equations 6. For a uniform grid. and does not involve the pressure at the point P. the momentum equations would not be able to distinguish it from a completely uniform pressure field. the discrete continuity equation for the cell P is ρv S s E W We realize that continuity equation for cell P does not contain the velocity for cell P. a checkerboard velocity pattern of the type shown in Figure 6. and is computed as a part of the solution. perfect checkerboarding is rarely encountered because of irregularities in the mesh.

are stored at the main grid points. For the momentum equations. for the velocity v n .20) f d (6. The cell P is used to discretize the continuity equation as before: However.2: Checkerboard Velocity Field 6. We distinguish between the main cell or control volume and the staggered cell or control volume. the pressure gradient term is Similarly. and are associated with the staggered cells. The u velocity is stored on the e and w faces and the v velocity is stored on the n and s faces. Thus the possibility of velocity checkerboarding is eliminated. Thus for the discrete momentum equation for the velocity u e . without interpolating as in Equation 6. we no longer have a dependency on pressure values that are 2∆x apart.3 The Staggered Grid A popular remedy for checkerboarding is the use of a staggered mesh. We note that the mesh for the u-momentum equation consists of non-overlapping cells which fill the domain completely.21) (6. The procedure is the same as above. the pressure gradient term is Thus. the staggered control volumes are used to write momentum balances. All properties. but this is of no consequence. The pressure is stored at centroids of the main cells.22) . no further interpolation of velocity is necessary since discrete velocities are available directly where required.3.100 200 100 200 Figure 6. except that the pressure gradient term may be written directly in terms of the pressures on the faces of the momentum control volumes directly. A typical staggered mesh arrangement is shown in Figure 6. The control volumes for u and v overlap each other and the cell P. such as density and Γ. The velocity components are stored on the faces of the main cells as shown.12. This is also true for the v-momentum equation and the continuity equation. 125 q ˜ p pP pN ∆y f ˜ d pP pE ∆y ’ f e˜ d f d ™ f e˜ d ρ u e ∆y ρu w ∆y ρ v n ∆x ρ v s ∆x 0 (6. Scalars such as enthalpy or species mass fraction are stored at the centroids of the cell P as in previous chapters.

nb refers to the momentum control volume neighbors. where they are needed for the discretization of the convective terms in scalar transport equations.3: Staggered Mesh We note further that the mass flow rates are available at the main cell faces.4 Discussion The staggered mesh provides an ingenious remedy for the checkerboarding problem by locating discrete pressures and velocities exactly where required. the neighbors nb would involve the u velocities at points ee. A similar stencil influences v n . The ue momentum equation may be written as nb Similarly the equation for v n may be written as: nb Here.W uw p. φ ue E P v s S Figure 6. nne w and sse shown in Figure 6.24) (6.4. For the e momentum equation. At this point. our discretization of the continuity and momentum equations is essentially complete. The discrete continuity equation 126 ™q ˜ p ™ ’ a n vn ∑ anbvnb ∆x pP pN ™f ˜ d ™ ’ ae ue ∑ anbunb ’ ’ Fn Fs f d f d f d f d ’ ’ Fe Fw ρ u e ∆y ρ u w ∆y ρ v n ∆x ρ v s ∆x ∆y pP pE be ’‘ ’ ‘’’ ‘’‘‘ ’’’ ‘‘ ‘’‘ bn N vn      ŽŽŽŽŽ  ŽŽŽŽŽ ŽŽŽ ŽŽŽŽŽ ŽŽ ŽŽŽŽŽŽ Ž ŽŽŽŽŽŽ ŽŽ main cell cell for u velocity cell for v velocity (6.23) (6. 6.25) .

where the solution path may determine which of several possible solutions is captured).4: Neighbors for u e Momentum Control Volume is given by Equation 6. we have examined issues related to discretization of the continuity and momentum equations. That is. one option is to employ a solution loop of the type: 1. It is not yet clear how this equation set is to be solved to obtain u. when solving multiple differential equations. Thus far. Though we have not emphasized this. v and p. 6. Ns “ Discretize governing equation for species i 127 . the coefficients a p and anb are different for the u and v equations). and only dependent on the discretization. the final solution we obtain is considered independent of the path used to obtain it. We now turn to issues related to the solution of these equations. For the purposes of this book.NW N nne P w e NE W E ee EE SW S sse SE Figure 6.5 Solution Methods Thus far. We turn to this matter next. (This is not true in general for non-linear problems. a convenient way is to solve them sequentially. The solution path determines whether we obtain a solution and how much computer time and memory we require to obtain the solution.20. The discretization affects the accuracy of the final answer we obtain. for example. when computing the transport of Ns chemical species. for species i =1. (Note that because of grid staggering. our solution philosophy has been to so solve our discrete equations iteratively.

φ is a column vector of size N N s . but for incompressible flows. For compressible flows. This practice is especially popular in the compressible flow community.2. In order to solve a set of discrete equations iteratively. and to deduce the pressure from it for use in the momentum equations. Thus. Methods which use pressure as the solution variable are called pressure-based methods. However there is a difficulty associated with the sequential solution of the continuity and momentum equations for incompressible flows. If we are not worried about storage or computational time. this type of simultaneous solution is still not affordable. a class of methods called the artificial compressibility methods have been developed which seek to ascribe a small (but finite) compressibility to incompressible flows in order to facilitate numerical solution through density-based methods [6]. pressure-based methods have also been developed which may be used for compressible flows [7]. For example. we intend to use the discrete u-momentum equation to solve for the u-velocity. It is this choice that forces us to associate each governing differential equation with a solution variable. It is important to realize that the necessity for pressure. For practical CFD problems. Such methods are called density-based methods. assuming prevailing values to resolve non-linearities and dependences on the mass fractions of species j . sequential iterative solution procedures are frequently adopted because of low storage requirements and reasonable convergence rate. That is. For incompressible flows. we may wish to solve the entire problem directly using a linear system of the type Mφ b (6. Similarly. it is necessary to associate the discrete set with a particular variable. else go to step 1.26) where M is a coefficient matrix of size N Ns N Ns . especially for non-linear problems where the M matrix (or a related matrix) would have to be recomputed every iteration. and b is a column vector also of size N Ns . There are a number of methods in the literature [5] which use the density as a primary variable rather than pressure. it is necessary to find a way to introduce the pressure into the continuity equation. If we intend to use the continuity equation to solve for pressure. stop. If all species mass fractions have converged. iterative methods. we encounter a problem for incompressible flows because the pressure does not appear in the continuity equation directly. the density is unrelated to the pressure and cannot be used instead. They are very popular in the incompressible flow community. our intent is to solve for the entire set of N Ns species mass fractions in the calculation domain simultaneously. It is possible to find the density using the continuity equation. If we were to use a direct method. where N is the number of cells and Ns is the number of species. Other alternatives are possible. and solve for the discrete 128 k f k d kf k d ’ k “ k Solve for mass fractions of species i at cell centroids. The density does appear in the continuity equation. we use the discrete energy equation to solve for the temperature. if we want to use sequential. For most practical applications. pressure and density are related through an equation of state. Conversely.and density-based schemes is directly tied to our decision to solve our governing equations sequentially and iteratively.

6 The SIMPLE Algorithm The SIMPLE (Semi-Implicit Method for Pressure Linked Equations) algorithm and its variants are a set of pressure-based methods widely used in the incompressible flow community [9]. The primary idea behind SIMPLE is to create a discrete equation for pressure (or alternatively. If the pressure field p is only a guess or a prevailing iterate. satisfy the discrete continuity equation (Equation 6. Thus. Since the continuity equation contains discrete face velocities. u e and vn satisfy nb Similar expressions may be written for u w and vs . a related quantity called the pressure correction) from the discrete continuity equation (Equation 6.27) pP k Œ Œ Œ ’ Œ Œ Œ (6.p . Let p represent the discrete pressure field which is used in the solution of the momentum equations. They then solve for the continuity and momentum equations sequentially. We propose a correction to the starred velocity field such that the corrected values satisfy Equation 6. However. Other methods.24 and 6. but which can be extended to compressible flows as well. in general. have been proposed [8] but are not pursued here. with each discrete equation set being solved using iterative methods. In this chapter. we wish to correct the existing pressure field p with p p p If we subtract Equations 6.29) (6. we shall concentrate on developing pressure-based methods suitable for incompressible flows.28) (6. We emphasize here that these methods define the path to solution and not the discretization technique.25 we obtain nb nb an v ∑ anbvnb 129 ∆x pS q” ˜” q” ˜” ’ ” ’ ” ae ue ∑ anbunb ∆y pP pE pP Œ ™ ” p ™ ” p ™ ” Œ ’ ™ ” ™Œ ’ Œ ’ ” u v u v u v Œ ™ a n vn ∑ anbvnb nb ∆x pS Œ Œ ™f ˜ d Œ Œ ™f ˜ d Œ Œ ™ Œ Œ Œ Œ ’ Œ ae ue ∑ anbunb ∆y pP pE be bn (6. direct solutions of this type are still out of reach for most problems of practical interest. we need some way to relate these discrete velocities to the discrete pressure field.30) .over N cells).27 from Equations 6.20). (three variables u. even with the power of today’s computers. The SIMPLE algorithm uses the discrete momentum equations to derive this connection.20: Correspondingly. including local direct solutions at each cell.velocities and pressure using a domain-wide matrix of size 3N 3N.20). the discrete u and v obtained by solving the momentum equations will not. coupled to an iterative sweep.v. These methods seek to create an equation for pressure by using the discrete momentum equations. no such association is necessary. Let u and v be the discrete u and v fields resulting from a solution of the discrete u and v momentum equations. 6.

37) .30 represent the dependence of the velocity corrections u and v on the pressure corrections p . We now make an important simplification. In effect. defining we write Equations 6. We approximate Equations 6. 130 ” ” ’ ” Fn q” ˜ ” p q” ˜” p ’ ” Fe ρe de ∆y pP ρn dn ∆x pP ’ Fn Fn Fn ” ™ ” ™Œ Œ ’ Fe Fe Œ ’ Œ Fn Œ ’ Œ Fe ρe ue ∆y ρn vn ∆x q” ˜ ” p q” ˜” p ™ ™Œ Œ ’ ” vn dn pP ue vn de pP dn pP q” ˜ ” p q” ˜” p ’ ” ue de pP ’ dn ’ de q” ˜” p q” ˜” p • ” • ” ae ue a n vn ∆y pP ∆x pS pE pP ∆y ae ∆x an pE pS pE pS Fe (6. they tell us how the velocity field will respond when the pressure gradient is increased or decreased.31) (6.23 we may write the face flow rates obtained after the solution of the momentum equations as The corrected face flow rates are given by with Similar expressions may be written for Fw .31 as so that ue vn Further. Fw .32) (6. Thus far.34) (6. Equations 6.30 as or.36) pE pS ” ” ” ” ’ ’ ” (6.Similar expressions may be written for u w and vs . Fs and Fs .35) (6. we have derived expressions describing how the face flow rates vary if the pressure difference across the face is changed. We now turn to the task of creating an equation for pressure from the discrete continuity equation. using Equations 6.33) (6.

6.6.1 The Pressure Correction Equation
We now consider the discrete continuity equation. The starred velocities u and v , obtained by solving the momentum equations using the prevailing pressure field p do not satisfy the discrete continuity equation. Thus

or, in terms of F, we have

We require our corrected velocities, given by Equations 6.28, to satisfy continuity. Alternately, the corrected face flow rates, given by Equation 6.36, must satisfy continuity. Thus,

or using Equations 6.37

Rearranging terms, we may write an equation for the pressure correction p P as:
nb

where

We note that the source term in the pressure correction equation is the mass source for the cell P. If the face flow rates F satisfy the discrete continuity equation (i,e, b is zero), we see that p constant satisfies Equation 6.44. Thus, the pressure correction equation yields non-constant corrections only as long as the velocity fields produced by the momentum equations do not satisfy continuity. Once these velocity fields satisfy the discrete continuity equations, the pressure correction equation will yield a constant correction. In this limit, differences of p are zero and no velocity corrections are obtained. If the constant correction value is chosen to be zero (we will see why this is possible in a later section), the pressure will not be corrected. Thus, convergence is obtained once the velocities predicted by the momentum equations satisfy the continuity equation.

™ Œ ˜Œ Œ ˜Œ

”

Œ

’

b

’

aP

’

’

aN aS

’

aW

’

aE

ρe de ∆y ρw dw ∆y ρn dn ∆x ρs ds ∆x ∑ anb
nb

Fw

Fe

131

™

—

’ ”

aP pP

∑ pnb

b

Fs

Fn

”

’ q” ˜” p q” ˜ ” p

Fe ρe de ∆y pP pE Fw ρw dw ∆y pW Fn ρn dn ∆x pP pN Fs ρs ds ∆x pS

™ ™ ™ ’” ˜ Œ ˜” Œ ” ˜ Œ ˜” Œ

Fe

Fe

Fw

™ –’ Œ ˜ Œ Œ ˜ Œ

Fe

Fw

Fn

Fs

0

Fw

Fn

Fn

Fs

Fs

0

pP pP

–’

f Œ e˜ d

fŒ d ™

˜ ˜ Œ 8q ” ˜ ” p ˜ Œ rq ” ˜ ” p ˜

f Œ e˜ d

fŒ d ’” ™

ρu

e ∆y

ρu

w ∆y

ρv

n ∆x

ρv

s ∆x

0

(6.38)

(6.39)

(6.40)

0

(6.41) (6.42)

(6.44)

Œ

Œ

Œ

Ϊ

Œ

™

6.6.2 Overall Algorithm
The overall procedure for the SIMPLE algorithm is the following: 1. Guess the pressure field p . 2. Discretize and solve the momentum equations using the guessed value p for the pressure source terms. This yields the u and v fields. 3. Find the mass flow rates F using the starred velocity fields. Hence find the pressure correction source term b. 4. Discretize and solve the pressure correction equation, and obtain the p field. 5. Correct the pressure field using Equation 6.29 and the velocities using Equation 6.28. The corrected velocity field satisfies the discrete continuity equation exactly. 6. Solve the discrete equations for scalar φ if desired, using the continuity-satisfying velocity field for the convection terms. 7. If the solution is converged, stop. Else go to step 2.

6.6.3 Discussion
The pressure correction equation is a vehicle by which the velocity and pressure fields are nudged towards a solution that satisfies both the discrete continuity and momentum equations. If we start with an arbitrary guess of pressure and solve the momentum equations, there is no guarantee that the resulting velocity field will satisfy the continuity equation. Indeed the b term in the continuity equation is a measure of the resulting mass imbalance. The pressure correction equation corrects the pressure and velocity fields to ensure that the resulting field annihilates this mass imbalance. Thus, once we solve the pressure correction equation and correct the u and v fields using Equations 6.28, the corrected velocity fields will satisfy the discrete continuity equations exactly. It will no longer satisfy the discrete momentum equations, and the iteration between the two equations continues until the pressure and velocity fields satisfy both equations. It is important to realize that because we are solving for the pressure correction rather that the pressure itself, the omission of the ∑nb anb unb and ∑nb anb vnb terms in deriving the pressure correction equation is of no consequence as far as the final answers are concerned. This is easily seen if we consider what happens in the final iteration. In the final iteration, u , v and p satisfy the momentum equations, and the b term in the p equation is zero. As discussed earlier, the p equation does not generate any corrections, and u u , v v , p p holds true. Thus, the p equation plays no role in the final iteration. Only discrete momentum equation, and the discrete continuity equation (embodied in the b term) determine the final answer. The dropping of the ∑nb anb unb and ∑nb anb vnb terms does have consequences for the rate of convergence, however. The u-velocity correction in Equation 6.30, for example, is a function of both the velocity correction term ∑nb anb unb and the pressure 132

Œ

”

”

”

Œ

”

Œ

”

”

Œ

”

Œ

Œ ’ Œ ’ Œ ’ Œ Œ

Œ

Œ

”

Œ

”

correction term. If we drop the ∑nb anb unb term, we place the entire burden of correcting the u-velocity upon the pressure correction. The resulting corrected velocity will satisfy the continuity equation all the same, but the resulting pressure is over-corrected. Indeed, because of this over-correction of pressure, the SIMPLE algorithm is prone to divergence unless underrelaxation is used. We underrelax the momentum equations using underrelaxation factors α u and αv in the manner outlined in previous chapters. In addition, the pressure correction is not applied in its entirety as in Equation 6.29. Instead, only a part of the pressure correction is applied:

The underrelaxation factor α p is chosen to be less than one in order to correct for the over-correction of pressure. It is important to emphasize that we do not underrelax the velocity corrections in the manner of Equation 6.45. The entire point of the pressure correction procedure is to create velocity corrections such that the corrected velocity fields satisfy continuity. Underrelaxing the velocity corrections would destroy this feature. Thus, the SIMPLE algorithm approaches convergence through a set of intermediate continuity-satisfying fields. The computation of transported scalars such as enthalpy or species mass fraction is therefore done soon after the velocity correction step (Step 6). This ensures that the face flow rates used in discretizing the φ transport equation are exactly continuity satisfying every single iteration.

6.6.4 Boundary Conditions
We have already dealt with the boundary conditions for scalar transport in the previous chapter. These apply to the momentum equations as well. We turn now to boundary conditions for pressure. Two common boundary conditions are considered here: given normal velocity and given static pressure. A third condition, given stagnation pressure and flow angle, is also encountered, but we will not address it here. At a given-velocity boundary, we are given the normal component of the velocity vector Vb at the boundary. This type of boundary could involve inflow or outflow boundaries or boundaries normal to which there is no flow, such a walls. Consider the near-boundary cell shown in Figure 6.5. Out objective is to derive the pressure correction equation for C0. Integrating the continuity equation for the cell C0 in the usual fashion, we have

We know how to write the interior face flow rates Fe , Fn and Fs in terms of the the pressure corrections. For Fb , no such expansion in terms of pressure correction is necessary because Fb is known, and is given by

This known flow rate is incorporated directly into the mass balance equation for cell C0. When all boundaries are given-velocity boundaries, we must ensure that the specified 133

’

Fb

ρb ub ∆y

’

˜

™

˜

Fe

Fb

Fn

Fs

”

™

Œ ’

p

”

p

αp p

(6.45)

0

(6.46)

Thus.6. and the problem does not arise. but the individual pressure values themselves are not. only N 1 unique equations can result.n V b P e s Figure 6. the result is still converged. In such a case. We should emphasize this situation only occurs if all boundaries are given-velocity boundaries. At a given-pressure boundary. otherwise the problem would not be well-posed. the pressure correction p b is set equal to zero. but this is acceptable since 134 Œ ” ” ˜ ™ ’” .44 and its behavior at convergence. it is necessary to specify pressure boundary conditions on at least part of the domain boundary. The reader may verify that p and p C are solutions to the governing differential equations. We have said that the pressure correction becomes a constant at convergence. Let us go back to the pressure correction equation. where the density is a function of pressure. Thus. Differences in pressure are unique. the level of pressure in the domain is not set. if we divide the computational domain into N cells. 6. Equation 6. we may set p 0 in one cell in the domain. This situation may be remedied by setting the pressure at one cell centroid arbitrarily. and impose a mass balance on them. the pressure correction has an arbitrary level. the pressure is made unique. Therefore we do not have enough equations for N pressure (or pressure correction) unknowns. the pressure level would rise by a constant every iteration. If all boundaries are given-velocity boundaries.where density is not a function of pressure.5 Pressure Level and Incompressibility For incompressible flows. which we are free to set equal to zero. For compressible flows. When the static pressure p is given on a boundary. We are given velocity boundary conditions that are continuity-satisfying in an overall sense. it is common to encounter situations which are best modeled with given-velocity boundary conditions on all boundaries. the pressure p sees no corrections at convergence. From a computational viewpoint we may interpret this situation in the following way.5: Near-Boundary Cell for Pressure boundary velocities satisfy overall mass balance over the entire computational domain. alternatively.(Even if we did not set p to zero.

and one such algorithm is SIMPLER (SIMPLE-Revised) [10]. it would seem appropriate to use the pressure correction equation to correct velocities. while finding another way to compute the pressure. we destroy the original (good) velocity field. and require under-relaxation. 6.49) pE q ™ ™ ’ ’ vn bn dn pP pN f ˜ p ˜ d ™ ™ ’ ue ∑nb anb unb ae ∑nb anb vnb an be de pP pE (6. If one or more given-pressure boundaries are present. the pressure correction predicts zero corrections at convergence. Thus the constant value predicted by the pressure correction will come out to be zero. are good. p 0 is set at at least one boundary face. Consequently. One of the drawbacks of the SIMPLE algorithm is the approximate nature of the pressure correction equation. we derive the pressure equation by re-arranging the momentum equations as follows: By defining we may write vn Furthermore. The velocity corrections. We would prefer an algorithm which can recover the correct pressure field immediately if the exact velocity field is known. If we solve the momentum equations with a guessed pressure field p . we may define ’ ’ ˆ Fe ˆ Fn ρe ue ∆y ˆ ρn vn ∆x ˆ 135 q vn ˆ dn pP pN f ˜ p ˜ d ™ ™ ’ ue ue ˆ de pP ™ ’ vn ˆ ™ ’ ue ˆ ∑nb anb unb au e ∑nb anb vnb ae be bn (6. This slows down convergence. since optimal values are problem dependent and rarely know a priori. A good guess of the velocity field is no use when using the SIMPLE algorithm. With SIMPLER. unless accompanied by a good pressure guess.7 The SIMPLER Algorithm The SIMPLE algorithm has been widely used in the literature. the pressure corrections resulting from it are too large.48) (6. A good way of understanding this is to consider what the SIMPLE algorithm does when we know the velocity field.51) ” Œ ’” ” . however. and then embark on a long iterative process to recover it. there have been a number of attempts to accelerate its convergence. In this case also. and guarantee that the corrected velocities satisfy the continuity equation.50) (6. Because the ∑nb anb unb and ∑nb anb vnb terms are dropped in its derivation. Nevertheless.only differences of pressure are relevant with all given-velocity boundaries). but do not know the pressure field.

and v . 7. Solve the pressure correction equation to obtain p . ˆ ˆ 3. Thus. if the velocity field is exact. Do not correct the pressure ! 136 ” ˜ ™ ˜ ’ b ’ aP ’ ’ aN aS ’ aW ’ aE ρe de ∆y ρw dw ∆y ρn dn ∆x ρs ds ∆x ∑ anb nb ˆ Fw ˆ Fe ˆ Fs ™ ’ aP pP ∑ anb pnb b ˆ Fn q f ˜ p ˜ d ™ ™ Œ ’ ’ ” Fe Fn ˆ Fe ˆ Fn ρe de ∆y pP pE ρn dn ∆x pP pN (6. Solve the pressure equation (Equation 6.28. it does not represent the mass imbalance. Guess the velocity field. 4.1 Overall Algorithm The SIMPLER solution loop takes the following form: 1.52 into the discrete continuity equation (Equation 6.so that Substituting Equations 6. Compute the mass source term b in the pressure correction equation. Another important difference is that no approximations have been made in deriving the pressure equation. and the a P and anb coefficients are identical to those governing the pressure correction.7. We should emphasize that although the b term looks similar in form to that in the p equation. Correct u and v using Equations 6. The b term.52) (6. the correct pressure field will be recovered. however. 6. 5. 2. and involves the velocities u and v rather than ˆ ˆ the prevailing velocities u and v . is different.54) Œ Œ Œ Œ Œ . 6. to obtain u . Compute u and v. Solve the momentum equations using the pressure field just computed.20) we obtain the following equation for the pressure: nb where The form of the pressure equation is identical to that of the pressure correction equation.54) using the guessed field and obtain the pressure.

33. which is easier to guess. It generates the pressure field from a good guess of the velocity field. and ˆ ˆ later. stop. the neglect of the ∑nb anb unb and ∑nb anb vnb terms in writing Equations 6. the SIMPLER algorithm does not have the tendency to destroy a good velocity field guess like the SIMPLE algorithm. The lack of Dirichlet boundary conditions for p causes linear solvers to converge slowly. Thus. but this is not usually required. 6. and therefore involves more computational effort. Because the pressure correction p is not used to correct the pressure. The same is true of pressure. Else go to 2. no underrelaxation of the pressure correction in the manner of Equation 6. The momentum equation coefficients are needed in two places – to find u and v for the pressure equation. 6. Solve for any scalar φ ’s of interest.45 is required. storage for each of the coefficient sets is required. The pressure correction solver in the SIMPLE loop typically accounts for half the computational effort during an iteration. 9. If converged.8. the SIMPLEC algorithm attempts to approximate the neighbor corrections by using the cell correction as: nb 137 ” • ∑ anbvnb nb ve ∑ anb nb ” • ∑ anbunb ue ∑ anb nb ” ” ” ” ” ” (6. it uses one extra equation. Thus. This is primarily because the SIMPLER algorithm does not require a good pressure guess (which is difficult to provide in any case).the actual pressure and the pressure correction.2 Discussion The SIMPLER algorithm has been shown to perform better than SIMPLE. The SIMPLER algorithm solves for two pressure variables . Instead of ignoring these completely. To avoid computing them twice.7.. to solve the momentum equations.e. adding an extra pressure equation in the SIMPLER algorithm increases the computational effort by about 50%.55) . This is also true for the pressure coefficients. The momentum equations must be underrelaxed to account for non-linearities and also to account for the sequential nature of the solution procedure. The pressure equation may itself be underrelaxed if desired. This is because the pressure correction equation is frequently solved with given-velocity boundary conditions. At this point we have a continuity satisfying velocity field. i. Thus. Check for convergence.8 The SIMPLEC Algorithm The SIMPLE-Corrected (SIMPLEC) algorithm [11] attempts to cure the primary failing of the SIMPLE algorithm.

the velocity corrections take the form nb nb Redefining de and dn as The rest of the procedure is the same as that for the SIMPLE algorithm except for the fact that the pressure correction need not be underrelaxed as in Equation 6. The SIMPLEC algorithm has been shown to converge faster than the SIMPLE and does not have the computational overhead of the SIMPLER algorithm. However.Thus. The SIMPLE procedure employs a pressure correction of the type whereas the SIMPLEC algorithm employs a pressure correction of the type Rather than solve for p .57) (6. 6.45.60) Then its correction equation takes the form of Equation 6. ˆ ˆ Now let us examine the p equation (or p equation) solved by SIMPLEC. let us make the SIMPLE algorithm solve for a variable p ˆ defined as p αp p ˆ (6.56) (6.58) (6. it does share with SIMPLE the property that a good velocity field guess would be destroyed in the initial iterations unless accompanied by a good guess of the pressure field.61) nb 138 ” ™ ” ” ” ” ™ Œ ’ p p p ” ™ Œ ’ p p αp p q ˜ p ’ š” ’ ” ” ’ dn an q ˜ p ’ de ae ∆y ∑nb anb ∆x ∑nb anb q” ˜” p ’ ” ™ ” ˜ an ∑ anb vn ∆x pP q” ˜” p pN (6. The equation has the form ˆ aP pP ∑ anb pnb b ˆ (6.59. we should note that the d e and dn definitions require the momentum equations to be underrelaxed to prevent the denominator from going to zero.9 Optimal Underrelaxation for SIMPLE It is possible to make SIMPLE duplicate the speed-up exhibited by SIMPLEC through the judicious choice of underrelaxation factors. We may think of SIMPLEC as solving for p rather than p . However.59) ’ ” ™ ˜ ˜ ˜ ” ” ae ∑ anb ue ∆y pP pE .

in strongly non-linear cases.62) ρ ∆y2 ∑nb anb (6.67 in underrelaxing the momentum equations and the pressure correction. Many of these difficulties are a result of the sequential nature of the momentum and continuity solutions. and reasonably good performance over a broad range of problems. we conclude that α p 1 αu (6. These are. and the same basic advantages and disadvantages obtain. the pressure correction coefficients in Equation 6. divergence may occur despite underrelaxation.66) . 6. All these procedures have the advantage of low storage. For such problems. so that ∑nb anb (6.62 may be written as ˆ Now we turn to the SIMPLE algorithm. However. the user would not find much difference in the performance of the different SIMPLE variants. variations on the basic theme of sequential solution.64) (6.64 to be equal to that in Equation 6.10 Discussion We have seen three different possibilities for a sequential solution of the continuity and momentum equations using a pressure-based scheme. swirl and other agents. however. If we cast its p equation in p form.65) (6.67) Thus.63) ae αu Thus. we get nb with the coefficients a nb having the form If we require the a nb coefficient in Equation 6. which are strongly coupled through the pressure gradient term when strong body forces are present. we see that if we use Equation 6.with the coefficients a nb having the form Let us assume for simplicity that the momentum equation coefficients have no S P terms. A number of other variants and improvements of the basic SIMPLE procedure are also available in the literature. we would essentially reproduce the iterations computed by SIMPLEC. they are known to require a large number of iterations in problems with large body forces resulting from buoyancy.66. A variety of coupled solvers have been developed which seek 139 ˜ ’ ’ anb αp αu ρ ∆y2 ∑nb anb ™ ” ’ ” aP p P ˆ ˆ ∑ anb pnb b ” ” › ’ anb 1 αu αu ˜ ’ ’ anb ρ ∆y2 ae ∑nb anb (6.

These velocity components are guaranteed to never become tangential to the face because they turn as the mesh turns. it is possible to encounter cells where the stored face velocity component is tangential to the face. especially in connection with unstructured meshes. for example. 6. we use velocity components normal to the face in question. though formulations of this type can be worked out. These procedures usually incur a storage penalty but exhibit substantial convergence acceleration. i.. it is necessary to use grid following velocities. However. The e η vector is aligned tangential to the face. the staggered mesh procedures described above may be used in principle.(a) (b) Figure 6. The e ξ vector is aligned along the line joining the cell centroids. If we store the u and v velocities on the faces as shown. On each face. For example.6(b). and (b) Grid-Following to replace the sequential solution of the momentum and continuity equations through tighter coupling of the two equations (see [8] for example). as illustrated in Figure 6. Two primary grid-following or curvilinear velocity systems have been used in the literature for this purpose. the component along the line joining the centroids is stored.(Other options. Any velocity set with a fixed (non-zero) angle to the local face would do as well. great care must be taken in the choice of velocity components. such as storing both components of the Cartesian velocities at all faces. velocities whose orientation is defined with respect to the local face. overlapping momentum control volumes result).e. The vectors e ξ and eη are called the covariant basis vectors.6: Velocity Systems for Structured Bodyfitted Meshes: (a) Cartesian.7(a). This area continues to be active area for new research.6(a). it is not possible to use Cartesian velocity components with a staggered mesh. Thus on Karki œ 140 . at least for laminar flow problems. Consider the cells P and E is Figure 6. making it difficult to discretize the continuity equation correctly. If staggered meshes are used. In Figure 6. Here we consider a 90 elbow. The velocity components along these basis directions are called the covariant velocity components. the result is not very elegant. These are the covariant velocity and the contravariant velocity systems. similar to our practice on regular meshes. have been tried.11 Non-Orthogonal Structured Meshes When structured non-orthogonal meshes are used. for example.

curvilinear velocities are not particularly easy entities to deal with. and (b) Contravariant and Patankar [7] have use a covariant velocity formulation to develop a staggered mesh SIMPLE algorithm for body-fitted structured meshes. Curvilinear coordinates do not have this property. Each face stores one contravariant component. The SIMPLE family of algorithms may be developed for a staggered mesh discretization using either of these two coordinate systems. the momentum equations written in Cartesian coordinates may always be cast in conservative form. momentum in the curvilinear directions is not conserved.P eη E e ξ (a) P η e E eξ (b) Figure 6. contravariant basis vectors may be used. curvilinear velocities remain cumbersome and are difficult 141 .7: Curvilinear Velocity Components (a) Covariant. additional curvature terms appear. Since Newton’s laws of motion conserve linear momentum. Thus we are not guaranteed conservation. just as they do in cylindrical-polar or spherical coordinates. or for strain rates in non-Newtonian rheologies. To overcome this. These quantities are extremely cumbersome to derive in curvilinear coordinates. The contravariant velocities are aligned along these basis directions. researchers have computed the flow field in curvilinear coordinates and stored both Cartesian and curvilinear velocities. velocity gradients are required in other equations. the basis vector e ξ is perpendicular to the face. Despite these workarounds. (Researchers have proposed clever cures for this problem. for example for production terms in turbulence models. Though these efforts have generally been successful. Here.7(b). the momentum equations written in these curvilinear directions cannot be written in conservative form. as shown in Figure 6. As a result. Alternatively. see Karki and Patankar [7]. They use Cartesian velocity components for all such manipulations. Furthermore. Since covariant and contravariant basis vectors change direction with respect to an invariant Cartesian system. and the basis vector e η is perpendicular to the line joining the cell centroids. for example). the component perpendicular to the face.

These tech142 .8. Because of these difficulties. 6. 6. We see that the staggered discretization developed in this chapter is not easily extended to body-fitted and unstructured meshes. equal-order. In the work by Baliga and Patankar. Staggering was shown to be necessary to prevent checkerboarding in the velocity and pressure fields. triangular macro-elements are employed. we have developed staggered mesh based discretization techniques for the continuity and momentum equations. it is not easy to identify a workable staggered mesh.13 Closure In this chapter. This has been shown to circumvent checker-boarding. or co-located methods. for example. For unstructured meshes. In the finite element community. prompting concerns about accuracy. as shown in Figure 6. Node-based finite-volume schemes [12] have been developed which employ the same unequal-order idea. The use of staggered mesh methods based on curvilinear velocities is cumbersome and uninviting for structured meshes.8: Storage Arrangement for Node-Based Unequal Order Finite Volume Scheme to interpret and visualize in complex domains. SIMPLER and SIMPLEC for solving this set of discrete equations.12 Unstructured Meshes For unstructured meshes. Though this arrangement has been shown to prevent checkerboarding. efforts have been underway to do away with staggering altogether and to develop techniques known variously as non-staggered . For cell based schemes there is no obvious counterpart of this unequal order arrangement. a class of unequal order methods have been developed which interpolate pressure to lower order than velocity. The macroelement is subdivided into 4 sub-elements. and velocity is stored on the vertices of the subelements.Pressure Storage Location Velocity Storage Location Figure 6. even if we could use curvilinear velocity components. pressure is resolved to only one-fourth the mesh size as the velocity in two dimensions. the staggered mesh discretization method we have derived so far is almost entirely useless since no obvious mesh staggering is possible. Pressure is stored at the nodes of the macroelement. We then developed sequential and iterative pressure-based techniques called SIMPLE.

and use Cartesian velocities in the development. They also do away with the necessity for curvilinear velocity formulations. We should emphasize that the material to be presented in the next chapter changes only the discretization practice. We will address this class of techniques in the next chapter.niques store pressure and velocity at the same physical location and attempt to solve the problem of checkerboarding through clever interpolation techniques. We may still use sequential and iterative techniques such as SIMPLE to solve the resulting set of discrete equations. 143 .

144 .

we turn to the problem of discretizing the continuity and momentum equations using a non-staggered or co-located mesh. staggered meshes are somewhat cumbersome to use.. Specialized interpolation schemes are used to prevent checkerboarding. u. we saw in the previous chapter that staggered meshes could only be used if grid-following velocities were used. In the discussion that follows. leads to checkerboarding in the pressure and velocity fields. We also used Cartesian velocity components as our primary variables. i. we saw that this option is also not entirely optimal. as well increased coding complexity. For the purposes of this chapter. defined in a global coordinate system. As a result. storing both pressure and velocity at the cell centroid. For Cartesian meshes. albeit with a few minor changes to account for the change in storage scheme. We saw in the last chapter that storing pressure and velocity at the same location.e.1 Velocity and Pressure Checkerboarding Co-located or non-staggered methods store pressure and velocity at the cell centroid. The iterative methods used to solve the resulting discrete set are the same as those in the previous chapter. it is not obvious how to define staggered pressure and velocity control volumes. we use Cartesian velocity components u and v. we will continue to use the SIMPLE family of algorithms for the solution of the discrete equations. The mesh and associated nomenclature are shown 145 . The change to a co-located or non-staggered storage scheme is a change in the discretization practice. in Figure 7. at the cell centroids. We will address two-dimensional and non-orthogonal meshes in a later section. Furthermore. We circumvented this in Cartesian meshes by using staggered storage of pressure and velocity.Chapter 7 Fluid Flow: A Closer Look In this chapter. staggering requires the storage of geometry information for the main and staggered u and v control volumes. v and p are stored at the cell centroid P. For unstructured meshes.1. Furthermore. let us assume an orthogonal one-dimensional uniform mesh. Thus. 7. as are other scalars φ . once the basic idea is clear. recent research has focused on developing formulations which employ Cartesian velocity components. The principle of conservation is enforced on the cell P. For body-fitted meshes.

φ s e E EE S Figure 7.2: Control Volumes for Velocity Interpolation 146 f ˜ d ™ ™ ’ ’ aP uP ∑ anbunb bu P pw pe (7.N n P W w u. a unit area of cross section ∆y 1 has been assumed.2.p. The pressure at the faces e and w are not known since the pressure is stored at the cell centroids.1: Co-Located Storage of Pressure and Velocity in Figure 7. The neighbors nb for this co-located arrangement include the velocities at the points E and W . 7.1.1) . ue W P e E EE Figure 7.1 Discretization of Momentum Equation The discretization of the u-momentum equation for the cell P follows the principles outlined in previous chapters and yields the following discrete equation: nb Here.v.

7 can support a checkerboarded pressure field. it only involves pressures at cells on either side. we may write nb Similarly.7) (7.Consequently. and a uniform mesh.2 and 7. we have ™ ’ uE uE ˆ 147 f ˜ d ™ ’ uP uP ˆ 1 pW pE aP 2 1 pP pEE aE 2 q ˜ ’ p ˜ ρe uE ρw uW ™ ™ ’ ’ Fe Fw ρe ue ∆y ρw uw ∆y ’ ˜ Fe Fw ™ ™ ’ ’ ’ aE uE bu E 2 0 0 f ˜ d ∑ anbunb ™ ™ ’ aP uP bu P 2 pP pEE q ˜ ∑ anbunb pW pE p (7. we may write nb We see that the u-momentum equation at point P does not involve the pressure at the point P. 7. If we retain this type of discretization for the pressure term in the momentum equation. The same is true for u E . we integrate it over the cell P as before and apply the divergence theorem. for u E .2) (7.1.3 Pressure Checkerboarding Let us now consider the question of whether Equation 7.2 Discretization of Continuity Equation In order to discretize the continuity equation. the u-momentum equation can support a checkerboarded solution for pressure. Adopting a linear interpolation.5) (7. If we use a linear interpolation uP uE ue 2 uW uP (7.3) (7.8) .1.4) (7. interpolation is required. Thus. This yields where As we discussed in the previous chapter.6) uw 2 Substituting these relations into Equation 7. we must make sure that the discretization of the continuity equation somehow disallows pressure checkerboarding.4 and assuming unit ∆y yields 7. we must interpolate u from the cell centroid values to the face in order to find u e and uw . Dividing Equations 7.3 by their respective center coefficients a P and aE .

we must ensure that the discretization of either the momentum or the continuity equation provides a filter to remove these oscillatory modes. Furthermore the face velocity u e is not defined purely as a linear interpolant of the two adjacent cell values. 148 ’ n ™ n ™ 2 ™ ’ uw 4 ˜ ˜ uW ˆ uP ˆ 1 aW pWW pP 4 1 aP pW pE n m ™ n m ™ ™ ’ ue 2 4 ˜ ˜ uP ˆ uE ˆ 1 aP pW pE 1 aE m ™ m ’ uE ˆ ™ ’ uP ˆ ∑nb anb unb aP ∑nb anb unb aE bu P bu E (7.1. the resulting discrete continuity equation. Thus. an additional term. These face velocities are used to write the one-dimensional discrete continuity equation (Equation 7. Since the same type of checkerboarding is supported by the discrete momentum equations.where If we average u P and uE using Equation 7. 7.7). In order to prevent checkerboarding in the final solution. does not involve the cell-centered velocities uP .10) (7. 7. Equation 7.11) ’ ’ . a checkerboarded pressure field can persist in the final solution if boundary conditions permit.7 we obtain A similar equation can be written for u w : We see right away that any checkerboarded pressure field which sets p W pE and pP pEE pWW will be seen as a uniform pressure field by u e and uw . the continuity equation supports a checkerboarded velocity field. we will in effect create a pressure field to offset these checkerboarded momenta. If we enforce momentum balance on the cell.7. this pressure field must of necessity be checkerboarded.9) pP pEE 4 (7. called the added dissipation prevents velocity checkerboarding. Such a checkerboarded velocity field implies checkerboarded momenta in the cell momentum balance.8 to find u e in Equation 7. Our discrete continuity equation does nothing to filter spurious oscillatory modes in the pressure field supported by the momentum equation. the linear interpolation of cell velocities also introduces checkerboarding. As we have seen in the previous chapter.2 Co-Located Formulation Co-located formulations prevent checkerboarding by devising interpolation procedures which express the face velocities u e and uw in terms of adjacent pressure values rather than alternate pressure values.4 Velocity Checkerboarding In addition to pressure checkerboarding.

the discrete one-dimensional momentum equations for cells P and E yield where dP Writing the continuity equation for cell P we have or equivalently As before. Another way of looking at this is to say that in writing u e .14) (7. It is important to understand the manipulation that has been done in obtaining Equation 7.16) (7.17) (7. If we interpolate u e linearly. 14. We have removed the pressure gradient term resulting from linear interpolation of velocities (which involves the pressures p W .17.As we saw in the previous section. we get Instead of interpolating linearly. It was proposed. 15] 149 f ˜ d ™ ’ ™ 2 de f ˜ d ™ uP ˆ de pP pE dP dE 2 ™ n 4 f ˜ d ˜ n ˜ ™ ’ ue dP dE ˜ ˜ uP uE pW pE pP pEE de pP n ™ n m ™ 2 m ™ ’ ™ ’ ’ ue 2 dP 4 dE ˜ ˜ uP uE uP ˆ uE ˆ pW pE m ’ ˜ ρe ue ρw uw ’ ˜ Fe ’ dE ’ ™ m ’ uE uE ˆ dE 2 1 aP 1 aE (7. pE . with small variations. It is also sometimes referred to as an added dissipation scheme.13) Fw 0 0 f pP pEE 4 pE ˜ d ™ ’ uP uP ˆ dP 2 pP pEE q ˜ pW pE p (7. we use 2 uE ˆ 4 where A similar expression may be written for u w . This type of interpolation is sometimes referred to as momentum interpolation in the literature. unit cross-sectional area is assumed. pP and pEE ) and added in a new pressure gradient term written in terms of the pressure difference p P pE .15) (7.12) (7. but write the pressure gradient term directly in terms of the adjacent cell-centroid pressures p P an pE .18) . by different researchers in the early 1980’s [13. we interpolate the u component ˆ linearly between P and E.

Thus.22) ˜ d m ˜ m ˜ ˜ m ™ ˜ ’ ’ ue dP ˜ ˜ uP uE pW pE pP pEE dP pP ’ ’ m pE . the momentum interpolation procedure derives it by interpolating u linearly. Another useful way to think about momentum interpolation is to consider the face velocity ue to be a sort of staggered velocity. the continuity equation does not permit such a pressure field to persist. we can show that P 150 q p ™ q ˜ ™ n p ’ ∂2p ∂ x2 pW pE 2pP ∆x2 O ∆x2 qf ˜ ™ h8q d ˜ ˜ ™ p p dP 4 pW pE 2pP pP pEE 2pE nf ˜ h˜ d ˜ ™ ˜ pW pE pP pEE ™ n ™ 4 4 pP pE f ˜ d ˜ ˜ pW pE pP pEE dP pP ™ n ™ 2 4 4 pE f (7.17: Let us look at the pressure terms dP Rearranging. For simplicity. may be interpreted as a momentum equation for the staggered velocity ue . Equation 7. Instead of deriving the staggered momentum equation from first principles. Since they are written in terms of adjacent pressures rather that alternate ones. This would be the case if the mesh were uniform. (Recall that the quantity u contains ˆ the convection. momentum interpolation avoids the creation of staggered cell geometry and makes it possible to use the idea for unstructured meshes. diffusion coefficients and source terms were constant for the cells P and E. and adding the ˆ pressure gradient appropriate for the staggered cell. The momentum interpolation formula. Ideas similar to it have also been used in the compressible flow community with density-based solvers. Momentum interpolation prevents checkerboarding of the velocity field by not interpolating the velocities linearly.3 The Concept of Added Dissipation It is useful to understand why momentum interpolation is also referred to as the added dissipation scheme. The face velocities u e and uw are used to write the discrete continuity equation for cell P. a continuity-satisfying velocity field would not be able to ignore a checkerboarded pressure field.) By not using an actual staggered-cell discretization.21) (7. even though the momentum equation contains a pressure gradient term that can support a checkerboarded pattern. let us assume that d P dE de . diffusion and source contributions of the momentum equation. 7. and the flow field.17.for use with pressure-based solvers. we have dP 4 4 Using a Taylor series expansion. Let us consider the first of the expressions in Equation 7.

25 and 7. let us look at the continuity equation.21 2 151 qf ˜ ™ h˜ q d ˜ ™ p p ˜ ™ ’ ue uP uE dP 4 pW pE 2pP pP ’ n ˜ n ∂u ∂x dP 4 ∂4p ∂ x4 ∆x3 f d ™ n m ’ uE uW 2∆x ∂u ∂x n m ˜ uE uW 2∆x dP 4 ’ m ˜ ue uw ∆x 0 ∂4p ∂ x4 P O ∆x2 n ˜ ™ ˜ ˜ ’ uw uW uP dP 4 ∂3p ∂ x3 n 2 m ˜ ™ ’ ue uP uE dP 4 ∂3p ∂ x3 ∆x3 e ∆x3 w ∆x3 0 n n ˜ n m ˜ m ™ ’ ue uP uE dP 4 ∂2p ∂ x2 ∂2p ∂ x2 E pEE q p ™ m f ˜ m žm ™ d ’ n m Similarly ∂2p ∂ x2 pP pEE 2pE ∆x2 O ∆x2 (7. Even derivatives are frequently referred to in the literature as dissipation.24) (7.31) .25) (7. and dividing through by ∆x we get Substituting for u e and uw from Equations 7.30) 2pE (7.26 we get Using a Taylor series expansion.23) ∆x2 (7.4 Accuracy of Added Dissipation Scheme Let us now examine the accuracy of the momentum interpolation or the added dissipation scheme.E The pressure term in the momentum interpolation scheme may thus be written as 2 P or.28 may be written as P P We see that momentum interpolation is equivalent to solving a continuity equation with an added fourth derivative of pressure.26) (7. 7. The interpolation scheme may be written using Equation 7. we may show that P so that Equation 7.28) (7. hence the name added dissipation scheme.27) (7. dividing and multiplying the pressure term by ∆x. we may write A similar expression may be written for u w : 2 Now. If we write the continuity equation for constant ρ .29) (7.

7. We already saw from Equation 7. They satisfy the continuity equations only indirectly 152 f d f f d d n 2 e f d ™ ˜ ™ ’ ue uP uE dP 4 ∂3p ∂ x3 ∆x3 O ∆x2 n ˜ ’ qf ˜ m ™ h˜ q d ˜ ™ p p dP 4 pW pE 2pP pP pEE 2PE dP 4 ∂3p ∂ x3 ∆x3 e f d m f d ™ ™ ’ ue uP uE O ∆x2 f d ™ n ™ ’ uE ue ∂u ∂x ∆x e 2 ∂ 2u ∂ x2 ∆x2 e 8 O ∆x3 f (7.34) (7.32) (7.Adding the two equations and dividing by two yields 2 Thus the truncation error in writing the first term in Equation 7.35) d ™ n m ™ ’ uP ue ∂u ∂x ∆x e 2 m lf ™ n n m ˜ m ™ d Let us consider the first term u P may write uE 2. we ∂ 2u ∂ x2 ∆x2 e 8 O ∆x3 ˜ . Adding this dissipation term does not change the formal accuracy of our discretization scheme since the term added has a dependence O ∆x 3 whereas the other terms have a truncation error of O ∆x 2 . The discretization of the momentum equations retains the form of Equation 7. at convergence. which is of higher order than the second-order truncation error of the linear interpolation. In a co-located formulation. not the cell-centered velocities. An extremely important point to be made is that the discrete continuity equation (Equation 7. We have seen that momentum interpolation is equivalent to solving the continuity equation with an extra dissipation term for pressure.33) (7. it is the face velocities that directly satisfy the discrete continuity equation. Consequently.1. the added dissipation term does not change the formal second-order accuracy of the underlying scheme. Using a Taylor series expansion about e. It is not written directly in terms of the cell-centered velocities u P and uE . Thus.22 that the pressure term may be written as so that the total expression for u e is We see that the pressure term we have added is O ∆x 3 .31 is O ∆x 2 . the cell-centered velocities directly satisfy the discrete momentum equations.5 Discussion Thus far we have been looking at how to interpolate the face velocity in order to circumvent the checkerboarding problem for co-located arrangements.14) is written in terms of the face velocities u e and uw . Our intent is to write the continuity equation using this interpolation for the face velocity.

Dividing the discrete momentum equations by the center coefficients we obtain: ™ ’ uE uE ˆ u dE 2 153 f ˜ d ™ ’ uP uP ˆ u dP 2 pP pEE q ˜ pW ™ p ™ ’ a v vP P bv P ∆x 2 pE q ∑ av vnb nb ˜ p ™ ™ ’ au uP P bu P ∆y 2 pS pN q (7. 7. in the sense that they satisfy the momentum interpolation formula. Though the properties of the momentum interpolation scheme are less clearly evident in 2D. everything we have said about the one-dimensional case is also true in two dimensions.and v-momentum equations for the velocities u P and vP : nb nb Here. in a co-located formulation.2 Momentum Interpolation Consider the face e in Figure 7.1.36) (7. 7.1. They satisfy momentum conservation only indirectly. 7. We P nb note that the pressure gradient terms involve pressures 2∆x and 2∆y apart respectively.6 Two-Dimensional Co-Located Variable Formulation Let us generalize our development to two-dimensional regular meshes before considering how to solve our discrete set of equations.through their role in defining u e and uw . let us look at regular two-dimensional meshes and derive the equivalent forms for the face velocity interpolation.37) ˜ ∑ au unb nb pW pE p . Similar discrete equations may be written for the neighboring cells. Conversely. the coefficients a u and au are the coefficients of the u-momentum equation for P nb cell P. the face velocities ue and uw directly satisfy the continuity equation.6.1 Discretization of Momentum Equations Using the procedures described earlier. Similarly. we may derive the discrete u. We will use this development as a stepping stone to developing a SIMPLE algorithm for solving the discrete set of equations. and the u momentum equations for the cells P and E. To complete the development. but do not satisfy any discrete momentum equation since no direct momentum conservation over a staggered cell is ever written for them. av and av are the coefficients of the v-momentum equation. We consider the cell P in Figure 7.6.

39) pE (7.40) (7.where The factor ∆y appears because the pressure gradient term is multiplied by it in a twodimensional mesh.41) pP (7. By analogy we may define equivalent quantities at other faces: Using momentum interpolation for the face velocity u e . we may write face velocities for the other faces as: with 2 v dS 7. and how 154 ™ ’ ds ™ ’ dn v dP 2 v dP 2 ™ ’ dw u dW u dP v dN q q ˜ p ˜ p ™ ™ ’ ’ vn vs vn ˆ vs ˆ dn pP pN ds pS pP q ˜ p ™ ’ uw uw ˆ dw pW ™ ’ de u dP ™ ’ ue ˆ uP ˆ uE ˆ 2 u dE 2 f ˜ d ™ ’ ue ue ˆ de pP ’ v dS ’ v dN ’ u dW ’ u dE ’ u dP ∆y au P ∆y au E (7.42) (7.43) .38) ∆y u aW ∆x av N ∆x av S (7.7 SIMPLE Algorithm for Co-Located Variables Having defined the face velocities as momentum-interpolants of cell centered values. we now turn to the question of how to write the discrete continuity equation. we obtain where By analogy.

We must now devise a way to formulate a pressure correction equation that can be used with the co-located variables. The face mass flow rates F are defined in terms of the momentum-interpolated face velocities as Similar expressions may be written for Fw and Fs . we wish to use the SIMPLE algorithm. we may write face flow rate corrections where Fe Fn We now seek to express u and v in terms of the cell pressure corrections p . 7. The procedure is similar to that adopted in the previous chapter.7.49) (7.48) (7. We wish to correct the face velocities (and the face flow rates) such that the corrected flow rates satisfy the discrete continuity equation. we write vn vs vn ˆ vs ˆ q” ˜” p ™” q” ˜” p ™” q” ˜ ” p ™ ” q” ˜” p ™” ’ ” ’ ” ’ ” ’ ” ue uw ue de pP pE ˆ uw dw pW pP ˆ dn pP pN ds pS pP 155 ” ™ –’ Œ ˜ Œ Œ ˜ Œ ρe ∆yue ρn ∆xvn ” ™ ” ™Œ ” ” Œ ’ ” ’ ” ’ ’ Fe Fn Fe Fn ” ™ pP pP Fe Fn ” ™ ” ™Œ Œ Œ ’ ’ ue ue ue (7. vn and vs found by interpolating the u and v to the face using momentum interpolation are not guaranteed to satisfy the discrete continuity equation.45) (7.to solve the discrete set. In keeping with our philosophy of using sequential iterative solutions. From our face velocity definitions. uw . we propose face velocity corrections vn and the cell pressure corrections pP vn vn Correspondingly. The face velocities u e . Thus.1 Velocity and Pressure Corrections As before.47) (7. let u and v denote the solution to the discrete momentum equations using a guessed pressure field p .46) Œ Œ Œ ’ Œ Fe Fn Œ ’ Œ ’ ” ” Œ Œ Œ Œ Œ Fe Fw Fn Fs 0 (7. Thus.44) ρe ue ∆y ρn vn ∆x (7. and to use these expressions to derive a pressure correction equation.50) . albeit with a few small changes.

The corresponding face flow rate corrections are Fn Fs We notice that the velocity corrections in Equations 7.53) (7. we approximate Equations 7.52) (7.51 and 7. we obtain the pressure correction equation: aP pP ∑ anb pnb b nb with We see that the pressure correction equation has the same structure as that for the staggered grid formulation.49 for the F values.2 Pressure Correction Equation To derive the pressure correction equation for the co-located formulation.54) .In keeping with the SIMPLE algorithm.51) ” ” (7. This is analogous to dropping the ∑nb anb unb terms in ˆ ˆ the staggered formulation. 156 ™ ” ’ ” ” ™ ™ ™ ’” ˜ Œ ˜” Œ ” ˜ Œ ˜” Œ Fe Fe Fw ’ b ™ Œ ˜™ Œ ™ Œ ˜ ™ Œ ’ ’ aS aP ’ ’ aW aN ’ aE ’ ” vP ’ ” uP u dP v dP Fw Fn ρe de ∆y ρw dw ∆y ρn dn ∆x ρs ds ∆x aE aW Fw Fe q” ˜” p f” ˜ ” d pW pS pE 2 pN 2 Fn Fs aN Fn q” q” q” q” ˜” p ˜” p ˜ ” p ˜” p ’ ” ’ ” ’ ” ’ ” Fe Fw ρe ∆yde pP pE ρw ∆ydw pW pP ρn ∆xdn pP pN ρs ∆xds pS pP Fs 0 aS (7. For later use.51 correct the face velocities. we write the cell-centered velocity corrections by analogy: 7.7. we write the continuity equation in terms of the corrected face flow rates F as before: Substituting from Equations 7.50 as by dropping the u and v terms. but not the cell-centered velocities. The source term in the pressure correction equation is the mass imbalance resulting from the solution of the momentum equations.56) Fs ” p p vn vs dn pP ds pS q” ˜” q” ˜” q” ˜ ” q” ˜” pN pP p p ’ ” ’ ” ’ ” ’ ” ue uw de pP pE dw pW pP (7.

Check for convergence. Correct the face flow rates using Equation 7.7. Else go to 2. 3. However. The pressure correction equation contains a source term b which is the mass imbalance in the cell P. they do not satisfy a discrete momentum equation directly. The solution of passive scalars φ in step 8 employs the continuity-satisfying face flow rates F in discretizing the convective terms. the face flow rates (and by implication the face velocities) satisfy the discrete continuity equation at step 5 in each iteration.7. The computed pressure corrections are designed to annihilate this mass imbalance. 157 ” ™ Œ ’ p p αp p Œ Œ Œ Œ Œ Œ ” Œ . We should also note that the cell-velocity correction in step 7 is designed to speed up convergence. we should note a very important difference. but does nothing to make u P and vP satisfy the discrete continuity equation. This curious disconnect between the cell-center and face velocities is an inherent property of co-located schemes.3 Overall Solution Procedure The overall SIMPLE solution procedure for co-located meshes takes the following form: 1. Correct the cell pressure using Equation 7. underrelax the pressure correction as: 8. in a co-located formulation. 2. Solve for other scalars φ if desired. 6. the momentum-interpolated values are used instead.4 Discussion We see that the overall SIMPLE procedure is very similar to that for staggered meshes.7. The cell-centered velocities are never used for this purpose since they do not satisfy the discrete continuity equation for the cell. Correct the cell-centered velocities u P and vP using Equation 7. Compute the face mass flow rates F using momentum interpolation to obtain face velocities. 7. 9. By the same token. Solve the u and v momentum equations using the prevailing pressure field p to obtain u and v at cell centroids. but not the discrete continuity equation.48. However. In keeping with the SIMPLE algorithm. and also at convergence. This is because the flow rates F are not written directly using u P and vP .50.47. Solve the p equation. If converged. the cell-centered velocities satisfy the discrete momentum equations. Thus. stop. Thus. 4. Guess the pressure field p . 7. 5. the cell-centered velocities either before or after the correction in step 6 are never guaranteed to satisfy the discrete continuity equation. we are assured corrected face flow rates in step 5 will satisfy the discrete continuity equation identically at each iteration of the SIMPLE procedure. However.

and the above expression recovers φ regardless of what underrelaxation is used. Let us say that u e and de in Equation 7. u e also contains au and au in the ˆ P E denominator. This is clearly extremely undesirable. which may be written as Recall that de involves the averages of 1 a u and 1 au . the value of u e is underrelaxation dependent.60) (7. the center coefficients of the P E momentum equations at points P and E.40 corresponds to un-underrelaxed ˆ values of au and au . φ φ . we obtain In order for a variable φ to be underrelaxation-independent at convergence. P E If the momentum equations are underrelaxed.7. The face velocity is then underrelaxed separately to obtain the desired form. and different underrelaxation factors may lead to different solutions.63) . Consider the face velocity u e .62) where ulinear is the prevailing linearly interpolated face value. We see that the underrelaxed value of u e does not have this form. the final solution depends on the underrelaxation employed. Similarly.61) Œ Œ (7. the resulting co-located formulation is underrelaxation dependent.59) 1 uP uE (7. since we cannot underrelax u e without storing it.8 Underrelaxation and Time-Step Dependence We have thus far said very little about the role of underrelaxation in developing our co-located formulation. the underrelaxation expression must have the form At convergence. Since u e is never equal to ulinear . That is.58) ˜ 1 α uP α uE (7. The remedy is to use an underrelaxation of the form Here ue and de are computed using un-underrelaxed momentum equations for cells P ˆ and E. We note that the interpolation requires the storage of the face velocity u e . The underrelaxed face velocity has the form α ue 1 α ulinear (7. not even at convergence. 158 ™f Œ f ˜ d Hf ˜ d ™ d ’ ue α ue ˆ de pP ™ Œ f ˜ d αφ ™ Œ f ˜ d ˜ d ™ d Œ ’ ’ ue α ue ˆ de pP pE 1 α 2 1 α φ pE 1 α ue Œ ™ f ˜ d ™ Cf f Œ ™ ’ uE u dE ˜ d α uE ˆ ™ m ’ uP α uP ˆ u dP 2 pE 2 pEE ™ Œ f ˜ d nf ™ Œ f ˜ d ™q ˜ pW pE f l ˜ d l p ™ ’ ue ue ˆ de pP pE (7. the cell-centered velocities satisfy Using momentum interpolation as before. Majumdar [16] has shown that unless care is taken in underrelaxing the face velocities.

we expect the dependence to disappear progressively as the mesh is refined. and for general non-orthogonal meshes. In keeping with the co-located formulation.3. the steady state obtained by co-located formulations will depend on the time step taken during the preceding unsteady process. Consider the cells C0 and C1 in Figure 7. Recall that the unsteady schemes we used for scalar transport (and indeed all reasonable time-stepping schemes) yield steady state solutions that are independent of the time-steps taken in getting to steady state. even if we did not take steps to remedy the situation. We note that the direction e ξ is aligned with the line joining the centroids. The vector e η is any direction tangential to the face. the pressure gradient term is also integrated over the cell. The only term that needs special consideration is the pressure gradient term. The procedures for discretizing the u and v momentum equations on the cell are similar to those adopted in previous chapters for the convection-diffusion equation. Unless remedied. A remedy similar to that for underrelaxation may be devised.b A f y e C0 ∆η η eξ C1 ∆ξ f face x a Figure 7. Since the cell momentum equations are derived by integrating the governing equation over the cell.3: Cell Cluster for Unstructured Mesh Similar arguments may be made about time-step dependence of co-located schemes. Applying the gradient 159 . as shown by our error analysis of the added dissipation scheme. 7.9 Co-Located Formulation for Non-Orthogonal and Unstructured Meshes The co-located formulation presented above can be applied readily to non-orthogonal and unstructured meshes. is not parallel to the face area vector A f . We should note that the difference between the momentum-interpolated and linearlyinterpolated face value decreases as ∆x 3 . we store the Cartesian velocities u and v and the pressure p at the cell centroids. Thus.

65 eliminates the cell pressure p 0 . If ∇p0 and ∇p1 are computed using the same type of linear assumptions. Thus. the reconstructed pressure value from Equation 7. In either event.72) .68) (7. the pressure gradient term in the u and v momentum equations may be written as ∑ pf Af f The face area vector is given by The pressure gradient terms in the u and v momentum equations are ∆ 0 ∆ 0 f In keeping with our co-located mesh technique. p f is interpolated linearly to the face.69) 2 where r0 and r1 are the distances from the cell centroids of cells C0 and C1 to the face centroid.69 will also behave in the same way. we may use the reconstructed value p1 ∇p1 r1 (7.71) 0 0 (7.∆ 0 Assuming that the pressure at the face centroid prevails over the face.64) (7.66) z ∑ p f Ax f ∑ p f Ay f (7. the discrete momentum equations for the cell C0 may now be written: nb nb 160 ˜ ™ ’ a v v0 0 ∑ av vnb nb bv 0 ∇p0 j∆ v t v t ˜ ™ ’ au u0 0 ∑ au unb nb bu 0 ∇p0 i∆ v ˜ ’ ∑ pf Af ∇p0 ∆ ™ ’ ™ ˜ ’ pf 0 t ™ t p0 ∇p0 r0 ™ ’ pf t ˜ ’ v j ∇pd j ∑ pf Af f p0 p1 ˜ ’ ˜ ’ t ˜ ’ v { t ˜ { zt ˜ i ∇pd i ™ ’ Af ˜ Wv ’ Ax i ∇pd Ay j ∑ pf Af z ˜ { z ˜ theorem.65) (7. let us write the pressure gradient term in the cell as f where ∇p0 denotes the average pressure gradient in the cell. p f may be written in terms of the cell-centroid values of the pressure. For future use. as with regular meshes. we may write pdA A (7. Since (7.67) (7. For a uniform mesh this interpolation would take the form 2 For non-uniform meshes. the momentum equations can support a checkerboarded pressure field.70) ∑Af 0 f it is clear that the summation in Equation 7. Having discretized the pressure gradient term.

The diffusion coefficient for the u and v momentum equations is the same.74) ∇p0 n (7. This velocity is given by In a co-located variable formulation. The main difference occurs at symmetry boundaries aligned with either the x or y directions.76) 0 (7. The face normal vector n is given by f n Let V0 denote the component of the cell-centered velocity at cell C0 in the direction of the face normal n.78) .75) (7.Here. The pressure gradient terms sum the face pressures on all 0 0 the faces of the cell. the same is true at inlet and outflow boundaries. the momentum equation in the cell C0 for the velocity in the face normal direction may be written as: nb where The pressure gradient term may be written as 0 f 0 We note further that 161 ™ ’ bn 0 bu nx 0 bv ny 0 v t ˜ ’ v n ˜ ’ ∑ pf Af ∂p ∂n ’ m ’ an nb au nb ’ ’ an 0 au 0 av 0 av nb ∆ ∇p0 n∆ t ˜ ™ ’ n anV0 0 n ∑ an Vnb nb bn 0 ™ ’ t ’ V0n V0 n u0 n x ™ ’ ƒ ƒ ’ A n Af nx i ny j (7. the coefficient modifications for both velocity directions are the same. and for most boundary conditions. nb 0 nb Under these circumstances. and is equal to viscosity µ . Away from the boundaries.73) v0 n y (7. But for these exceptions. the coefficients of the momentum equations are equal to each other when there are no body forces present. it is necessary to understand the form taken by the momentum equation for the velocity in the face normal direction. 7. the u momentum coefficient set ( a u and 0 au ) are equal to the coefficients of the v momentum equation ( a v and av ).9. au and av denote the center coefficients of the u and v momentum equations and 0 0 bu and bv the source terms. This is because the flow rates governing convection are the same for all φ ’s.77) ˜ (7.1 Face Normal Momentum Equation Let us consider the face f between the cells C0 and C1. Since it is the face normal velocity that appears in the discrete continuity equation for cells C0 and C1. At Dirichlet boundaries. the only difference between the center coefficients au and av occurs because of source terms with S p components which act 0 0 preferentially in the x or y directions.

In writing Equation 7.69. we may write. the quantities ∆ f and an represent the cell volume and center coefficient associf ated with the face.75 by a n .80) (7. These may be chosen in a number of different ways.83) f f l d v (7.74. we may write 0 Using similar procedures. Let the linearly interpolated face normal velocity be given by V f .84) (7.Dividing Equation 7. and adding in a face 162 ™ ’ ∇p ∇p0 2 ™ ’ an f an 0 2 ∇p1 ™ ’ v ∆ 0 v v ∆ ∆ 2 an 1 1 ™ n ˜ t f d ™ ’ Vf Vf v ∆ f ∇p n m ™ ˜ ’ Vf n V0 2 ™ ™ ’ ’ ˆn V0 ˆn V1 u 0 nx ˆ u 1 nx ˆ v0 ny ˆ v1 ny ˆ V1n t ˜ ’ V1n ˆn V1 ∆ 1 ∇p1 n an 1 t v ˜ ’ V0n ˆn V0 ∆ 0 ∇p0 n an 0 v (7. and a face normal velocity found using Equation 7. we choose them as f The pressure gradient ∇p is the mean pressure gradient at the face and is given by The quantity ∂ p ∂ n f is the face value of the pressure gradient.82) ∂p ∂n (7.81) (7.2 Momentum Interpolation for Face Velocity The momentum interpolation procedure is applied to the normal velocity at the face.79) (7.9.85) . On a uniform mesh For non-uniform meshes. The momentum-interpolated face normal velocity is given by an f Here. For the purposes of this chapter. as long as the associated truncation error is kept O ∆x 3 . for cell C1 Here 7. face values of u and v may be reconstructed to the face and averaged in the manner of Equation 7.83 we are removing the mean normal pressure gradient.

The face flow rate is defined as and represents the outflow from cell C0.89) (7. we get Thus.87.87) (7. since this the only gradient that can be directly associated with the adjacent pressure difference p 1 p0 . we decompose the normal gradient into the directions ξ and η to obtain.92) .pressure gradient term written. Only the gradient ∂ p ∂ ξ may be written in terms of p 0 and p1 alone.83 and 7. our manipulation results in adding a dissipation associated with the gradient ∂ p ∂ ξ rather than ∂ p ∂ n. Thus. that the normal gradient of pressure cannot be written purely in terms of p0 and p1 for general non-orthogonal meshes.90) (7.86) f (7. as in previous chapters: f f We now write the gradient ∂ p ∂ η f in terms of the mean pressure gradient: nn e e ∇p eη n eξ ξ η ∇p eξ f Using and combining Equations 7.10 The SIMPLE Algorithm for Non-Orthogonal and Unstructured Meshes The procedure for deriving the pressure correction closely parallels that for regular meshes. we may write where ˆ Vf 7.88) (7. other neighboring values would be involved.91) q ˜ p ™ ’ ’ Vf ˆ Vf d f p0 p1 n ˜ t ˜ t ™ ’ Vf Vf ∇p eξ ˜ f nn an n eξ f t v ∆ t ˜ t m ’ t ∇p eη ∇p n p1 p0 ∆ξ t t t t ™ ˜ ∂p ∂n n n p1 p0 n eξ ∆ξ n t t t ™ n t n t ’ m f l d t ’ n l t ∂p ∂n nn n eξ ∂p ∂ξ nn e e n eξ ξ η m l m m l ∂p ∂η (7. just like we did for regular meshes. We intend to write this face pressure gradient in terms of the adjacent pressure values p 0 and p1 . As 163 Œ Œ Œ ’ t ’ Ff ρf Vf Af t ’ df f nn ∆ξ an n eξ f t ∆ ρ f Vf A f t ™v Vf d f ∇p eξ ∆ξ (7. We realize however. let u and v be the solutions to the cell momentum equations using a guessed or prevailing pressure field p . As before. Rearranging terms.

96) (7.94 and 7. However a few important points must be made. The overall SIMPLE algorithm takes the same form.97) ” ™ Œ ’” p0 p0 q” ˜ ” p v ’ Ff ρ f d f A f p0 q” ˜ ” p ’” Vf d f p0 ’” ™ ∑ Ff Ff 0 (7.before.94) p1 (7. we postulate face normal velocity corrections ˆ Here the correction to V f has been dropped in keeping with the SIMPLE algorithm. we define cell velocity corrections f f with face pressure corrections (7.1 Discussion The broad structure of the pressure correction equation is the same as for regular meshes.98) 2 Substituting Equations 7.96 into the discrete continuity equation (Equation 7.93) p1 (7.100) Œ Œ Œ ” Œ Œ Œ . The corresponding face flow rate corrections are We also postulate a cell pressure correction As with regular meshes. We may write this in the form aP pP ∑ pnb b nb where 7.93) yields a pressure correction equation for the cell center pressure. As before.10. 164 ˜ ’ b f Œ ’ aP ’ anb ρf df Af ∑ anb nb ∑ Ff ™ ” ™ pf ” p0 p1 ” ˜ ” ’ ” ’ ” ’ ” v0 ∆ 0 av 0 ∑ p f Ay ” ˜ v ’ ” u0 ∆ 0 au 0 ∑ p f Ax (7. and is not repeated here. the discrete continuity equation for the cell C0 is not satisfied by u and v . We postulate face flow rate corrections F such that f where F are the face mass flow rates computed from the momentum-satisfying velocities u and v .95) p0 (7.

The final answer is the same whether we include the corrections due to ∂ p ∂ η or not. we developed a momentum interpolation or added dissipation scheme. The scheme preserves the basic conservation principle regardless of cell shape. the flow field must distort itself to provide the extra momentum sources required to balance the body force. however. we have chosen to add a dissipation involving the term ∂ p ∂ ξ . However. we have a complete procedure capable of computing the convection and diffusion of scalars. Improvement of co-located schemes for large-body force problems continues to be an active area of research. But when the mesh is not orthogonal. To circumvent checkerboarding resulting from linear interpolation of the face normal velocity. we should note that this choice does have consequences for convergence. Since we are ˆ dropping the corrections to V f in keeping with the SIMPLE algorithm anyway. 165 l f ˜ d l ’ t f d l l l l . the pressure field is smooth and a linear interpolation is adequate. Indeed we have made no assumptions about cell shape save that the cell be an arbitrary convex polyhedron. For orthogonal meshes (e η eξ 0). The accuracy of this omission is not a concern since the added dissipation scheme is O ∆ξ 3 accurate. Since a linear interpolation underpredicts the cell pressure gradient. The ∂ p ∂ η term is proportional to the non-orthogonality of the mesh. as well the underlying flow field. 7. only the rate of convergence changes.In writing our added dissipation term. also contains a pressure gradient tangential to the face. and to write this gradient explicitly in terms of p 0 p1 . At this point. We turn now to the problem of solving general unstructured sets of algebraic equations which result from the unstructured mesh discretizations we have seen in this and preceding chapters. means that the cell pressure gradient is steeper than that implied by linear interpolation. the term drops out altogether. both structured and unstructured. In the interest of clarity. we have chosen ˆ to leave it embedded in the V f term in Equation 7. The primary consequence of this choice is that the pressure correction equation ignores pressure corrections due to ∂ p ∂ η . This can lead to distortions in the cell-centered velocities. In other cases. We have seen that the primary difficulty has to do with the computation of the face normal velocity. Our experience shows that this approximation in the pressure correction equation is tolerable for most reasonable meshes. The total gradient driving the face normal velocity. But because it is not easy to write this explicitly. the presence of strong body force terms. the pressure correction equation attributes to ∂ p ∂ ξ the corrections that should have been attributed to ∂ p ∂ η . such as in swirling or buoyant flows. we may think of this as an additional approximation to the coefficients of pressure correction equation. We saw that the idea is easily extended to unstructured meshes and that a SIMPLE algorithm may be developed using it. we have developed a co-located formulation for structured and unstructured meshes.11 Closure In this chapter. For many flows. The development has been done for general orthogonal and non-orthogonal meshes. which is used to write the discrete continuity equation.91. one important aspect has been pushed to the background: the linear interpolation of face pressure.

166 .

It would seem to be a good idea to seek solution methods that take advantage of the sparse nature of our matrix.1) Ax b Here A is a N N matrix and x is a vector of the unknowns. However. The efficient solution of such systems is an important component of any CFD analysis. known as tri-diagonal matrices. has non-zero entries only on the diagonal and two adjacent “lines” on either side. implicit schemes result in a system of linear equations of the form (8. although the exact structure of these bands depends on how the cells are numbered. there are a large number of zeroes in the matrix A. Depending on the structure of the grid.e. the matrix has the form x x 0 0 0 x x x 0 0 0 x x x 0 (8. i. for example. 167 ¡¡  ¡¡ ¢ ’ ••– “•• ’ k Ÿ . One important characteristic of our linear systems is that they are very sparse. the systems of equations that we deal with in CFD have certain distinguishing characteristics that we need to bear in mind while selecting the appropriate algorithms. the matrix might also have specific fill pattern. can be solved easily and form the basis of some solution methods for more general matrices as well. Once again.e the pattern of location of the non-zero entries.. Thus for a two dimensional structured quadrilateral grid. Linear systems also arise in numerous other engineering and scientific applications and a large number of techniques have been developed for their solution. linear systems involving such matrices. The system of equations resulting from a one-dimensional grid. out of the N 2 entries in the matrix. only about 5 N of them are non-zero.Chapter 8 Linear Solvers As we have seen in the earlier chapters. We also note that two and three-dimensional structured grids similarly result in banded matrices. i. For a mesh of 5 cells.2) A 0 0 x x x 0 0 0 x x Here x denote the non-zero entries. As we shall see shortly. for example. Recall that the discrete equation at a cell has non-zero coefficients for only the neighboring cells.

variable properties (temperature dependent thermal conductivity. as we are iterating. By this we mean that the coefficients of the matrix and/or the source vector b are themselves subject to change after we have solved the equation. we can stop the process when the solution at any given outer iteration 1 has been obtained to a sufficient level of accuracy and not have to incur the expense of obtaining the machine-accurate solution. Iterative methods on the other hand. typically do not take advanatage of matrix sparsity and involve a fixed number of operations to obtain the final solution which is determined to machine accuracy. Iterative methods are therefore preferred and we shall devote the bulk of this chapter to such methods. the mass flux appearing in convective coefficients of the energy equation). As the outer iterations progress and we have better initial guesses for the iterations of the linear solver. 168 . 8. the implication for the linear solver is that it may not be really worthwhile to solve the system to machine accuracy. Since these methods successively improve the solution by the application of a fixed number of operations. a large number of the entries of our coefficient matrix are zero. direct or iterative. Also. 8. such as Gauss elimination. In this section we consider some smarter ways of storing only the non-zero entries that will still allow us to perform any of the matrix operations that the solution algorithm might require.2 Storage Strategies As we have already noted. This maybe because of coupling between different equations (e.g. Since we are going to recompute the coefficient matrix and solve the linear problem once again. both for storage and solution techniques. Consequently..1 Direct vs Iterative Methods Linear solution methods can broadly be classified into two categories. Whatever the underlying reason. LU decomposition etc.. Another important characteristic of our linear systems is that in many instances they are approximate. The exact way of doing this will depend on the nature of the grid. can easily be formulated to take advantage of the matrix sparsity. it is usually sufficient if we obtain only an approximate solution to any given linear system. for example) or other non-linearities in the governing equations. 1 To distinguish the iterations being performed because of equation non-linearity and/or inter equation coupling from the iterations being performed to obtain the solution for a given linear system. it is easy to see why they are rarely used in CFD applications. the effort required during the linear solution also decreases. They also do not take advantage of any initial guess of the solution. we use the term “outer iteration” for the former and “inner iteration” or simply iteration for the latter. it is very inefficient to use a two dimensional array structure to store our matrix. Direct methods. we usually have a good initial guess for the unknown and linear solvers that can take advantage of this are obviously desirable. Given the characteristics of the linear systems outlined above.it would seem advantageous to exploit the band structure of our matrix.

The total number of neighbor coefficients that we need to store is then given by i 1 We allocate two arrays of length B. AN and AS coefficients. it is usually convenient to refer to the cells using a double index notation and therefore we could use 5 two dimensional arrays of dimension NI NJ to store the AP. We also allocate one other integer array of length N 1.4) (8. because of the grid structure we implicitly know the indices of the neighboring cells and thus the position of these coefficients in the matrix A. The non-zero entries of the matrix A can then be obtained as For a two dimensional structured grid of NI NJ cells. we could store the diagonal and the two lines parallel to it using three one-dimensional arrays of length N. In either case. one of integers (labelled NBINDEX) and one of floating point numbers (labelled COEFF). Following the notation we have used in the previous chapters.CINDEX 2 1 4 3 1 3 5 7 9 NBINDEX 2 4 1 3 2 4 3 1 Figure 8. for example. arrays. aW etc.3) (8. AE and AW.8) . We will look at one strategy that is often used in these cases.6) ™ (8. one might prefer to number the cells using a single index notation and store coefficients using 5 one-dimensional arrays of size NI NJ instead. Therefore we cannot use the approach mentioned above of storing coefficients as aP . respectively. AE. Alternatively. Consider a mesh of N cells and let n i represent the number of neighbors of cell i.1: Storage Scheme for Unstructured Mesh Coefficient Matrix For a one-dimensional grid of N cells. we label these arrays AP. the connectivity of the matrix must be stored explicitly. AW. It is therefore easy to interpret any matrix operation involving the coefficient matrix A in terms of these coefficient arrays.5) f w d wd wd (8. aE . labelled CINDEX which is defined as 169 › ™ ’ ’ CINDEX(1) CINDEX(i) 1 CINDEX(i-1) £ ’ B ∑ ni N ni 1 Ÿ k ˜ ˜ Aii Aii ™ ’ f ’ f ˜ ’ fwd 1 1 Aii AP(i) AW(i) AE(i) (8.7) (8. For unstructured grids however. Another difficulty is caused by the fact that the number of neighbors is not fixed.

AE.1 which shows the contents of the CINDEX and NBINDEX for a two dimensional unstructured grid. 8. The solution for the other equations can then be obtained by working our way back from the last to the first unknown. First. Using the storage strategy described by Eq. i.B. Finally the center coefficient is stored in a separate array AP of length N. 8. however the sparse. AP(i) = AP(i) . 8.3 170 ~ ’ ~ f d x y x y x y for i = 2 to N r = AW(i)/AP(i-1). This is accomplished in two steps.r*AE(i-1). The idea is essentially the same as Gaussian elimination. X(i) = (B(i) .3 Tri-Diagonal Matrix Algorithm Although the bulk of this chapter is concerned with iterative solution techniques. Figure 8.AW. The corresponding coefficients for these neighbors are stored in the corresponding locations in the COEFF array..e. The last equation thus has ony one unknown and can be solved. the entries below the diagonal are successively eliminated starting with the second row. for the tridiagonal linear system arising out of a one-dimensional problem there is a particularly simple direct solution method that we consider first. tri-diagonal pattern of the matrix allows us to obtain the solution in O N operations.r*B(i-1). for i = N-1 down to 1 The idea is that the indices of the neighbours of cell i will be stored in the array NBINDEX at locations locations j that are given by CINDEX(i) j CINDEX(i+1). in a process known as back-substitution.TDMA(AP.3. the matrix is upper-triangularized. the algorithm can be written in the form shown in Fig.X) X(N) = B(N)/AP(N). B(i) = B(i) . 8.2: Tri-Diagonal Matrix Algorithm .AW(i)*X(i+1))/AP(i). This is illustrated in Fig.

4 Line by line TDMA Linear systems arising from two or three dimensional structured grids also have a regular fill pattern. However.e.2. AE. AW.3: Structured Grid for Line by Line TDMA 8.J) X (I.J) and X(I-1.J) X(I.J) AE(I. However. i.9) We also assume that we have a guess for the solution everywhere. This gives us values for X(i) for all cells i along j J line.10 is thus considered to be known and only X(I.J-1) B(I.J) (8. AN and AS.J) AE(I.J+1) AS(I. in 5 two dimensional arrays AP. there are no simple methods analogous to the TDMA that we saw in the previous section for the direct solution of such systems.J) AW(I.J) AN(I.J+1) and X(i.10) where the superscript denotes guessed values. Consider. We can now 171 ’ w ’ wf w d Œ ’ ™ ™ f w d ˜ ™ Œ ™ ™ ’ ˜ ™ ’ . We will assume that the coefficient matrix is stored using the strategy discussed in Sec.J) X (I. Unfortunately.J) X(I+1.I) X(I-1.J) X(I.j NJ NJ-1 J 1 i 1 2 I NI-1 NI Figure 8. 8. the two dimensional structured grid shown in Fig.J) AN(I. We rewrite this equation as AP(I.J) B(I.J+1) AS(I.J-1) (8.J). The equation at point I J is then given by AP(I. X(I+1.3 we obtain a system which has the same form as the tridiagonal system which we can then solve using TDMA.J-1) in building up the tri-diagonal system. for example.J) are considered to be unknowns. 8. using the TDMA we can devise iterative methods. The right hand side of Eq. 8. this is not the exact solution but only an approximate one since we had to guess for values of X(i.J) X(I+1. 8.J) X(I.J) AW(I.I) X(I-1. unlike the one-dimensional problem. Writing similar equations for all the cells i J i 1 NI (shown by the dotted oval in Fig.3.J) X(I.

4 Once we have applied the process for all the j lines.j).AS(i.J)’s are required. Figure 8.4 again.j). X(i. Thus for the line by line TDMA.AW1D. AE1D(i) = AE(i.X1D). In doing so we will use the recently computed values whenever X(i. With this symmetric visiting sequence we ensure that all cells in the domain see the influence of both boundaries as soon as possible. We could apply the same process along a constant i.j) = X1D(i). considering only the j 172 ’ ’ f wd ™ ’ ’ ˜ ’ ’ ’ f wd x y x y ’ x y for i = 1 to NI AP1D(i) = AP(i. if (j > 1) B1D(i) = B1D(i) . As noted above these are only approximate values but hopefully they are better approximations than our initial guess. AW1D(i) = AW(i. 8. an iteration may consist of two sweeps. 8.j-1).4: Line By Line TDMA Algorithm along j lines .AN(i. if (j < NJ) B1D(i) = B1D(i) . The sequence of operations whereby all the values of X i j are updated once is referred to as a sweep. As in all iterative methods. first visiting all j lines in increasing order of their index and then in decreasing order as described above.4 again.j).AE1D.j)*X(i. we could apply the algorithm in Fig. this time the cells at j NJ 1 will see this influence (since they will use the values obtained at j NJ during the present update) but it will takes several repetitions before cells near J 1 see any influence of the boundary at y 1.B1D. we will try to improve the solution by repeating the process. it is not mandatory to apply the TDMA for a constant j line. for i = 1 to NI apply the same process along the next line. 8. we notice that visiting j lines in sequence from 1 to NJ means that all cells have seen the influence of the boundary at y 0 but only the cells at j NJ have seen influence of y 1 boundary. However. If we repeat the process in Fig.j)*X(i.j).j+1). j J 1. To this end. Of course. The overall procedure can be described with the pseudocode shown in Fig.for j = 1 to NJ TDMA(AP1D. B1D(i) = B(i. An iteration is the sequence that is repeated multiple number of times. One easy way of removing this bias is to visit the j lines in the reverse order during the second update. we will have updated the value of each X i j .

Depending on the coordinate direction along which information transfer is most critical. we seek to obtain a better approximation x k 1 and then repeat the whole process. one iteration of the Gauss-Seidel method can be expressed in the pseudo-code shown in Fig. like the one shown in Fig. The simplest of these are the Jacobi and Gauss-Seidel methods. Thus one iteration of the line by line TDMA would consist of visiting. 8. we must use more general update methods. we also don’t know the error at any iteration. 8. however. Of course.11) where the summation is over all the neighbors of cell i. sweeping by visiting i or j lines might be the most optimal. of course. the latest values of xi are used at all the neighbours that have already been updated during the current sweep and old values are used for the neighbours that are yet to be visited. the order of visiting the cell is reversed for the next sweep so as to avoid directional bias.5. the cells are visited in sequence and at each cell i the value of x i is updated by writing its equation as Ai i xi b ∑ Ai nb xnb (8. 8.2. 8. We can determine the relation between them using Eqs. The two methods differ in the values of the neighboring x i that are employed.14) .12 and 8. Using the storage scheme outlined in Sec. 8. In case of the Jacobi method. since we don’t know the exact solution.direction neighbours implicitly. In general cases. Instead. We define the error at any given iteration as where x is the exact solution. it is useful to combine both. In both cases. As in the case of the line by line TDMA.5 Jacobi and Gauss Seidel Methods For matrices resulting from unstructured grids.13) (8.6 General Iterative Methods The general principle in all iterative methods is that given an approximate solution x k . However. it is possible to check how well any given solution satisfies the equation by examining the residual r. no line-by-line procedure is possible.12) (8. the solution approaches the exact solution. 8. say each of the i lines first in increasing order and then in decreasing order followed by similar symmetric sweeps along j lines (and k lines in three dimensional problems). defined as As the residual approaches zero. In general the Gauss-Seidel method has better convergence characteristics than the Jacobi method and is therefore most widely used although the latter is sometimes used on vector and parallel hardware.13 as 173 ’ Aek ˜ ’ rk ˜ ’ ek x xk b Axk rk ¤ ¥ ˜ ’ ¤ (8.1. the “old” values of xi are used for all the neighbors whereas in the Gauss-Seidel method.

for n = CINDEX(i) to CINDEX(i+1)-1 j = NBINDEX(n).CINDEX. IEND = N. 174 . ISTEP = 1. Figure 8.B.Gauss Seidel(AP.X) X(i) = r/AP(i).5: Symmetric Gauss-Seidel Sweep x y x y y x x y for sweep = 1 to 2 if (sweep = 1) IBEG = 1. r = r . ISTEP = -1. for i = IBEG to IEND stepping by ISTEP r = B(i). else IBEG = N. IEND = 1.COEFF(n)*X(j).NBINDEX.COEFF.

L and U are the diagonal. .15) Brk (8. This is an important property that we will make use of in devising multigrid schemes. To demonstrate this behavior.20) . 1 2 0 1 0 0 0 0 0 0 φ1 φ2 . Here D. 8. .14 and the definition of the error we obtain Most iterative methods are based on approximating this expression as xk where B is some approximation of the inverse of A that can be computed inexpensively. hs1 hs2 .16) f ™ d › ’ ••– •• ˜ “• (8. . . For example.19) ∂ x2 φ 0 and φ L φL . with the residual r replacing the source vector b. ›f ˜ d ’ 2φ0 h › ¡¡  ¡ ’ ’f d ¡¡  ¡ ’f d f d ’ ™ ™ ™ ¡¡  ¡ ™ ’ ¥ 1 ’ ¥ ’ ˜ x xk › ’ A xk 1 k r (8. .Thus the error satisfies the same set of equations as the solution. . If we discretize this equation on a grid of N equispaced control volumes using the method outlined in Chapter 3 we will obtain a linear system of the form 1 2φL h 175 ¢ › ™ ˜ tt HCt tt ˜ HCt 0 0 0 0 0 0 1 0 2 1 1 3 ••– ¢ › φN 1 φN •• ’ 1 h hsN hsN ¡¡ ¡ ™ “•• ¡¡ •– ¢ ˜ •• “•• ¡¡ tHCt t tt HCt ˜ ˜ 3 1 . where D is the diagonal part of the matrix A. it can be shown that the Jacobi method is obtained when B D 1 . Another way of expressing any iterative scheme that we will find useful in later analysis is xk 1 Pxk gk (8.18) A D L U 8. Recall that this and specified Dirichlet boundary conditions φ 0 equation results from our 1d scalar transport equation in the pure diffusion limit if we choose a diffusion coefficient of unity. The usual observation is that residuals drop quickly during the first few iterations but afterwards the iterations “stall”. For the Jacobi method the iteration matrix is given by P D 1 L U while for the Gauss-Seidel method it is P D L 1 U. This is specially pronounced for large matrices.7 Convergence of Jacobi and Gauss Seidel Methods Although the Jacobi and Gauss-Seidel methods are very easy to implement and are applicable for matrices with arbitrary fill patterns their usefulness is limited by their slow convergence characteristics. ∂ 2φ sx (8. let us consider the following 1D Poisson equation over a domain of length L.17) where P is known as the iteration matrix. strictly lower and upper triangular parts of A obtained by splitting it as (8. Using Eq.

the maximum error has reduced by less than 20% but with a guess of k 16 Fourier mode. The results are shown in Fig.21) . the error reduces by over 99% even after 10 iterations. To see what the scheme does in such cases we start with an initial guess consist176 ’ ’ n ’ φi sin k π xi L ’f d ’ ’ Figure 8. we apply the Gauss Seidel method for 50 iterations on a grid with N 64. 0.0 -0. We see that when we start with an initial guess corresponding to k 1. Note that for low values of k we get “smooth” profiles while for higher wavenumbers the profiles are very oscillatory. Thus Another simplification we make is to choose φ 0 φL 0 as well as s x the exact solution to this problem is simply φ x 0.5 k=1 φ 0. the error at any iteration is then simply the current value of the variable φ .2 0. In general cases. our initial guess will of course contain more than one Fourier mode.6: Fourier Modes on N 64 grid ’ ’f d m ’ ’ (8.4 0.8 1.0 k=8 k=2 0.1. Figure 8.6 0. We can now study the behavior of iterative schemes by starting with arbitrary initial guesses.7(a). In order to distinguish the convergence characteristics for different error profiles we will solve the problem with initial guesses given by Equation 8.0 x/L L where h N and hsi represents the source term integrated over the cell. To judge how the solution is converging we plot the maximum φi (which is also the maximum error).0 0.5 0. Starting with these Fourier modes.21 represents Fourier modes and k is known as the wavenumber.6 shows these modes over the domain for a few values of k. 8.

4 k=8 k=2 0. 8.9 indicate that the convergence becomes even worse. We see that the oscillatory component has vanished leaving a smooth mode error profile. 8. 177 ’ Š n ’ ™ n ™ n ˆ ’ φi 2π xi 1 sin 3 L sin 8π xi L sin m m m ’ w ’ ing of k 2 8 and 16 modes i. Another way of looking at the effect of the iterative scheme is to plot the solution after 10 iterations as shown in Fig. It is very effective at reducing high wavenumber errors.7: Convergence of Gauss-Seidel method on N 64 grid for (a) initial guesses consisting of single wavenumbers (b) initial guess consisting of multiple modes In this case we see from Fig. It appears that the same error profile behaves as a less smooth profile when solved on a coarser grid.1. Retaining the same form of initial guess and using k 2.6 Max. We see that the amplitude is not significantly reduced when the initial guess is of low wave number modes but it is greatly reduced for the high wave number modes.0 0 10 20 30 40 50 Iteration Iteration Figure 8.8. These numerical experiments begin to tell us the reasons behind the typical behavior of the Gauss-Seidel scheme. 8.4 0. ie. 16π xi L (8. Once these oscillatory components have been removed we are left with smooth error profiles on which the scheme is not very effective and thus convergence stalls. on a coarse grid with N 32. Using our sample problem we can also verify another commonly observed shortcoming of the Gauss-Seidel iterative scheme viz. 8.6 0.0 k=1 0. The resulting convergence plot shown in Fig. we solve the problem on a grid that is twice as fine. On the finer grid we can resolve more modes and again the higher ones among those converge quickly but the lower modes appear more “smooth” on the finer grid and hence converge slower.22.8 Max. Error 50 0.e..9 that the converse is also true. This accounts for the rapid drop in residuals at the beginning when one starts with an arbitrary initial guess.0 1.2 0. the convergence is quicker for the same mode. We also note from Fig.8 0.7(b) that the error drops rapidly at first but then stalls. that the convergence deteriorates as the grid is refined. 8..22) ’ .2 k=3 k = 16 0. N 128. Interesting results are obtained for the mixed mode initial guess given by Eq. ie. Error 0.0 0 10 20 30 40 0.

0 x/L x/L x/L Some of the methods for accelerating convergence of iterative solvers are based upon this property. 178 ­ ® ¯ ª tt CHt tt ª CHt 0 0 0 0 0 0 1 0 2 1 1 2 ­ ® φN 1 φN ¦ ­ ª 1 h hsN hsN ¬¬ ¬ ¯ ¨¨ ¨¨© ¬¬ ¬ tCHt t tt CHt ª ª 2 1 .8 1. 8.8 Analysis Of Iterative Methods For simple linear systems like the one we used in the examples above and for simple iterative schemes like Jacobi.8: Initial and final solutin after 10 Gauss-Seidel iterations on N (a) initial guesses consisting of k 2 (b) initial guesses consisting of k guess consisting of multiple modes 64 grid for 8 (c) initial §¨¨ ¬¬« ¨© ¬ ¨¨ ¬¬ §¨¨ ¬¬« ¦ ¦ ª ¨¨¨© §¨¨ (8. hs1 hs2 .5 -0. . we can show that the error at any iteration n is related to the initial error by the following expression (8.6 0.0 φ 0.0 0. if we choose the matrix linear system to be 2 1 φL h 2 This is the system one obtains using a finite difference discretization of Eq.0 -1.23) en Pn e0 In order for the error to reduce with iterations. Using the iterative scheme expressed in the form Eq.4 0. . 1 2 0 1 0 0 0 0 0 0 φ1 φ2 . φ0 h ¬¬ «¬ ¦ ¦ Figure 8.5 0. .8 1. The eigen values of the Jacobi iteration matrix are closely related to the eigen values of matrix A and the two matrices have the same eigen vectors. .6 0.24) .0 0.4 0.2 0.5 -0.16.5 Initial Final φ 0.0 -1.20 is that it is much easier to study analytically.6 0.0 0. 8. 8.0 0. Now.4 0. the reason for choosing this form instead of Eq. the spectral radius of the iteration matrix (which is the largest absolute eigenvalue of the matrix) must be less than one and the rate of convergence depends on how small this spectral radius is.5 -1. . it is possible to understand the reasons for the convergence behaviour analyically.0 -0. .5 Initial Final φ 0.1. We will not go into details here but briefly describe some of the important results. Both the systems have similar convergence characteristics.0 0. 8.2 0.0 1.19 with an equispaced mesh consisting of N interior nodes and is only slightly different from the system we used in the previous section.2 0.0 1.0 0.0 0.8 1.0 0.

0 N = 128 0.25 we note that the largest eigenvalue occurs for k 1 and therefore it is easy to see why the lower modes are the slowest to converge.16 and using the definition of eigenvalue. Error 0. if our initial error is decomposed into Fourier modes. From Eq. Also note that the magnitude of the largest eigenvalue increases as N increases.26) (8.25) 12 N (8.28) . The j th component of the eigen vector corresponding to the eigenvalue λ k is given by Now. 8.6 N = 64 0. we obtain We see from this expression that the k th mode of the initial error is reduced by a factor n λk .0 0 10 20 30 40 50 Iteration Figure 8.8 Max.2 N = 32 0. this indicates the reason 179 ¦ ¦ en ∑ αk λkn wk ± j I³D³C² ² ¦ ³ ¦ ¦ ´ wk sin jkπ N j D³I³H² ² ¦ ³ ± ° ª ¦ λk 1 sin2 ° ¦ kπ 2N k 12 N (8. They are given by The eigenvectors of the Jacobi iteration matrix. 8.9: Convergence of Gauss-Seidel method on different sized grids for initial guess corresponding to k 2 mode we can find analytical expression for the eigenvalues of the corresponding Jacobi iteration matrix.1.4 0.27) e0 ∑ αk wk Substituing this expression in Eq. w k turn out to be the same as the Fourier modes we used in the previous section as starting guesses. we can write it in terms of these eigenvectors as (8.

. One strategy for involving coarse levels might be to solve the original differential equation on a coarse grid. Practices such as linearizing source terms and underrelaxation that we need in order to handle non-linearities also help in reducing the spectral radius.e. those with spectral radius close to 1. They usually involve some form of preconditioning to improve the eigenvalues of the iteration matrix.behind our other observation that convergence on coarser grids is better than that on finer grids for the same mode. known as nested iteration is that it solves the problem fully on all coarse grids even though we are only interested in the finest grid 180 . these conclusions hold true in general. the fine grid solution approaches the exact answer) the influence of any coarse levels should also approach zero. the pressure correction equation. which is based on the improved convergence characteristics of the simple iterative schemes on coarser meshes. We can repeat the process recursively on even finer grids till we reach the desired grid. This means that the coarse grids can only provide us with corrections or guesses to the fine grid solution and as the fine grid residuals approach zero (i.. We know that in general the accuracy of the solution depends on the discretization. Although we have analyzed the convergence behaviour of a very simple scheme on a simple matrix. we must handle stiff linear systems. The disadvantage with this strategy. these methods are a lot more complicated to implement compared to the simple Jacobi and Gauss-Seidel methods we have studied so far. therefore we would require that our final solution be determined only by the finest grid that we are employing.9 Multigrid Methods We saw in the previous section that the reason for slow convergence of Gauss-Seidel method is that it is only effective at removing high frequency errors. We will not discuss any of them here but rather look at another strategy. Of course. i.g. However in many cases. the interpolated solution will not in general satisfy the discrete equations at the fine level but it would probably be a better approximation than an arbitrary initial guess. We also observed that low frequency modes appear more oscillatory on coarser grids and then the Gauss-Seidel iterations are more effective. The two main questions we need to answer are (1) what problem should be solved on the coarse grid and (2) how should we make use of the coarse grid information in the fine grid solution. Certain constraints can be easily identified. These observations suggest that we could accelerate the convergence of these iterative linear solvers if we could somehow involve coarser grids. we could interpolate it to a finer grid.e. Many iterative schemes have been devised to handle stiff systems.. The eigenvalues of the matrix A as well as that of the iteration matrix play an important role in determining the convergence characteristics. In general. e. One consequence of this requirement is that it is enough to solve only an approximate problem at the coarse levels since its solution will never govern the final accuracy we achieve. 8. Once we have a converged solution on this coarse grid. Our insistence on maintaining diagonal dominance and positive coefficients is motivated by the requirement of keeping the spectral radius below unity.

8.29) ª ¦ . the residual will be zero and thus the solution of the coarse level equation will also be zero. 8.1 with an initial guess x 0 is identical to solving Eq. Thus we are guaranteed that the final solution is only determined by the finest level discretization. note that if the fine grid solution is exact. At this stage we can simply solve the linear analytically..29. Thus any approximations we make in the coarse level problem only effect the convergence rate and not the final finest grid solution.. Of course. the error in the estimation of the fine grid error) will have smooth components. We can thus apply the same strategy for its solution that we used for the finest grid. solve for its error on an even coarser mesh. let us now look at some details. In addition. 8.29 with the residual r0 b Ax0 and an initial guess of zero error.29 on a coarse grid and how exactly we intend to use the errors estimated from the coarse levels but we can already see that the strategy outlined above has the desired properties. 8. It also does not make use of any guess we might have for the finest level grid from previous outer iterations. We can now view Eq. We still have to specify exactly what we mean by solving Eq. Smooth error modes may arise only on the finer grids and then the convergence will still be limited by them. When we have obtained a satisfactory solution for e we can use it to correct our fine grid solution. More importantly however. 8.2 Geometric Multigrid Having developed a general idea of how coarse grids might be used to accelerate convergence.29 as a linear problem in its own right. 8.9. i. we will achieve convergence right away and not waste any time on further coarse level iterations. even on the coarse level the error (which of course now is the error in Eq.9.solution. 8. 8. 8. Another useful characteristic of this approach is that we use coarse level to only estimate fine level errors. To distinguish between the matrices and 181 ¦ Ae r (8. We expect that on the coarser grid the smooth error will be more oscillatory and therefore convergence will be better.1 Coarse Grid Correction A more useful strategy. known as coarse grid correction is based on the error equation (Eq.29 on a coarser grid. Instead we could try to estimate it by solving Eq. Recall that the error e satisfies the same set of of equations as our solution if we replace the source vector by the residual: Note also that solving Eq. the physical problem may not be well resolved on the coarse grid and thus the solution on coarse grid may not always be a good guess for the fine grid solution. i. Although we don’t know the error we do know that the error at this stage is likely to be smooth and that further iterations will not reduce it quickly.14). Now suppose that after some iterations on the finest grid we have a solution x. This can be continued recursively on successively coarser meshes till we reach one with a few number (2-4) of cells. although using Gauss-Seidel iteration usually suffices as well. First of all.e.e. since we start with a zero initial guess for the coarse level error.

We also know that for coarse levels (l 0). We can now apply our usual discretization procedure on the differential equation (remembering that the unknown is a correction to the fine level unknown) and obtain the linear system of the same form 182 º ¦ · ¶ ¸ ª® µ ¹´¸ · ¸ · ª ¸ · ¦ ¹´¸ · k ¸· ¦¸· ¸· bl bl Al xl k » ¸· ¸ ·· ¸ ¶µ (8.10: Coarsening for 1D grid vectors at different grid levels. the unknown x l represents the estimate of the error at the l 1 level and that the source vector b l is somehow to be based on the residual r l 1 . The simplest way of obtaining the coarse grid for our sample 1D problem is to merge cells in pairs to obtain a grid of N 2 cells. a second superscript. After doing some iterations on the coarse grid (and perhaps recursively repeating the process at further coarse levels) we would like to make use of the errors calculated at level l to correct the current guess for solution at the finer level. as shown in Fig. will denote the iteration number.i 1 2 3 4 5 6 7 8 (a) Fine Level (l=0) I 1 2 (b) Coarse Level (l=1) 3 4 Figure 8. The resulting grid is similar to the original grid. The next step is to define the exact means of doing these coarse grid operations and the intergrid transfers. we shall employ a parenthicated superscript. starting with (0) for the finest grid and increasing it as the grid is coarsened . Thus the problem to be solved at the level l is given by Alxl and the residual at level l after k iterations is rl We have already seen how to discretize and iterate on the finest level (l 0) grid of N cells and compute the residual r 0 .31) . with a cell width of 2h. if present.10.30) (8. 8.

11 the coarse level cells may not even be convex. i. 1 2 0 1 0 0 0 0 0 0 ¬¬ «¬ ª ¨¨¨© §¨¨ ¦¸· (8. A more sophisticated approach is to use linear interpolation. of course. The process of transfering this correction back to the finer level is known as prolongation and is denoted by the operator I ll 1 .10 that the cell centroid of a coarse level cell lies midway between the centroids of its parent fine level cells. 8. for cell 2 at the fine level we use x20 x20 The strategy outlined in this section is known as geometric multigrid because we made use of the grid geometry and the differential equation at the coarse levels in order to arrive at the linear system to be solved. With such nested grid hierarchies it may not be feasible to discretize the original differential equation on the coarse level cells. For multidimensional cases. 8. in the general case we will need to use some form of interpolation operator. the coarse level cells had the same type of geometry as those at the fine level and this made the discretization process straightforward. use a zeroth order interpolation.32) . for example. In the one dimensional case. however. The coarse level matrix is given by A1 We also note from Fig.35) (8.e. 183 ± · ¸ ¯¸· ° ¯¸· ¦¸· 3 1 x 4 1 1 1 x 4 2 ¹´¸ ½ · ½ ¸· ½ ¦¸ ½· ½ ¿ ¸ · ¯ ®¸ · ¾ ¦ ¸ ½ · 1 1 rl 2 2i 1 l r2i Ill 1 rl ª ¸ ½· ½ ¯¸· ¦¸· ¼¼ CC¼ ª ¼¼ 6CC¼ 0 0 0 0 0 0 1 0 2 1 ­ ª 1 3 (8. We already know that the starting guess for the coarse level unknowns x l 1 0 is zero.10) is to apply the correction from a coarse level cell to both the parent fine level cells.33) (8. Thus we now have all the information to iterate the coarse level system and obtain an esitmate for the error.34) (8.36) 1 2h ¬¬ ¼CC¼ ¼ ¼¼ CC¼ ª ª 3 1 . 8. . The correction of the solution at the fine level using the coarse level solution is written as xl xl Ill 1 x l 1 The simplest prolongation operator that we can use on our 1D grid (Fig. the cell shapes obtained by agglomerating fine level cells can be very different. As shown in Fig. The source term for the coarse level cell can thus be obtained by averaging the residuals at the parent cells: bi l This operation of transfering the residual from a fine level to the coarse level is known as restriction and is denoted by the operator I ll 1 defined as bl 1 For our equispaced grid we used averaging as the restriction operator. .20.as 8.

11: Nested Coarsening For 2D grid (a) l=0 (b) l=1 (c) l=2 Figure 8.(a) l=0 (b) l=1 (c) l=2 Figure 8.12: Independent Coarsening For 2D grid 184 .

9. in some instances. as shown in Fig. For instance. Our derivation above implies zeroth order interpolation as the prolongation operator. for example. Likewise. Writing out the error equation (Eq.37 and 8. In this case there are no common faces between any two grids. we speak of agglomerating the equations at those cells to directly obtain the linear equation corresponding to that coarse cell.12. We will see shortly how to select the equations to be agglomerated in the general case. shown in Fig.38 gives us the required coarse level equation for index I: A i 0 1 xI 1 1 i Ai 0 i Ai 0 i 1 Ai 0 1 i Ai 0 1 i 1 xI 1 Ai 0 1 i x1 2 I 1 ri 0 ri 0 1 (8. For these reasons. the pressure correction equation that we derived algebraically. Instead of thinking in terms of agglomerating two or more fine level cells to obtain the geometry of a coarse level cell.3 Algebraic Multigrid The general principles behind algebraic multigrid methods are the same as those for the geometric multigrid method we saw in the last section. The main difference is that the coarse level system is derived purely from the fine level system without reference to the underlying grid geometry or physical principle that led to the fine level system. The source term for the coarse level cells turn out be the sum of the residuals at the constituent fine levels cells.37) (8. that we used in the geometric multigrid section above. 8. For the moment let us just consider the 1D grid and the coarse grid levels. it is useful to devise methods of obtaining coarse grid linear systems that do not depend on the geometry or the differential equation. We will look at such algebraic multigrid methods in the next section. Let i and i 1 be the indices of the fine level equations that we will agglomerate to produce the coarse level equation with index I.38) .39) Thus we see that the coefficients for the coarse level matrix have been obtained by summing up coefficients of the fine level matrix and without any use of the geometry or differential equation. 8.One approach to get around this problem is to use a sequence of non-nested. 8. 8. 185 ¯ ¯ ¸ ½ · ¯ ¸ · ¦ ¸ ½ · ½ ´ ¸ ½ · ¯ ¸ · ¶ ½ ´ ¸ ½ · ¯ ´ ¸ ½ · ¯ ¸ ½ ´ · ¯ ¸ ´ · µ ¯ ¸ ® · ¸® ´ · ¸ ½ · ¦ ¸ ½· ¸ ½· ¸· ¦ ¸ ½· ½ ´ ¸ ½· ¦ ¸ ½ · ¸½ ´ · ¸ ® · ¦ ¸ ®· ¯ ¸ ½· ½ ´ ¸ ½· ¯ ¸ · ´ ¸ ½· ¯ ¸ · ¸ ´ · ¯ ¸ ® · ¸® ´ · ¸· ¯ ¯ (8. we may not have a formal differential equation that can be discretized to obtain the coarse level system.10. 8. This is equivalent to the use of addition as the restriction operator. Substituting these relations and adding Eqs. independent grids. We assume that the error for both the parent cells i and i 1 is the same and is obtained from x I 1 . the multigrid principle is that the errors at level l are to be estimated from the unknowns at level l 1. ei 0 1 xI 1 1 and ei 0 2 xI 1 1 . The main problem with this approach is that the prolongation and restriction operators become very complicated since they involve multidimensional interpolation. cells 1 and 2 at level 0 are combined to obtain the equation for cell 1 at level 1.14) for indices i and i 1 we have A i 0 1 ei 0 1 i A i 0 ei 0 i e0 1 i 1 A i 0 1 ei 0 1 i e0 2 i 2 ri 0 A i 0 1 i ei 0 Ai 0 1 i Ai 0 1 i ri 0 1 Now. Also.

For unstructured grids. Besides simplifying the book-keeping this practice has the additional advantage of maintaining the penta. Proceeding in the same manner that we used to derive Eq.e. This permits the use of relaxation methods such as line-by-line TDMA on the coarse level systems as well as the fine level systems. This creates coarse level grids 3 that allow the optimal transfer of boundary information to interior regions and thus accelerates convergence. The linear systems encountered in CFD applications are frequently stiff. and others.39 we can show that i GI j GJ where GI denotes the set of fine level cells that belong to the coarse level cell I. and if has not been grouped (i. 8. as we have seen before.41) ¦ .. disparate grid sizes typical of unstructured meshes.or equations at a time to obtain septa-diagonal form of the linear system. the total memory required for storing all the coarse levels is roughly equal to that required for the finest level. the source vector for the coarse level equation is obtained by summing up the residuals of the constituent fine level cells i GI The coarse level matrices can be stored using the same storage strategies outlined in Sec. however. large conductivity ratios in conjugate heat transfer problems. To implement such a coarsening procedure.2 for the finest level. 8.e.8. it is nevertheless quite useful to visualize the effective grids resulting from the coarsening in order to understand the behaviour of the method. We also initialize a coarse level cell counter C 1 We then visit the cells (or equations) in sequence. the same idea can be applied in one or more directions simultaneously. its coarse index is 0). 186 À bI l 1 ¸· ∑ ri l ´ À À AI lJ 1 ¦¸ ½· ¦ ¸ ½´· ¯ ¦ ´ ∑ ∑ Al i j (8. If such a division is continued till we have just 2 or 3 cells at the coarsest level. Best multigrid performance is usually observed for n 2.. a coarse level grid that consists of roughly half the number of cells as the finest level. The agglomeration strategy outlined above is very effective in accelerating the convergence rate of the linear solver. Also. One useful practice is to try to combine cells that have the largest mutual coefficients. we associate a coarse index with each fine level cell and initialize it to zero.4 Agglomeration Strategies In the 1D case that we have seen so far. assign them the coarse level index C) and increment C by 1. i. group it and n of its neighbours for which the coefficient Ai j is the largest (i.40) (8. This stiffness is a result of a number of factors: large aspect-ratio geometries. For linear systems resulting from two or three dimensional structured grids. 3 Even though we are not concerned with the actual geometry of the coarse level grids in algebraic multigrid. agglomeration was a simple matter of combining equations at cells 2i and 2i 1 to obtain the coarse level system of equations.9. We have already seen that the coefficients of the coarse level matrix are obtained by summing up appropriate coefficients of the fine level matrix. we need to devise more general agglomeration criteria.e.

Information transfer from the outer boundary to the interior region is inhibited because the large-coefficient terms overwhelm the boundary information transferred through the small-coefficient terms. At the coarsest level. coefficients to interior cells are approximately three orders of magnitude bigger than coefficients to cells in the low-conducting region. However. The ratio of conductivities is 1000.13: Conduction in composite domain: multigrid coarsening Consider the situation depicted in Fig. A composite domain consists of a low-conductivity outer region surrounding a highly conducting inner square domain. For interface cells in the highly conducting region. which set the level of the temperature field. 8. 8.13. adjacent to the low-conducting region. where A is a typical face area and ∆x is a typical cell length scale. The temperature is specified on the four external walls of the domain. the domain consists of a single cell in the high-conducting region. The associated coefficient matrix has coefficients of the same order.13. Dirichlet boundary conditions. and results in very fast convergence. Coefficients resulting from the diffusion term scale as kA ∆x. and another in the low-conducting region. Convergence of typical linear solvers is inhibited by the large anisotropy of coefficients for cells bordering the interface of the two regions. The temperature level of the inner region is set primarily by the multigrid corrections at this level. » 187 . are only available at the outer boundaries of the domain. a ratio of this order would occur for a copper block in air.Level 0 Level 1 Level 2 Level 4 Level 6 Level 8 Figure 8. An agglomeration strategy which clusters cell neighbors with the largest coefficients results in the coarse levels shown in Fig.

Athough coarse levels created by agglomerating complete grid lines in each grid direction have the advantage of preserving the grid structure and permitting the use of the same line-by-line relaxation schemes as used on the finest level.14: Orthotropic conduction: multigrid coarsening Another example is shown in Fig. Algebraic multigrid methods used with sequential solution procedures have the advantage that the agglomeration strategy can be equation-specific. the coarse level mesh correctly captures the direction of information transfer. the mutual coupling between the governing equations is the main cause of convergence degradation. Thus. 188 » º . however. aligned at π 3 radians from the horizontal. they do not always result in optimal multigrid acceleration in general situations since coefficient anisotropies are not always aligned along lines.Level 0 Level 1 Level 2 Level 3 Level 4 Level 5 Figure 8. This is specially useful for non-linear and/or transient problems. We should note here that the coefficient based coarsening strategy are dersirable even on structured grids. Geometric multigrid methods that solve the coupled problem on a sequence of coarser meshes may offer better performance in such cases. In some applications. the discrete coefficients for the specific governing equation can be used to create coarse mesh levels. the conductivity k ξ ξ in the direction perpendicular to η is zero. The problem involves orthotropic conduction in a triangular domain with temperature distributions given on all boundaries [17]. 8.14. Mesh agglomeration based on coefficient size results in coarse-level meshes aligned with η as shown. Since all faces with normals in the ξ direction have zero coefficients. Since the coarsening is based on the coefficients of the linearized equations it also changes appropriately as the solution evolves. the primary direction of information transfer is in the η direction. The material has a conductivity k ηη 0 in the η direction.

i. the V-cycle may not be sufficient and more coarse level iterations are called for. Mutigrid cycles can broadly be classified into two categories – (1) fixed cycles that repeat a set pattern of coarse grid visits and (2) flexible cycles that involve coarse grid relaxations as and when they are needed. 8. The µ -cycle can then be thought of as a cycle which is recursively applied µ ¦ 189 . The starting point in all fixed grid methods therefore is to compute all the coarse level coefficients. then transfer the residuals to the next coarse level and relax on that level.8.e. a function is allowed call itself). The simplest fixed cycle is known as the V cycle and consists of two legs. After finishing sweeps on the coarsest level we start the upward leg.5 Cycling Strategies and Implementation Issues The attractiveness of multigrid methods lies in the fact that significant convergence acceleration can be achieved just by using simple relaxation sweeps on a sequence of coarse meshes. for geometric multigrid the coarsest possible grid size might be dictated by the minimum number of cells required to reasonably discretize the governing equation. One can think of the V-cycle as a fixed grid cycle where the cycle is recursively applied at each coarse grid if we haven’t reach the coarsest grid. then perfoming some relaxation sweeps at that finer level and continuing the process till we reach the finest level. the coarse level matrix is only a function of coefficients of the fine level matrix and thus remains constant. We will look at both of these ideas next. In the first leg we start with the finest level and perform a fixed number of relaxation sweeps.15(a) where each circle represents relaxation sweeps and the up and down arrows represent prolongation and restriction operators. For very stiff systems. It is best understood through a recursive definition. continuing till we reach the coarsest level. These cycling strategies can be expressed rather compactly using recursion and this makes it very easy to implement them. ν 1 and ν2 respectively. respectively. This cycle is graphically illustrated in Fig. The coarsest level then establishes an average solution over the entire domain which is then refined by relaxation sweeps on the upward leg. The two need not be equal. The two parameters defining the V-cycle are the number of sweeps performed on the down and up legs. The general principles of these cycling strategies are applicable for both geometric and algebraic multigrid methods but we shall concentrate on the latter. Various strategies can be devised for the manner in which the coarse levels are visited. to not do any sweeps on the down leg but to simply keep injecting the residuals till the coarsest level. Fixed Cycles We have seen that the coarse level source vector is computed from the residuals at the previous fine level and thus it changes every time we visit a coarse level. We should note that since the coarse grids only provide an estimate of the error..e.. using the solution from the current level to correct the the solution at the next finer level. However. This can be achieved by using a µ cycle. specially using a computer language such as C that allows recursion (i.9. it is generally a good idea to always have non-zero ν 2 in order to ensure that the solution satisfies the discrete equation at the current level. in many applications it is most efficient to have ν1 0. With algebraic multigrid it is usually desirable to keep coarsening the grid till there are only two or three cells left.

15: Relaxation and Grid Transfer Sequences for Some Fixed Cycles times at each successive level. the RMS value) or the L-∞ norm (i.. 8. It is illustrated in Fig. the largest value) is employed. Here. 8. Flexible Cycles For linear systems that are not very stiff. Usually the L-2 norm (i.e. we monitor the residuals after every sweep on a given grid level and if the ratio is above a specified rate β .15(c). Because of the recursiveness. it is not always economical to use all multigrid levels all the time in a regular pattern. A slight variant of the W-cycle. For such cases the use of flexible cycles is preferred.. All the fixed grid cycles we have seen so far can be expressed very compactly in the recursive pseudocode shown in Fig.17. known as the Fcycle. specially when the number of levels is large. When we meet the termination criterion at 190 DÁÁ IÁÁ ¦ . a W-cycle involves a lot of coarse level relaxation sweeps. If the ratio is below β we continue sweeps at the current level till the termination criterion is met. Here α is the termination criterion which determines how accurately the system is to be solved and nmax is the maximum number of fixed multigrid cycles allowed. It can be thought of as a fixed cycle where one recursively applies one fixed cycle followed by a V-cycle at each successive level. we transfer the problem to the next coarse level and continue sweeps at that level. x represents some suitable norm of the vector x.l=0 l=1 l=2 l=3 (a) V-cycle (b) W-cycle l=0 l=1 l=2 l=3 l=0 l=1 l=2 l=3 (c) F-cycle Figure 8. It is illustrated in Fig.e. The commonly used version is the one corresponding to µ 2.15(b).16 The entire linear solver can then be expressed using the code shown in Fig. 8. which is also known as the W-cycle. involves somewhat less coarse level sweeps but still more than the V-cycle. 8.

bl 1 Ill 1 r l . . W CYCLE) µ else if (cycle type = F CYCLE) Fixed Cycle(l+1. cycle type) Compute r0 b0 A0x0 . Compute rn b0 A0x0 . if (cycle type = µ CYCLE) Fixed Cycle(l+1. x 0 . cycle type). cycle type) Perform ν1 relaxation sweeps on A l x l if (l lmax) Perform ν2 relaxation sweeps on A l x l Figure 8. bl.cycle type). xl x l Ill 1 x l 1 . 1 times. l 1 x 0. α .16: Fixed Cycle Algorithm Solve(A 0 . if rn r0 α return. Compute all coarse level matrices. ¸· ¦¸· ¸· ¶ Å » µ IÁÁ ¸ · ¸ · ª ¸ · IÁ¦ Á DÁÁ ¸ · ¸ · ª ¸ · DÁc¦ Á ¸· ¸· ¸· ¸ ½· ½ ¯¸· ¦¸· Ä ¦¸ ½· ¸· ½ ¦¸ ½· ¸· ¸· ª¸· ¦¸· Â Ä Â Ä Ã¦ Â Â Ä bl. Fixed Cycle(l+1. V CYCLE). for n = 1 to nmax Fixed Cycle(0. x 0 .17: Driver Algorithm for Fixed Cycle 191 ¸· ¦¸· ¸· ¶ ª µ rl bl Al xl . Figure 8.Fixed Cycle(l.

¸· ¦¸· ¸· IÁÁ ¸ · ¸ · ª ¸ · IÁ¦ Á æ ¸ ½· ½ ¯¸· ¦¸· Ä ¦¸ ½· ¸ ½· ¦¸· ¸· ½ ¦ ¸· ¸· ª¸· ¸ ½· ¶ r¶ º IÁÁ ¸ · ¸ · ª ¸ · DÁc¦ Á » Hµ  µ Ŷ » µ Â Ä ¦ Â Ä Â Ä bl. the solution at that level is used to correct the solution at the next finer level and the process continues. The line-by-line TDMA algorithm may be used for structured meshes. and we are not already at the finest level. x l Ill 1 x l 1 . However. xl else Figure 8. as shown in Fig. β and (l lmax) else if r rold Compute A l 1 if first visit to level l+1. a limit is imposed on the number of relaxation sweeps allowed at any level.18 8. we examined different approaches to solving the linear equation sets that result from discretization.10 Closure In this chapter. if total number of sweeps on level l not exhausted Perform ν1 relaxation sweeps on A l x l bl Al xl . In practical implementation.Flexible Cycle(l) Compute r0 bl Al xl . 8. We saw that the only viable approaches for most fluid flow problems were iterative methods. Compute r if r r0 α return. but is not suitable for unstructured meshes.18: Flexible Cycle Algorithm any level. Set rold r0 . Flexible Cycle(l+1). The flexible cycle can also be described compactly in a recursive form. . methods 192 ¦ rold r. rl bl Al xl . l 1 Ill 1 r l . b l 1 x 0.

To accelerate these schemes. and are very efficient way to solve unstructured linear systems. These schemes have been shown in the literature to substantially accelerate linear solver convergence. they are also inadequate on fine meshes. we examined geometric and algebraic multigrid schemes. We saw that these schemes are good at reducing high frequency errors. 193 . which use coarse mesh solutions for the error to correct the fine mesh solution. By the same token. but cannot reduce low-frequency errors.like Gauss-Seidel or Jacobi iteration do not have adequate rates of convergence.

194 .

2(1):12–26. 1984. J. AIAA Journal. Patankar. The design and application of upwind schemes on unstructured meshes.B. Journal of Computational Physics. [9] S. 100:32–74. Patankar. Enhancements of the SIMPLE method for predicting incompressible fluid flows. [8] S. 19:59–98. and H. Hemisphere Publishing Corporation. C. K. AIAA 89-0366. [3] B. [11] J.. 1979. Lewy. and R. Tannehill.O. mass and momentum transfer in three-dimensional parabolic flows. [5] D. [2] R. H. 195 . Uber die partiellen differenzgleichungen der mathematischen physik. Spalding. Patankar and D. 1972. 11:215–234. Leonard. [7] K.D. 65:138–158. J.A. and H.C. McGraw-Hill New York. A stable and accurate convective modelling procedure based on quadratic upstream interpolation. On the partial difference equations of mathematical physics.J. Res.P. Dev. 1980. Mathematische Annalen. Courant. Van Doormal and G. Pressure based calculation procedure for viscous flows at all speeds in arbitrary configurations. 1967. Friedrichs. V.V. Courant. Block-implicit multigrid solution of Navier-Stokes equations in primitive variables. 1989. Lewy.O. K. A numerical method for solving incompressible viscous flow problems. 15:1787–1805. [4] T. Friedrichs. 1967. Journal of Computational Physics. 1989. 1928. 27(9):1167–1174. Anderson.P. A calculation procedure for heat. International Journal of Heat and Mass Transfer. 1984. Chorin.Bibliography [1] R. 1986. Numerical Heat Transfer and Fluid Flow. Computational Fluid Mechanics and Heat Transfer. Karki and S. Barth and D. Vanka.P. Raithby.C. [6] A. Jespersen. [10] S. 7:147–163. Pletcher. IBM J.V. Computer Methods in Applied Mechanics and Engineering. Numerical Heat Transfer.

Numerical Heat Transfer. Peric. PhD thesis. August 1985. V. Patankar. Baliga and S. Chow. Computation of anisotropic conduction using unstructured meshes. [17] J.[12] B. 120:583–591. University of Minnesota. University of London. 1981. A control-volume finite element method for twodimensional fluid flow and heat transfer. Murthy and S. 196 .R. Heat and Mass Transfer in Domains of Irregular Geometry. Hsu. A Curvilinear-Coordinate Method for Momentum. 13:125–132. Role of underrelaxation in momentum interpolation for calculation of flow with nonstaggered grids. PhD thesis. [13] C. 6:245–261. 1983. 1983. Numerical Heat Transfer. 21:1525–1532. [14] C. 1988. Mathur. Rhie and W. [15] M. AIAA Journal.M. [16] S. Majumdar. Journal of Heat Transfer.Y. A numerical study of the turbulent flow past an isolated airfoil with trailing edge separation. R. August 1998.L. A Finite Volume Method for the Prediction of Three Dimensional Fluid Flow in Complex Ducts.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->