The transesterification of vegetable oils is usually carried out as a
batch process, since the proportion of catalyst required can vary. If
used, the oil must first be filtered, and heated to remove water.
During this process, Bumping may occur. A strong base (usually sodium
hydroxide) is mixed with an alcohol (either ethanol or methanol), then
added to the oil. The alcohol is deprotinated, and acts as a
nucleophile, attacking the ester groups on the glycerides, and
displacing them, forming glycerol and esters.
Reaction scheme for Conversion of Triglyceride to ethyl esters during the production of biodiesel.
Image taken from Wikipedia, used under GNU Free Documentation Licence
The glycerol is denser than the esters which form the biodiesel, and so
it sinks, allowing the product to be collected. Once neutralised, the
glycerin can be used to make soaps. The mixture is generaly stirred for
two to three hours, than allowed to stand for 12-24 hours, to allow the
reaction to complete, and separation to take place.