1
$\begingroup$

I have to discretize a generalized Poisson equation in 2D which is

$$\nabla\cdot(\varepsilon \nabla \phi )=-\rho$$

My problem is that here $\varepsilon$ is $2\times2$ permittivity tensor

where

$$\varepsilon = \begin{bmatrix} \varepsilon_{xx} & \varepsilon_{xy} \\ \varepsilon_{yx} & \varepsilon_{yy} \end{bmatrix}$$

Can anyone help me to discretize this Poisson equation using the finite difference method?

$\endgroup$
4
  • 1
    $\begingroup$ I assume the permittivity is spatially dependent. The first thing is to expand the left-hand side and write it explicitly in terms of the partial derivatives, then it will become clear what to do. $\endgroup$ Commented Feb 2, 2023 at 15:13
  • 1
    $\begingroup$ This is much easier to do with the finite element method. Are you set on using finite differences? $\endgroup$ Commented Feb 2, 2023 at 18:15
  • $\begingroup$ The permitivity tensor should be symmetric for the energy to be positive. $\endgroup$
    – nicoguaro
    Commented Feb 3, 2023 at 11:26
  • $\begingroup$ Do you already feel like you understand how to discretize this problem in the case where $\varepsilon$ is a scalar, and you're just not sure about what to do when it becomes a tensor? If so, can you write down what formula you'd use for a scalar permittivity and why you'd choose that? $\endgroup$ Commented Feb 3, 2023 at 16:44

1 Answer 1

3
$\begingroup$

You have \begin{align} \nabla \cdot \left(\begin{pmatrix} a & b \\ c & d\end{pmatrix} \nabla \phi \right) &= \nabla\cdot\begin{pmatrix} a \partial_x\phi + b\partial_{y}\phi \\ c\partial_{x}\phi+d\partial_y \phi\end{pmatrix} \\ &= \partial_x(a\partial_x\phi) + \partial_x(b\partial_y\phi) + \partial_y(c\partial\phi_{x})+\partial_y(d\partial_y\phi). \end{align}

You can try and apply central finite differences with step one half for the non-mixed terms: \begin{align} \partial_x f(x,y) &=\frac{f(x+\frac{1}{2}h_x,y)-f(x-\frac{1}{2}h_x,y)}{h_x} + O(h_x^2), \\ \partial_y f(x,y) &=\frac{f(x,y+\frac{1}{2}h_y)-f(x,y-\frac{1}{2}h_y)}{h_y} + O(h_y^2) \end{align}

For simplicity consider $h_x = h_y = 1$, then: \begin{align} \partial_{x}(a\partial_x\phi) &\approx a_{i+\frac{1}{2},j}(\partial_x\phi)_{i+\frac{1}{2},j}-a_{i-\frac{1}{2},j}(\partial_x\phi)_{i-\frac{1}{2},j} \\ &\approx a_{i+\frac{1}{2},j}(\phi_{i+\frac{1}{2},j}-\phi_{i-\frac{1}{2},j})_{i+\frac{1}{2},j} - a_{i+\frac{1}{2},j}(\phi_{i+\frac{1}{2},j}-\phi_{i-\frac{1}{2},j})_{i-\frac{1}{2},j} \\ &= a_{i+\frac{1}{2},j}(\phi_{i+1,j}-\phi_{i,j})-a_{i-\frac{1}{2},j}(\phi_{i,j}-\phi_{i-1,j}) \\ &= a_{i+\frac{1}{2},j}\phi_{i+1,j} - (a_{i+\frac{1}{2},j}+a_{i-\frac{1}{2},j})\phi_{i,j} + a_{i-\frac{1}{2},j}\phi_{i-1,j} \\ &\approx \frac{a_{i+1,j}+a_{i,j}}{2}\phi_{i+1,j} - \frac{a_{i+1,j}+2a_{i,j}+a_{i-1,j}}{2}\phi_{i,j} + \frac{a_{i,j}+a_{i-1,j}}{2}\phi_{i-1,j}. \end{align}

For the mixed terms you can apply central finite differences with a full step: \begin{align} \partial_{x}(b\partial_y\phi) &\approx \frac{1}{2}b_{i+1,j}(\partial_y\phi)_{i+1,j} - \frac{1}{2}b_{i-1,j}(\partial_y\phi)_{i-1,j} \\ &\approx \frac{1}{4}b_{i+1,j}(\phi_{i,j+1}-\phi_{i,j-1})_{i+1,j} - \frac{1}{4}b_{i-1,j}(\phi_{i,j+1}-\phi_{i,j-1})_{i-1,j} \\ &= \frac{1}{4}b_{i+1,j}\phi_{i+1,j+1}-\frac{1}{4}b_{i+1,j}\phi_{i+1,j-1} - \frac{1}{4}b_{i-1,j}\phi_{i-1,j+1}+\frac{1}{4}b_{i-1,j}\phi_{i-1,j-1}. \end{align}

You can do a similar thing for the remaining terms. For some other discretisations you can have a look at this paper and the references within.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.