The modeling of phase separating binary mixtures in porous media is a great research challenge. Recently, new cellular automata methods called lattice gas and lattice Boltzmann (LB)  have demonstrated the capability to model multiphase fluid flow while including interfacial surface tension effects between the two fluids and between the fluid and solid interface . Lattice Boltzmann and lattice gas algorithms are also easily adaptable for parallel computers since they, in general, only need nearest neighbor information on the lattice on which they are defined. Such information is readily available in a digital image of a porous medium.
In this section we present a brief description of the LB method used in this study. A detailed description of the LB method is found in the paper by Martys and Chen . The approach of LB is to consider a typical volume element of fluid to be composed of a collection of particles which are represented in terms of a particle velocity distribution at each point in space. Macroscopic variables such as density and fluid velocity can be obtained by taking suitable moments of the distribution function. The velocity distribution function, , where superscript i labels the fluid component and the subscript a indicates the velocity direction, is the amount of particles at node x, time t with velocity ea where (a=1,...,b). The time is counted in discrete time steps, and the fluid particles can colide with each other as they move under applied forces (surface tension, applied shear, etc.). The directions of the particle velocities are discretized reflecting the lattice and physical symmetries.
For this study we use the D3Q19 (3 Dimensional lattice with b=19)  lattice where the discrete particle velocities, ea , equal all permutations of (±1, ±1, 0) for 1 a 12, (±1 , 0, 0) for 13 a 18 and (0,0,0) for a=19. The units of ea are the lattice constant divided by the time step. Macroscopic quantities such as density, n i(x,t ), and fluid velocity, u i, of each fluid component, i, are obtained by the following moment sums,
Note that while the distribution function is defined only over a discrete set of velocities, the actual macroscopic velocity field of the fluid is continuous.
The time evolution of the particle velocity distribution function
satisfies the following LB equation:
where is the collision operator representing the rate of change of the particle distribution due to collisions. The collision operator is greatly simplified by use of the single time relaxation approximation [6,5]
where is the equilibrium distribution at (x, t ) and i is the relaxation time that controls the rate of approach to equilibrium. The equilibrium distribution can be represented in the following form for particles of each type :
mi is molecular mass of the ith component, and ta=1/36 for and ta=1/36 for and t19=1/3 .
It has been shown that the above formalism leads to a velocity
field which is a solution of the Navier-Stokes  equation with the kinematic viscosity , ,
where ci is the concentration of each component.