Let
- $d\in\mathbb N$
- $\Lambda\subseteq\mathbb R^d$ be bounded and open with Lipschitz boundary $\partial\Lambda$
- $\nu$ denote the outer unit normal vector of $\partial\Lambda$
- $E:=\left\{u\in L^2(\Lambda,\mathbb R^d):\nabla\cdot u\in L^2(\Lambda^)\right\}$
- $G:=\left\{\nabla p:p\in H^1(\Lambda)\right\}$
It's known that there are a unique bounded linear Operator $\gamma_0$ from $H^1(\Lambda,\mathbb R^d)$ to $L^2(\partial\Lambda,\mathbb R^d)$ with $$\gamma_0\left.u\right|_\Lambda=\left.u\right|_{\partial\Lambda}\;\;\;\text{for all }u\in C^1(\overline\Lambda)\tag 1$$ and a unique bounded linear operator $\gamma_\nu$ from $E$ to $H^{1/2}(\partial\Lambda)$ with $$\langle\gamma_0w,\gamma_\nu u\rangle_{H^{1/2}(\partial\Lambda)}=\langle v,\nabla\cdot u\rangle_{L^2(\Lambda)}+\langle\nabla v,u\rangle_{L^2(\Lambda,\:\mathbb R^d)}\;\;\;\text{for all }u\in E\text{ and }v\in H^1(\Lambda)\tag 2$$ and $$\gamma_\nu\left.u\right|_{\Lambda}=\left.u\right|_{\partial\Lambda}\cdot\nu\;\;\;\text{for all }v\in C^1(\overline\Lambda,\mathbb R^d)\tag 3\;.$$ Moreover, it's known that $$L^2(\Lambda,\mathbb R^d)=G\oplus H\tag 4$$ with $$H:=\left\{w\in H^2(\Lambda,\mathbb R^d):\nabla\cdot w=0\text{ and }\gamma_\nu w=0\right\}\;.$$
Now, let $u\in L^2(\Lambda,\mathbb R^d)$. Using $(4)$, we obtain $$u=\nabla p+w\tag 5$$ for some unique $(\nabla p,w)\in G\times H$. Given $u$, I want to numerically compute $w$. In order to do that, I guess that I need to first compute $p$ and then obtain $w$ by $(5)$.
Since I plan to compute $p$ by a Galerkin method, I need to find a variational formulation for that problem. How can we do that?
Sure, we should be in the well-known case of a Poisson equation: Since $\nabla\cdot w=0$, we obtain $w\in E$ and $$\nabla\cdot u=\nabla\cdot\nabla p\;,\tag 6$$ i.e. $$\langle\nabla\phi,u\rangle_{L^2(\Lambda,\:\mathbb R^d)}=\langle\nabla\phi,\nabla p\rangle_{L^2(\Lambda,\:\mathbb R^d)}\;\;\;\text{for all }\phi\in C_c^\infty(\Lambda)\;.\tag 7$$ However, this shouldn't be sufficient to come up with a variational formulation of the problem. What I mean is: I guess that we need to specify a boundary condition for $p$ using $\gamma_0$ and $\gamma_\nu$.
How should we do that and what are the correct test function and solution spaces?