Worksheet

Worksheet #

Question 1#

An electrical current is flowing into a bar of height \(0.5m\) and length \(2m\) (assume that it is deep enough in the 3rd dimension for this to be considered a 2D problem). On the left hand side there is a 2D electrical flux of \(10 A/m\). This flux splits evenly out of the top and bottom of the bar, with the outflowing flux decreasing linearly down to zero at the right hand end of the top and bottom boundaries. There is no flux out of the right hand side of the bar.

We will be using a stream function formulation and so the first step will be to calculate the values of the stream function at all locations on the boundary of the domain.

Question 2#

Write a Python script to calculate the stream function values ar every point on a 51x201 grid (note the number of points - with 51 points there are 50 intervals and with 201 points there are 200 intervals).

Implement a Jacobi iteration algorithm to solve this problem.

Question 3#

Given that you have the value of the stream function at all locations on the grid and you know the relationship between the gradients of the stream function and the x and y fluxes, calculate these fluxes.

Use the finite difference approximations for the gradients of the stream function. At all interior points you can use a central difference, but on the boundaries you will need to use forward or backward differences as approximations for any gradients in the direction perpendicular to the boundary.