Fundamentals / Numerical mathematics / Numerical partial differential equations

Incompressibility and discrete pressure modes

Derive the velocity–pressure block system and use a periodic mesh to detect a pressure pattern that exerts no discrete force.

From first principles

Eliminate velocity to expose the pressure equation

In a mixed incompressible discretization, velocity responds to applied force and pressure while pressure enforces zero discrete divergence. Let \(A\) be a positive definite velocity block after applying boundary conditions, \(B\) the discrete divergence, and use \(B^\mathsf T\) with the corresponding weak pressure sign convention. With forcing \(f\) and prescribed divergence \(g\) the block equations are

\[Au+B^\mathsf T p=f,\]
\[Bu=g .\]

Eliminate velocity by applying the inverse action of \(A\) to the first equation and substituting into the second. The resulting pressure Schur system is

\[S p=BA^{-1}f-g,\]
\[S=BA^{-1}B^\mathsf T .\]

Since \(p^\mathsf TSp=(B^\mathsf Tp)^\mathsf T A^{-1}(B^\mathsf Tp)\), a pressure vector is invisible precisely when its discrete gradient vanishes. A constant pressure often has this property by physics; additional oscillatory pressure null modes can indicate incompatible spaces. Fixing a pressure reference removes the arbitrary constant but does not cure those extra modes. Once pressure is obtained, substitute it back to recover a velocity satisfying the original continuity equation.

Derivation and applications

Follow a pressure Fourier mode through two discrete gradients

The divergence and pressure-gradient operators must recognize every nonconstant pressure that is meant to constrain the velocity. Consider an even number of uniformly spaced periodic cells along a line, with pressure \(p_j\) at cell centres. A one-dimensional Fourier mode \(p_j=e^{ij\theta}\) is a convenient algebraic test; the constant mode is the expected arbitrary pressure reference. Suppose a colocated method uses a centred pressure gradient at the same locations:

\[(G_cp)_j=(p_{j+1}-p_{j-1})/(2h)=i[\sin\theta/h]e^{ij\theta}.\]

The pressure Schur operator in a simplified projection with identity velocity mass is \(G_c^\ast G_c\). Its eigenvalue is the squared magnitude of that gradient multiplier. It vanishes both at \(\theta=0\) and at the checkerboard \(\theta=\pi\). To compare, place normal velocity at faces and difference its adjacent cell pressures:

\[(G_sp)_{j+1/2}=(p_{j+1}-p_j)/h=\frac{2i\sin(\theta/2)}h e^{i(j+1/2)\theta}.\]

Combining the face gradient with its adjoint yields two different pressure operators on the same grid:

\[\lambda_c(\theta)=\sin^2\theta/h^2,\]
\[\lambda_s(\theta)=4\sin^2(\theta/2)/h^2 .\]

At long wavelengths both agree with \(k^2\) for physical wavenumber \(k=\theta/h\). At the alternating mode, staggered differences detect adjacent pressure differences even though a centred two-cell difference cancels them. This calculation isolates one spatial compatibility issue; other geometries and velocity boundary conditions require the full divergence-gradient pairing to be checked.

Worked example

Compare a resolved oscillation with a checkerboard

On a grid with \(h=0.100\) m, choose \(\theta=\pi/2\). The two Schur eigenvalues are \(100\) and \(200\) m⁻². At \(\theta=\pi\) they become zero and \(400\) m⁻² respectively. A unit-amplitude alternating pressure consequently produces zero centred forces, although its differences across neighbouring faces have magnitude \(20.0\) per metre.

Second application

Test the effect of setting the pressure mean to zero

An even periodic grid with pressure values \(+3,-3,+3,-3\) Pa has zero arithmetic mean. Fixing that mean does nothing to its spurious mode in the centred scheme. With face velocities the pressure gradients alternate between \(-60\) and \(+60\) Pa/m for \(h=0.100\) m. A compatible projection sees these forces and excludes this pattern from the nullspace. Removing an arbitrary constant addresses a different degeneracy.

Pressure enforces a constraint

For a steady incompressible viscous fluid, one simplified model is \(-\mu\Delta u+\nabla p=f\), \(\nabla\cdot u=0\), with prescribed wall velocity. Multiplying momentum by a velocity test function vanishing at the wall and integrating by parts gives

\[\mu\int\nabla v:\nabla u-\int p\,\nabla\cdot v=\int f\cdot v.\]

Testing incompressibility with a pressure test function completes a coupled weak formulation. Adding a constant to pressure leaves its gradient unchanged, so use a reference pressure or impose zero mean in a closed domain.

Choose discrete velocity and pressure spaces, and define \(B\) as the negative weak divergence. After eliminating prescribed velocities, the block equations are

\[Au+B^Tp=f,\ Bu=0,\]

with \(A\) positive definite under these boundary conditions. Eliminating velocity yields the pressure operator \(BA^{-1}B^T\). Its quadratic form is \((B^Tp)^TA^{-1}(B^Tp)\). A nonconstant pressure whose discrete gradient vanishes therefore survives as a spurious null mode, even if the velocity block is exceptionally well conditioned.

Test a checkerboard

On an even periodic one-dimensional grid use the collocated centred gradient \((p_{j+1}-p_{j-1})/(2h)\). Choose \(p_j=(-1)^j\). The two neighbouring pressures match, so the gradient is zero at every velocity point. The pressure has zero mean and amplitude one, making it independent of the constant pressure ambiguity. For values \(1,-1,1,-1\) and \(h=0.25\), the result is still the identically zero vector. A pressure solver applied to such a discretisation can retain arbitrary amounts of this alternating pattern without changing the velocity residual.

