Math 270E: Assignment 3

Assigned Wednesday, Oct. 7, 2008, due Wednesday, Oct. 14, 2008


In this assignment you will extend the program from Assignment 2 to one that solves the convection-diffusion equation. You will also experiment with the influence of the diffusion coefficient on the stability of the numerical method.


  1. Using the program in Assignment 2, determine parameters for each of the spatial discretizations that yield a solution with 10% accuracy after evolving for 1/2 a revolution. Observe the solutions (e.g. look at final time results) and report which one you feel is of the highest quality, and why you feel it is of the highest quality.

  2. Modify the programs in Assignment 2 to solve the convection diffusion equation

    $\qquad \dfrac{\partial S}{\partial t} + \vec u \cdot \nabla S = \nu \Delta S$

    Do this by adding a second order approximation to $\nu \Delta S$ to the DoubleArray2D "con" in the routine evaluateConvectionOp(...) contained in ConvenctionRoutines.cpp. Note: the loops currently in the code exclude the boundary points, and thus, as discussed in lecture, implicitly return the value of zero for the ODE associated with the boundary points.

    Since your routines now solve the convection diffusion equation, it is strongly suggested that you rename the files and routines appropriately. (For example, you might change the name of the routine evaluateConvectionOp(...) to something like evaluateConvectionDiffusionOp(...)).

    You will also need to pass in the value of the diffusion coefficient to the convection-diffusion operator. A good way to do this is to add a data member to the RunParameters class defined in RunParameters.h.

  3. For a fixed mesh size and $ \nu = 0$, determine a time-step for which second order spatial differencing (of the non-conservative form of the equations) with fourth order Runge-Kutta time-stepping is stable. Keeping the time-step and the mesh size fixed, experiment with changing the value of the diffusion coefficient.

(a) As you increase the viscosity what happens to the solutions?

(b) Does the method ever become unstable?

(c) If the method does become unstable - then why does it do so?

(d) Do you get similar results when you use first order upwind?


What You Should Turn In