Animation of Partial Pressure of Gases
This animation shows the evolution from atomic collisions of the partial pressure results associated with the perfect gas law. Importantly it also shows how to extend the usual three dimensional result to two and one dimension.
The total pressure due to a mixture of gases in a container is given by:
(1)
where P is the pressure (N m-2), V is the volume (m3) N is the total number of atoms in the volume, k is Boltzmann's constant, and T is the absolute temperature in degrees Kelvin. The partial pressure law is entirely similar to equation except that it expresses the pressure due to each atomic type, m, in the container.
(2)
where Pm is the pressure due to the mth atomic type and Nm is the total number of atoms of the mth type in the container. In equations 1 and 2 it is assumed that atom-atom collisions have caused the temperatures (average energies) of all the atoms to become equal. In this animation, we will start with either all the atoms of a given type with either random or equal energies. The energy distributions of the atoms will, after a time, become the normal Boltzmann exponential where the exponential coefficient is the average energy.
Van der Waals recognized that in denser gases the total volume of the N atoms could become a substantial fraction of the total volume of the container and this fraction could modify equation 1 causing the pressure to have a more complicated dependence on N, atomic radius and volume. The modification is especially important when the gas density approaches that for a phase transition to a liquid. For the animation presented here we will assume that the gas is rarified enough that the modifications presented in the above link are not needed.
The perfect gas law presented in equation 1 is derived in the Appendix A for 3, 2, and 1 dimensional gases.
For completeness, since the perfect gas laws depend on energy equi-partition, Appendix B discusses how the energy distribution is computed from hard sphere collision kinetics and Appendix C discusses the hard sphere collision kinetics themselves.
Figure 1: Showing results for 3D gas with 500 red
atoms and 400 blue atoms. The estimated
pressures are from and Appendix A. The actual pressures Vs time are computed
from the momentum transferred to the walls of the container. The other curves are the energy distributions. The difference between estimated and actual
is due to the rather small number of atoms in the samples.
Figure 2: Same as Figure 1 except for being a 1D gas
with 200 red atoms and 250 blue atoms.
The results are for 20 Sub-Domains.
The pressure may be gauged by the force that the walls of the container has to apply in order to keep atoms that hit the wall inside the container. For this animation it will be assumed that the wall receives no energy from the atoms that collide with it. To keep it simple, we will consider the container to be a box of width X, height Y and depth Z. The amount of momentum change, dp, needed to reverse the motion of an atom colliding with the wall at x=X is
where m is the mass of the atom and vx is the x component of its velocity. If dn atoms hit an area dA of the X wall in time dt then the force per unit area (pressure) needed to reverse the x component of the momenta of all of them is:
(3)
where <vx> is the average x component of the velocity for the n particles. Equation 3 has units of force per unit area and is the equation used by the animation program to compute the pressure when considering a 3 dimensional gas. The total area of our container is just
The program sums up all the collision momentum changes for all 6 walls during a single time interval and computes equation 3.
(4)
For a two dimensional gas the depth can be considered to have gone toward infinity so that the areas of the Z walls are negligible compared to the X and Y walls. Then equation 4 becomes:
(5)
where the definition of the perimeter, 2(X+Y), has been used and it should be remembered that the sum over vz will be much smaller than the sums over vx and vy.
Also, for a 2 dimensional gas we need to determine the analog of the volume that was used in equation. Obviously, letting Z>> X,Y makes no difference in the volume:
.
However, to show that the results in 2D are consistent with equation 1, we should look at the ratio of P2D to P from equation 1. When this ratio is taken it cancels the Z dependence:
(6)
and therefore the new wall area for the 2D case becomes the perimeter, 2(X+Y), and the new volume in equation 1 becomes the area, XY. The units for 2 dimensional pressure are therefore force per unit length.
We will assume that the motion is in the x direction and, similar to the 2D case, let Y and Z be very large compared to X so that the areas XZ and XY are much smaller than YZ. Then the equations for the 2D case can be converted to following form:
(7)
The ratio of P1D to the P in equation 1 becomes:
(8)
so that the new effective volume for equation 1 becomes X and the new effective area becomes unity. The units for 1 dimensional pressure are therefore simply force.
But the force exerted by a particular atomic type on the end of the one dimensional domain depends on which type of atom happens to be closest to the particular end. So, in order to reduce statistical fluctuations of the partial pressures, we must separate the domain into a number Ms of equal sub-domains and compute the force at the ends of each. Since the average number of atoms in each sub-domain is reduced by the factor 1/Ms and the length of each sub-domain is also reduced by the factor 1/Ms, this division doesn't affect PT in equation 1. However, the total forces on all the ends that result from equation 7 must be reduced by the factor 1/Ms since there are Ms more ends being impacted. Then equation 8 becomes:
(7a)
We want to
be able to compare the numerically computed kinetic pressure results in the
preceding section with the expected results from an analog of equation 1 which
uses the average translational kinetic energy of the particles in place of a
factor of kT, the thermal energy. For that reason, here I derive the analogs of
equation 1 in 3, 2, and 1 dimension.
The time that elapses between a single atom's collisions on a single x=0 or x=X wall is
The momentum imparted by a single collision of an atom with the x=X wall is
and therefore the force due to a single atom imparted to the wall is
However, since the energy is divided into 3 equal orthogonal (x,y,z) components we can now derive equation 1. The total average energy of the atom is
so that Fx becomes:
and then the pressure on the x=X wall becomes
Boltzmann's law states that each degree of freedom (e.g. Ex) carries kT/2 thermal energy.
so that finally we can write PX in terms of the temperature and volume:
In the 2D case, the main change from the 3D case is that now the energy of a single atom is:
However, since there are only 2 degrees of freedom we have that:
and therefore the computed pressure is still the same:
where A is the area of the 2D domain and becomes the effective volume.
For the 1D case, there is a big difference because the only atoms that have access to the ends of the 1D domain are the 2 that are closest to the ends. Since the average spacing of atoms is X/N, the single end collision time for one of these atoms is therefore reduced to
The force that a single atom exerts on its adjacent wall is
For one dimension, the pressure is equal to the force and kT=1/2(m<vx2>
which is really the same as equation 1 except for the factor 2 and the fact that now the effective volume is X.
The program uses the results for velocity changes that are given in the next section to compute the kinetic energies of all of the atoms at each time increment. These energies are used to compute a bin number, b
where Emax
is several times larger than the average energy of all the atoms and nbins is the number of energy bins that we use.
When an atom has bin number b, an integer array component, iEb, is incremented by an the integer 1. After all of the atoms have been polled, iE contains the distribution of number of atoms Vs atom energy, N(E). But, since we use 80 bins and we are limited to only about 1200 atoms, that would result, if N(E) is constant, in an average bin population of 15. The variance of 15 is about 4 and this would result in very erratic N(E). What we really want to know is the relative average occupancy of the energy bins. To obtain the final relative occupancy of the bins, it is acceptable to keep incrementing iEb after each time interval. If we do this for a very large number of time increments, the initial transient changes of N(E) will be "averaged out". It is equivalent to taking many "snapshots" of the atomic energy distribution and averaging the results for each bin. Then what is plotted as a histogram is
where t is the snapshot number and T is much greater than one.
The animation makes separate histograms for red and blue atoms. In addition, a least squares fit of an exponential function (the Boltzmann distribution) to the data in the histogram is made. The relative occupancy number (RON) equation is:
where <E> is the average energy of the entire atom ensemble just as expected for a Boltzmann distribution. The animation shows beyond doubt that the RON equation has the same form and constants for red and blue atoms regardless of their masses, numbers and initial energies.
Figure 1: Diagram of the animation after evolution was reasonably complete with an average energy <E>=3.0. Note that the green and purple exponential plots are a good fit to the red and blue atom numbers per bin histogram with correlation coefficients of 1.0. Also note that the exponential coefficients were very close to -1/3.0 as expected for a Boltzmann distribution.
Here we will consider spherical atoms which have the different masses, m1 and m2, and diameters, D1 and D2. The centers of the spheres will be labeled (x1,y1,z1) and (x2,y2,z2). Upon collision, the momentum transferred between the spheres will always be along the unit vector between their centers:
(2)
where
is the distance between centers. Since the animation is illustrated in only 2 dimensions, the collision analysis will assume a containing box that is large in the x and y dimensions but very thin in the z dimension. The following vector mathematics is correct for either 2 or three dimensions.
The expression for the final momenta in terms of the initial momenta is:
(3)
where the apostrophe on the left side of the equations indicates the final velocities. We know that the energies are conserved so
(4)
The directions of the change in momenta are along the vector of centers, u, and the values of the changes of momenta must be equal and opposite.
(5)
where M has units of mass and is still to be determined. Using equation 5 in equation 3:
(6)
Now we can use equation 6 in equation 4 to solve for the value of Mdv.
(7)
where the large dot stands for the dot product and equation 7 simplifies to:
(8)
We can now make the identification:
(9)
where M is known as the "reduced mass".
Equations 6 and 8 are a complete solution for the final momenta. The final velocities are computed by dividing both sides of equations 6 by their respective masses:
(10)
Suppose m2>m1. Then we see that the magnitude of the speed
added to molecule 1 will be larger than the magnitude of the speed removed from molecule
2. We can easily see from equation 7,
even though the averages of the dot products are zero, that, on average, the collision
results in an increased kinetic energy for atom 1 and a decreased kinetic
energy for molecule 2 because of the mass term in the denominators.
After a collision with initial energies E10 and E20
we obtain the following results:
(11)
When the above result is averaged over all angles between u and vi that actually lead to a collision i.e. u.(v2-v1)<0 we obtain:
(12)
(13)
When m1=m2=m so that M=m the results for average E, <E> , are easily seen from equations 12 and 13 to be:
(14)
With a little more difficulty the results for the variances of E, <DE>, are given by the following equations:
(15)
So, what really happens when the masses are equal, is that the energies redistribute themselves into a gaussian-like pattern with the gaussian width greater when the energy differences are greater. Of course, the minimum outcome for any energy is always zero, so the distribution tends to become biased toward its E=0 end.
If we start with mono-energetic atoms, E0, so that Etotal=2E0, then the first variance will always be 0.250E0. A fraction of these scattered atoms will have energy 2E0 and an exactly equal fraction will have zero energy. The next scattering, when with atoms with energies E0, can result in energies from zero energy up to 3E0. When the next scattering is between 2 atoms that have energy of 2E0 the final energy can be as large as 4E0 but that is a very unlikely event. Of course, since neither is moving, atoms with zero energy don't scatter with other atoms of zero energy so these latter remain at zero energy. In fact the number of scatterings per second depends on the energy of the atoms, so this makes all the lower energy atoms less likely to scatter with similar low energy atoms.
We could write the following approximate differential equation for the rate of scattering of atoms
where n is the atom density, vr is some average relative speed, and s is the collision cross section. Thus the rate of change of energies via scattering depends on the sum of the velocities of the two atoms involved. This is one of the mechanisms that I think would cancel out the usual tendency for the atoms to form a symmetric gaussian distribution centered at the average energy. The other mechanism is that, while any energy higher than the average energy is possible, the minimum energy is always zero so a lot of atoms tend to accumulate near the zero end of the number Vs energy distribution.
We can also say that there are few high energy atoms because they scatter quite often so that they usually get their energies degraded by scattering with lower energy atoms and become "thermalized".