Following Hundsdorfer approach the finite volume discretisation of the advection-diffusion equation (conservative form) on non-uniform cell centered grid can be written as,
$$ w_j^{\prime} = \frac{w_{j-1}}{h_j}\left( \frac{ah_j}{2h_{-}} + \frac{d}{h_{-}} \right) - \frac{w_j}{h_j}\left( \frac{a}{2}\left[ \frac{h_{j-1}}{h_{-}} - \frac{h_{j+1}}{h_{+}} \right] + d\left[-\frac{1}{h_{-}} - \frac{1}{h_{+}} \right]\right) + \frac{w_{j+1}}{h_j}\left(- \frac{ah_j}{2h_{+}} + \frac{d}{h_{+}} \right) $$
I am having trouble implementing this stencil because the edge terms have a dependence on the position of ghost cells which are outside of the domain.
For example, if we write the equation at the left hand side boundary (this corresponds to cell centre $x=x_1$), $$ w_1^{\prime} = - \frac{w_1}{h_1}\left( \frac{a}{2}\left[ \frac{h_{0}}{h_{-}} - \frac{h_{2}}{h_{+}} \right] + d\left[-\frac{1}{h_{-}} - \frac{1}{h_{+}} \right]\right) + \frac{w_{2}}{h_1}\left(- \frac{ah_1}{2h_{+}} + \frac{d}{h_{+}} \right) $$
N.B. The terms in the first bracket depend on the position of the ghost point. To make this clear see the diagram below and notice that the $h_0$ and $h_{-}$ term stray outside of the domain.
Am I free to choose the position and size of the ghost cell? For example,
- Can I set $h_{-}\equiv h_{+}$?
- Or, can I set $h_{-}=0$?
Regarding the latter, does it make sense to have a cell with zero volume? This would mean that the cell "center" and vertex coincide.
The value of the variable at the ghost point ($w_0$) is never used in numerical methods (this is clear!). However, the stencil above would seem to imply that we must at least choose a location and size for the ghost cell and this must be included in the discretisation. Is that assessment correct?