Problem
Hey people. I'm currently working on a small approximation of a fluid simulation on a sphere based on curl noise. The math behind that is based on this paper, which notes that because the curl of a field is divergence free, which should hold for the velocity of an incompressible fluid. To do the simulation I am trying to create such a velocity field tangent to the sphere, so in $\hat{\theta}$ and $\hat{\phi}$ direction (I use $\hat{\phi}$ 0 at the north pole).
However, when I calculate a velocity field like this and move a series of particles over the sphere, the field does not seem divergence free as I end up with a lot of spirals.
Why is this? I would presume that if one takes the derivative of the noise in the tangent direction on the sphere, this would also be divergence free.
Math
This part is just the math I use to calculate the curl for reference *
Now, I have a noise function which gives for each point in 3D the value of F and a vector with the partial derivatives
$$ \nabla_{cart} = \begin{bmatrix} \frac{dF}{dx}\\ \frac{dF}{dy}\\ \frac{dF}{dz} \end{bmatrix}$$
What I currently do is project the partial derivatives onto the sphere and then calculate the curl based on that. So I first calculate the tangent vectors as
$$\hat{\phi}_{cart}= \begin{bmatrix} cos(\theta)cos(\phi)\\ sin(\theta)cos(\phi)\\-sin(\phi) \end{bmatrix}$$
$$\hat{\theta}_{cart}=sin(\phi)\begin{bmatrix}-sin(\theta)\\ cos(\theta)\\ 0\end{bmatrix}$$
Where the length of $\hat{\theta}_{cart}$ is scaled with $sin(\phi)$ to compensate for the difference in distance in world space at the poles. Then I project the partial derivatives onto this to get
$$\nabla_{proj} = \begin{bmatrix} \hat{\theta}_{cart} \cdot \nabla_{cart} \\ \hat{\phi}_{cart} \cdot \nabla_{cart} \end{bmatrix} $$
I calculate the curl as
$$ \nabla \times \textbf{F}= \begin{bmatrix} - \hat{\phi}_{cart} \cdot \nabla_{cart} \\\hat{\theta}_{cart} \cdot \nabla_{cart} \end{bmatrix} $$
I then use this curl to move the particles in tangent space.
Does anything stand out here as incorrect?
