Field Calculator Physics: Divergence Explained
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This article explains the physics of field calculator divergence, covering what divergence measures, how it is calculated, and where it applies in physics and engineering. You will learn the mathematical definition, physical intuition, and common applications, with worked examples and practical guidance.
Formula
The divergence of a vector field F = (Fx, Fy, Fz) is a scalar quantity given by:
∇·F = ∂Fx/∂x + ∂Fy/∂y + ∂Fz/∂z
Where:
- Fx, Fy, Fz are the components of the vector field (units depend on the field, e.g., N/m² for force density).
- ∂/∂x, ∂/∂y, ∂/∂z are partial derivatives with respect to spatial coordinates.
- ∇·F (nabla dot F) is the divergence, a scalar with units of the field component per unit length (e.g., N/m³).
In Cartesian coordinates, if the field components are constant, the divergence simplifies to the sum of the constants divided by the respective coordinate lengths. For a uniform field, divergence is zero because derivatives of constants are zero. The calculator above computes divergence for a field with constant components, where ∂Fx/∂x = Fx / Lx, but for simplicity, it assumes unit length (1 meter) in each direction, so the divergence equals the sum of the components.
Worked Example
Using the default values: Fx = 3 N/m², Fy = 4 N/m², Fz = 5 N/m².
Assuming a unit cube (1 m × 1 m × 1 m), the partial derivatives become:
- ∂Fx/∂x = 3 / 1 = 3
- ∂Fy/∂y = 4 / 1 = 4
- ∂Fz/∂z = 5 / 1 = 5
Sum = 3 + 4 + 5 = 12 N/m³. The calculator shows 12.00, matching the result.
Physical Meaning of Divergence
Divergence measures the net outflow of a vector field from a point. Think of a fluid flow: if you place a small sphere at a point, divergence tells you whether fluid is expanding out of that sphere (positive divergence) or converging into it (negative divergence). Zero divergence means the fluid is incompressible—what flows in also flows out.
In electromagnetism, divergence of the electric field relates to charge density (Gauss’s law). In fluid dynamics, divergence of velocity equals the rate of volume expansion. In heat transfer, divergence of heat flux relates to heat sources or sinks.
How to Calculate Divergence in Practice
For a general vector field, you compute the partial derivative of each component with respect to its corresponding coordinate and sum them. Steps:
- Write the field components as functions of coordinates.
- Differentiate Fx with respect to x.
- Differentiate Fy with respect to y.
- Differentiate Fz with respect to z.
- Add the three results.
For example, F = (x², yz, xz). Then ∂Fx/∂x = 2x, ∂Fy/∂y = z, ∂Fz/∂z = x, so divergence = 2x + z + x = 3x + z.
Common Mistakes and Misconceptions
A frequent error is forgetting that divergence is a scalar, not a vector. Another is confusing divergence with curl, which measures rotation. Also, many people think divergence is always zero for uniform fields—true for constant components, but if the field varies spatially, divergence can be non-zero even if the field looks simple.
Unit mix-ups are common: ensure the field components have consistent units and that you differentiate with respect to the correct coordinate. For example, if Fx is in meters per second and x in meters, the derivative unit is 1/s (per second).
Choosing the Right Coordinate System
Divergence formulas differ in cylindrical and spherical coordinates. In cylindrical (r, θ, z):
∇·F = (1/r) ∂(rFr)/∂r + (1/r) ∂Fθ/∂θ + ∂Fz/∂z
In spherical (r, θ, φ):
∇·F = (1/r²) ∂(r²Fr)/∂r + (1/(r sinθ)) ∂(sinθ Fθ)/∂θ + (1/(r sinθ)) ∂Fφ/∂φ
Using the wrong formula leads to errors, especially near the origin where r = 0.
Applications in Physics and Engineering
- Electrostatics: ∇·E = ρ/ε₀, where ρ is charge density.
- Fluid dynamics: ∇·v = 0 for incompressible flow.
- Heat conduction: ∇·(k∇T) = ρc ∂T/∂t (heat equation).
- Gravity: ∇·g = -4πGρ (Poisson’s equation).
These equations are fundamental in solving field problems numerically, such as finite element analysis.
Limitations of the Simple Calculator
This calculator assumes constant field components and unit length per direction. Real fields vary with position, so you must compute partial derivatives analytically or numerically. The calculator is useful for quick checks or for fields that are piecewise constant.
Frequently Asked Questions
What is divergence in simple terms? Divergence measures how much a vector field spreads out from a point. Positive divergence means the field is expanding outward, negative means converging inward.
How is divergence different from curl? Divergence is a scalar that measures outflow; curl is a vector that measures rotation. A field can have zero divergence but non-zero curl, like a whirlpool.
Can divergence be negative? Yes, negative divergence indicates a sink, where field lines converge, such as a drain in a fluid flow.
Why is divergence zero for incompressible fluids? Because the volume of a fluid element doesn’t change; what flows in equals what flows out, so net outflow is zero.
What are the units of divergence? Units are the field’s units per unit length. For velocity (m/s), divergence is in 1/s (per second). For electric field (V/m), divergence is V/m².
Does divergence depend on coordinate system? The value is invariant, but the formula changes. You must use the correct formula for Cartesian, cylindrical, or spherical coordinates.
Related
Formula used
in Fx | Fx component | N/m² | 3 | 0 in Fy | Fy component | N/m² | 4 | 0 in Fz | Fz component | N/m² | 5 | 0 out div | Divergence (∇·F) | 1/m | Fx + Fy + Fz | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.