From first principles
Derive the Péclet restriction for a centred steady stencil
Take steady one-dimensional transport with constant speed \(a>0\), diffusivity \(D>0\) and no interior source. Conservation requires constant total flux \(J=au-Du'\). On a uniform mesh of spacing \(h\), approximate the advective face value by the arithmetic mean and the face gradient by a difference. The right face flux becomes
Equating the two neighbouring face fluxes and collecting the centre coefficient gives a relation among the three consecutive values:
For \(|\mathrm{Pe}_h|\le2\) the centre value is a positive weighted average of its neighbours. Above that threshold one weight becomes negative and the discrete solution can overshoot even when the continuum solution is monotone. This restriction is on the local cell Péclet number, not on \(aL/D\) for the whole physical domain. Smaller cells, an upwind flux or an exponentially fitted flux can change the discrete behaviour.
Derivation and applications
Distinguish an imposed inlet flux from an imposed inlet concentration
With diffusion, a concentration measurement alone does not specify the total material entering a channel. Consider steady one-dimensional advection at constant speed \(a>0\) and diffusion coefficient \(D>0\), constant area, no reaction, and coordinate \(0<x<L\). Concentration is \(u(x)\). The net species flux is the sum of advection and diffusive backflow. Conservation makes it constant throughout the interval:
Suppose the upstream supply delivers a specified total flux \(J=a u_f\), where \(u_f\) is the incoming feed concentration used to normalize the supply rate. Prescribe an outlet concentration \(u(L)=u_L\) maintained by a reservoir. Subtract the uniform particular solution \(u_f\). The resulting first-order homogeneous equation for the excess has a convenient outlet-referenced solution:
At the inlet the interior concentration can differ from the feed because diffusion also contributes to the prescribed mass rate. Define \(\mathrm{Pe}=aL/D\) and evaluate both terms at \(x=0\):
For large Péclet number the outlet affects only a layer of thickness \(D/a\). For small Péclet number the outlet reservoir can affect the whole channel. Imposing both \(u(0)=u_f\) and the specified total flux at the inlet would impose more conditions than this problem needs. A numerical method should record which physical boundary condition it approximates.
Worked example
Compute a moderate-Péclet-number channel profile
Take \(L=1.00\) m, \(a=0.0200\) m/s, \(D=0.0100\) m²/s, \(u_f=1.00\) and \(u_L=0\) kg/m³. The inlet concentration is \(1-e^{-2}=0.8647\) kg/m³ and the midpoint is \(1-e^{-1}=0.6321\) kg/m³. Inlet advection carries \(0.01729\) kg/(m² s) and diffusion supplies \(0.00271\) kg/(m² s), giving the prescribed total \(0.0200\).
Second application
Quantify a boundary-condition error
If a code instead fixes \(u(0)=1.00\) and \(u(L)=0\), its exact constant flux for those Dirichlet data satisfies
Hence \(J=0.0200/(1-e^{-2})=0.0231\) kg/(m² s), about \(15.7\%\) too large for the original feed problem. Grid refinement can converge cleanly to that incorrect-for-purpose value because the error lies in the boundary model.
Which length sets the balance?
Model a steady scalar on \([0,L]\) with \(a u'-\kappa u''=0\), constant speed \(a>0\) and diffusivity \(\kappa>0\). Advection and diffusion balance over length \(\ell=\kappa/a\). On a mesh with spacing \(h\), the cell Péclet number \(P=ah/\kappa\) measures how many layer lengths fit into one cell. This definition uses the full cell spacing; some conventions divide it by two. Stating the convention matters when quoting a threshold.
Write the centred interior equation in flux form. Its coefficients multiplying \(u_{j-1},u_j,u_{j+1}\) are \(-\kappa/h^2-a/(2h),2\kappa/h^2,-\kappa/h^2+a/(2h)\). For \(P\le2\), the neighbour coefficients are nonpositive and the row sum is zero, so each interior value is a weighted average of its neighbours. For \(P>2\), one weight changes sign. The discrete maximum principle can fail even though the centred derivative is formally second-order accurate on smooth resolved fields.
Watch a node cross below the boundary range
Take \(L=1,a=1,\kappa=0.1\), \(u(0)=0,u(1)=1\) and two equal cells. Then
At the only interior node the coefficients are \(-1.4,0.8,0.6\). The numerical value is \(-0.75\), outside the prescribed boundary range. The exact solution is \((e^{ax/\kappa}-1)/(e^{aL/\kappa}-1)\), increasing and close to zero except near the outlet. At \(x=0.5\) it is \(1/(e^5+1)\approx0.00669\). The coarse grid does not resolve a physical layer of width 0.1.
Using the upstream difference \((u_j-u_{j-1})/h\) changes the coefficients to \(-2.4,2.8,-0.4\); the computed midpoint is \(1/7\). The value lies in range but the layer is excessively broad. A monotone method can replace an oscillation with a large smoothing error. Plot the magnitude of the profile at fixed physical locations while refining to distinguish those outcomes.
Explain the extra diffusion
Expand \(u_{j-1}=u_j-hu'_j+h^2u''_j/2+\cdots\). The upstream derivative is \(u'_j-hu''_j/2+O(h^2)\). The leading modified equation therefore contains effective diffusivity \(\kappa+ah/2\). In the example the artificial addition is 0.25, larger than the physical diffusivity 0.1. Reducing \(h\) below 0.2 restores the coefficient-sign requirement for the centred formula, while resolving the layer shape accurately generally needs several cells across \(\ell\). A convergence study should report both bounds compliance and the actual layer width or flux.
Fit the face flux to a constant-coefficient cell
For smooth constant coefficients the total flux \(J=au-\kappa u'\) is constant in a source-free cell. Solve this first-order equation between endpoints separated by \(h\). The exact relation is \(u_R=e^P u_L+(J/a)(1-e^P)\), hence \(J=a(e^P u_L-u_R)/(e^P-1)\). At large positive \(P\), the flux approaches \(a u_L\), the value carried from upstream. As \(P\) tends to zero, expansion gives a diffusive difference \(-\kappa(u_R-u_L)/h\) plus the centred advective contribution \(a(u_L+u_R)/2\). This exponential fitting uses additional local knowledge of the differential equation. It reproduces the constant-coefficient cell relation exactly, but variable material properties and sources require new local approximations.
Allocate grid points to a singularly perturbed outflow layer
For steady positive advection and small diffusivity the outflow layer shape is approximately \(e^{-(L-x)/\ell}\), with physical thickness scale \(\ell=\kappa/a\). A uniform grid that resolves that scale at a fixed number of points may waste most of its cells where the solution is almost flat. A simple layer-adapted strategy divides the domain into a coarse interval and a fine interval ending at the outflow boundary. Choose the fine-region width \(\tau\) by specifying how small the layer should already be at their interface.
If \(e^{-\tau/\ell}=N^{-2}\) for a grid with \(N\) total cells, then \(\tau=2\ell\log N\). Capping this width at \(L/2\) prevents a separate-layer construction when the physical layer is no longer thin. Place half the cells on each subinterval. This produces a piecewise-uniform grid, often called a Shishkin mesh for this boundary-layer setting. The amplitude threshold motivates its construction; it is not itself a proof of a particular numerical convergence rate. Such a proof must also control truncation, stability and matching across the grid transition.
Compare the information captured by sixty-four cells
Consider \(L=1\) m, \(a=1\) m/s and \(\kappa=0.002\) m²/s. Then \(\ell=0.002\) m. A uniform mesh of 64 cells has spacing 0.015625 m, almost eight physical layer lengths per cell. The first interior point back from the outflow has layer amplitude about \(e^{-7.8125}\approx0.000405\). Most of the transition from nearly zero to one takes place in a single cell. A method may fit an acceptable boundary value while giving a poor near-wall shape or slope.
The two-region design instead places its transition \(\tau=0.004\log64\approx0.01664\) m before the end. With 32 fine cells, their width is approximately 0.000520 m, so the fine cell Péclet number is about 0.260. At the last interior point the layer amplitude is now \(e^{-0.260}\approx0.771\). Several distinct intermediate values are available near the wall. At the coarse-to-fine transition the amplitude is \(64^{-2}\approx0.000244\), just as designed.
The coarse cells on the remaining 0.98336 m have width about 0.03073 m and cell Péclet number about 15.4. Their small expected layer amplitude does not license an unstable or nonmonotone coarse discretisation. Use a spatial scheme whose behaviour is controlled there, and check flux continuity through the changing cell sizes. If advection reverses, the thin layer moves to the opposite boundary; retaining the old mesh would concentrate cells in the wrong region. In time-dependent transport, moving layers may similarly call for adaptive tracking instead of a fixed partition.
The wall derivative supplies a more demanding check than a prescribed boundary value. For the exponential layer its exact slope at outflow has magnitude \(1/\ell=500\) per metre. A backward difference across the final fine cell gives approximately \((1-0.771)/0.000520=440\) per metre. Even this substantially improved mesh still underestimates the wall slope by about twelve percent, which matters if wall flux is the reported observable.
Expose a monotonicity failure on ten cells
For constant positive advection and diffusion solve \(u''-\mathrm{Pe}\,u'=0\) with end values zero and one. At cell Péclet number three, the centred recurrence has ratio \((1+\mathrm{Pe}_h/2)/(1-\mathrm{Pe}_h/2)=-5\); the upwind ratio is four.

Read values from the plot
| Position / domain length | Exact | Centred cells | First-order upwind |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0.2 | 3.7658e−11 | 2.4576e−6 | 1.4305e−5 |
| 0.5 | 3.059e−7 | −0.0003201 | 0.00097561 |
| 0.8 | 0.0024788 | 0.04 | 0.062499 |
| 1 | 1 | 1 | 1 |
Change parameters · Expose a monotonicity failure on ten cells
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Choose the physically admissible wave in a conservative update · Spatial discretisation and field equations
A discontinuous scalar flow can satisfy integral conservation in more than one way. Derive the shock speed, use a convex entropy to distinguish a compression from an expansion and build a finite-volume flux from the resulting local solution.