FERRETGame engine over Babylon.js
Ferret

Pneumatics

Skill ferret-physics-pneumatics · download all skills · SKILL.md

When to use#

Train air brakes, a tyre and a pump, a pneumatic door, an air gun, a diving set with a regulator, a balloon filled from tanks, a soda bottle.

The model#

Nodes are closed volumes of a gas mixture (moles per species, internal energy). Links move moles: subsonic or choked from the isentropic law (gasMassFlow), carrying enthalpy; walls exchange heat. Cylinders have gas chambers and a moving mass.

Steps#

  1. Add the capability pneumatics() and a level block physics.pneumatics (or build a PneumaticCircuit directly).
  2. Tanks with volume, pressure, mix, and a wall if heat should leave; air is the atmosphere.
  3. Links: orifice/link with cdA (or pipe), check, regulator, relief, compressor; cylinder with vented: true for an air spring.
  4. Drive from programs with (gas-valve …), (compressor …), (regulator …), read with (gas-pressure …).
  5. For a bottle, liquid(node, { liquidVolume, henry }) (constants in EXAMPLE_LIQUIDS.water.henry, or gases: ['CO2'] for the aqueous set's table, or vessel to share the dissolved gas with a chemistry vessel).

Check afterwards#

A blow-down ends at the atmosphere; a regulator holds its set pressure while the supply is above it; a fast fill warms and a slow one with a wall does not; inventory(species) is constant.

What usually goes wrong#

  • A compressor stops: the tank reached its maxPressure.
  • A regulator never opens: its set pressure is below the downstream pressure.
  • A cylinder rod side missing: use vented: true or give the .rod chamber a link.
  • Gas names are case sensitive (CO2, N2); an unknown one is refused with the list.

Files#