Skip to content

AnisotropicDiffusion

Jonathan Guyer edited this page Sep 26, 2014 · 1 revision

Anisotropic Diffusion

We want to be able to discretize the following term,

$ \int \partial_i \Gamma_{ij} \partial_j \phi dV = \sum_f n_i^f \Gamma_{ij} \partial_j \phi A_f $

where $n_i^f$ is the face normal. We would like to write the $\partial_j$ in terms of a coordinate system parallel to the cell-to-cell vector. Such a coordinate system is given by $\partial^k$ such that

$ \sigma_i^j \partial_i = \partial^j $

Now $\sigma_i^j$ is an orthogonal matrix. Its rows comprise the normal between the cells and arbitrary tangents. Thus,

$ \partial_i = \sigma_j^i \partial^j $

Therefore our discretized term becomes,

$ \sum_f n_i^f \Gamma_{ij} \sigma_k^j \partial^k \phi A_f $

Now, as an example, let's choose a 2D system, with a tangent vector $\left(-n_y, n_x\right)$, then the transformation matrix becomes,

$ \sigma = \left(\begin{matrix} n_x & n_y \\ -n_y & n_x \end{matrix} \right) $

and for 3D we can choose arbitrary tangent vectors such that,

$ \sigma = \left(\begin{matrix}n_x & n_y & n_z \\ \frac{-n_y}{\sqrt{1 - n_z^2}} & \frac{n_x}{\sqrt{1 - n_z^2}} & 0 \\ \frac{n_x n_z}{\sqrt{1 - n_z^2}} & \frac{n_z n_y}{\sqrt{1 - n_z^2}} & -\sqrt{1 - n_z^2} \\ \end{matrix} \right) $

As Jon points out, the choice above is bad; when $n_z=1$, we are doomed. Need to fix this. This allows us to write the cartesian derivatives in terms of the derivatives oriented along the cell to cell directions, which we currently already use. The cell to cell oriented derivatives are defined by,

$ \partial^i = \left(\partial_{n}, \partial_{t_1}, \partial_{t_2} \right) $

where the normals and the tangents make up the rows of $\sigma$. We already have the implicit discretization for $\partial_n$. How do we figure out the implicit form for $\partial_{t_1}$ and $\partial_{t_2}$? Let's code it with the explicit form for now. In 2d the explicit coefficients are given by

$ n_x^f \Gamma_{xx} n_x + n_y^f \Gamma_{yy} n_y + n_y^f \Gamma_{yx} n_x + n_x^f \Gamma_{xy} n_y $

for $\partial_n$ and

$ - n_x^f \Gamma_{xx} n_y + n_y^f \Gamma_{yy} n_x - n_y^f \Gamma_{yx} n_y + n_x^f \Gamma_{xy} n_x $

for $\partial_t$

Clone this wiki locally