Divergence measures how much a flow swells or shrinks at a point
Warm a pocket of air and it expands in every direction, so arrows describing its motion all point outward. Mathematicians capture that outward push with a single number called divergence: positive where a field acts like a source, negative where it behaves like a sink, and zero where it neither gains nor loses.
Formally, divergence takes a vector field, such as the velocity of air at every point, and returns a scalar field. At each location it gives the rate at which the flow changes the volume of a tiny neighbourhood, found by computing how much of the field escapes through a small closed surface, dividing by the enclosed volume and letting that volume shrink to nothing. In two dimensions, volume simply becomes area. The limit comes out the same no matter which sequence of shrinking shapes is used.
Heating illustrates the sign. Air warmed throughout a region expands, pushing particles outward and giving positive divergence there; cooling contracts the air and makes it negative. If only one spot is heated, or a thin tube feeds in extra gas at a single point, only surfaces surrounding that spot register a net outward flow. Any surface elsewhere encloses gas of constant density, with as many particles entering as leaving. A field whose divergence is zero everywhere is called solenoidal; its flow preserves volume, so any region carried along keeps the same size forever.
The familiar symbol, an upside-down triangle followed by a dot, is admitted to be an abuse of notation. It suggests a dot product, pairing each component of the del operator with a component of the field and adding them, but applying an operator is not the same as multiplying. Because the defining limit never mentions axes, the value is the same in every coordinate system, and even the Cartesian formula stays unchanged under rotation, since the trace of the Jacobian matrix survives any invertible linear transformation. In practice, though, people calculate with coordinate formulas, which are much simpler.
For tensors the operation is less settled. Two different Cartesian definitions have been used routinely; J. Willard Gibbs, the progenitor of vector algebra, favoured one of them, and the two agree whenever the tensor is symmetric, which is why mechanics texts often treat them as interchangeable.
Source: Divergence