# Finite volume with cell averages vs cell totals for conservation equations

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?

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).