Math 270E : Assignment 2

Assigned Wednesday, Oct. 1, 2008, due Wednesday, Oct. 8, 2008


In this assignment you will be experimenting with different methods for solving the two dimensional convection equation.

Files used in this assignment:

ConvectionTest.cpp Program for testing several different discretizations for solving the convection equation.
ConvectionRoutines.h, ConvectionRoutines.cpp Convection routine function prototypes and source code
GridParameters.h, RunParameters.h Parameter class declarations. Declarations for the GridParameters and RunParameters classes.
DoubleArray1D.h, DoubleArray2D.h A "light" array class that provides dynamic allocation, optional bounds checking and high level array operations. Note: Array indexing starts at 0 ("C" convention)

outputToGNUplot.h, outputToGNUplot.cpp
or
outputToMatlab.h, outputToMatlab.cpp

Output header file and source for creating GNUplot or Matlab readable data files. Substitute your own output routines if you are not using GNUplot or Matlab.


The main driver program is ConvectionTest.cpp. As the routine is now written, it will prompt you for the input, and, in addition to displaying the errors it will output the solution to a data file at every nth step.

  1. For each of the spatial discretizations, estimate (on the basis of suitable numerical experiments) their rate of convergence when you refine the mesh while keeping the ratio of the timestep to the mesh size constant. Use fourth order Runge-Kutta timestepping when doing your experiments. When doing your experiments, you may want to "comment out " the console output code.

  2. Report the effect of using different order Runge-Kutta schemes for each type of spatial discretization. In particular, when computing a single rotation using a timestep equal to that suggested by the CFL condition, determine which RK scheme gives reasonable results.


What You Should Turn In