Sorry for shouting and also for 2 messages -- some keyboard shortcut bit me in the ...
Anyway, Don't throw away rancid soap, especially when soap is our best single defense from the novel Corona virus.
Rancid OIL (or fatty acid, more likely) stinks. Rancid SOAP, not so much. If your soap smells strongly rancid, you probably have residual oil that went rancid; it may or may not have saponified first.
The difference between fatty acids and soap is not much: the former is the free acid (e.g., palmitic acid), the latter the sodium (or sometimes potassium) salt (e.g., sodium palmitate).
You can SALVAGE that soap. It may never be as wonderful as you intended, but it will be usable soap, which is my point.
Here's one way, which you should try in small scale before scaling up to the whole lot:
- Weight the soap you're going to rework. This datum will be needed later.
- Cut or grate the soap into small pieces. (Optional, but it speed the process a lot.)
- Soak the pieces in an excess of DISTILLED or DEIONIZED water (in a extra-large glass or SS vessel). Record the total volume of water you use, throughout these several steps. This datum will be needed later. Do not use tap water. If you run a dehumidifier, the condensate from this is fine. The morning dew would also be fine if you have a poetic streak and the infinite patience needed to collect it in quantity. If you have a salt-based water softener, and keep it in good operating condition (purging the unit and recharging with salt as per the instructions from the manufacturer) that water would also do -- It's not deionized, but the primary residual cation is sodium, which is acceptable.
- When the pieces of soap are sufficiently soft (heating helps, but avoid boiling to avoid foaming) mix to dissolve the soap into the water, adding more water (see #3) if necessary, as it likely will be. Stir gently to minimize foaming (which will occur regardless).
- To convert residual (rancid) fatty acids to soap, add more lye. You'll have to determine the quantity of lye (sodium hydroxide = NaOH) from what you know about the batch. For example, if you make your soap like I do with 5% excess oil, and you're reworking 1 kg of soap, then you have approximately 50 g of excess unsaponified fatty acids present. You need enough lye to completely saponify these fatty acids, with some excess. Feel free to overestimate (slightly) as the excess lye will come out in the wash (literally). For example, you may assume you have only C18 fatty acids present. The MW of these is roughly 284g/mole, so 50 g is 176 mmole (=0.176 mole). So you need at least 176 mmole of lye, MW 40 g/mole. 176 mmole x 40 g/mole = 7 grams lye, minimum.
- Let the mix stew for a while at 120-150F (50-65C), avoiding boiling to minimize foaming. The mix will foam somewhat anyway. Add enough water to keep the foam under control. (This is why you need a large vessel.) If you worry you may not have added sufficient lye, you may use any usual test for free lye (such as taste). When adding water, bear in mind that the more water you use, the more salt you will need to use later and the more soap you will lose, dissolved in the brine.
- Now you need to add enough salt (sodium chloride = NaCl) to precipitate the soap. (Soap is relatively insoluble in brine.) 36 g of NaCl will saturate 100 g water. A roughly half-saturated final concentration will probably do, so add 180 g NaCl per liter of water you used. You can use any clean salt for this. I use salt intended for water softeners because it is clean, but I grind it in a mortar so it will dissolve faster, as it comes in lumps. Add the salt slowly, with stirring, as it may happen that you can get away with using less salt, a good thing. As the salt dissolves, the soap will precipitate -- but it likely will float due to entrained air. Stir till the precipitation is complete, then ladle off the soap into a colander or cheese cloth to drain.*
- Transfer to your mold and cure the soap as if it were a new batch. You should find that the odor has diminished greatly, but there's no guarantee that it will be suitable for milady's boudoir. If you want to add scent to it, which I never do, I think you should do so just before you place it in your mold.
*The soapy brine can be discarded, or used to wash dishes. I wouldn't use it to wash clothes or hands.