ES98D · Course contents

8. When particles represent a continuum

A particle in molecular dynamics represents an atom or molecule. A particle in smoothed particle hydrodynamics represents a moving parcel of a continuum. Both calculations can store positions, velocities, masses and neighbour lists, yet they answer different physical questions. The resemblance of their update loops must not obscure the origin of their interactions.

The useful question is how a pressure gradient, originally defined as a field, becomes a sum of forces between numerical particles while respecting conservation laws.

8.1 Replace a field by a local average, then by quadrature

Start from the continuum identity

A(r)=∫A(r′)δ(r−r′)dr′.A(r)=\int A(r')\delta(r-r')dr'.

Replace the delta distribution by a normalised smoothing kernel Wh(r)=h−dw(r/h)W_h(r)=h^{-d}w(r/h), usually symmetric and compactly supported. The smoothed field is

Ah(r)=∫A(r′)Wh(r−r′)dr′≈A(r).A_h(r)=\int A(r')W_h(r-r')dr'\approx A(r).

For smooth fields away from boundaries, a symmetric kernel with finite second moment gives a smoothing error of order h2h^2 by Taylor expansion: the first-order moment cancels. For a nonzero finite hh, convolution is generally not equal to the original field. The equality in the source was missing this approximation.

Now partition the continuum into parcels of fixed mass mjm_j. Their volume elements are represented by mj/ρjm_j/\rho_j. Replacing the integral by a particle quadrature gives

Ah(ri)≈∑jmjρjAjWh(ri−rj).A_h(r_i)\approx\sum_j\frac{m_j}{\rho_j}A_jW_h(r_i-r_j).

For density, Aj=ρjA_j=\rho_j cancels the volume denominator:

ρi=∑jmjWh(ri−rj).\rho_i=\sum_jm_jW_h(r_i-r_j).

This is a density estimator defining the discrete model, often including the self contribution j=ij=i. Particle-distribution error and smoothing error are distinct. Near boundaries the kernel support is truncated unless boundary treatment corrects it; a disordered quadrature need not reproduce even a constant field exactly.

In the illustration, three equal-mass parcels each contribute a compact kernel to the density. The sum is a field even though its representation uses finitely many moving points. Observe that overlapping support, rather than physical molecular contact, determines which parcels communicate.

A sum of parcel contributions becomes a field

Each parcel supplies a kernel

position xkernel contribution−2202

The finite support describes smoothing, not an atomic hard core.

Add contributions at each position

position xdensity Σ m W−2202

The dots locate parcels. The continuous curve estimates density between them.

Three one-dimensional parcels of unit mass at −0.8, 0, 0.8; tent-kernel width h = 0.8. Both panels share position and vertical scales. Each kernel integrates to one, so the total density integrates to mass three. ↗

The plotted one-dimensional kernel is Wh(x)=(1−∣x∣/h)+/hW_h(x)=(1-|x|/h)_+/h, whose integral is one. Its corner is useful for seeing support and normalisation; smoother kernels are generally preferable for accurate pressure gradients. Reducing hh changes spatial resolution and neighbour number, not a molecular interaction radius.

Compress the parcel positions. Does the height of the density change because mass was created, or because the same mass occupies less space?

Moving parcels carry a continuous mass field
The kernels move with their parcels
individual mass kernelsposition x-2.72.706
Their sum preserves total mass
total represented densityposition x-2.72.706area = total mass = 5

ρ(x) = ΣⱼmⱼWₕ(x−xⱼ); ∫ρ dx = 5

Spacing 0.51; peak density 2.00; represented total mass 5.

Paused. Play the sequence, step through it, or drag the position slider.

Five one-dimensional unit-mass parcels and a normalised compact cubic B-spline kernel with support |x| < 2h. Motion is a prescribed geometry experiment, not an integrated fluid flow. Total represented mass is exactly five.

Follow each parcel's cubic-spline kernel and their sum during one prescribed compression cycle. Change h to alter smoothing while preserving the area under the total density. ↗

8.2 Build a pressure force with a conservation argument

For an inviscid fluid, the material momentum equation is

DvDt=−1ρ∇P,DρDt=−ρ∇⋅v.\frac{Dv}{Dt}=-\frac1\rho\nabla P, \qquad \frac{D\rho}{Dt}=-\rho\nabla\cdot v.

A direct replacement of ∇P\nabla P by an unsymmetrised particle sum can lose pairwise momentum conservation. A common fixed-hh SPH form instead uses

dvidt=−∑jmj(Piρi2+Pjρj2)∇iWh(ri−rj).\frac{dv_i}{dt}=-\sum_jm_j \left(\frac{P_i}{\rho_i^2}+\frac{P_j}{\rho_j^2}\right) \nabla_iW_h(r_i-r_j).

For a symmetric kernel, ∇jWh(rj−ri)=−∇iWh(ri−rj)\nabla_jW_h(r_j-r_i)=-\nabla_iW_h(r_i-r_j). Multiply by mim_i to obtain forces: the force of jj on ii is exactly opposite to that of ii on jj. Pair contributions therefore cancel in total momentum. If the kernel is radial, they are also central and conserve angular momentum in continuous time.

