advanced32 min studyLesson 926 in Physics

Finite-volume fluxes and conservation

Update cell averages with one shared interface flux and distinguish conservation from stability and entropy selection.

On this page

What you’ll understand

  • Derive a conservative update from integrated transport.
  • Compute periodic and open-boundary mass balances.
  • Explain why conserving total mass does not by itself select a correct shock or stable method.

Finite-volume methods start from what crosses a cell boundary. Instead of approximating a pointwise derivative first, they update an average by subtracting the outgoing flux and adding the incoming flux. Neighboring cells must use the same value for their shared interface, which makes internal transfers cancel in the global balance. This organization is essential for transport and shocks. Conservation remains only one requirement: an unstable flux or an inadmissible shock approximation can preserve the total amount while representing the wrong solution.

Integrate first and discretize the flux

Consider a one-dimensional density q measured as mass per unit length, moving at constant positive speed a. Integrating the conservation law over a fixed cell relates the rate of cell mass to flux through its two endpoints. Define qj as a cell average, not a point value. An explicit finite-volume step replaces each time-averaged endpoint flux with a numerical approximation. For positive-speed first-order upwinding, the interface takes the density from its left, upstream cell.

The resulting update is a convex combination of the old cell and its upstream neighbor when the Courant number lies between zero and one. This preserves nonnegative averages from nonnegative input and limits this scheme's explicit step. It also smooths a transported discontinuity, producing numerical diffusion. A sharp-looking profile is therefore not the only measure of quality: conservation, positivity, error in transported position and convergence under refinement all describe different aspects of the approximation.

qjn+1=qjn−ΔtΔx(Fj+1/2n−Fj−1/2n),Fj+1/2=aqj (a>0),qjn+1=(1−C)qjn+Cqj−1nq_j^{n+1}=q_j^n-\frac{\Delta t}{\Delta x}(F_{j+1/2}^n-F_{j-1/2}^n),\quad F_{j+1/2}=a q_j\ (a>0),\quad q_j^{n+1}=(1-C)q_j^n+Cq_{j-1}^n
q has mass/length units, F mass/time units, a length/time units and C = aΔt/Δx. The upwind formula shown applies to positive constant speed; changing its sign changes the upstream side.↔ Scroll wide equations horizontally.

Make the boundary contribution visible

Sum cell masses after the update. Each internal interface enters twice with opposite signs, leaving only the outer boundary fluxes. Periodicity identifies the two outer fluxes, so the total mass is unchanged up to arithmetic error. At an open boundary the mass may legitimately change. Treating any mass loss as a numerical bug would confuse a physical outflow with a violation of the discrete balance.

For positive advection speed, an inflow condition is supplied at the left boundary while information exits at the right. Prescribing arbitrary independent data at both ends can overconstrain the transport problem. A wall, an inflow and a periodic wrap represent different experiments. Record flux conventions and compare the observed domain mass change with the integrated boundary transfer. A shared interface update also makes debugging local conservation possible before a full simulation has reached an interesting flow pattern.

Mn=Δx∑j=1Jqjn,Mn+1−Mn=−Δt(FJ+1/2n−F1/2n)M^n=\Delta x\sum_{j=1}^J q_j^n,\qquad M^{n+1}-M^n=-\Delta t(F_{J+1/2}^n-F_{1/2}^n)
The identity assumes uniform cells and the same stored interface flux used by both neighbors. M is a mass, so each boundary flux multiplied by Δt is also a mass.↔ Scroll wide equations horizontally.

Do not confuse a conservative weak limit with admissibility

For nonlinear conservation laws, discontinuities are interpreted through integral balances rather than ordinary derivatives at the jump. Consistent conservative methods have an important relation to weak solutions when a suitable convergent limit exists. That statement does not prove the sequence converges, remains positive or satisfies the physical entropy condition. Numerical fluxes, limiting and time integration must address those issues. A nonconservative discretization can even propagate a shock at the wrong speed while behaving acceptably on smooth data.

The relevant entropy inequality is a mathematical admissibility condition for the chosen conservation law, not an assertion that every computed cell has a thermodynamic entropy variable. The Markov lab offers a small example of nonnegative weights that preserve a total. Its two-state probabilities are exact matrix updates, not cell averages on an advecting mesh. It can distinguish conservation from convergence to equilibrium, but it has no physical interface flux, shock solver or boundary inflow.

