# Discretization Dirichlet boundary condition for Elliptic PDE with finite volume method

I want to discretize the following equation using FMV: $$\nabla \cdot (a(x)\nabla u)=f(x)\\x\in \Omega \subset \mathbb{R}^2 \\u_{|\partial\Omega}=g$$ To this end, let $$V_i \subset\Omega$$, $$i=1,\dots,N$$, such that $$\bigcup\limits_{i=1}^N V_i=\Omega$$, $$V_i\cap V_j=\partial V_i \cap \partial V_j$$ for $$i\ne j$$ be the mesh cells.

After applying the Divergence theorem and integrating the equation over each $$V_i$$, obtain

$$\int_{V_i} \nabla \cdot (a(x)\nabla u) dx = \int_{\partial V_i} a(x)\nabla u \cdot n ds=\int_{V_i} fdx$$

Let $$x_i$$ be the "center" of $$V_i$$ (this is a cell-cenetered method). Define $$n_i\subset \{1,\dots,N\}$$ as the set of indices of the cells immediately neighbouring $$V_i$$. Let the boundary between any two mesh cells be defined as

$$\Gamma_{i,j}:=\partial V_i \cap \partial V_j$$

Define the length of the boundary segment between neighbouring cells $$V_i$$ and $$V_j$$ as $$l_{i,j}:=\left|\Gamma_{i,j}\right|, j\in n_i$$

and the distance between two cell "centers" as $$h_{i,j}:=\|x_i-x_j\|_2, j\in n_i$$

Approximate $$a(x)$$ for each two neighbouring cells $$V_i,V_j$$ as

$$a_{i,j}:=a\left(\frac{x_i+x_j}{2}\right), j\in n_i$$

So we obtain the following discretization:

$$\int_{\partial V_i} a(x)\nabla u \cdot n ds=\sum_{j\in n_i}\int_{\Gamma_{i,j}}a(x)\nabla u(x)\cdot n ds \approx \sum_{j\in n_i} a_{i,j} \frac{u_j-u_i}{h_{i,j}}l_{i,j}=|V_i|f(x_i)\approx \int_{V_i} f(x)dx$$

To discretize the Dirichlet BC using centered cells, as far as I understand, one needs to use outer ghost cells. So let $$V_{G_j}$$ be such a cell, adjacent to $$V_j$$ for some $$j\in\{1,\dots, N\}$$, and $$x_{G_{j}}\in V_{G_{j}}$$ be its "center". But this is where I'm stuck. Where do I go from here?

I was thinking about interpolating $$u_i$$ and $$u_j$$, thus obtaining

$$c_1x_j+c_0=u_j$$ $$c_1x_i+c_0=u_i$$ and then equating something to $$g_j$$, the BC, but, unfortunately, I don't really understand the motivation and further dynamics of this approach. I'd appreciate if someone could help me with this.