A refinery is a production
Production, costs, and pricing
The following outline is provided as an overview of and topical guide to industrial organization:Industrial organization – describes the behavior of firms in the marketplace with regard to production, pricing, employment and other decisions...

 facility composed of a group of chemical engineering
Chemical engineering
Chemical engineering is the branch of engineering that deals with physical science , and life sciences with mathematics and economics, to the process of converting raw materials or chemicals into more useful or valuable forms...

 unit processes and unit operation
Unit operation
In chemical engineering and related fields, a unit operation is a basic step in a process.Unit operation involves bringing a physical change such as separation, crystallization, evaporation, filtration etc.. For example in milk processing, homogenization, pasteurization, chilling, and packaging are...

s refining
Refining is the process of purification of a substance or a form. The term is usually used of a natural resource that is almost in a usable form, but which is more useful in its pure form. For instance, most types of natural petroleum will burn straight from the ground, but it will burn poorly...

 certain materials or converting raw material into products of value.
Different types of refineries are as follows:
  • oil refinery
    Oil refinery
    An oil refinery or petroleum refinery is an industrial process plant where crude oil is processed and refined into more useful petroleum products, such as gasoline, diesel fuel, asphalt base, heating oil, kerosene, and liquefied petroleum gas...

    , which converts crude oil into high-octane
    Octane rating
    Octane rating or octane number is a standard measure of the anti-knock properties of a motor or aviation fuel. The higher the octane number, the more compression the fuel can withstand before detonating...

     motor fuel (gasoline
    Gasoline , or petrol , is a toxic, translucent, petroleum-derived liquid that is primarily used as a fuel in internal combustion engines. It consists mostly of organic compounds obtained by the fractional distillation of petroleum, enhanced with a variety of additives. Some gasolines also contain...

    /petrol), diesel oil, liquefied petroleum gases (LPG), jet aircraft fuel, kerosene
    Kerosene, sometimes spelled kerosine in scientific and industrial usage, also known as paraffin or paraffin oil in the United Kingdom, Hong Kong, Ireland and South Africa, is a combustible hydrocarbon liquid. The name is derived from Greek keros...

    , heating fuel oil
    Fuel oil
    Fuel oil is a fraction obtained from petroleum distillation, either as a distillate or a residue. Broadly speaking, fuel oil is any liquid petroleum product that is burned in a furnace or boiler for the generation of heat or used in an engine for the generation of power, except oils having a flash...

    s, lubricating oils, asphalt
    Asphalt or , also known as bitumen, is a sticky, black and highly viscous liquid or semi-solid that is present in most crude petroleums and in some natural deposits, it is a substance classed as a pitch...

     and petroleum coke
    Petroleum coke
    Petroleum coke is a carbonaceous solid derived from oil refinery coker units or other cracking processes. Other coke has traditionally been derived from coal....

  • sugar refinery
    Sugarcane refers to any of six to 37 species of tall perennial grasses of the genus Saccharum . Native to the warm temperate to tropical regions of South Asia, they have stout, jointed, fibrous stalks that are rich in sugar, and measure two to six metres tall...

    , which converts sugar
    Sugar is a class of edible crystalline carbohydrates, mainly sucrose, lactose, and fructose, characterized by a sweet flavor.Sucrose in its refined form primarily comes from sugar cane and sugar beet...

     cane and sugar beets into crystallized sugar and sugar syrups;
  • natural gas processing
    Natural gas processing
    Natural-gas processing is a complex industrial process designed to clean raw natural gas by separating impurities and various non-methane hydrocarbons and fluids to produce what is known as pipeline quality dry natural gas.-Background:...

     plant, which purifies and converts raw natural gas into residential, commercial and industrial fuel gas, and also recovers natural gas liquids (NGL) such as ethane
    Ethane is a chemical compound with chemical formula C2H6. It is the only two-carbon alkane that is an aliphatic hydrocarbon. At standard temperature and pressure, ethane is a colorless, odorless gas....

    , propane
    Propane is a three-carbon alkane with the molecular formula , normally a gas, but compressible to a transportable liquid. A by-product of natural gas processing and petroleum refining, it is commonly used as a fuel for engines, oxy-gas torches, barbecues, portable stoves, and residential central...

    , butane
    Butane is a gas with the formula C4H10 that is an alkane with four carbon atoms. The term may refer to any of two structural isomers, or to a mixture of them: in the IUPAC nomenclature, however, butane refers only to the unbranched n-butane isomer; the other one being called "methylpropane" or...

    s and pentane
    Pentane is an organic compound with the formula C5H12 — that is, an alkane with five carbon atoms. The term may refer to any of three structural isomers, or to a mixture of them: in the IUPAC nomenclature, however, pentane means exclusively the n-pentane isomer; the other two being called...

  • salt refinery, which cleans common salt (NaCl
    Sodium chloride
    Sodium chloride, also known as salt, common salt, table salt or halite, is an inorganic compound with the formula NaCl. Sodium chloride is the salt most responsible for the salinity of the ocean and of the extracellular fluid of many multicellular organisms...

    ), produced by the solar evaporation of sea water, followed by washing and re-crystallization
    Crystallization is the process of formation of solid crystals precipitating from a solution, melt or more rarely deposited directly from a gas. Crystallization is also a chemical solid–liquid separation technique, in which mass transfer of a solute from the liquid solution to a pure solid...

  • metal refineries refining metals such as alumina, copper
    Copper is a chemical element with the symbol Cu and atomic number 29. It is a ductile metal with very high thermal and electrical conductivity. Pure copper is soft and malleable; an exposed surface has a reddish-orange tarnish...

    , gold
    Gold is a chemical element with the symbol Au and an atomic number of 79. Gold is a dense, soft, shiny, malleable and ductile metal. Pure gold has a bright yellow color and luster traditionally considered attractive, which it maintains without oxidizing in air or water. Chemically, gold is a...

    , lead
    Lead is a main-group element in the carbon group with the symbol Pb and atomic number 82. Lead is a soft, malleable poor metal. It is also counted as one of the heavy metals. Metallic lead has a bluish-white color after being freshly cut, but it soon tarnishes to a dull grayish color when exposed...

    , nickel
    Nickel is a chemical element with the chemical symbol Ni and atomic number 28. It is a silvery-white lustrous metal with a slight golden tinge. Nickel belongs to the transition metals and is hard and ductile...

    , silver
    Silver is a metallic chemical element with the chemical symbol Ag and atomic number 47. A soft, white, lustrous transition metal, it has the highest electrical conductivity of any element and the highest thermal conductivity of any metal...

    , uranium
    Uranium is a silvery-white metallic chemical element in the actinide series of the periodic table, with atomic number 92. It is assigned the chemical symbol U. A uranium atom has 92 protons and 92 electrons, of which 6 are valence electrons...

    , and zinc
    Zinc , or spelter , is a metallic chemical element; it has the symbol Zn and atomic number 30. It is the first element in group 12 of the periodic table. Zinc is, in some respects, chemically similar to magnesium, because its ion is of similar size and its only common oxidation state is +2...

  • vegetable oil refinery

The image below is a schematic flow diagram
Process Flow diagram
A process flow diagram is a diagram commonly used in engineering to indicate the general flow of plant processes and equipment.The PFD displays the relationship between major equipment of a plant facility and does not show minor details such as piping details and designations...

 of a typical oil refinery depicting various unit processes and the flow of intermediate products between the inlet crude oil feedstock and the final products.