phetsims / gas-properties

"Gas Properties" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 6 forks source link

Possible for an open container's lid to blow #271

Closed Nancy-Salpepi closed 5 months ago

Nancy-Salpepi commented 5 months ago

Test device MacBook Air M1 chip

Operating System 14.5

Browser Safari 17.5

Problem description On the first 3 screens, it is possible to blow a lid that is already opened. This behavior also happens in published.

From @arouinfar on slack:

I know why it’s happening — the pressure calculation doesn’t know about the lid, it just uses the ideal gas law. Once particles start escaping, the pressure will go down. Right now we trigger the explosion when the pressure gauge reaches its max, but I wonder if we should add an additional check to see if the lid is open or not. It doesn’t make sense to blow an open lid.

Steps to reproduce Energy Screen:

  1. Open the lid completely
  2. Set ignition temperature to 900K
  3. Rapidly start adding Heavy Particles until lid blows

Ideal Screen:

  1. Decrease the container volume to minimum
  2. Press pause
  3. Open lid completely
  4. Add 900 heavy particles
  5. Press Play

Visuals

https://github.com/phetsims/gas-properties/assets/87318828/d5a06308-90d9-404b-93f7-1915b3417632

https://github.com/phetsims/gas-properties/assets/87318828/84364db2-3d3a-441e-bc55-9995bdaaae76

pixelzoom commented 5 months ago

@Nancy-Salpepi and I collaborated on this. We decided that if the opening in the top of the container is < 1500 pm, then the lid should blow off. For openings >= 1500 pm, it feels like the opening is large enough for particles to escape fast enough that the structural integrity of the container is not compromised, and the pressure comes down at a reasonable rate. We tested with a variety of container widths, and this threshold felt good. Implemented in https://github.com/phetsims/gas-properties/commit/a690e505c743c4de2fc07c7099e8720006c00dc7.

Back to @Nancy-Salpepi for review, close if OK.

Nancy-Salpepi commented 5 months ago

Looks great! Thanks @pixelzoom.

Closing.