Finite-volume conservation and numerical fluxes
Build updates from shared interface fluxes and separate conservation from entropy and positivity.
On this page
The question for today
What you’ll understand
- Derive a cell-average update from the integral conservation law.
- Verify periodic mass conservation by cancellation of shared fluxes.
- Choose upwind information according to the transport direction and distinguish consistency from admissibility.
A finite-volume method evolves averages of a conserved quantity over cells. Its defining structure is a balance between flux entering and flux leaving each cell. If neighboring cells use exactly the same interface flux with opposite signs, conservation follows by cancellation even when the solution is discontinuous. Accuracy, positivity and selection of the physically admissible weak solution are additional requirements, not automatic consequences of that cancellation.
Start from an integral balance rather than a point derivative
For a scalar conservation law u_t+f(u)_x=0, integrate over a fixed cell. The time derivative of the cell average equals the flux entering through the left face minus the flux leaving through the right face, divided by cell width. A numerical method replaces the unknown interface fluxes by computable shared quantities. The exact fully discrete balance uses time-averaged fluxes over each step; a Forward Euler scheme approximates them from the current states. Reconstructed point values and cell averages are distinct objects.
On a nonuniform fixed grid, cell widths must stay inside the mass balance. The conserved total is the sum of cell width times cell average, not simply the unweighted sum of averages. In several dimensions, oriented face areas play the same role. A locally refined interface needs a compatible coarse-fine flux accounting rather than separate unrelated flux evaluations. These geometric factors are not optional corrections: they encode how much conserved material each degree of freedom represents.
Conservation cancels interior fluxes
Multiply each update by its cell width and sum. Every interior face appears once as an outflow and once as an inflow, so only physical boundary fluxes remain. On a periodic mesh those terms cancel as well, giving exact algebraic mass conservation apart from floating-point summation. The flux function should also be consistent: feeding equal left and right states must recover the physical flux. Consistency ensures a constant state is represented correctly, but does not say how perturbations or discontinuities are treated.
For linear advection f(u)=a u, the upwind interface flux uses the left state when a is positive and the right state when a is negative. Characteristics carry information into the face from that direction. Equivalently, split a into its positive and negative parts. The formula changes when the velocity changes sign; copying a positive-speed left-biased stencil for negative speed is a downwind method and can be unstable. Boundary data should likewise be imposed at inflow, rather than prescribing independent values at both ends of a first-order transport problem.
A conserved answer can still be the wrong answer
For positive constant speed on a uniform mesh, Forward Euler upwind gives a convex combination when the Courant number lies between zero and one. This supplies monotonicity, positivity preservation for nonnegative averages and an L1 contraction property in the periodic scalar setting. Outside that interval the method remains algebraically conservative but can generate negative values and amplify grid oscillations. Conservation therefore survives a failure of the properties one usually needs for a reliable approximation.
For nonlinear conservation laws, shocks introduce a further admissibility issue. Consistent conservative methods can converge to a weak solution only under suitable convergence assumptions, and an entropy mechanism is needed to select the physically appropriate solution. A local numerical viscosity or an exact entropy Riemann flux can provide that mechanism in appropriate scalar schemes. It is not legitimate to infer entropy convergence for an arbitrary system solely from a telescoping mass sum. The worked update tests the algebraic balance and positive-speed flux direction without claiming a universal nonlinear theorem.
Work it through
A three-cell periodic transfer
Take three equal periodic cells with averages(1,2,0), positive advection speed a=2 and time-step-to-width ratio 0.2. Perform one Forward Euler upwind update and check total mass.
The Courant number is nu=a times time step/width=0.4. The right-face fluxes are 2U_i, namely 2,4,0; periodic left-face fluxes are 0,2,4.
The updated averages are 1−0.2(2−0)=0.6,2−0.2(4−2)=1.6, and 0−0.2(0−4)=0.8. Each is also 0.6 times its old value plus 0.4 times its left neighbor.
The old and new unweighted sums are both three. Since cell widths are equal, multiplying by that common width proves conserved total mass; all updated values are nonnegative.
One step produces(0.6,1.6,0.8), preserving periodic mass and nonnegativity under this particular monotone update.
The living notebook
Explore the model
Interactive lab · probability
A convex-combination transport weight
Pause and Reset, then set probability p = 0.40 and trials n = 1. The two bars are 0.60 and 0.40, matching the weights on the current and left-neighbor values in the worked upwind update. Reset and set both p = 0.80 and n = 1 to predict weights 0.20 and 0.80. This binomial instrument illustrates valid convex weights only; it has no spatial cells, physical interface flux or negative-weight regime and is not a finite-volume solver.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forNonnegative weights summing to one can preserve bounds, while conservation additionally requires shared spatial fluxes.
Pause & reason
Check your understanding
Your turn
Try it yourself
For a=−1 and Courant magnitude|a|time step/width=0.25, update periodic averages(0,2,2) with the correct upwind direction. Explain which total is conserved on unequal cells.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Negative-speed upwind uses the right neighbor: new U_i=0.75U_i+0.25U_(i+1). For unequal cells, return to the flux-balance equation.
Compare with the solution
The new averages are 0.75·0+0.25·2=0.5,0.75·2+0.25·2=2, and 0.75·2+0.25·0=1.5. Their sum remains four on this equal-cell grid. For unequal cells the proper invariant is , because multiplying each flux difference by its own cell width restores the telescoping interface balance. An unweighted sum of unequal-cell averages need not be conserved. This negative-speed update uses the right neighbor and remains a convex combination at the chosen Courant magnitude; using the left neighbor would represent the wrong information direction.
Keep the idea
Take it with you
- Cell averages represent conserved material only after multiplication by cell volume.
- Shared interface fluxes give conservation through cancellation.
- Upwind direction, positivity and entropy admissibility require conditions beyond conservation alone.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.