
The role of the refinery is very simple. Make a profit for the shareholders and produce an environmentally responsible product.
The method of making a profit is to carefully follow the supply and demand curve for their products.
Products from a refinery are the obvious: gasoline (46%), diesel, jet fuel, & fuel oil and the less obvious (to some of us): asphalt, coke (for the aluminum, iron, and steel industries), chemicals, plastics, & lubricants (including motor oil).
The demand for these products will be dependent on the weather (fuel oil), economy, driving habits (Americans are driving further, and more in the summer), military conflict (jet fuel, etc during the Gulf war and other conflicts), and other suppliers. The quality that a barrel of crude oil produces will also be dependent on the quality of the crude oil, which can be highly variable.

Major Refinery Components
Separation
Desalination
The first thing to do is clean up the crude oil and take out the water from the oil. An interesting feature of this water contamination is that it contains salt. This is a very corrosive liquid (salt water) and needs to be removed prior to any other processing steps.
Distillation Tower
Distillation is the heart of the refinery operation. It is the location where the crude oil is separated into many "cuts". Often the distillation tower is very noticeable, as it tends to be one of the taller structures at the refinery. The crude oil is separated into certain "cuts" depending on the volatility of the compounds. This occurs as a continual process: crude oil arrives, is stored and sent for separation via the distillation tower. The cuts are blended, or altered to increase the quality or the quantity of the more desirable products.

Crude oil is very complex. Some crude oils will contain over 1,000,000 separate compounds. Different isomers, length molecules, sized molecules will be present. It is very difficult and expensive to separate the compounds into pure cuts, so we don't even try. We are content to separate the molecules into an initial series of cuts.
Do you know what factors influence the desirability of different products?
Below is a very simplified view of the distillation process. If you find that this topic keenly interests you, then you should consider the 3 credit, 400-level class our department offers just on this subject alone. The processes and products are explained in more detail below the image! Place your mouse over the green text on the image for more information.
The crude oil is heated before entering the distillation tower. In the tower, the more volatile compounds will turn into gases and flow up the tower, and those compounds that have higher volatilization temperatures will remain behind and get hotter. Thus, the top of the tower will have the lower temperatures and the compounds that have the lower boiling points (temperatures). The bottom of the tower will have the less volatile compounds and have the hotter temperature. To ensure good separation there are lots of stages (also called trays) that the volatile compounds may pass on the way up the tower. When the volatiles are cool enough they will turn back into the liquid form. It is the liquid in the trays that will make up the initial cut. A better quality crude oil will yield more of the lighter cuts than the denser cuts. Unfortunately, even the good quality crude oils will not give a 45% gasoline cut from the crude oil which is what is desired (average for the year), thus other processing steps are required to increase the yield. As always, "How stuff works" provides more good information on this topic.
Vacuum Distillation Towers
Some refineries will also operate a vacuum distillation unit to increase the more useful products from the remnants of the atmospheric distillation tower. By lowering the pressure it becomes easier for certain compounds to enter the vapor stage at lower temperatures.
Chemical Processes
Often the gasoline fraction produced by the initial cut in the distillation tower will not be of sufficient quantity or quality for the market and so chemical processing is required to increase the product yield and to ensure appropriate quality and compliance with environmental regulations (which in turn is dependent on market and country location; California, for example, has more stringent requirements than central Pennsylvania).
Cracking
In the past, the longer chain molecules were highly prized for the production of waxes, and while they're still prized for specialty lubricants, the market is not as large as the gasoline market, so some of the long chain molecules will be "cracked" to produce the smaller molecules that are of appropriate length for gasoline production.

This cracking can be achieved through high temperatures and high pressures or through combined catalysts and temperatures with high pressures. The "ends" of the molecule require capping hydrogen atoms so to achieve this one fragment forms a carbon to carbon double bond that we chemists call an alkene (we call paraffin alkanes).
Gasoline Quality - Revisited
Gasoline quality is often indicated by the octane number. 2,2,4-trimethylpentane is assigned an octane number of 100 (it contains 8 carbons hence the name "iso" octane, compounds can have octane numbers higher than 100), heptane an octane number of 0. The octane number of gasoline indicates the fuel has the same combustion performance in an engine as a certain blend of 2,2,4-trimethylpentane and heptane (i.e., an octane value of 80 has fuel characteristics similar to a blend of 80% 2,2,4-trimethylpentane and 20% heptane). The higher the octane number the less likely the fuel is to "knock", i.e. buying a higher octane number gasoline indicates a better quality fuel.
Lead (tetraethyl lead to be precise)
As you'll recall from Lesson 5, was also used as an octane enhancer but has been banned from most of our gasoline back in 1970.
The quality of the gasoline can be increased by reforming, which is either altering the shape (isomerisation) or altering the composition of the molecules. Essentially, the quality of gasoline can be increased by increasing the branched chain producing higher octane numbers.