The air in your base is almost never a single gas. It is a mixture, and every gas in it has its own role: one keeps you alive, one burns, one poisons you, one just fills the room. This article shows how to calculate with mixtures and how to make breathing air on purpose. The basics of pressure and the gas law are in Atmosphere and pressure.
The main gases and their roles
| Gas | Role in the game | Heat capacity J/(mol·K) |
|---|---|---|
| Oxygen | breathing gas, oxidiser | 21.1 |
| Nitrogen | neutral filler gas | 20.6 |
| Carbon Dioxide | not toxic, not flammable | 28.2 |
| Methane (Volatiles) | fuel, toxic | 20.4 |
| Hydrogen | fuel | 20.4 |
| Pollutant | toxic | 24.8 |
| Nitrous Oxide | oxidiser | 37.2 |
| Steam | water vapour | 72 |
Toxic in the game are pollutant, volatiles, hydrazine, silanol and hydrochloric acid. Carbon dioxide is not among them – it only becomes dangerous when it displaces oxygen.
Partial pressure: the value that counts
In a mixture every gas contributes its share of the pressure. The partial pressure of a gas is its fraction times the total pressure:
- p(gas) = fraction × total pressure
For you as a player, partial pressures decide almost everything:
- Breathing: breathing efficiency is the oxygen partial pressure divided by 16 kPa, clamped to 0 to 1.5. From 16 kPa of oxygen you breathe at full efficiency.
- Poison: from 0.5 kPa partial pressure of a toxic gas you get a warning, from 1 kPa damage.
- Total pressure: for breathing air 20 kPa counts as the lower and 607.95 kPa as the upper limit.
An example: normal breathing air with 22 % oxygen at 101 kPa has 22 kPa of oxygen – enough. The same mixture at 60 kPa has only 13.2 kPa, about 83 % breathing efficiency. The other way round, at 50 kPa total pressure 32 % oxygen is already enough for full breathing.
The gas sensor gives fractions as a number between 0 and 1 (RatioOxygen 0.22 means 22 %). For the partial pressure you multiply it by Pressure.
Planning breathing air
First work out the total amount. A room of four cells (32,000 L) at normal pressure and 20 °C needs:
- n = 101.325 · 32,000 / (8.3144 · 293.15) ≈ 1,330 mol
With 22 % oxygen that is about 293 mol of oxygen and 1,037 mol of nitrogen.
Where the gases can come from:
- Ice (Oxite) releases 22.5 mol of oxygen and 2.5 mol of nitrogen when melted. So 13 pieces deliver the 293 mol of oxygen.
- Ice (Nitrice) gives 22.5 mol of nitrogen, but also 2.5 mol of nitrous oxide. Nitrous oxide is an oxidiser; filter it out before the gas goes into the room.
- A piece of water ice brings 5 mol of nitrogen along with its 20 mol of water.
- You pull single gases from mixtures with a filtration unit and the matching filters, for example Filter (Oxygen) or Filter (Nitrogen).
In the game a mixture burns as soon as fuel and oxidiser are present with at least 0.00001 mol each and there is a spark. The share of nitrogen or carbon dioxide plays no role. Only a room without fuel is safe.
The gas mixer
The Gas Mixer joins two gas streams into one. Setting from 0 to 100 is the share of Input in percent; Input2 supplies the rest – at 100 only Input passes, at 0 only Input2.
The game code works in moles: each tick the mixer takes from each input the amount that its share of 200 kPa in 10 litres corresponds to at the temperature of that input. Three things follow:
- Input pressure does not matter for the ratio. You do not need pressure regulators in front of the inputs for that.
- Temperature does. With equally warm inputs,
Settingis exactly the mole fraction. If one input is colder, it delivers more moles:Setting22 with oxygen at 293.15 K and nitrogen at 273.15 K gives (22 / 293.15) / (22 / 293.15 + 78 / 273.15) ≈ 20.8 % oxygen. - If one input runs dry, the mixer stops instead of delivering a wrong mix.
It does not regulate the pressure at its output – it even keeps pushing against higher pressure, at 20 °C at least about 0.82 mol per tick. So switch it off with IC10 as soon as a Pipe Analyzer at the output reports the target pressure. More details are on the device page.
Without a mixer: two vents and a chip
Often it is simpler to feed oxygen and nitrogen into the room through two separate active vents and regulate the partial pressure with a chip. The program below keeps oxygen between 19 and 22 kPa and tops up nitrogen until the room reaches 100 kPa. Above 105 kPa it switches both vents off.
# Keep breathing air: O2 partial pressure and total pressure
define SENSOR -1252983604 # Gas Sensor (StructureGasSensor)
define VENT -1129453144 # Active Vent (StructureActiveVent)
define NSENSOR HASH("Living Sensor")
define NO2 HASH("Supply O2") # vent on the oxygen network
define NN2 HASH("Supply N2") # vent on the nitrogen network
define O2MIN 19 # kPa O2, top up below
define O2MAX 22 # kPa O2, stop above
define PMIN 95 # kPa total, add N2 below
define PTARGET 100 # kPa total, target for N2
define PMAX 105 # kPa total, absolute upper limit
alias pressure r0
alias fraction r1
alias po2 r2
alias o2on r3
alias n2on r4
alias tmp r5
sbn VENT NO2 Mode 0 # 0 = Outward, resets target pressures
sbn VENT NN2 Mode 0
yield # the mode only applies after the tick
sbn VENT NO2 PressureExternal PMAX
sbn VENT NN2 PressureExternal PMAX
start:
yield
lbn pressure SENSOR NSENSOR Pressure 0
bnan pressure start # no sensor with this name
lbn fraction SENSOR NSENSOR RatioOxygen 0
mul po2 fraction pressure # partial pressure = fraction * total
# --- 1. Oxygen with hysteresis ---
slt tmp po2 O2MIN
select o2on tmp 1 o2on
sgt tmp po2 O2MAX
select o2on tmp 0 o2on
# --- 2. Nitrogen with hysteresis ---
slt tmp pressure PMIN
select n2on tmp 1 n2on
sgt tmp pressure PTARGET
select n2on tmp 0 n2on
select n2on o2on 0 n2on # no N2 while O2 is running
# --- 3. Upper limit ---
sgt tmp pressure PMAX
select o2on tmp 0 o2on
select n2on tmp 0 n2on
sbn VENT NO2 On o2on
sbn VENT NN2 On n2on
j start
How to read it:
- The lines before
start:run only once. They set both vents to Outward and limit their target pressure. WriteModefirst, then ayield, then the pressure: on the active vent, setting the mode overwrites both target pressures, and according to the game code the game only carries out that change after the chip's tick. A pressure written in the same tick right afterModewould be gone again. multurns fraction and total pressure into the oxygen partial pressure.- Each pair of
selectlines forms a hysteresis so the vents do not flutter every tick. More in the academy: hysteresis.
If the total pressure stays above 105 kPa for good, something else has to take gas away, for example a filtration unit for carbon dioxide.
Temperature when mixing
The game stores the heat of a gas as energy: heat capacity × amount × temperature. When gases mix, the energies add up. The mixed temperature is therefore a weighted average:
- T = (n₁ · c₁ · T₁ + n₂ · c₂ · T₂) / (n₁ · c₁ + n₂ · c₂)
An example: 100 mol of oxygen at 273 K meet 300 mol of nitrogen at 303 K.
- T = (100 · 21.1 · 273 + 300 · 20.6 · 303) / (100 · 21.1 + 300 · 20.6) ≈ 295.4 K
Gases with a high heat capacity pull the mixed temperature towards themselves. Steam at 72 J/(mol·K) weighs more than three times as much as nitrogen.
Where next
- Filtration: separating gases, changing filters, getting rid of waste gases – separating gases and getting rid of waste gases
- Pumps, valves and pressure regulators: which part for what – regulators and valves for the supply
- Electrolysis and water: winning oxygen and hydrogen – winning oxygen from water
- All substance values and phase diagrams: Gases, calculator: Gas calculator
- IC10 basics: IC10 academy