stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 148

Day 148 of 365 · Advanced · Month 6: Atmosphere and control

Gas in the game: pressure, temperature, moles

Pressure, volume, temperature and amount of gas are linked by the gas law. With rgas the chip works out how much gas is in a tank and what heating does to it.

Lesson 15 min Week 22

What you learn today

  • Pressure, volume, temperature and moles
  • rgas
  • Why heating raises pressure

A full oxygen tank stands next to the furnace. An hour later the analyzer shows 20 % more pressure although nobody refilled it. No leak, no bug – just physics. If you control gases you need to know this relationship.

Four quantities

QuantityUnitLogicType
Pressure pkPaPressure
Volume VlitresVolume (pipe analyzer)
Temperature TkelvinTemperature
Amount nmolTotalMoles

A straight gas pipe holds 10 litres, a liquid pipe 20 litres. The pipe analyzer reports the volume of the whole pipe network it sits on – tanks included.

The gas law

All four are linked by one formula:

p · V = n · R · T

R is the gas constant, on the chip the constant rgas (≈ 8.314 J/(mol·K)). The units fit without conversion: kPa times litres gives joules. Solved for the amount:

mul n p v       # p * V
div n n rgas    # / R
div n n t       # / T

With that you can work out, for example, how many moles of oxygen are in a tank when you only know pressure, temperature and volume.

Why heating raises the pressure

In a closed tank V and n stay the same. Then the pressure is proportional to the temperature: double the kelvin, double the pressure. The new pressure is

p₂ = p₁ · T₂ / T₁

div factor tNew tOld
mul pNew p factor

From 20 °C (293.15 K) to 50 °C (323.15 K) the pressure therefore rises by a good 10 %. A tank already filled close to its limit can burst when it warms up.

Warning

The gas law always takes kelvin. With Celsius the formula is wrong, and at 0 °C you even divide by zero. A sensor delivers Temperature in kelvin anyway – convert to Celsius only for the display.

Note

Internally the game uses R = 8.3144. The constant rgas has a few more digits; the difference is below one in a hundred thousand and does not matter for any control loop.

Exercise

Task

A pipe analyzer “Tank” sits on the pipe network of a tank. Two LED displays are named “Mol” and “Druck50”.

  • “Mol” shows the amount of gas in the network: n = p · V / (rgas · T)
  • “Druck50” shows the pressure the tank would have at 50 °C (323.15 K)
  • If the analyzer is gone, both displays show −1

The readings are already there; the calculation and the output are missing.

Hints

Hint 1

Amount: mul n p v, then two div – by rgas and by t.

Hint 2

Pressure at 50 °C: first div pNew TARGET t, then multiply by p.

Hint 3

Without the analyzer t is NaN, so ok is 0. select n ok n -1 then sets −1.

Quiz

4 questions. You pass from 60 % – the server does the grading.

Complete the day

  • Passed the simulator exercise
  • Passed the quiz with at least 60 %

Without an account progress is saved in this browser only.

Report a mistake in this lesson

Please sign in to report. Sign in

Esc
↑ ↓ selectEnter open/ opens search anywhere