I am working on creating a finite element model for the Darcy equation using Raviart-Thomas elements and the mixed hybrid formulation. The problem in mixed form is this:
$\mathbb{K}\nabla p = \vec{q}$
$\nabla\cdot\vec{q} = 0$
Where $\mathbb{K}$ is the diagonal matrix $\begin{bmatrix} k_0 & 0 \\ 0 & k_1\end{bmatrix}$
Now the weak formulation with Lagrange multipliers is: $\begin{align} \int_\Omega \mathbb{K}^{-1} \bar{\vec{q}}\cdot\vec{q} d \Omega + \int_\Omega p \nabla\bar{\vec{q}} d \Omega- \sum_E \iint_E \lambda\cdot(\bar{\vec{q}}\cdot\vec{n}_E) dE & = \int_\Gamma \bar{\vec{q}}\cdot\vec{n}p d \Gamma \\ \int_\Omega \bar{p}\nabla\cdot\vec{q} &= 0 \\ \sum_E \iint_E \bar{\lambda}\cdot(\vec{q}\cdot\vec{n}_E) dE &= 0 \end{align}$
Where a bar over the variable indicates it is a test function for that variable. Now I understand where the Dirchelet boundary conditions can be included, but for my case I would like to be able to also include Neumann boundary conditions. I found an article which does what I want to be included, but the mathematic are unfortunately too complicated for me (I'm an undergrad student Biomedical Engineering).
I am hoping that someone here can help me with this problem.
Are the sets $E$ edges of the triangulation? if so I don't see why you are applying your Lagrange multipliers on the edges (unless this is just a method for determining a constant that I haven't seen before), you want them on the whole domain so that you can impose the integral of a variable to be zero. Also $q$ is fully determined by the system, it is $p$ that may differ by a constant, so you want Lagrange multipliers for that one, taking a bar overhead to be a test function you want to add $$\int_\Omega\lambda\cdot\overline p+\overline\lambda\cdot p=0$$ to the system. Imagine you had $q=0$ on $\partial\Omega$, then your sum over edges would just be zero. If you want to impose Neumann boundary conditions for $q$, then we impose homogeneous BC's for $q$, and then $q$ may differ by a constant so we need a second lagrange multiplier $$\int_\Omega\lambda'\overline q+\overline\lambda' q=0$$ to the system. If you want nonhomogeneous Neumann BC's you do the same thing, and then enforce the nonhomogeneity as a boundary integral on the right hand side.