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 sea-going 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 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.
Major products 
Petroleum products are usually grouped into three categories: light distillates (LPG, gasoline, naphtha), middle distillates (kerosene, diesel), heavy distillates and residuum (heavy fuel oil, lubricating oils, wax, asphalt). This classification is based on the way crude oil is distilled and separated into fractions (called distillates and residuum) as in the above drawing.
- Liquified petroleum gas (LPG)
- Gasoline (also known as petrol)
- Kerosene and related jet aircraft fuels
- Diesel fuel
- Fuel oils
- Lubricating oils
- Paraffin wax
- Asphalt and tar
- Petroleum coke
Oil refineries also produce various intermediate products such as hydrogen, light hydrocarbons, reformate and pyrolysis gasoline. These are not usually transported but instead are blended or processed further on-site. Chemical plants are thus often adjacent to oil refineries. For example, light hydrocarbons are steam-cracked in an ethylene plant, and the produced ethylene is polymerized to produce polyethene.
Common process units found in a refinery 
- Desalter unit washes out salt from the crude oil before it enters the atmospheric distillation unit.
- Atmospheric distillation unit distills crude oil into fractions. See Continuous distillation.
- Vacuum distillation unit further distills residual bottoms after atmospheric distillation.
- Naphtha hydrotreater unit uses hydrogen to desulfurize naphtha from atmospheric distillation. Must hydrotreat the naphtha before sending to a Catalytic Reformer unit.
- Catalytic reformer unit is used to convert the naphtha-boiling range molecules into higher octane reformate (reformer product). The reformate has higher content of aromatics and cyclic hydrocarbons). An important byproduct of a reformer is hydrogen released during the catalyst reaction. The hydrogen is used either in the hydrotreaters or the hydrocracker.
- Distillate hydrotreater unit desulfurizes distillates (such as diesel) after atmospheric distillation.
- Fluid catalytic cracker (FCC) unit upgrades heavier fractions into lighter, more valuable products.
- Hydrocracker unit uses hydrogen to upgrade heavier fractions into lighter, more valuable products.
- Visbreaking unit upgrades heavy residual oils by thermally cracking them into lighter, more valuable reduced viscosity products.
- Merox unit treats LPG, kerosene or jet fuel by oxidizing mercaptans to organic disulfides.
- Alternative processes for removing mercaptans are known, e.g. doctor sweetening process and caustic washing.
- Coking units (delayed coking, fluid coker, and flexicoker) process very heavy residual oils into gasoline and diesel fuel, leaving petroleum coke as a residual product.
- Alkylation unit produces high-octane component for gasoline blending.
- Dimerization unit converts olefins into higher-octane gasoline blending components. For example, butenes can be dimerized into isooctene which may subsequently be hydrogenated to form isooctane. There are also other uses for dimerization.
- Isomerization unit converts linear molecules to higher-octane branched molecules for blending into gasoline or feed to alkylation units.
- Steam reforming unit produces hydrogen for the hydrotreaters or hydrocracker.
- Liquified gas storage vessels store propane and similar gaseous fuels at pressure sufficient to maintain them in liquid form. These are usually spherical vessels or "bullets" (i.e., horizontal vessels with rounded ends).
- Storage tanks store crude oil and finished products, usually cylindrical, with some sort of vapor emission control and surrounded by an earthen berm to contain spills.
- Amine gas treater, Claus unit, and tail gas treatment convert hydrogen sulfide from hydrodesulfurization into elemental sulfur.
- Utility units such as cooling towers circulate cooling water, boiler plants generates steam, and instrument air systems include pneumatically operated control valves and an electrical substation.
- Wastewater collection and treating systems consist of API separators, dissolved air flotation (DAF) units and further treatment units such as an activated sludge biotreater to make water suitable for reuse or for disposal.
- Solvent refining units use solvent such as cresol or furfural to remove unwanted, mainly aromatics from lubricating oil stock or diesel stock.
- Solvent dewaxing units remove the heavy waxy constituents petrolatum from vacuum distillation products.
Flow diagram of typical refinery 
The image below is a schematic flow diagram of a typical oil refinery that depicts the various unit processes and the flow of intermediate product streams that occurs between the inlet crude oil feedstock and the final end products. The diagram depicts only one of the literally hundreds of different oil refinery configurations. The diagram also does not include any of the usual refinery facilities providing utilities such as steam, cooling water, and electric power as well as storage tanks for crude oil feedstock and for intermediate products and end products.
There are many process configurations other than that depicted above. For example, the vacuum distillation unit may also produce fractions that can be refined into endproducts such as: spindle oil used in the textile industry, light machinery oil, motor oil, and various waxes.
The crude oil distillation unit 
The crude oil distillation unit (CDU) is the first processing unit in virtually all petroleum refineries. The CDU distills the incoming crude oil into various fractions of different boiling ranges, each of which are then processed further in the other refinery processing units. The CDU is often referred to as the atmospheric distillation unit because it operates at slightly above atmospheric pressure.
Below is a schematic flow diagram of a typical crude oil distillation unit. The incoming crude oil is preheated by exchanging heat with some of the hot, distilled fractions and other streams. It is then desalted to remove inorganic salts (primarily sodium chloride).
Following the desalter, the crude oil is further heated by exchanging heat with some of the hot, distilled fractions and other streams. It is then heated in a fuel-fired furnace (fired heater) to a temperature of about 398 °C and routed into the bottom of the distillation unit.
The cooling and condensing of the distillation tower overhead is provided partially by exchanging heat with the incoming crude oil and partially by either an air-cooled or water-cooled condenser. Additional heat is removed from the distillation column by a pumparound system as shown in the diagram below.
As shown in the flow diagram, the overhead distillate fraction from the distillation column is naphtha. The fractions removed from the side of the distillation column at various points between the column top and bottom are called sidecuts. Each of the sidecuts (i.e., the kerosene, light gas oil and heavy gas oil) is cooled by exchanging heat with the incoming crude oil. All of the fractions (i.e., the overhead naphtha, the sidecuts and the bottom residue) are sent to intermediate storage tanks before being processed further.
Specialty end products 
These require blending various feedstocks, mixing appropriate additives, providing short term storage, and preparation for bulk loading to trucks, barges, product ships, and railcars:
- Gaseous fuels such as propane, stored and shipped in liquid form under pressure in specialized railcars to distributors.
- Lubricants (produces light machine oils, motor oils, and greases, adding viscosity stabilizers as required), usually shipped in bulk to an offsite packaging plant.
- Wax (paraffin), used in the packaging of frozen foods, among others. May be shipped in bulk to a site to prepare as packaged blocks.
- Sulfur (or sulfuric acid), byproducts of sulfur removal from petroleum which may have up to a couple percent sulfur as organic sulfur-containing compounds. Sulfur and sulfuric acid are useful industrial materials. Sulfuric acid is usually prepared and shipped as the acid precursor oleum.
- Bulk tar shipping for offsite unit packaging for use in tar-and-gravel roofing.
- Asphalt unit. Prepares bulk asphalt for shipment.
- Petroleum coke, used in specialty carbon products or as solid fuel.
- Petrochemicals or petrochemical feedstocks, which are often sent to petrochemical plants for further processing in a variety of ways. The petrochemicals may be olefins or their precursors, or various types of aromatic petrochemicals.
Siting/locating of petroleum refineries 
A party searching for a site to construct a refinery or a chemical plant needs to consider the following issues:
- The site has to be reasonably far from residential areas.
- Infrastructure should be available for supply of raw materials and shipment of products to markets.
- Energy to operate the plant should be available.
- Facilities should be available for waste disposal.
Refineries which use a large amount of steam and cooling water need to have an abundant source of water. Oil refineries therefore are often located nearby navigable rivers or on a sea shore, nearby a port. Such location also gives access to transportation by river or by sea. The advantages of transporting crude oil by pipeline are evident, and oil companies often transport a large volume of fuel to distribution terminals by pipeline. Pipeline may not be practical for products with small output, and rail cars, road tankers, and barges are used.
Petrochemical plants and solvent manufacturing (fine fractionating) plants need spaces for further processing of a large volume of refinery products for further processing, or to mix chemical additives with a product at source rather than at blending terminals.
Safety and environmental concerns 
The refining process releases a number of different chemicals into the atmosphere (see AP 42 Compilation of Air Pollutant Emission Factors) and a notable odor normally accompanies the presence of a refinery. Aside from air pollution impacts there are also wastewater concerns, risks of industrial accidents such as fire and explosion, and noise health effects due to industrial noise.
Many governments worldwide have mandated restrictions on contaminants that refineries release, and most refineries have installed the equipment needed to comply with the requirements of the pertinent environmental protection regulatory agencies. In the United States, there is strong pressure to prevent the development of new refineries, and no major refinery has been built in the country since Marathon's Garyville, Louisiana facility in 1976. However, many existing refineries have been expanded during that time. Environmental restrictions and pressure to prevent construction of new refineries may have also contributed to rising fuel prices in the United States. Additionally, many refineries (over 100 since the 1980s) have closed due to obsolescence and/or merger activity within the industry itself.
Environmental and safety concerns mean that oil refineries are sometimes located some distance away from major urban areas. Nevertheless, there are many instances where refinery operations are close to populated areas and pose health risks such as in the Campo de Gibraltar, a CEPSA refinery near the towns of Gibraltar, Algeciras, La Linea, San Roque and Los Barrios with a combined population of over 300,000 residents within a 5-mile (8.0 km) radius and the CEPSA refinery in Santa Cruz on the island of Tenerife, Spain which is sited in a densely populated city center and next to the only two major evacuation routes in and out of the city. In California's Contra Costa County and Solano County, a shoreline necklace of refineries, built in the early 20th century before this area was populated, and associated chemical plants are adjacent to urban areas in Richmond, Martinez, Pacheco, Concord, Pittsburg, Vallejo and Benicia, with occasional accidental events that require "shelter in place" orders to the adjacent populations.
Corrosion problems and prevention 
Petroleum refineries run as efficiently as possible to reduce costs. One major factor that decreases efficiency is corrosion of the metallic components found throughout refining process. Corrosion causes the failure of equipment items as well as dictating the maintenance schedule of the refinery, during which part or all of the refinery must be shut down. The corrosion-related direct costs in the U.S. petroleum industry as of 1996 was estimated as US$3.7 billion per year.
Corrosion occurs in various forms in the refining process, such as pitting corrosion from water droplets, embrittlement from hydrogen, and stress corrosion cracking from sulfide attack. From a materials standpoint, carbon steel is used for upwards of 80 per cent of refinery components, which is beneficial due to its low cost. Carbon steel is resistant to the most common forms of corrosion, particularly from hydrocarbon impurities at temperatures below 205 °C, but other corrosive chemicals and environments prevent its use everywhere. Common replacement materials are low alloy steels containing chromium and molybdenum, with stainless steels containing more chromium dealing with more corrosive environments. More expensive materials commonly used are nickel, titanium, and copper alloys. These are primarily saved for the most problematic areas where extremely high temperatures or very corrosive chemicals are present.
Corrosion is fought by a complex system of monitoring, preventative repairs and careful use of materials. Monitoring methods include both off-line checks taken during maintenance and on-line monitoring. Off-line checks measure corrosion after it has occurred, telling the engineer when equipment must be replaced based on the historical information he has collected. This is referred to as preventative management.
On-line systems are a more modern development, and are revolutionizing the way corrosion is approached. There are several types of on-line corrosion monitoring technologies such as linear polarization resistance, electrochemical noise and electrical resistance. On-Line monitoring has generally had slow reporting rates in the past (minutes or hours) and been limited by process conditions and sources of error but newer technologies can report rates up to twice per minute with much higher accuracy (referred to as real-time monitoring). This allows process engineers to treat corrosion as another process variable that can be optimized in the system. Immediate responses to process changes allow the control of corrosion mechanisms, so they can be minimized while also maximizing production output. In an ideal situation having on-line corrosion information that is accurate and real-time will allow conditions that cause high corrosion rates to be identified and reduced. This is known as predictive management.
Materials methods include selecting the proper material for the application. In areas of minimal corrosion, cheap materials are preferable, but when bad corrosion can occur, more expensive but longer lasting materials should be used. Other materials methods come in the form of protective barriers between corrosive substances and the equipment metals. These can be either a lining of refractory material such as standard Portland cement or other special acid-resistant cements that are shot onto the inner surface of the vessel. Also available are thin overlays of more expensive metals that protect cheaper metal against corrosion without requiring lots of material.
The first oil refinery in the world was built in 1851 at Bathgate, Scotland, by Scottish chemist James Young shortly followed by Ignacy Łukasiewicz near Jasło, Poland from 1854 to 1856, but they were initially small as there was no real demand for refined fuel. As Łukasiewicz's kerosene lamp gained popularity, the refining industry grew in the area.
The world's first large 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. Another early large refinery is Oljeön, Sweden (1875) (Swedish name means The Petroleum Isle), now preserved as a museum near Engelsberg Ironworks, a UNESCO World Heritage Site, and part of the Ekomuseum Bergslagen.
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) (J-1 660,000 bbl/d (105,000 m3/d), J-2 580,000 bbl/d (92,000 m3/d). PDVSA's Paraguana refinery complex in 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.[when?]
Oil refining in the United States 
In the 19th century, refineries in the U.S. processed crude oil primarily to recover the kerosene. There was no market for the more volatile fraction, including gasoline, which was considered waste and was often dumped directly into the nearest river. The invention of the automobile shifted the demand to gasoline and diesel, which remain the primary refined products today. Today, national and state legislation requires refineries to meet stringent air and water cleanliness standards. In fact, oil companies in the U.S. perceive obtaining a permit to build a modern refinery to be so difficult and costly that no new refineries have been built (though many have been expanded) in the U.S. since 1976. More than half the refineries that existed in 1981 are now closed due to low utilization rates and accelerating mergers. As a result of these closures total US refinery capacity fell between 1981 to 1995, though the operating capacity stayed fairly constant in that time period at around 15,000,000 barrels per day (2,400,000 m3/d). Increases in facility size and improvements in efficiencies have offset much of the lost physical capacity of the industry. In 1982 (the earliest data provided), the United States operated 301 refineries with a combined capacity of 17.9 million barrels (2,850,000 m3) of crude oil each calendar day. In 2010, there were 149 operable U.S. refineries with a combined capacity of 17.6 million barrels (2,800,000 m3) per calendar day.
In 2009 through 2010, as revenue streams in the oil business dried up and profitability of oil refineries fell due to lower demand for product and high reserves of supply preceding the economic recession, oil companies began to close or sell refineries.
See also 
- Acid gas
- AP 42 Compilation of Air Pollutant Emission Factors
- API oil-water separator
- Ethanol fuel
- Butanol fuel
- Gas flare
- Industrial wastewater treatment
- K factor crude oil refining
- List of oil refineries
- Nelson complexity index
- Sour gas
- Gary, J.H. and Handwerk, G.E. (1984). Petroleum Refining Technology and Economics (2nd Edition ed.). Marcel Dekker, Inc. ISBN 0-8247-7150-8.
- Leffler, W.L. (1985). Petroleum refining for the nontechnical person (2nd Edition ed.). PennWell Books. ISBN 0-87814-280-0.
- Beychok, Milton R. (1967). Aqueous Wastes from Petroleum and Petrochemical Plants (1st Edition ed.). John Wiley & Sons. LCCN 67019834.
- Guide to Refining from Chevron Oil's website
- Refinery flowchart from Universal Oil Products' website
- An example flowchart of fractions from crude oil at a refinery
- Kister, Henry Z. (1992). Distillation Design (1st Edition ed.). McGraw-Hill. ISBN 978-0-07-034909-4.
- By Steve Hargreaves, CNNMoney.com staff writer (2007-04-17). "Behind high gas prices: The refinery crunch". Money.cnn.com. Retrieved 2011-11-05.
- "Smoke, oil spills and now radiation - whatever next?". Atan.org. 2004-09-01. Retrieved 2011-11-05.
- Corrosion Costs and Preventive Strategies in the United States, a publication of NACE International.
- R.D. Kane, Corrosion in Petroleum Refining and Petrochemical Operations, Corrosion: Environments and Industries, Vol 13C, ASM Handbook, ASM International, 2006, p 967–1014.
- E.N. Skinner, J.F. Mason, and J.J. Moran, High Temperature Corrosion in Refinery and Petrochemical Service, Corrosion, Vol 16 (No. 12), 1960, p 593t–600t.
- E.L. Hildebrand, Materials Selection for Petroleum Refineries and Petrochemical Plants, Mater. Prot. Perform., Vol 11 (No. 7), 1972, p19–22.
- R.D. Kane, D.C. Eden, and D.A. Eden, Innovative Solutions Integrate Corrosion Monitoring with Process Control, Mater. Perform., Feb 2005, p 36–41.
- W.A. McGill and M.J. Weinbaum, Aluminum-Diffused Steel Lasts Longer, Oil Gas J., Vol 70, Oct 9, 1972, p 66–69.
- "Founder of the modern oil industry to be honoured". BBC News. 2011-11-08.
- Frank, Alison Fleig (2005). Oil Empire: Visions of Prosperity in Austrian Galicia (Harvard Historical Studies). Harvard University Press. ISBN 0-674-01887-7.
- "Warsaw University timeline" (in (Polish)). Geo.uw.edu.pl. 2003-10-10. Retrieved 2011-11-05.
- "WORLD EVENTS: 1844-1856". PBS.org. Retrieved 2009-04-22. "world's first oil refinery"
- "Ekomuseum Bergslagen: Our sites and facilities - Oljeön" (in (English)). Stiftelsen Ekomuseum Bergslagen. Retrieved 2012-01-30.
- White Paper on Refining Capacity, Federal Trade Commission, April, 2007.
- "U. S. Operating Crude Oil Distillation Capacity (Thousand Barrels per Day)". Eia.doe.gov. 2011-07-28. Retrieved 2011-11-05.
- "2011 The U.S. Petroleum Industry: Statistics & Definitions" (PDF). Retrieved 2011-11-05.
|Wikimedia Commons has media related to: Oil refinery|
- Interactive map of UK refineries
- Searchable United States Refinery Map
- Complete, detailed refinery description
- Ecomuseum Bergslagen - history of Oljeön, Sweden
- Fueling Profits: Report on Industry Consolidation (publication of the Consumer Federation of America)
- Price Spikes, Excess Profits and Excuses (publication of the Consumer Federation of America)
- Basics of Oil Refining Overview of crude oil refining process
- Refining NZ Learning Centre Oil Refinery Process Animations,Videos & 360 Degree Views