There is a deeper route to the same formula. Let e(ρ,s)e(\rho,s) be specific internal energy and hold each parcel's entropy label sis_i fixed. For adiabatic thermodynamics,

(∂e∂ρ)s=Pρ2.\left(\frac{\partial e}{\partial\rho}\right)_s=\frac{P}{\rho^2}.

Use the discrete Lagrangian

L=∑imi[12∣vi∣2−e(ρi,si)],ρi=∑jmjWh(ri−rj).L=\sum_i m_i\left[\frac12|v_i|^2-e(\rho_i,s_i)\right], \qquad \rho_i=\sum_jm_jW_h(r_i-r_j).

Varying particle positions differentiates every density containing the moved particle. For a pair i,ji,j, the terms from e(ρi,si)e(\rho_i,s_i) and e(ρj,sj)e(\rho_j,s_j) add, producing precisely the symmetric pressure coefficient. Thus continuum internal energy can generate conservative discrete interactions. They are not microscopic pair potentials: the pressure coefficients depend on the surrounding density and thermodynamic state.

The variational SPH formulation in Price's review develops this relationship between density estimation, thermodynamics and conservation. It also explains why variable smoothing lengths require consistent correction terms. The fixed-hh expression above should not be copied unchanged into an adaptive formulation.

If two parcels have unequal mass, should equal and opposite pressure forces produce equal accelerations?

Different accelerations can still conserve momentum
Kernel overlap supplies pressure
density from two parcelsposition x-2204ρᵢ = 1.53ρⱼ = 1.87
Force balance, unequal response
pair forces (same linear scale)FᵢFⱼaccelerationsaᵢaⱼFᵢ + Fⱼ = 0 at every separation

Fᵢⱼ = −Fⱼᵢ; aᵢ = Fᵢⱼ/mᵢ

Forces -1.420 and 1.420; accelerations -1.420 and 0.947.

Paused. Play the sequence, step through it, or drag the position slider.

Fixed-h one-dimensional SPH pressure pair, h = 0.65, mᵢ = 1, P = ρ−0.7. Includes each parcel's self-density. Separations are prescribed, not a simulated fluid trajectory. Force arrows share one linear scale.

Move the pair through overlapping kernel supports and watch the conservative pressure interaction. Change the second mass while checking the force sum and the two accelerations. ↗

8.3 The equation of state closes the particle model

Density alone does not supply the pressure. A barotropic model prescribes P=P(ρ)P=P(\rho), for example

P=cs2(ρ−ρ0).P=c_s^2(\rho-\rho_0).

Here cs2=dP/dρc_s^2=dP/d\rho is the squared sound speed and ρ0\rho_0 a reference density. Weakly compressible approximations choose csc_s large enough to keep density variations small relative to the flow speed, while paying the cost of a shorter acoustic timestep. The pressure law is a material/numerical closure, not a substitute for the momentum equation or the kernel discretisation.

For non-barotropic thermodynamics, evolve internal energy or entropy and use an equation of state P(ρ,e)P(\rho,e). For the inviscid adiabatic fixed-hh scheme, one compatible work equation is

deidt=Piρi2∑jmj(vi−vj)⋅∇iWh(ri−rj).\frac{de_i}{dt}=\frac{P_i}{\rho_i^2} \sum_jm_j(v_i-v_j)\cdot\nabla_iW_h(r_i-r_j).

Combined with the symmetric momentum equation, pair terms exchange kinetic and internal energy while preserving their total in continuous time. Viscous stresses and shock-capturing terms add dissipation and the corresponding heating. Artificial viscosity used for shocks must be distinguished from a calibrated physical viscosity.

8.4 Similar computation, different limits

Both MD and SPH integrate positions and velocities, often use finite-support neighbour searches, and need timestep-convergence checks. MD forces approximate microscopic interactions; SPH pressure forces approximate a continuum conservation law. SPH parcels do not acquire independent molecular thermal noise merely because they are called particles.

In an explicit SPH method, acoustic and flow propagation impose a Courant-type bound involving h/(cs+∣v∣)h/(c_s+|v|), with additional restrictions for viscosity, acceleration and the specific integrator. Increasing sound speed to suppress compressibility therefore increases cost. Kernel choice, neighbour resolution, boundary treatment and particle disorder affect convergence; decreasing hh without improving quadrature is insufficient.

This chapter has reduced a continuum field to numerical parcels. The final chapter makes another kind of reduction: it maps a full microscopic configuration onto a small set of collective coordinates, while retaining the statistical weight of the unresolved degrees of freedom.

Exercises

  1. Use a Taylor expansion to show why a symmetric normalised kernel has no first-order smoothing error in the interior.
  2. Verify the total momentum cancellation pair by pair for unequal parcel masses.
  3. Differentiate the density sum and derive the adiabatic work equation. Check that it conserves total energy with the stated momentum equation.