Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Ideal gas simulation

  1. Sep 30, 2012 #1
    Hi

    I built with Python a simulation of an ideal gas in 2D, treating the molecules as hard spheres with elastic collisions. I am trying to test the experimental values of P,T etc. in the simulation versus the theoretical values. however, I have two problems:

    1) when comparing the pressure in the simulation to the pressure predicted from P=NmVx^2/a^2 (when N in number of molecules, m is the mass of each molecule and a^2 is the area of the box) I consistently get approximately the right values, but they are higher by a factor of 1000. What can be the reason?

    2) I wonder how should I adjust the value of the gas constant R to the fact that in the simulation distances and velocities are measured with unites of pixels and pixels/iteration rather than by meters and meters/sec?

    Thanks in advance and sorry for my poor english
     
  2. jcsd
  3. Sep 30, 2012 #2
    An ideal gas is composed of point masses with no interaction (except gravity).

    In a 2D simulation the walls are 1D and therefore have no area but a length only.

    Just define the size of a pixel in meters and the length of an iteration step in seconds.
     
  4. Sep 30, 2012 #3
    Molecules of an ideal gas do interact through elastic collisions. They do not interact through electric attraction forces. according to Wikipedia: "the ideal gas model depends on the following assumptions...All collisions are elastic and all motion is frictionless (no energy loss in motion or collision)...There are no attractive or repulsive forces between the molecules or the surroundings".

    I did not say the walls have area, I said the box has area.

    Thank you for the second answer.
     
  5. Sep 30, 2012 #4

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    A factor of 1000 looks like some error in unit conversions - kg to g, m to mm or whatever.
     
  6. Sep 30, 2012 #5
    With the walls but not with each other. Points are simply to small for local interactions. By using elastic spheres instead of points you created a very simple real gas model.

    In a 2D simulation the area of the box is irrelevant for the pressure. It plays the same role as the volume in 3D.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Ideal gas simulation
  1. Ideal Gas simulator (Replies: 6)

  2. Work done by ideal gas (Replies: 5)

Loading...