Jump to content

Gases don't diffuse properly


HenryBlatbugIII
  • Pending

There have been comments on the forums about gases not diffusing properly.  In order to test this, I used the debug tools to create multiple types of gas and let them combine.  The gases in the picture are, from top to bottom, Hydrogen, Helium, Oxygen, Chlorine, and CO2.  These are the problems that I notice:

  • Diffusion is far too slow.  Even after nearly a full cycle of waiting for the gases to reach equilibrium, there's still a factor of 1.5 difference in pressure between the left and right sides of this room, increasing to a factor of 3.5 in the CO2 layer.
  • Pressures do not equalize between gases.  All gases are still at approximately the same density they were created at (1kg/tile, within a factor of 2).  At equal pressure, the Chlorine should be 35 times as dense as the Hydrogen.
  • Densities are incorrect.  Using the game's assumption that gases will stratify rather than mix, the densest gases should be at the bottom.  Chlorine gas (mass ~71) should therefore be below CO2. (mass ~44).
  • Low-pressure boundaries.  Most tiles that form a boundary with another gas have a much lower pressure than the rest of that layer, by a factor of 5 or more.

gas_column.jpg


Steps to Reproduce
Create one large room with multiple types of gas. Observe them while they stratify.



User Feedback


Some updates from further experimentation:

  • The diffusion does go at a reasonable speed if there's a sufficient pressure difference.  For example, the boundary between vacuum and oxygen moves at a reasonable rate as they combine, but the slowness occurs as the low-pressure oxygen only gains a few mg per volume per timestep.
  • On equalizing pressure: it looks like the game is trying to equalize the pressure between gases, but instead it's equalizing density.  Presumably it will eventually be fixed by giving each gas a correct molecular mass and equalizing (density * temperature / molecular mass)
  • On that note, perhaps chlorine is floating above CO2 because it's programmed as Cl instead of Cl2.  In the gases' information boxes, oxygen and carbon dioxide are correctly labeled as O2 and CO2, but hydrogen and chlorine are incorrectly labeled H and Cl instead of H2 and Cl2.

Share this comment


Link to comment
Share on other sites

I decided to test the right bias of CO2 when mixed with oxygen after the release notes for one of the development builds stated "Gas displacement should no longer have a directional bias".  I honestly have no clue what was actually fixed, but the tendency of heavier gasses to settle to the right was not it.  I made two identically sized thermally insulated long rooms and placed CO2 and Oxygen on each side using the debug tools with vacuum in between (this was done while paused, the image shows a few seconds afterwards, where some mixing had occurred rapidly.)

start.thumb.png.0ae70641cba69f335bd774b2a7288e96.png

After two cycles the CO2 in the bottom room had switched place to the right side, hugging the wall.

cy2.thumb.png.dc9dff5a967a321a36339ec0b9876ae3.png

Share this comment


Link to comment
Share on other sites

2 hours ago, Hornwitser said:

I decided to test the right bias of CO2 when mixed with oxygen after the release notes for one of the development builds stated "Gas displacement should no longer have a directional bias".  I honestly have no clue what was actually fixed, but the tendency of heavier gasses to settle to the right was not it.  I made two identically sized thermally insulated long rooms and placed CO2 and Oxygen on each side using the debug tools with vacuum in between (this was done while paused, the image shows a few seconds afterwards, where some mixing had occurred rapidly.)

start.thumb.png.0ae70641cba69f335bd774b2a7288e96.png

After two cycles the CO2 in the bottom room had switched place to the right side, hugging the wall.

cy2.thumb.png.dc9dff5a967a321a36339ec0b9876ae3.png

I think it is much more faster to calculate the gases this way, you don't want to use your processor just calculating the gases. Maybe they will solve this later with a bunch of other optimalization (pre-release).

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...