Math 270E: Assignment 4

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


In this assignment you will extend the program from Assignment 3 to one that solves the convection-diffusion equation with a divergence free velocity field that is obtained from a stream function.

The additional files you will need for this assignment can be downloaded from the FastPoissonSolver repository at https://www.math.ucla.edu/~anderson/270eSupport/

The additional files contained in this repository are

FastPoissonSolver.cpp
FastPoissonSolver.h
C++ interface routine for HWSCRT, a subroutine that solves Laplace's equation in a rectangular region.
hwscrt.c f2c (Fortran to C) translation of subroutine HWSCRT.

[1] Modify the programs in Assignment 3 to solve the convection diffusion equation

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

with the initial condition

$\qquad \qquad s(x,y,0) = \left\{ \begin{array}{c|c} ( 1 - ((x-2)^2 + y^2))^3 & (x -2)^2 + y^2 \leq 1 \\ 0 & (x -2)^2 + y^2 > 1 \end{array} \right. $

and the velocity field is obtained from the stream function

$\qquad \qquad u = \dfrac{\partial \Psi}{\partial y} \qquad y = - \dfrac{\partial \Psi}{\partial x} $

where

$\qquad \qquad \Delta \Psi = - \omega$

and

$\qquad \qquad \omega(x,y) = \left\{ \begin{array}{c|c} ( 1 - (x^2 + y^2))^3 & x^2 + y^2 \leq 1 \\ 0 & x^2 + y^2 > 1 \end{array} \right. $


One way to do this is to modify initializeVelocity(...) in the test program. You should use the routine FastPoissonSolverDirichlet(...) to compute the stream function given $\omega$. To use the routine FastPoissonSolverDirichlet, you need only include FastPoissonSolver.h in your test program and then add the files FastPoissonSolver.cpp and hwscrt.c to your project. Documentation for the arguments to FastPoissonSolverDirichlet is given in the header file FastPoissonSolver.h.

[2] Using the program that you created in problem [1], compute the solution to time t = 100.0 with $\nu = 0.0$.

(a) Compare the results obtained with convection method (c) and convection method (d). Use N, the number of panels in each direction, to be 25, 50, and 100. (If you don't mind waiting for results, you might try larger N).

  1. Do either of these schemes provide convergent results?
  2. How are you judging convergence?

(b) How do the results in (a) change when $\nu = 0.001$?


What You Should Turn In