What implementation details need to change if I use a cell average approach rather than a cell total approach for the finite-volume method?

For example, consider the conservation law,

$$ u_t + \mathcal{F}_x = s(x,t) $$

A cell average approach yields,

$$ \frac{\partial}{\partial t}\int_{x_{j-1/2}}^{x_{j+1/2}} u(x,t)~dx = -\int_{x_{j-1/2}}^{x_{j+1/2}} F_x~dx + \int_{x_{j-1/2}}^{x_{j+1/2}}s(x,t)~dx \\ \frac{\partial}{\partial t} \tilde{u}(x,t) = \frac{1}{x_{j+1/2} - x_{j-1/2}}\left(\mathcal{F}_{j-1/2} - \mathcal{F}_{j+1/2} \right) + \tilde{s}(x,t) $$

The cell total is the same but without dividing the flux term by the cell length $(x_{j+1/2} - x_{j-1/2})$ (I am considering 1D only).

When solving the equation numerically, do I need to define $\tilde{u}$ and $\tilde{s}$ differently in these two cases?

A little confused about this subtlety. My first impression what that nothing needs to change other than the dividing the flux term by $(x_{j+1/2} - x_{j-1/2})$ when using a cell averaged approach. Is that correct?


1 Answer 1


Before answering, note that there are a couple of mistakes in the formulation of your question. First, your equation is not a conservation law due to the presence of the source term; it is somewhat common to refer to an equation like this as a balance law instead. Second, by definition the cell average is only a function of time, so you should write $\tilde{u}(t)$ (the same goes for $\tilde{s}(t)$). Third, following from the second observation, the time derivative that operates on the cell average should be an ordinary time derivative.

Now turning to your question as such. The definitions of $\tilde{u}$ and $\tilde{s}$ do not depend on what form you write your equation in. The only thing you need to be careful about is if the grid is a function of time (moving grid). If it moves, note that $x_{i+1/2}-x_{i-1/2}$ would remain inside the time derivative. In that case, you would also need to obey the so-called geometric conservation law, which relates the normal velocity at which the cell faces move to the rate of change in time of the cell volume (in this case the length).

  • $\begingroup$ Thank you for pointing out those details, I follow your reasoning apart for the point of using ordinary time derivatives. Why is this? $\endgroup$
    – boyfarrell
    Commented Jun 21, 2013 at 7:41
  • $\begingroup$ The average of a variable in a particular volume (cell) is defined as the integral of that variable over the volume divided by that volume. So effectively you have integrated out the spatial dependence of the of the variable in that volume. Therefore, the cell average in a particular cell must be considered constant in that cell. Of course, unless your function is constant, the cell averages in adjacent cells will differ. $\endgroup$ Commented Jun 21, 2013 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.