The Velocity calculator takes three scalar data sets and from them creates a vector data set representing seepage velocity. The three input data sets are head, porosity and hydraulic conductivity. The calculations are based on Darcy’s Law:

where vs is the seepage velocity, vd is the Darcy velocity, n is the effective porosity, k is the hydraulic conductivity, and i is the head gradient.
In 3D, the equation is:

If we assume kx = ky = kh and kz = (anis factor)*kh then this equation simplifies to:

Or:

Thus, the first step is to calculate the hydraulic gradient vector. This is done using simple finite differences. For an interior node (ijk):

We can compute the dh/dx as:

The gradients in the other direction are computed in a similar fashion.