Finite-volume Method - 1D Example

1D Example

Consider a simple 1D advection problem defined by the following partial differential equation

Here, represents the state variable and represents the flux or flow of . Conventionally, positive represents flow to the right while negative represents flow to the left. If we assume that equation (1) represents a flowing medium of constant area, we can sub-divide the spatial domain, into finite volumes or cells with cell centres indexed as . For a particular cell, we can define the volume average value of at time and, as

and at time as,

where and represent locations of the upstream and downstream faces or edges respectively of the cell.

Integrating equation (1) in time, we have:

where .

To obtain the volume average of at time, we integrate over the cell volume, and divide the result by, i.e.

We assume that is well behaved and that we can reverse the order of integration. Also, recall that flow is normal to the unit area of the cell. Now, since in one dimension, we can apply the divergence theorem, i.e., and substitute for the volume integral of the divergence with the values of evaluated at the cell surface (edges and ) of the finite volume as follows:

\quad (6) \qquad \qquad \bar{\rho}_i \left( t_2 \right) = \bar{\rho}_i \left( t_1 \right)
- \frac{1}{\Delta x_{i}} \left( \int_{t_1}^{t_2} f_{i + \frac{1}{2}} dt
- \int_{t_1}^{t_2} f_{i - \frac{1}{2}} dt
\right) .

where .

We can therefore derive a semi-discrete numerical scheme for the above problem with cell centres indexed as, and with cell edge fluxes indexed as, by differentiating (6) with respect to time to obtain:

\quad (7) \qquad \qquad \frac{d \bar{\rho}_i}{d t} + \frac{1}{\Delta x_i} \left[
f_{i + \frac{1}{2}} - f_{i - \frac{1}{2}} \right] =0 ,

where values for the edge fluxes, can be reconstructed by interpolation or extrapolation of the cell averages. Equation (7) is exact for the volume averages; i.e., no approximations have been made during its derivation.

Read more about this topic:  Finite-volume Method