This is a genuine 2D cross-section model, not a flattened 3D scene. Each square grain is split into a dislocation-carrying core and a thin, disordered grain-boundary (GB) rim of fixed thickness t. Because this is a cross-section, the GB area fraction scales with the square of the shrink ratio — a different exponent from a 3D grain's volume fraction (which scales with the cube):
GB area fraction: φ = 1 − ((d − t) / d)² (2D, exact for a self-similar shrink)
Core (Hall-Petch): σᵢ(d) = σ₀ + k_HP / √d
k_HP (pile-up theory): k_HP = √( 2·μ·b·τ_c / (π·(1−ν)) ) (Eshelby-Frank-Nabarro)
GB-rim strength: σ_gb ≈ const (boundary sliding)
Rule of mixtures: σ_y(d) = (1 − φ)·σᵢ(d) + φ·σ_gb
k_HP is not a tuned constant here — it is derived from a real dislocation pile-up: n edge dislocations queue up on a glide plane against the grain boundary under an applied shear stress τ. Each dislocation repels its neighbours (a 1/r pairwise force), so the pile-up has an equilibrium length L set by n and τ. The lead dislocation's stress concentration is amplified roughly n-fold; the grain yields when that amplified stress reaches the boundary's obstacle strength τ꜀. Solving n·τ = τ꜀ together with the pile-up's mean-field length gives the 1/√d hardening law directly — this simulator's dislocations shown queuing in the blue (pile-up) regime are drawn at that same computed equilibrium spacing, denser near the head.
As d shrinks, φ grows (more of the cross-section is boundary, not lattice) while σᵢ(d) keeps rising via 1/√d — the two effects trade off and σ_y(d) peaks at a critical grain size d꜀. Below d꜀ the soft, sliding GB phase dominates and strength falls: the inverse Hall-Petch effect.
- Grain size d — rebuilds the 2D grid of square grains and recomputes σ_y(d) live.
- GB layer thickness t — a thicker disordered rim pushes d꜀ larger and deepens the softening.
- Loading rate — speeds up the dislocation glide (blue regime) or GB shear oscillation (red regime); it is a visualization speed, not a new physical input.
- Shading toggle — colors each grain by its own local GB area fraction instead of a flat material color.
The small chart traces σ_y against grain size across the whole range and marks the current point, so the peak is always visible.