Placing velocities on the faces instead leads to a face gradient \((p_{j+1}-p_j)/h\). On the same four-cell grid its magnitudes are all 8 with alternating signs. This layout couples the previously invisible pressure variation to the velocity unknowns. The one-dimensional example diagnoses an algebraic pairing issue. In higher dimensions the geometry, boundaries and full selection of discrete spaces also affect stability.

A uniform coupling requirement

A family of stable mixed spaces requires a lower bound, independent of mesh size, on the largest discrete divergence pairing a normalised pressure can obtain with a normalised velocity test. This is the discrete inf-sup condition, with pressures measured after removing their constant ambiguity. It excludes both exact checkerboards and nearly invisible modes that become worse as the mesh is refined. A standard finite-element pairing on suitable triangulations combines continuous quadratic velocities with continuous linear pressures. Other pairings need a separate stability argument or stabilising terms.

Check discrete divergence and momentum, then inspect pressure on grid-scale patterns. A smooth velocity, or even a small residual in both block equations, provides very little information about the amplitude of a pressure component on which those equations have no sensitivity.

Give pressure a reference without changing forces

Replacing a four-cell periodic pressure vector \((2,4,6,8)^T\) by its zero-mean representative \((-3,-1,1,3)^T\) leaves every face difference unchanged. The mean removal fixes one arbitrary pressure level. Adding the checkerboard \((1,-1,1,-1)^T\) also preserves its mean, yet changes the individual face differences. This distinction makes a practical diagnostic: verify a constant shift has no physical effect, then test whether a nonconstant alternating shift produces a physically nonzero force in the chosen velocity space. Passing the former test alone cannot reveal uncoupled pressure coordinates.

Project a tentative velocity onto discrete incompressibility

After an explicit force update a tentative velocity \(v^\ast\) may have nonzero discrete divergence. Suppose \(M\) is a symmetric positive definite velocity mass matrix and the desired constraint is \(Bv=0\). Find the divergence-free velocity closest to \(v^\ast\) in the kinetic metric by minimising \((v-v^\ast)^TM(v-v^\ast)/2\). Introducing a multiplier \(p\) gives

\[M(v-v^\ast)+B^Tp=0.\]

Applying \(B\) to the resulting corrected velocity yields

\[BM^{-1}B^Tp=Bv^\ast.\]

Here \(p\) acts as a pressure impulse; conversion to a physical pressure depends on the time-step and scaling conventions.

The correction \(M^{-1}B^Tp\) is mass-orthogonal to every admissible velocity \(w\), since \(w^TB^Tp=(Bw)^Tp=0\). Hence the norm of the tentative state splits into squared norms of the corrected velocity and removed component. This projection never increases kinetic energy in homogeneous constraints. A null pressure mode with \(B^Tp=0\) does not affect the corrected velocity; fixing a gauge can select a unique multiplier. If the discrete gradient and divergence are assembled inconsistently, the orthogonality and corresponding energy argument may fail even if a pressure equation is solved accurately.

Follow an impulse through three velocity unknowns

Choose \(M=\operatorname{diag}(1,2,1)\), and let \(Bv=(v_1-v_2,v_2-v_3)^T\). Constraint-compatible velocities have all three components equal. The tentative velocity is \((0,0,2)^T\), with weighted momentum two and kinetic energy two. Its divergence vector is \((0,-2)^T\). Multiplying \(BM^{-1}B^T\) gives diagonal entries 1.5 and off-diagonal entries −0.5. Solving this two-by-two system yields

\[p=(-0.5,-1.5)^T.\]

Recover \(B^Tp=(-0.5,-1,1.5)^T\), then

\[M^{-1}B^Tp=(-0.5,-0.5,1.5)^T.\]

Subtracting gives \(v=(0.5,0.5,0.5)^T\), now satisfying both constraints. Its weighted momentum is still two because the constant velocity vector is admissible and therefore mass-orthogonal to the correction. The final kinetic energy is 0.5. The removed component has energy \([0.25+2(0.25)+2.25]/2=1.5\), exactly the energy difference. Both conservation of uniform momentum and removal of the incompatible component have been checked numerically.

With prescribed boundary fluxes the target constraint is generally inhomogeneous. The closest admissible velocity then lies in an affine space; the preceding zero-centred energy decrease need no longer hold because boundaries can do work. Transforming to fluctuations about a boundary-compatible lifting can restore an orthogonality statement for the correction. Before interpreting a pressure projection's apparent dissipation or energy injection, specify the boundary conditions and the metric used in its derivation.

For the same tentative state an ordinary unweighted Euclidean projection would set all velocities to their arithmetic mean \(2/3\). That also makes both discrete differences zero, but the weighted momentum becomes \(8/3\), exceeding its initial value two. A check on incompressibility alone would accept this physically different state. Choosing a mass matrix in the pressure correction is therefore consequential whenever cell masses, staggered volumes or basis-function weights differ. Evaluating both the discrete divergence and the physically weighted momentum provides information that neither result supplies on its own.

The impulse components give an additional equation-level diagnostic because applying their discrete gradient must reproduce the actual velocity correction.

Change parameters · Explore the worked calculation

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.