OIL REFINERY

The Opening Pump crude oil from the ground. It's black, viscous, useless. You can't put it in your car. You can't fly a plane with it. You can't make plastic from it — yet. Crude is a soup of 500+ hydrocarbon molecules, from C₁ (methane — gas at room temp) to C₅₀+ (asphalt — solid). Your job: separate this soup into products the world runs on. Requirements: ├── Process 500,000 barrels per day ├── Separate into 10+ products (gasoline, diesel, jet fuel, LPG, naphtha, asphalt) ├── Run 24/7 for 4 years between shutdowns └── Don't blow up Let's build one.
───
PHASE 1: Heat the Soup
Turn on the furnace. Crude oil enters at ambient temperature — a thick black sludge. You need to get it to 350°C. Not to destroy it. To sort it. Because every molecule in this soup has a different boiling point, and heat is your sorting mechanism. Different molecules boil at different temperatures. This is the most important fact in petroleum refining. A short-chain molecule (few carbon atoms) is light — it vaporizes easily. A long-chain molecule (many carbon atoms) is heavy — it clings to liquid form. The Boiling Point Ladder
Molecule Carbons Boiling Point State at 25°C Product ────────────────────────────────────────────────────────────────────── Methane C₁ -161°C Gas LNG Ethane C₂ -89°C Gas Ethylene feedstock Propane C₃ -42°C Gas LPG Butane C₄ -1°C Gas LPG / lighter fuel Pentane C₅ 36°C Liquid Light naphtha Octane C₈ 126°C Liquid Gasoline Dodecane C₁₂ 216°C Liquid Kerosene / jet fuel Hexadecane C₁₆ 287°C Liquid Diesel Eicosane C₂₀ 343°C Waxy solid Heavy gas oil Triacontane C₃₀ 450°C Solid Lubricating oil C₅₀+ C₅₀+ >500°C Solid AsphaltEvery additional carbon atom adds roughly 20-30°C to the boiling point. This regularity is what makes distillation possible — nature gave us a built-in sorting key.
The Furnace — 350°C in 8 Seconds Crude enters the furnace at 250°C (preheated by hot products — more on that in Phase 8). It travels through tubes inside a firebox burning refinery gas. Heat flux: 30 kW/m² on the tube surfaces. Total heat duty: ~150 MW — enough to power 100,000 homes. Why 350°C and not higher? Above 370°C, large molecules start to crack — breaking apart into smaller, unpredictable fragments. That's thermal cracking, and it happens uncontrollably. You want to vaporize, not destroy. So you heat to 350°C: hot enough to vaporize everything up to diesel-range, cold enough to keep the heavy stuff intact. Clausius-Clapeyron — Why Pressure Matters The relationship between vapor pressure and temperature: dP/dT = ΔH_vap / (T × ΔV) In simplified form (for ideal gases): ln(P₂/P₁) = (ΔH_vap / R) × (1/T₁ - 1/T₂) This tells you: lowering pressure lowers the boiling point. Refineries use this trick in vacuum distillation — by pulling a vacuum (50-100 mmHg instead of 760 mmHg), heavy oils that would crack at 500°C under atmospheric pressure boil safely at 400°C under vacuum.
What Leaves the Furnace At 350°C, the crude is roughly 60% vapor and 40% liquid. The vapor is everything lighter than diesel. The liquid is everything heavier. This two-phase mixture — a roaring, turbulent fog of hot hydrocarbon vapor carrying droplets of black residuum — enters the bottom of the distillation tower. The sorting begins.
DESIGN SPEC UPDATED: ├── Crude: 500+ molecules, C₁ to C₅₀+, boiling points -161°C to >500°C ├── Furnace: heats crude to 350°C, heat duty ~150 MW ├── Clausius-Clapeyron: ln(P₂/P₁) = (ΔH/R)(1/T₁ - 1/T₂) ├── Vacuum distillation: lower pressure → lower boiling point → avoids cracking └── At 350°C: ~60% vapor (lights), ~40% liquid (heavies)
───
PHASE 2: Build the Tower
Look at a refinery skyline. The tallest structure — 50 meters, bristling with pipes — is the atmospheric distillation column. This single tower does more separation work than any other piece of equipment in the plant. 500,000 barrels per day enter as mixed crude. Ten distinct products leave from ten different heights. The Principle: Hot at the Bottom, Cold at the Top The tower is 350°C at the bottom and 25°C at the top. Vapor rises from the bottom. As it climbs, it hits progressively cooler zones. Heavy molecules condense first (low on the tower). Light molecules keep rising (condense near the top, or exit as gas). Each horizontal tray inside the tower is an equilibrium stage. Vapor bubbles up through liquid sitting on the tray. Molecules exchange: heavy ones leave the vapor phase and join the liquid, light ones leave the liquid and join the vapor. Every tray makes the vapor a little lighter and the liquid a little heavier.
25°C ──→ Fuel gas (C₁-C₂) ┌───┐ │ │ ──→ LPG (C₃-C₄) ~40°C ├───┤ │ │ ──→ Light naphtha (C₅-C₆) ~90°C ├───┤ │ │ ──→ Heavy naphtha (C₇-C₁₀) ~150°C ├───┤ │ │ ──→ Kerosene/Jet (C₁₁-C₁₃) ~200°C ├───┤ │ │ ──→ Diesel (C₁₄-C₂₀) ~300°C ├───┤ │ ↑ │ vapor rises, getting │ ↑ │ lighter at each tray │ ↑ │ Feed ──→ ├───┤ ← 350°C flash zone │ │ └───┘ ──→ Residuum (C₂₀+) ~350°C (goes to vacuum unit) Height: ~50 meters │ Diameter: ~8 meters Trays: 30-50 │ Throughput: 500,000 bbl/dayProducts are drawn off at different heights based on their boiling range. The tower runs continuously — crude enters, products leave, 24 hours a day, 365 days a year.
Relative Volatility — The Separation Driving Force How easy is it to separate two components? The relative volatility α tells you: α = (y_A / x_A) / (y_B / x_B) Where y = mole fraction in vapor, x = mole fraction in liquid. If α = 1: the two components are equally volatile — separation is impossible. If α > 2: separation is easy — a few trays suffice. If α = 1.1-1.5: separation is hard — you need many trays. For crude oil fractions: ├── Propane vs butane: α ≈ 3.5 (easy — 10 trays) ├── Naphtha vs kerosene: α ≈ 2.0 (moderate — 20 trays) ├── Kerosene vs diesel: α ≈ 1.5 (harder — 30 trays) └── Close-boiling isomers: α ≈ 1.05 (nearly impossible by distillation) The Fenske Equation — Minimum Trays For a desired separation at total reflux: N_min = ln[(x_D/(1-x_D)) × ((1-x_B)/x_B)] / ln(α) For separating naphtha from kerosene (α = 2.0, want 95% purity): N_min = ln[(0.95/0.05) × (0.95/0.05)] / ln(2.0) N_min = ln[361] / 0.693 N_min = 5.89 / 0.693 N_min = 8.5 trays (minimum — real columns use 2-3× more for efficiency)
What Each Tray Actually Does A bubble-cap tray or sieve tray holds a pool of liquid ~50mm deep. Vapor pushes up through holes or caps, forming bubbles in the liquid. The bubbles have enormous surface area — thousands of tiny vapor-liquid interfaces where molecules exchange. Tray efficiency: 50-70% of theoretical equilibrium per tray. A column with 40 real trays ≈ 20-28 theoretical stages. Enough to cut crude into 6+ distinct products with sharp boundaries between them.
DESIGN SPEC UPDATED: ├── Column: 50m tall, 8m diameter, 30-50 trays, 350°C bottom to 25°C top ├── Products: fuel gas, LPG, light/heavy naphtha, kerosene, diesel, residuum ├── Relative volatility: α = (y_A/x_A)/(y_B/x_B) — drives separation ├── Fenske equation: N_min = ln[...]/ln(α) — minimum trays for a given purity └── Tray efficiency: 50-70%, real columns use 2-3× minimum theoretical stages
───
PHASE 3: Crack the Big Ones
The distillation tower gave you a problem. About 40% of the crude came out as residuum — heavy, high-boiling molecules with 20 to 50+ carbon atoms. The market doesn't want heavy oil. The market wants gasoline (C₅-C₁₂), diesel (C₁₄-C₂₀), and jet fuel (C₁₁-C₁₃). You have too much heavy, not enough light. You need to break the big ones into smaller ones. This is catalytic cracking — the reaction that turns a $40/barrel residuum into $80/barrel gasoline. The Chemistry: Breaking Carbon-Carbon Bonds A long hydrocarbon chain like C₃₂H₆₆ (dotriacontane, boiling point ~465°C, useless as fuel) can be cracked into: C₃₂H₆₆ → C₁₂H₂₆ + C₁₀H₂₂ + C₈H₁₆ + C₂H₄ dodecane decane octene ethylene (diesel) (diesel) (gasoline) (petrochemical) The zeolite catalyst does this at 500°C. Without a catalyst, you'd need 700°C+ and you'd get random, uncontrolled fragmentation. The zeolite's crystalline pores (0.7 nm wide) act as molecular-scale reaction chambers that favor cracking into gasoline-range molecules.
Flue gas Products to (CO₂, N₂) fractionator ↑ ↑ ┌───────────────┐ ┌─────────────────┐ │ REGENERATOR │ │ REACTOR │ │ │ │ │ │ Burns coke │ │ Feed + hot │ │ off catalyst │ │ catalyst mix │ │ at 700°C │ │ at 500°C │ │ │ │ │ │ Air blown in │ │ Contact time: │ │ from bottom │ │ 2-4 seconds │ │ │ │ │ └───────┬───────┘ └────────┬─────────┘ │ │ │ hot clean │ spent catalyst │ catalyst │ (covered in coke) │ ↓ │ └───────→───────────────┘ continuous loop ~40 tonnes/minute circulating Feed: vacuum gas oil (C₂₀-C₄₀), ~370°C Products: gasoline (48%), light gas oil (20%), LPG (18%), coke (5%)The catalyst circulates in a continuous loop — cracking heavy oil in the reactor, then burning off deposited coke in the regenerator. The heat from burning coke provides the energy to crack more oil. Self-sustaining.
Conversion and Yield A modern FCC unit converts 75-80% of its heavy feed into lighter products:
Feed: 100 barrels of vacuum gas oil (VGO) ████████████████████████████████████████████████░░ Gasoline (C₅-C₁₂): 48% ████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░ Light gas oil: 20% ██████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ LPG (C₃-C₄): 18% █████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ Dry gas (C₁-C₂): 5% █████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ Coke (on catalyst): 5% ████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ Slurry oil: 4%Volume gain: 100 barrels of heavy feed → ~105 barrels of lighter products. Cracking creates more volume because lighter molecules take up more space per unit mass. Free barrels from chemistry.
Why Zeolites? Zeolites are crystalline aluminosilicates with pores of precisely controlled size. The FCC catalyst (Y-type zeolite, pore diameter 0.74 nm) acts as a molecular sieve: ├── Molecules that fit in the pore: crack selectively → gasoline-range products ├── Molecules too large for the pore: crack on the external surface → less selective ├── Molecules too small: pass through without reacting The catalyst deactivates in 2-4 seconds as coke (solid carbon) deposits on its surface. This is why the FCC is a continuous circulation system — spent catalyst flows to the regenerator, coke burns off at 700°C, and the clean hot catalyst flows back to crack more feed.
DESIGN SPEC UPDATED: ├── FCC converts 75-80% of heavy feed to lighter products ├── Products: 48% gasoline, 20% light gas oil, 18% LPG, 5% coke ├── Zeolite catalyst: 0.74 nm pores, shape-selective cracking ├── Catalyst circulation: ~40 tonnes/min, 2-4 second contact time └── Volume gain: 100 bbl heavy feed → ~105 bbl lighter products
───
PHASE 4: Reform the Small Ones
You cracked the heavies into gasoline-range molecules. But there's a problem: most of them are straight-chain alkanes. Straight chains burn too fast in an engine — they auto-ignite before the spark plug fires, causing engine knock. Knock destroys engines. You need to reshape these molecules. Octane Rating — What It Really Means The octane rating measures a fuel's resistance to knock: ├── n-heptane (C₇H₁₆): straight chain, knocks terribly → octane rating 0 ├── iso-octane (C₈H₁₈): branched chain, resists knock → octane rating 100 ├── toluene (C₇H₈): aromatic ring, resists knock → octane rating 120 Regular gasoline: 87 octane. Premium: 93 octane. The higher the number, the more compression the fuel tolerates before self-igniting. Catalytic Reforming — Reshaping Molecules The reformer takes low-octane straight chains and converts them to high-octane ring structures: n-heptane → toluene + 4H₂ (octane 0) (octane 120)
BEFORE: n-heptane (octane rating: 0) H H H H H H H │ │ │ │ │ │ │ H ─ C─C─C─C─C─C─C ─ H straight chain │ │ │ │ │ │ │ burns too fast H H H H H H H → engine knock │ Pt catalyst │ 500°C, 20 bar ↓ AFTER: toluene (octane rating: 120) CH₃ │ ┌────C────┐ │ ║ │ aromatic ring C C C stable, resists ║ │ ║ auto-ignition C────C────C + 4 H₂ released │ (hydrogen = valuable byproduct)The platinum catalyst dehydrogenates the alkane and cyclizes it into an aromatic ring. The 4 hydrogen molecules released are worth more than the octane upgrade — they're used in hydrodesulfurization (Phase 5).
The Reformer Conditions Temperature: 500°C (endothermic reaction — needs constant heat input) Pressure: 20-30 bar Catalyst: platinum on alumina (Pt/Al₂O₃) — each reactor contains ~3 tonnes of catalyst with $15 million worth of platinum The reaction is endothermic (absorbs heat), so the reformer uses 3-4 reactors in series with reheating furnaces between them. Feed enters Reactor 1 at 500°C, exits at ~470°C (temperature drops as heat is absorbed), gets reheated to 500°C, enters Reactor 2, and so on. Feed: heavy naphtha (C₇-C₁₀), octane rating 40-50 Product: reformate, octane rating 95-105 Byproduct: hydrogen — 300-400 scf per barrel of feed That hydrogen is critical. The entire refinery depends on it. Without reformer hydrogen, you can't remove sulfur (Phase 5), you can't hydrocrack, you can't make clean fuels. The reformer is both an octane machine and a hydrogen factory.
Octane Comparison
Component Octane (RON) Source ──────────────────────────────────────────────────── n-butane 94 Distillation iso-pentane 93 Isomerization FCC gasoline 91-93 Catalytic cracking Reformate 95-105 Catalytic reforming Toluene 120 Reforming Alkylate 94-98 Alkylation Straight-run naphtha 40-60 Distillation (unprocessed) n-heptane 0 Reference fuelEvery refinery is a blending puzzle. Mix high-octane components (reformate, alkylate) with low-octane ones (straight-run naphtha) to hit the target: 87, 89, or 93 octane at the pump.
DESIGN SPEC UPDATED: ├── Reforming: straight chains → aromatics (n-heptane → toluene + 4H₂) ├── Conditions: 500°C, 20 bar, Pt/Al₂O₃ catalyst ($15M in platinum) ├── Octane upgrade: feed 40-50 → product 95-105 ├── Byproduct: hydrogen (300-400 scf/bbl) — feeds desulfurization └── 3-4 reactors in series with interstage reheating
───
PHASE 5: Remove the Poison
Crude oil contains 0.5-5% sulfur by weight. When sulfur-containing fuel burns in an engine, it produces sulfur dioxide (SO₂). SO₂ in the atmosphere combines with water to form sulfuric acid — acid rain. It corrodes buildings, kills forests, and destroys aquatic ecosystems. It also poisons catalytic converters in cars, making their exhaust controls useless. Regulation says: maximum 10 ppm sulfur in gasoline (US, EU). Crude oil starts at 5,000-50,000 ppm. You need a 500× to 5,000× reduction. Hydrodesulfurization (HDS) — Hydrogen Attacks Sulfur The reaction is conceptually simple. Hydrogen reacts with organic sulfur compounds over a catalyst to produce H₂S gas (which you capture) and clean hydrocarbon: R-S-R' + 2H₂ → R-H + R'-H + H₂S (organic sulfur) (hydrogen sulfide) For a common sulfur compound in diesel — dibenzothiophene: C₁₂H₈S + 2H₂ → C₁₂H₁₀ + H₂S (DBT) (biphenyl) (captured)
H₂ feed ─────────→─┐ (from reformer) │ ↓ Sulfur-rich ┌─────────────────┐ Clean product feed ─────────→│ │───→ (10 ppm S) (5,000 ppm S) │ CoMo/Al₂O₃ │ │ catalyst bed │ H₂S gas │ │───→ (to Claus unit) │ 350°C, 50 bar │ │ │ └─────────────────┘ Catalyst: cobalt-molybdenum on alumina (CoMo/Al₂O₃) Hydrogen consumption: 100-300 scf per barrel Bed life: 2-4 years before replacementThe hydrogen comes from the catalytic reformer (Phase 4). The H₂S goes to the Claus process (below). Nothing is wasted — sulfur becomes a sellable product.
The Claus Process — Turning Poison into Product You've captured H₂S gas. Now what? The Claus process converts it to elemental sulfur: Step 1 (thermal): 2H₂S + 3O₂ → 2SO₂ + 2H₂O (burn one-third of the H₂S) Step 2 (catalytic): 2H₂S + SO₂ → 3S + 2H₂O (react remaining H₂S with SO₂) Net: 3H₂S + 1.5O₂ → 3S + 3H₂O Recovery: 95-98% of sulfur captured. A large refinery produces 500-2,000 tonnes of sulfur per day. This sulfur is sold — it goes into sulfuric acid production, fertilizers, rubber vulcanization. The Numbers A 500,000 bbl/day refinery processing 2% sulfur crude: ├── Sulfur in: 500,000 × 159 L × 0.85 kg/L × 0.02 = ~1,350 tonnes/day ├── Sulfur out (in products): ~7 tonnes/day (at 10 ppm average) ├── Sulfur captured: ~1,343 tonnes/day └── Removal efficiency: 99.5%
DESIGN SPEC UPDATED: ├── HDS: R-S-R' + 2H₂ → R-H + R'-H + H₂S over CoMo catalyst at 350°C, 50 bar ├── Sulfur reduction: 5,000 ppm → 10 ppm (500× reduction) ├── Claus process: 2H₂S + SO₂ → 3S + 2H₂O (95-98% recovery) ├── Sulfur production: ~1,350 tonnes/day from 500,000 bbl/day refinery └── Hydrogen consumption: 100-300 scf/bbl (supplied by reformer)
───
PHASE 6: Blend to Spec
Gasoline is not one chemical. When you pump "regular 87" into your car, you're buying a blend of 200+ different hydrocarbon molecules, tuned to hit a dozen simultaneous specifications. Get any one wrong and the fuel fails — engine knock, hard starting, excessive emissions, or vapor lock on a hot day. The Specification Sheet Every batch of gasoline must meet ALL of these simultaneously:
Property Spec (Regular 87) Why It Matters ─────────────────────────────────────────────────────────────────── Octane (R+M)/2 87.0 minimum Anti-knock performance Reid Vapor Pressure (RVP) 7.0-9.0 psi Starting, evaporative emissions (summer: 7.0) (winter: 9.0) Sulfur ≤10 ppm Catalyst protection, emissions Benzene ≤0.62 vol% Carcinogen limit Aromatics ≤25 vol% Emissions, deposits Olefins ≤10 vol% Stability, gum formation T50 (50% evaporated) 170-250°F Warmup, driveability T90 (90% evaporated) ≤374°F Deposits, heavy ends Distillation end point ≤437°F Complete combustionSummer vs winter is the key difference. In summer, vapor pressure must be low (fuel can't boil in the fuel line on a hot day — "vapor lock"). In winter, vapor pressure must be high (fuel needs to vaporize easily for cold starting).
Linear Programming — The Blending Optimizer A refinery has 8-12 blending components (reformate, FCC gasoline, alkylate, butane, straight-run naphtha, etc.). Each has different properties. The blending problem: Maximize: profit = Σ(product_price × volume) - Σ(component_cost × volume) Subject to: ├── Octane ≥ 87 (or 89, or 93 for each grade) ├── RVP ≤ 9.0 psi (summer) or ≤ 13.5 psi (winter) ├── Sulfur ≤ 10 ppm ├── Benzene ≤ 0.62% ├── Total volume = demand └── Component availability ≤ production This is a linear programming problem with 50-200 constraints. Refineries solve it daily using LP software. A 1% improvement in blend optimization on a 500,000 bbl/day refinery = $2-5 million per year in additional margin. The Butane Trick Butane has high octane (94) and is the cheapest blending component. But butane has high vapor pressure (52 psi RVP). In summer, you can only add ~2% butane before hitting the RVP limit. In winter, you can add ~10%. This is why refineries produce more gasoline in winter (more butane blended in) and must find other markets for butane in summer.
The Seasonal Switchover Twice a year, every refinery reformulates: Winter blend (October-March): ├── More butane (cheap octane boost) ├── Higher RVP (easier cold starting) ├── Lighter distillation curve └── Lower cost to produce Summer blend (April-September): ├── Less butane (RVP limit) ├── More reformate and alkylate (expensive octane) ├── Lower vapor pressure (no vapor lock) └── Higher cost to produce → gas prices rise every spring The spring price spike isn't just demand. It's chemistry.
DESIGN SPEC UPDATED: ├── Gasoline: 200+ components blended to 10+ simultaneous specs ├── LP optimization: maximize profit subject to octane, RVP, sulfur, benzene constraints ├── Summer vs winter: RVP 7.0 vs 9.0 psi drives seasonal reformulation ├── Butane: octane 94, cheap, but RVP 52 psi limits summer blending └── 1% blend optimization improvement = $2-5M/year on a large refinery
───
PHASE 7: Don't Blow Up
March 23, 2005. Texas City, Texas. BP refinery. An isomerization unit is being restarted after maintenance. Liquid hydrocarbon overflows from a blowdown drum — a tower that was supposed to handle vapor, not liquid. A geyser of hot gasoline erupts 20 feet into the air. It finds an ignition source. 15 people die. 180 injured. The unit had been restarted in a non-standard way. Multiple alarms were ignored. The blowdown drum was a 1950s design that should have been replaced decades ago. Process safety isn't about one big mistake. It's about multiple small failures lining up. The Hazards — What Can Kill You
Hazard What Happens Energy Released ───────────────────────────────────────────────────────────────── Vapor cloud explosion Hydrocarbon vapor + air 10-100 tonnes TNT equiv ignites in open space BLEVE Boiling Liquid Expanding Fireball 200m diameter Vapor Explosion — vessel from a single propane ruptures under fire sphere Pool fire Liquid spill ignites Heat flux 200+ kW/m² at 10m distance Toxic release H₂S leak (lethal at 100 ppm = fatal in 100+ ppm) 30-60 minutes Overpressure Blocked outlet + heat Vessel fragments as = pressure rise to burst shrapnel at 100+ m/sA single propane sphere (2,000 m³) contains the energy equivalent of 20 tonnes of TNT. A refinery has dozens of vessels this size. Process safety is the engineering discipline that keeps this energy contained.
Layers of Protection Analysis (LOPA) Safety isn't one barrier — it's multiple independent layers. If one fails, the next catches it:
Hazard ──→ │ │ │ │ │ │ → Accident │ │ │ │ │ │ Layer 1: Process design (inherently safe design) Layer 2: Basic Process Control (DCS alarms, automated control) Layer 3: Critical alarms (operator intervention) Layer 4: Safety Instrumented System (SIS) (automated shutdown) Layer 5: Relief devices (pressure relief valves) Layer 6: Physical containment (dikes, blast walls) Layer 7: Emergency response (fire brigade, evacuation) Each layer reduces risk by 10× to 100× Combined: initiating event frequency × PFD₁ × PFD₂ × ... = tolerable risk Target: <10⁻⁶ fatalities per year (one in a million)The Swiss cheese model: every layer has holes (failures). An accident happens only when holes in ALL layers line up simultaneously. Texas City 2005: holes in layers 1, 2, 3, 4, and 5 all lined up at the same time.
Relief Valve Sizing — The Last Mechanical Defense When all control systems fail, the relief valve is the last barrier before vessel rupture. It must handle the worst-case vapor generation: A = W × √(T × Z) / (C × K × P × √M) Where: ├── A = required orifice area (in²) ├── W = worst-case mass flow rate (lb/hr) ├── T = relieving temperature (°R) ├── P = set pressure × 1.1 (psia) ├── M = molecular weight of vapor ├── C, K, Z = correction factors The worst case: fire engulfment. A pool fire surrounds the vessel. Heat input boils the liquid. The relief valve must vent vapor faster than it's being generated, or the vessel pressure rises, the metal weakens at temperature, and the vessel ruptures — BLEVE. API 521 standard: relief valve must handle full fire case on the largest vessel in the unit. Typical relief valve: 6-inch orifice, 300,000 lb/hr capacity.
DESIGN SPEC UPDATED: ├── Hazards: VCE, BLEVE, pool fire, toxic release, overpressure ├── LOPA: 5-7 independent protection layers, each 10-100× risk reduction ├── Target: <10⁻⁶ fatalities/year per individual ├── Relief valves: sized for worst-case fire engulfment per API 521 └── Texas City lesson: multiple barriers failed simultaneously
───
PHASE 8: Recover the Heat
Your refinery burns $3-5 million per day in fuel for furnaces, reboilers, and steam. Meanwhile, hot products leave process units at 200-400°C and get cooled down to storage temperature. You're paying to heat things up, then throwing that heat away. The thermodynamic crime is obvious: use the hot stuff to heat the cold stuff. Heat Exchanger Networks — Hot Meets Cold Crude oil enters at 25°C and needs to reach 350°C before the distillation column. That's a ΔT of 325°C. Without heat recovery, the furnace provides all of it: ~150 MW. But products leave hot: ├── Diesel product: 300°C (needs cooling to 50°C) ├── Kerosene product: 200°C (needs cooling to 40°C) ├── Residuum: 350°C (needs cooling to 150°C for pumping) ├── Pump-around streams: 150-250°C Match hot streams against cold crude in a series of shell-and-tube heat exchangers:
Crude oil temperature as it passes through exchangers: 25°C → [Exch 1: vs kerosene] → 80°C → [Exch 2: vs diesel] → 140°C → [Exch 3: vs pump-around] → 190°C → [Exch 4: vs residuum] → 250°C → [FURNACE: remaining 100°C] → 350°C Without heat recovery: Furnace duty = 150 MW (ΔT = 325°C) With heat recovery: Furnace duty = 50 MW (ΔT = 100°C) Heat recovered: 100 MW = 67% of total requirement Fuel savings: ~$2 million per dayEach heat exchanger transfers heat from a hot product stream to the cold crude. By the time crude reaches the furnace, it's already at 250°C. The furnace only needs to add the last 100°C.
Pinch Analysis — Finding the Thermodynamic Limit How much heat CAN you recover? Pinch analysis answers this. Plot all hot streams (need cooling) and all cold streams (need heating) on a temperature-enthalpy diagram. Where the curves come closest is the pinch point. Rules: ├── Above the pinch: heat deficit (need external heating) ├── Below the pinch: heat surplus (need external cooling) ├── At the pinch: ΔT_min (typically 10-20°C for refinery exchangers) The minimum energy requirement: Q_hot_min = Q_cold_total - Q_recoverable For our crude unit: ├── Total cold duty (crude 25→350°C): 150 MW ├── Total hot duty (products cooling): 120 MW ├── Pinch temperature: ~180°C ├── Maximum recovery: ~110 MW ├── Minimum furnace duty: ~40 MW A well-designed refinery recovers 60-70% of heat internally. The remaining 30-40% comes from fuel gas (mostly refinery off-gas — the lightest hydrocarbons that are worth more as fuel than as product).
Fouling — The Slow Death of Heat Transfer Over months of operation, heat exchangers foul. Crude oil deposits asphaltenes, waxes, and salts on tube surfaces. Each millimeter of fouling acts as insulation: Clean exchanger: U = 500 W/m²·K After 1 year: U = 300 W/m²·K After 2 years: U = 200 W/m²·K The result: less heat recovery, more furnace firing, higher fuel cost. This is why refineries shut down every 4-5 years for a "turnaround" — clean all exchangers, inspect vessels, replace catalyst. Cost: $50-200 million. Duration: 30-45 days. Revenue lost during shutdown: $5-10 million per day.
DESIGN SPEC UPDATED: ├── Heat recovery: 60-70% of total heating duty from hot products ├── Crude preheat: 25°C → 250°C via exchangers, furnace adds last 100°C ├── Pinch analysis: Q_hot_min = total cold duty - recoverable heat ├── Fuel savings: ~$2M/day from heat integration └── Fouling: U drops 40-60% over 2 years → drives $50-200M turnaround
───
PHASE 9: Treat the Water
Water touches everything in a refinery. It washes salt from crude in the desalter. It condenses as sour water in overhead systems. It cools equipment in cooling towers. It generates steam in boilers. And every drop that contacts hydrocarbons becomes contaminated. A 500,000 bbl/day refinery generates ~200,000 barrels per day of wastewater. You can't dump it in the river. The Contamination Problem Refinery wastewater contains: ├── Free oil: 100-1,000 mg/L (visible sheen) ├── Dissolved oil: 50-200 mg/L (invisible but toxic) ├── Phenols: 20-200 mg/L (toxic to aquatic life at >1 mg/L) ├── Sulfides: 50-300 mg/L (H₂S, toxic, odorous) ├── Ammonia: 100-500 mg/L └── Suspended solids: 50-200 mg/L Discharge limits (to receiving water): ├── Oil & grease: ≤10 mg/L ├── Phenols: ≤0.5 mg/L ├── Sulfides: ≤0.5 mg/L └── BOD: ≤30 mg/L You need 99%+ removal of most contaminants. Step 1: Oil-Water Separation — Stokes' Law Oil droplets are lighter than water. They rise. How fast? Stokes' law: v = (ρ_w - ρ_o) × g × d² / (18μ) Where: ├── ρ_w = water density (1,000 kg/m³) ├── ρ_o = oil density (850 kg/m³) ├── g = 9.81 m/s² ├── d = droplet diameter (m) ├── μ = water viscosity (0.001 Pa·s) For a 100 μm (0.1 mm) oil droplet: v = (1000 - 850) × 9.81 × (0.0001)² / (18 × 0.001) v = 150 × 9.81 × 10⁻⁸ / 0.018 v = 1.4715 × 10⁻⁵ / 0.018 v = 8.2 × 10⁻⁴ m/s = 0.82 mm/s For a 10 μm droplet: v = 0.0082 mm/s — 100× slower (v ∝ d²) This is why the API separator works for large droplets but can't catch the small ones.
The Treatment Train
STEP 1: API SEPARATOR ┌──────────────────────────────────────────┐ │ oil skimmed ← ═══oil layer═══ │ │ ───────────── │ │ wastewater → ═══water═══ → water │ │ ───────────── │ │ ═══sludge═══ → sludge │ └──────────────────────────────────────────┘ Removes: droplets >150 μm Oil out: 100-1,000 → 50-100 mg/L STEP 2: DISSOLVED AIR FLOTATION (DAF) Microbubbles (30-100 μm) attach to oil droplets Float them to surface for skimming Oil out: 50-100 → 10-30 mg/L STEP 3: BIOLOGICAL TREATMENT (activated sludge) Bacteria consume dissolved organics Aeration basins, 6-24 hour retention Phenols: 200 → 0.3 mg/L Oil out: 10-30 → 3-8 mg/L BOD: 200-500 → 10-20 mg/L STEP 4: TERTIARY (if needed) Filtration, activated carbon, polishing Oil out: → <5 mg/LFour steps, each catching what the previous one missed. The API separator handles the easy stuff (big droplets). Biology handles the hard stuff (dissolved organics). Total residence time: 24-48 hours from inlet to discharge.
The Sour Water Stripper When steam contacts hydrocarbons at high temperature, it absorbs H₂S and NH₃ — producing "sour water." This is the most toxic stream in the refinery. The sour water stripper boils it: NH₄HS(aq) → NH₃(g) + H₂S(g) Steam strips the dissolved gases out. The H₂S goes to the Claus unit (Phase 5). The NH₃ goes to a scrubber or is destroyed thermally. The stripped water — now clean of sulfides — joins the main wastewater treatment system. Volume: 50,000-100,000 bbl/day of sour water from a large refinery. Without the stripper, all that H₂S would poison the biological treatment bacteria in the wastewater plant.
DESIGN SPEC UPDATED: ├── Wastewater: ~200,000 bbl/day from 500,000 bbl/day crude input ├── Stokes' law: v = (ρ_w - ρ_o)gd²/(18μ) — rise velocity ∝ d² ├── Treatment train: API separator → DAF → biological → tertiary ├── Oil removal: 1,000 mg/L → <5 mg/L (99.5% reduction) └── Sour water stripper: removes H₂S + NH₃ before wastewater treatment
───
PHASE 10: The Margin Game
───
FULL MAP Oil Refinery ├── Phase 1: Heat the Soup ├── Crude: 500+ molecules, C₁ to C₅₀+, boiling points -161°C to >500°C} ├── Furnace: heats crude to 350°C, heat duty ~150 MW} ├── Clausius-Clapeyron: ln(P₂/P₁) = (ΔH/R)(1/T₁ - 1/T₂)} ├── Vacuum distillation: lower pressure → lower boiling point → avoids cracking} └── At 350°C: ~60% vapor (lights), ~40% liquid (heavies)} ├── Phase 2: Build the Tower ├── Column: 50m tall, 8m diameter, 30-50 trays, 350°C bottom to 25°C top} ├── Products: fuel gas, LPG, light/heavy naphtha, kerosene, diesel, residuum} ├── Relative volatility: α = (y_A/x_A)/(y_B/x_B) — drives separation} ├── Fenske equation: N_min = ln[...]/ln(α) — minimum trays for a given purity} └── Tray efficiency: 50-70%, real columns use 2-3× minimum theoretical stages} ├── Phase 3: Crack the Big Ones ├── FCC converts 75-80% of heavy feed to lighter products} ├── Products: 48% gasoline, 20% light gas oil, 18% LPG, 5% coke} ├── Zeolite catalyst: 0.74 nm pores, shape-selective cracking} ├── Catalyst circulation: ~40 tonnes/min, 2-4 second contact time} └── Volume gain: 100 bbl heavy feed → ~105 bbl lighter products} ├── Phase 4: Reform the Small Ones ├── Reforming: straight chains → aromatics (n-heptane → toluene + 4H₂)} ├── Conditions: 500°C, 20 bar, Pt/Al₂O₃ catalyst ($15M in platinum)} ├── Octane upgrade: feed 40-50 → product 95-105} ├── Byproduct: hydrogen (300-400 scf/bbl) — feeds desulfurization} └── 3-4 reactors in series with interstage reheating} ├── Phase 5: Remove the Poison ├── HDS: R-S-R' + 2H₂ → R-H + R'-H + H₂S over CoMo catalyst at 350°C, 50 bar} ├── Sulfur reduction: 5,000 ppm → 10 ppm (500× reduction)} ├── Claus process: 2H₂S + SO₂ → 3S + 2H₂O (95-98% recovery)} ├── Sulfur production: ~1,350 tonnes/day from 500,000 bbl/day refinery} └── Hydrogen consumption: 100-300 scf/bbl (supplied by reformer)} ├── Phase 6: Blend to Spec ├── Gasoline: 200+ components blended to 10+ simultaneous specs} ├── LP optimization: maximize profit subject to octane, RVP, sulfur, benzene constraints} ├── Summer vs winter: RVP 7.0 vs 9.0 psi drives seasonal reformulation} ├── Butane: octane 94, cheap, but RVP 52 psi limits summer blending} └── 1% blend optimization improvement = $2-5M/year on a large refinery} ├── Phase 7: Don't Blow Up ├── Hazards: VCE, BLEVE, pool fire, toxic release, overpressure} ├── LOPA: 5-7 independent protection layers, each 10-100× risk reduction} ├── Target: <10⁻⁶ fatalities/year per individual} ├── Relief valves: sized for worst-case fire engulfment per API 521} └── Texas City lesson: multiple barriers failed simultaneously} ├── Phase 8: Recover the Heat ├── Heat recovery: 60-70% of total heating duty from hot products} ├── Crude preheat: 25°C → 250°C via exchangers, furnace adds last 100°C} ├── Pinch analysis: Q_hot_min = total cold duty - recoverable heat} ├── Fuel savings: ~$2M/day from heat integration} └── Fouling: U drops 40-60% over 2 years → drives $50-200M turnaround} ├── Phase 9: Treat the Water ├── Wastewater: ~200,000 bbl/day from 500,000 bbl/day crude input} ├── Stokes' law: v = (ρ_w - ρ_o)gd²/(18μ) — rise velocity ∝ d²} ├── Treatment train: API separator → DAF → biological → tertiary} ├── Oil removal: 1,000 mg/L → <5 mg/L (99.5% reduction)} └── Sour water stripper: removes H₂S + NH₃ before wastewater treatment} └── Phase 10: The Margin Game
───
Air Conditioner Skyscraper
Oil Refinery — FirstPrincipleScroll — FirstPrincipleScroll