Anisotropic Diffusion
We want to be able to discretize the following term,
where
is the face normal. We would like to write the
in terms of a coordinate system parallel to the
cell-to-cell vector. Such a coordinate system is given by
such that
Now
is an orthogonal matrix. Its rows comprise the normal
between the cells and arbitrary tangents. Thus,
Therefore our discretized term becomes,
Now, as an example, let's choose a 2D system, with a tangent vector
, then the transformation matrix becomes,
and for 3D we can choose arbitrary tangent vectors such that,
As Jon points out, the choice above is bad; when
, 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,
where the
normals and the tangents make up the rows of
. We already
have the implicit discretization for
. How do we figure
out the implicit form for
and
? Let's
code it with the explicit form for now. In 2d the explicit
coefficients are given by
for
and
for
FiPy: A Finite Volume PDE Solver Using Python