Skip to content

Finite Difference and Finite Volume Methods

Finite volume methods can easily handle arbitrary geometries. You can use arbitrarily shaped cells, irregular meshes, and even unstructured meshes. With an irregular mesh, the cell shapes can distort. In an unstructured mesh, the cell shape can even change. Why would you ever want that, you may ask? Consider a circular shape in the middle of our domain. We'll have a pretty hard time fitting a regular or even irregular mesh to a circle.

Differential Operators

Starting with a 2-dimensional domain, the divergence operator can be discretized as

F=Fxx+Fyy=Fxi+1,jFxi1,j2Δx+Fyi,j+1Fyi,j12Δy \div F = \pdv{F_x}{x} + \pdv{F_y}{y} = \frac{F_{x_{i+1, j}} - F_{x _{i-1, j}}}{2 \Delta x} + \frac{ F_{y_{i, j+1}} - F_{y _{i, j-1}}}{2 \Delta y}

In a finite volume method, we need to integrate the differential operators over a cell volume

VFdV=dSF \int_V \div \vec{F} \dd V = \oint \vec{\dd S} \cdot \vec{F}

=facesFdS = \sum_{\text{faces}} \vec{F} \cdot \vec{\dd S}

=Fxi+1/2+dSxi+1/2+Fyj+1/2dSuj+1/2+Fxi1/2+dSxi1/2 = F_{x_{i+1/2}} + \dd S_{x_{i+1/2}} + F_{y_{j+1/2}} \dd S _{u_{j+1/2}} + F_{x_{i-1/2}} + \dd S_{x_{i-1/2}}

    |  j+1/2  |

-------------------------- | |
| |
i-1/2 * ij * i+1/2
| |
| |
| |
-------------
------------- | j-1/2 |
```

If you have an orthogonal regular grid, dVijk=ΔxΔyΔz \dd V_{ijk} = \Delta x \Delta y \Delta z , then

mathdSxi+1/2=ΔyΔz``` ```math \dd S_{x_{i+1/2}} = \Delta y \Delta z

Fxi+1/2=Fxi+Fxi+12 F_{x_{i+1/2}} = \frac{F_x i + F_{x_{i+1}}}{2}

and the same for other terms, then dVijk \dd V_{ijk} reduces to the finite difference operator and the finite volume method is exactly equivalent to the finite difference method. In this sense, finite volume algorithms are simply a straightforward extension of finite difference algorithms, where instead of simply looking ahead/behind by some amount Δx \Delta x , we must here take the appropriate dot products to calculate fluxes across faces of oddly-shaped cells. We get to maintain the conservation form

Qt=F=0 \pdv{Q}{t} = \div F = 0

while using finite difference methods. Finite volume methods are some of the most popular for commercial CFD codes.

The modified PDE gives the accuracy from the leading order error term, e.g. O(Δx2 O(\Delta x ^2 . Because of the way we expand our Taylor series, the leading order error term tends to look like

3ux3Δx2 \propto \pdv{^3 u}{x^3} \Delta x^2

2ux2Δx \propto \pdv{^2 u}{x^2} \Delta x

One thing we know about wave PDEs is that adding a term with an odd order derivative will introduce dispersive effects, and adding a term with an even order derivative will add diffusive (viscous) effects.