In this chapter we continue with mixed discretizations for initial value problems (IVP) and boundary value problems (BVP), but our emphasis is on advection equations and wave propagation with and without dissipation. Specifically, we introduce two important non-dimensional numbers that define the accuracy and the stability of discretizations we present: The Courant number or CFL condition first proposed by Courant in 1928, and the (grid) Peclet number for advection-diffusion systems. We also provide C++ functions and corresponding results that illustrate the effects of numerical diffusion and numerical dispersion in pure advection and in advection-diffusion systems.
On the parallel computing side, we introduce the concept of non-blocking communications, specifically the use of MPI_Isend and MPI_Irecv. Non-blocking communications may lead to a reduction in the computational time by allowing the programmer to appropriately intertwine computation and communication.
The declarations and definitions of these functions/classes can be found in the following files:
- Section 8.1.3: void EF_CentralDifference(int N, double CFL, double *uold, double *unew) function definition
- Section 8.1.3: void EF_FirstOrderUpwind(int N, double CFL, double *uold, double *unew) function definition
- Section 8.1.3: void LaxFriedrichs(int N, double CFL, double *uold, double *unew) function definition
- Section 8.1.3: void LaxFriedrichsTadmor(int N, double CFL, double *uold, double *unew) function definition
- Section 8.1.3: void LaxFriedrichsTadmor(int N, double CFL, double *uold, double *unew, double alpha) function definition
- Section 8.1.4: void EF_SecondOrderUpwind(int N, double CFL, double *uold, double *unew) function definition
- Section 8.1.4: void LaxWendroff(int N, double CFL, double *uold, double *unew) function definition
- Section 8.1.4: void CrankNicolson_CentralDifference(int N, double CFL, double *uold, double *unew) function definition
- Section 8.1.5: void AB2_CentralDifferenceNP(int N, double CFL, double **uold, double *unew) function definition
- Section 8.2.2: void CrankNicolson_CentralDifference_AdvectionDiffusion(int N, double CFL, double DN, double *uold, double *unew) function definition
Go to the file SCchapter8.h for function/class declarations
Go to the file SCchapter8.cpp for function/class definitionsIn the case that an entire program (meaning that a main() function is provided) is presented in the text, we classify this as a driver program. Unlike the functions/classes above, driver programs are complete C++ programs which can be compiled and executed. As you read through the book, you will see that driver programs are often times created by using functions/classes which are in the SCchapter files. We denote driver programs which are explicitly given in the text of the book in red. In some chapters, we present very few driver programs explicitly in the text, however we provide some example driver programs which demonstrate how to use the functions/classes with in SCchapter files. Such driver programs are denoted in black.
Section 8.1.3: Program demonstrating the use of the Euler-Forward First-Order Upwind scheme | chapter8c0.cpp |
Section 8.1.3: Program demonstrating the use of the Lax-Friedrichs scheme and Tadmor's Correction | chapter8c1.cpp |
Section 8.1.: Program demonstrating the use of the Third-Order Adams-Bashforth/Central Difference scheme | chapter8c2.cpp |
Section 8.2: Program demonstrating the use of the Crank-Nicolson/Central Difference for the advection-diffusion equation | chapter8c3.cpp |