# Godfrey's island rule (stream function in multiply connected domains)

In this paper, the authors detail the methods to calculate the stream function $\psi$ from velocity data in the case of the global ocean (i.e., multiply connected domains).

The general idea is to use velocity to calculate the vorticity $\zeta$ and, with that, calculate the stream function by solving the Poisson equation: $$\nabla^2\psi=\zeta$$ The difficulty of the problem is to specify the boundary conditions. As we do not want a flow across the boundary, we require $\psi=\mu_k$ on all the coastlines, with the value of $\mu_k$ being a constant to be determined for each different coastline (i.e., each island/continent).

To do this one can use the so-called Godfrey's islands rule that follows from requiring that the circulation around each island should be constant. At the end of the day, one should solve a system of equations that relate the $\mu_k$ and the derivatives of $\psi$ normal to the coastlines (eq. 19 in the paper):

$$\sum_k\mu_k\int_{\partial I_k}\partial_n\psi_j~ds+\int_{\partial I_k}\partial_n\psi_0~ds=\int_{\partial I_k}\mathbf{m}\cdot ds$$

BUT

Shouldn't the normal derivative be zero in order to have no-flow?

If yes, probably not, but if yes, this would imply that all the $\mu_k$ would be zero and one could avoid to solve the system altogether...

What am I missing?

Side questions:

1- How can one calculate the normal derivative with numerical data when the coastline is "segmented" and the normal vector not well defined? For example in this case:

   ____
__|xxxx|___
xxxxxxxxxxx


2- Does anyone know of a freely-available code for solving this problem? I am currently struggling with the normal derivatives...