Presenting the self-cleaning well:
Level Z2, the upper pump. Power feed is from the south. One tile of 7/7 magma has been loaded onto the floor hatch at the outlet of the pump.
Level Z1, the well level. On the left side is the connection to the fortress's utility magma pump stack, which was used to load the initial single tile of magma into the pump. Note that there are several doors shown here that were not on my diagrams. These were for assembly and are locked hen the well is in use.
Level Z0, the well and dwarf-catching floor. The room in the upper right is to safely catch any dwarves who fall through opening floor hatches on level Z1. The well is hard to see at the bottom right. There's a floor hatch controlled by a lever which can be used to close the well channel, and a drain which lets magma out if something goes wrong with the self-clean cycle.
Here we have the self-cleaning well in action:
A dwarf walks into the well from the north, through the left-side corridor.
He steps on the first pressure plate, opening one hatch and two doors. None of these are in his path, so he keeps going without noticing.
While the dwarf is using the well, the first pressure plate resets, closing the doors and floor hatch. This doesn't really matter at this point.
Having finished cleaning, leaving a pool of blood behind, the dwarf leaves the well. Initially, he paths through the left entrance, but when he steps on the first pressure plate, his path is interrupted by an opening floor hatch.
He'll stand there for a moment confused, then take the right side exit, which is now open. On the way out, he'll step on the second pressure plate.
The second pressure plate will open the floor hatch on Z2 level. The single tile of magma will fall onto the grate...
and then keep falling to level Z0, burning away the blood pools as it goes.
The magma will cycle through repeatedly, until the second pressure plate resets. The well is now clean and ready to be used again.
The one thing I don't like about this design is that it requires a constant power source. If any dwarf uses it when it's not powered, the magma will fall to level Z0, then flow into the well and clog it with obsidian. In this fortress, that means leaving the water reactor running all the time, which I had preferred not to do to save FPS. If I feel really clever I'll give the well pumps its own mini-reactor with a self-priming mechanism that starts it and stops it automatically as needed.