An oil refinery or petroleum refinery is an industrial process plant where crude oil is processed and refined into more useful products such as petroleum naphtha, gasoline, diesel fuel, asphalt base, heating oil, kerosene and liquefied petroleum gas. Oil refineries are typically large, sprawling industrial complexes with extensive piping running throughout, carrying streams of fluids between large chemical processing units. In many ways, oil refineries use much of the technology of, and can be thought of, as types of chemical plants. The crude oil feedstock has typically been processed by an oil production plant. There is usually an oil depot (tank farm) at or near an oil refinery for the storage of incoming crude oil feedstock as well as bulk liquid products.
Raw or unprocessed crude oil is not generally useful in industrial applications, although "light, sweet" (low viscosity, low sulfur) crude oil has been used directly as a burner fuel to produce steam for the propulsion of seagoing vessels. The lighter elements, however, form explosive vapors in the fuel tanks and are therefore hazardous, especially in warships. Instead, the hundreds of different hydrocarbon molecules in crude oil are separated in a refinery into components which can be used as fuels, lubricants, and as feedstocks in petrochemical processes that manufacture such products as plastics, detergents, solvents, elastomers and fibers such as nylon and polyesters.
Petroleum fossil fuels are burned in internal combustion engines to provide power for ships, automobiles, aircraft engines, lawn mowers, chainsaws, and other machines. Different boiling points allow the hydrocarbons to be separated by distillation. Since the lighter liquid products are in great demand for use in internal combustion engines, a modern refinery will convert heavy hydrocarbons and lighter gaseous elements into these higher value products.
Oil can be used in a variety of ways because it contains hydrocarbons of varying molecular masses, forms and lengths such as paraffins, aromatics, naphthenes (or cycloalkanes), alkenes, dienes, and alkynes. While the molecules in crude oil include different atoms such as sulfur and nitrogen, the hydrocarbons are the most common form of molecules, which are molecules of varying lengths and complexity made of hydrogen and carbon atoms, and a small number of oxygen atoms. The differences in the structure of these molecules account for their varying physical and chemical properties, and it is this variety that makes crude oil useful in a broad range of several applications.
Once separated and purified of any contaminants and impurities, the fuel or lubricant can be sold without further processing. Smaller molecules such as isobutane and propylene or butylenes can be recombined to meet specific octane requirements by processes such as alkylation, or less commonly, dimerization. Octane grade of gasoline can also be improved by catalytic reforming, which involves removing hydrogen from hydrocarbons producing compounds with higher octane ratings such as aromatics. Intermediate products such as gasoils can even be reprocessed to break a heavy, long-chained oil into a lighter short-chained one, by various forms of cracking such as fluid catalytic cracking, thermal cracking, and hydrocracking. The final step in gasoline production is the blending of fuels with different octane ratings, vapor pressures, and other properties to meet product specifications.
Oil refineries are large scale plants, processing about a hundred thousand to several hundred thousand barrels of crude oil a day. Because of the high capacity, many of the units operate continuously, as opposed to processing in batches, at steady state or nearly steady state for months to years. The high capacity also makes process optimization and advanced process control very desirable.
The world's first refinery opened at Ploiești, Romania, in 1856-1857, with United States investment. After being taken over by Nazi Germany, the Ploiești refineries were bombed in Operation Tidal Wave by the Allies during the Oil Campaign of World War II.
At one point, the refinery in Ras Tanura, Saudi Arabia owned by Saudi Aramco was claimed to be the largest oil refinery in the world. For most of the 20th century, the largest refinery was the Abadan Refinery in Iran. This refinery suffered extensive damage during the Iran-Iraq war. The world's largest refinery complex is the Jamnagar Refinery Complex, consisting of two refineries side by side operated by Reliance Industries Limited in Jamnagar, India with a combined production capacity of 1,240,000 barrels per day (197,000 m3/d). PDVSA's Paraguaná Refinery Complex in Paraguaná Peninsula, Venezuela with a capacity of 956,000 bbl/d (152,000 m3/d) and SK Energy's Ulsan in South Korea with 840,000 bbl/d (134,000 m3/d) are the second and third largest, respectively.