Gold: wheel torque. Green: load torque. They cross at the steady speed (white dot).
The science
Each bucket on the rim carries a mass of water m = ρV at angle φ from the top and pulls on the wheel with torque m·g·R·sinφ. Buckets are filled over the top at a rate Q, so at wheel speed ω each carries V = Q / (N·ω/2π), up to its capacity. As a bucket tips past about 90° it spills; the code uses a smooth capacity curve, which is a model value, not a measurement.
Summing over the carried arc gives the torque τ(ω). Without spill this reduces to P = ρgQR(cosφin − cosφout), one of the checks above. The load is a pair of millstones, P = kω² (a model value), plus bearing friction; the steady speed is where torque meets load. Real wheels reach 60 to 85 % efficiency; the bucket volume and load constants here are simplified and chosen to match the 3D mill at about 8 rpm.
Not a design tool. Splash, bucket venting and the pond's falling level are left out; the 3D mill models the pond.