Lecture 17: Convection and Diffusion 1 Last Time… In the last lecture, we Developed the least-squares method for finding cellbased gradients on unstructured meshes Looked at influence of secondary gradients in destroying boundedness Considered implementation issues, including the use of face- and cell-based data structures 2 This Time … We will Start looking at adding convection terms to our transport equation Look at two different schemes for discretizing the convection terms » Central difference scheme » Upwind difference scheme Consider the properties of these schemes vis-à-vis » Boundedness » Stability » Accuracy 3 Steady 2D Convection-Diffusion Equation Governing equation: Assume flow field known Assume Cartesian structured mesh 4 Discretization As usual, integrate over control volume Apply divergence theorem, linearize source term: Nothing different so far ! 5 Discretization (Cont’d) Area vectors: Flux on east face: Units? Flow rate on east face: 6 Diffusion Term Write as usual assuming linear profile between (E,P) etc: 7 Grid Peclet Number Face flux*area written in terms of two coefficients Multiplies face gradient Multiplies face value e: How to evaluate? Define grid Peclet number 8 Central Difference Scheme (CDS) Find face value of using cell average: Assuming uniform mesh Convection through face e: Same sign! Trouble ahead… 9 CDS: Discrete Equation Note possibility of negative coefficients Note extra flow rate term in aP 10 CDS: Discussion Consider V= u i+ v j with u>0, v>0. When Fe > 2De , i.e., if Peclet number Pee >2 , aE <0. Similarly aN becomes negative if Fn > 2Dn or if Pen >2 For other configurations of the velocity vector, the other coefficients can also become negative This implies that if neighbor values go up, value at point P can go down! This is true even though aP anb for S=0 and extra mass flow rate term =0 What about Scarborough criterion ? 11 CDS: Discussion Scarborough criterion not satisfied: In fact aP =0 is possible for zero diffusion and uniform flow – how would you do Gauss-Seidel? 12 CDS: Discussion Notice extra flow rate term in aP: This is the net mass flow rate out of the control volume If the assumed flow field is continuity-satisfying, this term would be zero. If not, it can cause loss of diagonal dominance Summary: » Spatial wiggles are possible because of negative coefficients – for uniform mesh, keep Pe<2 » Scarborough criterion not satisfied – can’t use iterative schemes 13 Upwind Difference Scheme (UDS) Write face value as: “Upwind” in the direction of the mass flow Note asymmetric nature of the discretization! 14 UDS: Discrete Equation Here What are the signs on the neighbor coefficients? Note extra flow rate term in aP 15 UDS: Discussion Notice that all coefficients are positive Since aP anb for S=0 and extra mass flow rate term =0 » Solution is bounded Scarborough criterion satisfied in the equality for S=0 and extra mass flow rate term=0 Notice extra flow rate term in aP: Zero for continuitysatisfying velocity field 16 Summary Central difference scheme (CDS) » Makes linear profile assumptions between grid points to get face value » Can lead to spatial wiggles in convectiondominated flows » Can lose diagonal dominance – difficult to use iterative solvers » Can show that it is O(x2) accurate 17 Summary (Cont’d) Upwind difference scheme (UDS) » Makes linear profile assumption for diffusion term, but upwinds convective term » Bounded solutions guaranteed for continuitysatisfying fields regardless of grid Peclet number » Satisfies Scarborough criterion – iterative solutions possible Can show that UDS is O(x) accurate Neither very satisfactory for practical use 18 Closure In this lecture: We considered the steady 2D convection-diffusion equation Convection term requires evaluation of on the faces Considered two different scheme (CDS and UDS) and examined the properties of the discretizations 19