First, here is the IFIXIT guide for the dual drive setup: Installing iMac Intel 21.5" EMC 2389 Dual Hard Drive. While it implies dual Hard Drives it also will support a SSD instead.
If you jump down to Step12 here is the point you take the optical drive thermal sensor off the optical drive and then carefully place it back onto the drives case. This will preserve the SMC signaling so the fans will not go into safe mode (running at full blast).
If you decide to replace the HD with the SSD. You'll need to buy a replacement thermal sensor as the built-in sensor in the hard drive will now be missing. What I do here is get an extra optical drive sensor cable, Apple P/N: 922-9624 Cable, Temp Sensor, Optical Drive to use instead of the drives sensor. Follow this IFIXIT guide for all of the details: iMac Intel 21.5" EMC 2389 Hard Drive Replacement.