Stokes FEM derivation
For modelling the equations above, we will employ the finite element method (FEM).
To use this method, we transform the equations into their variational form.
\[\begin{split}
\int_{\Omega_{CSF}} -\mu \Delta \mathbf{u}\cdot \mathbf{v}~\mathrm{d}x + \int_{\Omega_{CSF}} \nabla p \cdot \mathbf{v}~\mathrm{d}x = 0\\
\int_{\Omega_{CSF}} \nabla\cdot \mathbf{u}q~\mathrm{d} x = 0
\end{split}\]
Integrating the first equation by parts, and choosing \(\mathbf{u}\in H_{div}(\Omega)\), we get
\[
\int_{\Omega_{CSF}} \mu \nabla \mathbf{u} \cdot \nabla \mathbf{v} - \nabla \cdot \mathbf{v} p ~\mathrm{d}x + \int_{\partial\Omega_{CSF}} \left(-\mu \nabla \mathbf{u} \cdot \mathbf{n} + p\mathbf{n}\right) \cdot \mathbf{v} ~\mathrm{d}s=0.
\]
We observe that we can split the boundary integral into its normal and tangential component \(\mathbf{A}_t = \mathbf{A} - (\mathbf{A}\cdot \mathbf{n}) \mathbf{n}\)
\[
\int_{\partial\Omega_{CSF}} \left(-\mu \nabla \mathbf{u} \cdot \mathbf{n} + p\mathbf{n}\right) \cdot \mathbf{v} ~\mathrm{d}s= \int_{\partial\Omega_{CSF}} \left(-\mu \nabla \mathbf{u} \cdot \mathbf{n} + p\mathbf{n}\right)\cdot \mathbf{n} \mathbf{n} \cdot\mathbf{v} + \left(-\mu \nabla \mathbf{u} \cdot \mathbf{n} + p\mathbf{n}\right)_t \cdot \mathbf{v} ~\mathrm{d}x.
\]
As we enforce \(\mathbf{u}\cdot n=\mathbf{0}\) on \(\Gamma_{AM-L}\cup\Gamma_{pia}\cup\Gamma_{SSAS}\) and \(\mathbf{u}\cdot n =\frac{1}{\vert \Gamma \vert}u_{in}\) through our choice of function space, these integrals dissapear on these boundaries.
On \(\Gamma_{AM-u}\) we use the boundary condition relation to rewrite the equation above as
\[
\int_{\partial\Omega_{CSF}} \left(-\mu \nabla \mathbf{u} \cdot \mathbf{n} + p\mathbf{n}\right) \cdot \mathbf{v} ~\mathrm{d}s= \int_{\Gamma_{AM-u}} R_0 \mathbf{u}\cdot \mathbf{n} \mathbf{n} \cdot\mathbf{v}~\mathrm{d}s + \int_{\partial \Omega_{CSF}} \left(-\mu \nabla \mathbf{u} \cdot \mathbf{n} + p\mathbf{n}\right)_t \cdot \mathbf{v} ~\mathrm{d}x.
\]
It is clear that \((p\mathbf{n})_t=0\). As \(\mathbf{u}\cdot \mathbf{t} =0\) across the whole boundary, we have that \((\nabla \mathbf{u})_t=0\), and we are left with only the first integral.
This leaves us with the variational form
\[\begin{split}
\int_{\Omega_{CSF}} \mu \nabla \mathbf{u} \cdot \nabla \mathbf{v} - \nabla \cdot \mathbf{v} p ~\mathrm{d}x + \int_{\Gamma_{AM-u}} R_0 \mathbf{u}\cdot \mathbf{n} \mathbf{n} \cdot\mathbf{v} ~\mathrm{d}s=0\\
\int_{\Omega_{CSF}} \nabla\cdot \mathbf{u}q~\mathrm{d} x = 0
\end{split}\]
Discretized problem
When the domain is discretized into tetrahedra, and a discrete \(H_{div}\) space is chosen, one cannot guarantee the tangential continuity of \(\mathbf{u}\) across element
surfaces \(\mathcal{F}\). To enforce this, we add a standard interior penalty method of the form
\[
\int_{\mathcal{F}} -\mu (\{\nabla \mathbf{u}\}\cdot\mathbf{n}_F) \cdot \left[\mathbf{v}_t\right] -\mu (\{\nabla \mathbf{v}\}\cdot \mathbf{n}_F) \cdot \left[\mathbf{u}_t\right] + \frac{\sigma \mu}{h_F}\left[\mathbf{u}_t\right]~\mathrm{d}s
\]