Air Pressure Simulation

Here’s some images of the beginning stages of an atmospheric physics program. It uses the ideal gas law to determine the flow of molecules from high pressure areas to low pressure areas. It still needs tweaking to get a less turbulent dispersion; currently the pressure swings are around 5 kPa which is quite a lot compared to how real air mixes on a calm day.

1500ºK - 11500ºK - 21500ºK - 31500ºK - 4

This begins with randomly assigned temperatures from 0 – 3000 ºK for each cell, then lets the pressure naturally disperse them. Each cell begins with the same amount of molecules (134 moles) and occupies 3 cubic meters.

275ºK -1275ºK -2275ºK -3275ºK -4275ºK -5275ºK -6275ºK -8275ºK -10

Here is another selection, with starting temperatures from  0-550 ºK.

The eventual goal of this physics engine is to get a more realistic physical model for games similar to Dwarf Fortress. It will expand to cover liquids, combustion, state changes in matter, etc. The model is based on cellular automata so each cell only needs to check its neighbors.

Author: Daniel X

Heretic priest of the Machine God. I enjoy crawling around in Jeff Bezo's spaceship, bringing technology to the people, and long walks outside of time and space.

3 thoughts on “Air Pressure Simulation”

  1. @Thomas

    I actually haven’t made much progress on this, but just last night I was revisiting using cellular automata for water levels.

    One of my long term goals is creating an open source Dwarf Fortress style simulation, but it’s on hiatus at the moment in lieu of other projects.

    If you know of any developers interested in collaborating on such a project please send them my way!


  2. I certainly have interest in such a project 🙂

    I’m looking at atmosphere simulation as part of a Dwarf-Fortress style game set on other planets; e.g. you dig out an area on the moon, shove an airlock on the front, install life support equipment and fill it with air. Or Venus, where you also need to pump out the high pressure corrosive atmosphere first.

    Introduce the concept of failure rates, asteroid impacts and weapons, and you get satisfying looking blowouts and some interesting implications for how a base would be designed; bulkheads, shelters, emergency shutters, etc.


Leave a Reply to Thomas Hurst Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: