Next: Fluid flow
Up: Computing material properties
Previous: Computing material properties
The important problem of steady-state conduction is a good case in which to display the differences between finite difference and finite element methods. The partial differential equation to solve is

is the current flux,
and
, with V being the
potential of the problem and
the local conductivity.
Inside a constant conductivity material phase, this equation
becomes the same as
Laplace's equation,

, the normal flux must be
continuous, along with the potential, at a phase boundary.
The energy functional that obeys a variational principle is given as

In a digital image, all phase boundaries are also pixel boundaries. Having a square array, in 2-D, or a cubic array, in 3-D, of pixels means that locally, all boundaries are oriented in one of the principal directions. Since in a direct finite difference formulation of the partial derivatives of the problem, the derivatives are thought of as being between the nodes, it makes sense in the finite difference formulation to place the nodes at pixel centers, so that the boundaries are always located exactly between nodes. To get a finite difference form of eq. (8), we simply expand the partial derivatives of the potential around the center of the pixel of interest, pixel m, to obtain:

where Sm,j is the conductance connecting pixels m and j, and Vm is the voltage at pixel m. For a porous two-phase material, if pixels m and j are both conductors, then Sm,j is just the conductance of one conducting pixel. Otherwise, Sm,j = 0. For a electrolyte-filled rock, in the case of electrical conductivity, the pore phase is the conductor and the solid phase is the insulator. In the case of steady-state thermal conduction of a rock with empty pores, the solid phase becomes the conductor and the pore phase becomes the insulator. When there are two types of conductor, then the finite difference formulation implies that Sm,j becomes a series combination of the conductances of one half of pixel m and one half of pixel j [57,62]. Figure 6 shows a piece of a finite difference network superimposed on a random image, where the colored pixels are conducting and the white pixels are insulating. The bonds indicate conducting connections between nodes.
Figure 6: Finite difference grid for a piece of a digital image. The colored area has non-zero conductivity, and the white area is insulating. The nodes are at pixel centers, and the lines connecting the nodes indicate mathematical "bonds."
A finite element solution of Laplace's equation can also be generated, using the variational principle that the correct solution gives the minimum energy dissipated, averaged over the random structure [57]. Now the finite element nodes are placed on the corners of the pixels, with the voltages given at the pixel corners instead of at the pixel centers. The voltage at the interior of the pixel is found by linear interpolation of the corner voltages. Equation (10) is then approximately computed, pixel by pixel, by integrating over each pixel and then summing over all pixels. This converts the energy functional into a quadratic form that involves the nodal voltages. This functional is minimized to solve for the nodal voltages and the approximate solution to the conduction problem. In many cases, the finite difference method is simpler and gives results which are just as accurate. For the case where two or more phases have a non-zero conductivity, sometimes the finite element method can be more accurate [57]. Figure 7 shows some of the finite element nodes superimposed on the same digital image as was shown in Fig. 6. Again, the colored phase is the conducting phase.
Figure 7: Finite element grid for the same digital image as shown in Fig. 6. The nodes are now at pixel corners, where variables like voltages and elastic displacements are evaluated. Both colored and white regions can have non-zero elastic moduli.
Earlier, it was mentioned that the connectivity of a digital image can vary when different sets of neighbors are defined to be connected [63]. This can affect the result of computations. In the finite difference cases described above, the only mathematical connections are between nearest neighbor pixels. In the finite element method, however, since the nodes are at the corners of a pixel, and all the nodes on the corners of a given pixel are mathematically connected in the quadratic form, that means that in 2-D, each node is mathematically connected to 9 different nodes, itself and its 4 nearest and 4 second nearest neighbors, which are the nodes in the corners of the four pixels that share a corner. In 3-D, each node is mathematically connected to 26 other nodes plus itself. Therefore a conducting structure that is physically made up of pixels connected only by corners, would be connected electrically when using finite elements, but disconnected electrically when using finite differences. There is not much difference when the image resolution is high enough so that even the smallest feature is made up of many pixels. However, for low resolution digital images, there can be a difference between the answer that these two methods give, with generally no way of distinguishing which is preferred. If the real pixel-to-pixel connections are defined beforehand in some way, so that only certain neighbors are "really" connected, this will give insight into which method to use. Otherwise, the choice is arbitary. However, exact solutions for various non-trivial systems can be used to check on the accuracy of these different methods [57], in some cases distinguishing between them in a quantitative way.