# 2.11.1. The finite volume method: finite volumes versus finite difference¶

The finite volume method is used to discretize the equations in space.
The expression “finite volume” actually has two meanings; one is the
method of embedded or intersecting boundaries (shaved or lopped cells in
our terminology) and the other is non-linear interpolation methods that
can deal with non-smooth solutions such as shocks (i.e. flux limiters
for advection). Both make use of the integral form of the conservation
laws to which the *weak solution* is a solution on each finite volume of
(sub-domain). The weak solution can be constructed out of piece-wise
constant elements or be differentiable. The differentiable equations can
not be satisfied by piece-wise constant functions.

As an example, the 1-D constant coefficient advection-diffusion equation:

can be discretized by integrating over finite sub-domains, i.e. the lengths \(\Delta x_i\):

is exact if \(\theta(x)\) is piece-wise constant over the interval \(\Delta x_i\) or more generally if \(\theta_i\) is defined as the average over the interval \(\Delta x_i\).

The flux, \(F_{i-1/2}\), must be approximated:

and this is where truncation errors can enter the solution. The method for obtaining \(\overline{\theta}\) is unspecified and a wide range of possibilities exist including centered and upwind interpolation, polynomial fits based on the the volume average definitions of quantities and non-linear interpolation such as flux-limiters.

Choosing simple centered second-order interpolation and differencing recovers the same ODE’s resulting from finite differencing for the interior of a fluid. Differences arise at boundaries where a boundary is not positioned on a regular or smoothly varying grid. This method is used to represent the topography using lopped cell, see Adcroft et al. (1997) [AHM97]. Subtle difference also appear in more than one dimension away from boundaries. This happens because each direction is discretized independently in the finite difference method while the integrating over finite volume implicitly treats all directions simultaneously.