Skip to content

Instantly share code, notes, and snippets.

@dukelion
Created April 6, 2026 18:57
Show Gist options
  • Select an option

  • Save dukelion/2c821050cd26be74113f709b735524f1 to your computer and use it in GitHub Desktop.

Select an option

Save dukelion/2c821050cd26be74113f709b735524f1 to your computer and use it in GitHub Desktop.
COI recipes energy efficiency
# Refinery HSU Equations
This note tracks refinery-chain recipes in terms of `HSU`, short for `High Steam Unit`.
`1 HSU` is defined as the energy content of `1` unit of `Steam (high)`. Using the high-pressure turbine recipe:
- `4 Steam (high) -> 6000 kW for 10 s`
- so `4 HSU = 60000 kW*s`
- therefore `1 HSU = 15000 kW*s`
For electrical recipes, this note applies generator efficiency when converting electrical energy back into `HSU` cost:
- Simple mechanical generator efficiency: `2/3`
- Large mechanical generator efficiency: `5/6`
- Simple electrical cost: `kW*s / 10000`
- Large electrical cost: `kW*s / 18750`
The large-generator electrical cost assumes the large generator is fed by both high-pressure and low-pressure turbine stages, so each `HSU` contributes `15000 + 7500 = 22500 kW*s` of mechanical energy before applying `5/6` generator efficiency.
`Diesel` is set to `0.85 HSU` in this note. This is based on the truck fuel-use reference point: trucks use `1.1 diesel / 60` or `1.4 hydrogen / 60`. With `hydrogen = 2/3 HSU`, that implies `diesel = (1.4 / 1.1) * (2/3) = 28/33 ~= 0.85 HSU`. The note uses the rounded value `0.85 = 17/20 HSU` as a practical baseline.
Method:
- Assign an `HSU` value to each material we care about.
- Convert machine electricity use into `kW*s` with `machine_kW * power_multiplier * recipe_duration`.
- Convert electrical energy into `HSU` with generator efficiency applied.
- For power-using recipes, two net values are shown: `simple` for `2/3` efficiency and `large` for `5/6` efficiency.
- For each recipe, compute `total output HSU - total input HSU`.
- Positive net value means the recipe gains `HSU` under the current assumptions.
- Negative net value means the recipe loses `HSU` under the current assumptions.
- Materials explicitly treated as valueless in this note count as `0 HSU`.
Assumed values:
- Crude oil = `1/2 HSU`
- Coal = `8/5 HSU`
- Medium oil = `8/7 HSU`
- Heavy oil = `4/3 HSU`
- Light oil = `8/9 HSU`
- Naphtha = `8/9 HSU`
- Fuel gas = `2/3 HSU`
- Diesel = `17/20 HSU`
- Hydrogen = `2/3 HSU`
- Oxygen = `1/15 HSU` (simple) or `8/225 HSU` (large)
- Steam (high) = `1 HSU`
- Steam (super) = `5/2 HSU`
- Water / seawater / wastewater / exhaust / sour water / brine = `0 HSU`
Equations:
- Basic distillation to diesel: `20 crude oil + 2 coal -> 9 diesel | 20*(1/2) + 2*(8/5) -> 9*(17/20) | 66/5 -> 153/20 | -111/20 HSU`
- Water desalination (basic): `10 seawater + 1 coal -> 6 water + 4 brine | 1*(8/5) -> 0 | 8/5 -> 0 | -8/5 HSU`
- Crude oil refining (stage I): `20 crude oil + 2 steam(high) -> 16 medium oil + 4 heavy oil | 20*(1/2) + 2 -> 16*(8/7) + 4*(4/3) | 12 -> 496/21 | +244/21 HSU`
- Crude oil refining (stage II): `16 medium oil + 1 steam(high) -> 12 diesel + 10 light oil | 16*(8/7) + 1 -> 12*(17/20) + 10*(8/9) | 135/7 -> 859/45 | -62/315 HSU`
- Heavy distillate refining (stage III): `10 light oil + 1 steam(high) -> 8 naphtha + 4 fuel gas | 10*(8/9) + 1 -> 8*(8/9) + 4*(2/3) | 89/9 -> 88/9 | -1/9 HSU`
Electrolysis:
- Water electrolysis: `1 water + 300*4*30 kW*s -> 4 oxygen + 2 hydrogen | simple: 18/5 -> 8/5 = -2 HSU | large: 48/25 -> 332/225 = -4/9 HSU`
- Water electrolysis II: `1 water + 1100*4*7.5 kW*s -> 4 oxygen + 2 hydrogen | simple: 33/10 -> 8/5 = -17/10 HSU | large: 44/25 -> 332/225 = -64/225 HSU`
- Ammonia electrolysis: `2 ammonia + 300*10 kW*s -> 4 nitrogen + 2 hydrogen | simple: 3/10 -> 4/3 = +31/30 HSU | large: 4/25 -> 4/3 = +88/75 HSU`
- Ammonia electrolysis II: `8 ammonia + 1100*10 kW*s -> 16 nitrogen + 8 hydrogen | simple: 11/10 -> 16/3 = +127/30 HSU | large: 44/75 -> 16/3 = +356/75 HSU`
Cracking:
- Heavy oil cracking to diesel: `8 heavy oil + 3 hydrogen + 160*20 kW*s -> 12 diesel + 2 fuel gas | simple: 974/75 -> 173/15 = -109/75 HSU | large: 4814/375 -> 173/15 = -489/375 HSU`
- Heavy oil cracking to naphtha: `8 heavy oil + 3 hydrogen + 160*20 kW*s -> 12 naphtha + 2 fuel gas | simple: 958/75 -> 12 = -74/75 HSU | large: 4814/375 -> 12 = -314/375 HSU`
- Naphtha reforming to diesel: `8 naphtha + 3 hydrogen + 160*20 kW*s -> 8 diesel + 2 fuel gas | simple: 2122/225 -> 122/15 = -292/225 HSU | large: 31326/3375 -> 5490/675 = -3876/3375 HSU`
- Diesel reforming to naphtha: `8 diesel + 1 steam(high) + 160*20 kW*s -> 6 naphtha + 2 fuel gas | simple: 203/25 -> 20/3 = -109/75 HSU | large: 2989/375 -> 20/3 = -489/375 HSU`
- Fuel gas reforming to diesel: `12 fuel gas + 6 oxygen + 160*20 kW*s -> 8 diesel + 2 water | simple: 218/25 -> 34/5 = -48/25 HSU | large: 3144/375 -> 34/5 = -594/375 HSU`
- Naphtha reforming to gas: `12 naphtha + 1 steam(high) + 160*30 kW*s -> 12 fuel gas + 4 hydrogen | simple: 32/3 + 1 + 12/25 -> 32/3 = -37/25 HSU | large: 1491/125 -> 32/3 = -157/125 HSU`
Reformer:
- Fuel gas reforming to hydrogen: `12 fuel gas + 1 steam(high) + 400*30 kW*s -> 14 hydrogen + 12 carbon dioxide | simple: 51/5 -> 28/3 = -13/15 HSU | large: 241/25 -> 28/3 = -23/75 HSU`
- Super-pressure steam reforming to hydrogen: `4 water + 3 steam(super) + 400*15 kW*s -> 8 hydrogen + 8 oxygen + 3 steam(depleted) | simple: 81/10 -> 88/15 = -67/30 HSU | large: 391/50 -> 1264/225 = -991/450 HSU`
Products by Recipe Value:
- Medium oil:
`Crude oil refining (stage I): +11.62 HSU`
- Heavy oil:
`Crude oil refining (stage I): +11.62 HSU`
- Diesel:
`Crude oil refining (stage II): -0.20 HSU`
`Naphtha reforming to diesel: -1.30 / -1.15 HSU`
`Heavy oil cracking to diesel: -1.45 / -1.30 HSU`
`Fuel gas reforming to diesel: -1.92 / -1.58 HSU`
`Basic distillation to diesel: -5.55 HSU`
- Light oil:
`Crude oil refining (stage II): -0.20 HSU`
- Naphtha:
`Heavy distillate refining (stage III): -0.11 HSU`
`Heavy oil cracking to naphtha: -0.99 / -0.84 HSU`
`Diesel reforming to naphtha: -1.45 / -1.30 HSU`
- Fuel gas:
`Heavy distillate refining (stage III): -0.11 HSU`
`Heavy oil cracking to naphtha: -0.99 / -0.84 HSU`
`Naphtha reforming to diesel: -1.30 / -1.15 HSU`
`Naphtha reforming to gas: -1.48 / -1.26 HSU`
`Heavy oil cracking to diesel: -1.45 / -1.30 HSU`
`Diesel reforming to naphtha: -1.45 / -1.30 HSU`
- Hydrogen:
`Ammonia electrolysis II: +4.23 / +4.75 HSU`
`Ammonia electrolysis: +1.03 / +1.17 HSU`
`Fuel gas reforming to hydrogen: -0.87 / -0.31 HSU`
`Water electrolysis II: -1.70 / -0.28 HSU`
`Water electrolysis: -2.00 / -0.44 HSU`
`Naphtha reforming to gas: -1.48 / -1.26 HSU`
`Super-pressure steam reforming to hydrogen: -2.23 / -2.20 HSU`
- Oxygen:
`Water electrolysis II: -1.70 / -0.28 HSU`
`Water electrolysis: -2.00 / -0.44 HSU`
`Super-pressure steam reforming to hydrogen: -2.23 / -2.20 HSU`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment