I am trying to write a simple finite volume method code but there are some concepts I'm still not really getting right (perhaps I'm overcomplicating things)
Given a uniform grid, the idea is to approximate the solution by computing cell averages as
$$\bar u(x_j,t^n) = \bar u_j^n = \frac{1}{h}\int^{x_{j+1/2}}_{x_{j-1/2}} u(x,t^n)dx$$
When implementing the cell average computation in my code, I suppose I can use any quadrature, is this right?
Now, at $t=0$, I know the values for every $x_{j+1/2}$ and compute can compute $\bar u_j^0$, $\bar u_{j+1}^0$, $\bar u_{j-1}^0$ which in turn I can use to compute
$$\bar u_j^{n+1} = \bar u_j^{n} - \frac{\Delta t}{\Delta x}\Big[ F(\bar u_j^{n},\bar u_{j+1}^{n})-F(\bar u_{j-1}^{n},\bar u_j^{n}) \Big]$$
given the numerical flux $F(\cdot,\cdot )$If I understood correctly, everything should be fine up to this point.
Now, for the next iteration do I need to recompute the averages for each cell? If so I don't see where to get the values for each $x_{j+1/2}$. Or should I just use the new computed values, i.e. $\bar u_{j-1}^{n+1}$,$\bar u_j^{n+1}$,$\bar u_{j+1}^{n+1}$ , to iterate over the scheme?
I don't know if I missing something else in here, any thoughts?