# Compute 2d velocity field with given curl and zero divergence

Given $\omega$ I want to compute the vector $q=(u,v)$ such that $$v_x - u_y = \omega, \qquad u_x + v_y = 0, \qquad \textrm{in } \Omega$$ and $$u n_x + v n_y = 0, \qquad \textrm{on } \partial\Omega$$ I am looking for a finite element method to find such a vector field.

I can introduce a stream function $\psi$ such that $$\Delta\psi = -\omega$$ and then $(u,v) = (\psi_y, -\psi_x)$. Solving this numerically I would obtain $\psi^h \in P_k$ but then $(u^h, v^h) = (\psi_y^h, -\psi_x^h)$ will not be globally divergence-free, i.e., normal component of velocity will not be continuous across the elements when using $C^0$ elements.

So I want to obtain a globally divergence-free vector field with specified curl.

Projection to Raviart-Thomas space

I obtain $\psi^h \in P_k$ and then project to $RT_k$: find $q^h \in RT_k$ such that $$\int_\Omega q^h \cdot w dx = \int_\Omega (\psi^h_y, -\psi^h_x) \cdot w dx, \qquad \forall w \in RT_k$$ I can check that the resulting $q^h$ indeed has zero divergence and converges with error $O(h^k)$ which seems less than optimal. I don't know how to prove these things but I guess this must already be published somewhere. I am looking for some reference on this sort of projection.

But I am also interested to know if we can compute $q$ without using a stream-function.

• What do you know about $\omega$? Does it have any exploitable structure? – Wolfgang Bangerth Apr 25 '17 at 21:39
• @WolfgangBangerth $\omega$ is a scalar for me and I dont know anything more about this function. – cfdlab Apr 26 '17 at 6:52
• I'm not as familiar with FEM as I am with FVM and FDM, but I see no issue with using streamfunction with FDM. Is this because of non-orthogonal elements or something? – Charles Apr 27 '17 at 3:01
• I have to use the velocity within a finite element method to solve another PDE. Hence I am looking for a finite element method to find the velocity also. – cfdlab Apr 27 '17 at 7:55

Solve $$\Delta \psi^h = -\omega$$ using $$C^0$$ elements and Galerkin method. Then compute $$(u^h, v^h) = (\psi_y^h, -\psi_x^h)$$ The normal component of velocity on cell faces is $$u^h n_x + v^h n_y = \psi_y^h n_x - \psi_x^h n_y = \textrm{tangential derivative of } \psi^h$$ But since $$\psi^h$$ is continuous, its tangential derivative on a face has the same value whether we evaluate it from one side or the other.