Finite Difference and Finite Volume Methods

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

\[\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

\[\int_V \div \vec{F} \dd V = \oint \vec{\dd S} \cdot \vec{F}\] \[= \sum_{\text{faces}} \vec{F} \cdot \vec{\dd S}\] \[= 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, \( \dd V_{ijk} = \Delta x \Delta y \Delta z \), then

\[\dd S_{x_{i+1/2}} = \Delta y \Delta z\] \[F_{x_{i+1/2}} = \frac{F_x i + F_{x_{i+1}}}{2}\]

and the same for other terms, then \( \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 \( \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

\[\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(\Delta x ^2 \). Because of the way we expand our Taylor series, the leading order error term tends to look like

\[\propto \pdv{^3 u}{x^3} \Delta x^2\] \[\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.