A live drift-diffusion simulation with a few hundred carriers: join p and n silicon, watch the depletion region and built-in field appear, then forward- and reverse-bias the junction.
holeelectron⊖ ⊕ fixed dopant ions (bold when uncovered)recombinationgeneration
Electron potential energy −qψ across the device (time averaged): the barrier electrons must climb to reach the p side
Carrier densities (time averaged, log scale)
Measured |current| at each bias you visit (log scale; red points: reverse current); dashed grey: the ideal slope
What to look for
Before contact nothing moves on average. After contact the first carriers to cross recombine almost at once, and the uncovered ions near the junction build up the field that stops the rest.
In equilibrium the densities change by orders of magnitude across a narrow region, the same exponential Boltzmann profile as in the diffusion animation, now produced by the junction's own charge.
Under forward bias the depletion region shrinks and recombination flashes appear on both sides of the junction; under reverse bias the region widens and only rare generation events feed the current.
The physics behind it
φbi = φt ln(NAND/ni²) (eq. 1.5.1); the depletion width grows as √(φbi − VA) (eqs. 1.5.3 to 1.5.11).
Forward bias lowers the barrier by VA and the number of carriers able to cross grows as exp(VA/φt): I = I0(eVA/φt − 1) (eq. 1.5.2).
The simulation solves Poisson's equation from the actual particle positions at every step, so the depletion region, the field and the barrier are not drawn in: they emerge.