∂tq+∂xf(q)=0,∂tη(q)+∂xψ(q)≤0for an admissible entropy pair\partial_t q+\partial_x f(q)=0,\qquad \partial_t\eta(q)+\partial_x\psi(q)\le0\quad\text{for an admissible entropy pair}
For a scalar convex-entropy framework, η is convex and ψ′ = η′f′. The inequality is interpreted weakly at shocks; additional system-specific physics may be needed for coupled fluid equations.↔ Scroll wide equations horizontally.

A tiny periodic upwind transport

Three periodic cells each have width 1 m and initial averages (1,0,0) kg/m. Let a = 2 m/s and Δt = 0.25 s. Compute two upwind steps and the total mass after each.

  1. The Courant number is 0.50. Each new cell receives one half of its own average and one half of its wrapped upstream neighbor.

  2. The first step is (0.5, 0.5, 0) kg/m. The second is (0.25, 0.5, 0.25) kg/m, because the first cell's upstream neighbor was the third.

  3. Multiplying each sum by the one-meter width gives one kilogram at both steps. The profile spreads while conserving mass; this is numerical diffusion of first-order upwinding, not loss of the transported substance or random diffusion imposed by a sampling model.

The result

The two levels are (0.5, 0.5, 0) and (0.25, 0.5, 0.25) kg/m, each containing 1 kg.

Explore the model

Interactive lab

Interactive lab · markov

Preserving a total does not imply equilibration

Reset and set BOTH Transition p · 0 → 1 = 0.50 and Transition q · 1 → 0 = 0.50; one Step gives probabilities (0.5,0.5). Reset and set p = 1 and q = 1; successive Steps alternate between the two pure states while their total stays one. This exact two-state chain illustrates positive conservative weights only, not finite-volume advection, shock entropy or physical boundary fluxes.

Preserving a total does not imply equilibrationExact finite-step probabilities for a two-state chain starting in state 0, not sampled trajectories. Playback advances two transitions per second. When p = q = 0 every distribution is stationary; when p = q = 1 the chain alternates forever. A single zero transition creates an absorbing state. Current readings: P(state 1) at step 0: 0%; Stationary P(state 1): 60%; Chain behavior: Monotone convergence. All parameters are adjustable with the labeled controls below.Two-state Markov distribution after 0 steps: state zero probability 1, state one probability 0.Initial distribution (1, 0) · step 0p = 0.3q = 0.201100%0%1−p1−qP(0)P(1)Monotone convergence
P(state 0)P(state 1)Stationary distribution
P(state 1) at step 0
0%
Stationary P(state 1)
60%
Chain behavior
Monotone convergence
t = 0 s

Exact finite-step probabilities for a two-state chain starting in state 0, not sampled trajectories. Playback advances two transitions per second. When p = q = 0 every distribution is stationary; when p = q = 1 the chain alternates forever. A single zero transition creates an absorbing state. 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 forPreservation of a total and convergence toward a steady state are distinct properties.

Check your understanding

An open-domain finite-volume calculation loses mass exactly equal to the measured net outward boundary transfer. What follows?

Try it yourself

Two cells of width 1 m have averages (1,1) kg/m. Use a = 1 m/s, Δt = 0.5 s, zero prescribed inflow density and upwind outflow. Compute one step and check the mass change against the boundary flux.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

The left, middle and right interface fluxes are respectively 0, 1 and 1 kg/s for this initial state.

Compare with the solution

The first cell becomes 1 − 0.5(1 − 0) = 0.5 kg/m and the second remains 1 − 0.5(1 − 1) = 1 kg/m. Domain mass falls from 2 kg to 1.5 kg. The outward-minus-inward flux is one kilogram per second, giving a loss of 0.5 kg over the step. The decrease is therefore consistent with the specified open-boundary problem. Replacing these boundaries by a periodic wrap would give a different calculation and would require conservation of the mass inside the periodic domain.

Take it with you

  • One shared interface flux makes internal transfers cancel.
  • Boundary flux determines whether domain mass is constant.
  • Conservation, stability, positivity and entropy admissibility are separate requirements.

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.