How real gases differ from ideal gases, and when intermolecular attractions and gas molecule volume matter.

Because sometimes life isn't ideal

By now you've probably heard a lot about the ideal gas law, and you may have a sense of how to use the ideal gas equation to look at the relationships between pressure (P), volume (V), moles of gas (n), and temperature (T). But when do gases follow the ideal gas law and why? What if we want to study a gas that behaves in a “non-ideal” way? When we use the ideal gas law, we make a couple assumptions:
1, point, spaceWe can ignore the volume taken up by the imaginary ideal gas molecules
2, point, spaceThe gas molecules do not attract or repel each other
However, we know that in real life, gases are made up of atoms and molecules that actually take up some finite volume, and we also know that atoms and molecules interact with each other through intermolecular forces.

Compressibility: A measure of ideal behavior

One way we can look at how accurately the ideal gas law describes our system is by comparing the molar volume of our real gas, V, start subscript, m, end subscript, to the molar volume of an ideal gas at the same temperature and pressure. To be more specific, at some temperature we can take n moles of our gas and measure the volume it takes up at a given pressure (or measure the pressure for a known volume). We can also calculate the molar volume of the ideal gas at the same temperature and pressure, and then take the ratio of the two volumes.
Z, equals, start fraction, start fraction, V, divided by, n, end fraction, divided by, start fraction, R, T, divided by, P, end fraction, end fraction, equals, start fraction, P, V, divided by, n, R, T, end fraction
This ratio is called the compressibility or compression factor, Z. For a gas with ideal behavior, V, start subscript, m, end subscript of the gas is the same as V, start subscript, m, end subscript of an ideal gas so Z, equals, 1. It turns out that this is reasonably accurate for real gases under specific circumstances that also depend on the identity of the gas. Let’s look at the compressibility Z for a couple different gases.
Image from: UC Davis ChemWiki.
This graph shows the compression factor Z over a range of pressures at 273, space, K for nitrogen (N, start subscript, 2, end subscript), oxygen (O, start subscript, 2, end subscript), hydrogen (H, start subscript, 2, end subscript), and carbon dioxide (C, O, start subscript, 2, end subscript). For all of the real gases in this graph, you might notice that the shapes of the curves look a little different for each gas, and most of the curves only approximately resemble the ideal gas line at Z, equals, 1 over a limited pressure range. Also, for all the real gases Z is sometimes less than 1 at very low pressures, which tells us that the molar volume is less than that of an ideal gas. As you increase the pressure past a certain point that depends on the gas, Z gets increasingly larger than 1. That is, at high pressures the V, start subscript, m, end subscript of the gas is larger than V, start subscript, m, end subscript of the ideal gas, and V, start subscript, m, end subscript of the real gas increases with pressure. Why is that?
OK, maybe this was kind of a trick question. The answer depends on the pressure or pressure range you are interested in! At pressures around 1, space, b, a, r, all the gases are pretty close to ideal (keep in mind that standard pressure is 1, space, a, t, m or ~1, space, b, a, r, which is approximately atmospheric pressure unless you live on top of Mt. Everest or at the bottom of the ocean). At high pressures (up to ~50, space, b, a, r), hydrogen, oxygen and nitrogen look closer to ideal than carbon dioxide.

High pressures: When gas molecules take up too much space

At high pressures, the gas molecules get more crowded and the amount of empty space between the molecules is reduced. How might this affect V, start subscript, m, end subscript and Z? It helps to remember that the volume we use in the ideal gas equation is the empty volume that the gas molecules have to move around in. We usually assume that this is the same as the volume of the container when the gas molecules don’t take up much space. But what happens when this is not the case, such as at high pressures?
Initially the gas molecules move around to take up the entire volume of the container. Once you put all the gas molecules in one corner, you can see the total space in container minus the volume of the gas molecules.
For a given pressure, the real gas will end up taking up a greater volume than predicted by the ideal gas law since we also have to take into account the additional volume of the gas molecules themselves. This increases our molar volume relative to an ideal gas, which results in a value of Z that is greater than 1. The error in molar volume gets worse the more compressed the gas becomes, which is why the difference between Z for the real and ideal gas increases with pressure.
The volume of a single nitrogen molecule is ~6, point, 5x10, start superscript, minus, 23, end superscript, space, c, m, start superscript, 3, end superscript, or 39, point, 13, space, c, m, start superscript, 3, end superscript for a mole of nitrogen. If we have one mole of nitrogen gas in a 1, point, 00, space, L container at 298, space, K, the pressure is relatively high (~22, point, 8, space, b, a, r using the ideal gas law). At this pressure and volume, the nitrogen molecules take up about 4, percent of the volume of the flask.

Low temperatures and intermolecular Forces

To examine the effect of intermolecular forces, let’s look at the compressibility of a single kind of gas at different temperatures.
Image from: UC Davis ChemWiki.
For nitrogen, you can see that at T, equals, 300, space, K and 400, space, K with pressures below 200, space, b, a, r, the curve looks relatively similar to what you would expect for an ideal gas. As you lower the temperature to 200, space, K and 100, space, K, the curves look much less ideal. In particular, at low pressures we see that Z for real gases is noticeably less than 1 for T, equals, 200, space, K, and this effect is even more pronounced at 100, space, K. What’s going on at lower temperatures?
Imagine our gas molecules bouncing around in the container. The pressure we measure comes from the force of the gas molecules hitting the walls of the container. Attractive forces between the molecules will pull them a little closer together, which effectively slows the molecule down a little before it hits the container wall.
This results in a decrease in volume if the pressure is constant compared to what you would expect based on the ideal gas equation. The decreased volume gives a corresponding decrease in V, start subscript, m, end subscript compared to the ideal gas so Z, is less than, 1. The effect of intermolecular forces is much more prominent at low temperatures because the molecules have less kinetic energy to overcome the intermolecular attractions.

The van der Waals equation

We can use a number of different equations to model the behavior of real gases, but one of the simplest is the van der Waals (VdW) equation. The VdW equation basically incorporates the effect of gas molecule volume and intermolecular forces into the ideal gas equation.
open bracket, P, plus, start fraction, a, n, start superscript, 2, end superscript, divided by, V, start superscript, 2, end superscript, end fraction, close bracket, open bracket, V, minus, n, b, close bracket, equals, n, R, T
where:
P, equals measured pressure
V, equals volume of container
n, equals moles of gas
R, equals gas constant
T, equals temperature (in Kelvin)
Compared to the ideal gas law, the VdW equation includes a “correction” to the pressure term, start fraction, a, n, start superscript, 2, end superscript, divided by, V, start superscript, 2, end superscript, end fraction, which accounts for the measured pressure being lower due to attraction between gas molecules. The “correction” to the volume, n, b, subtracts out the volume of the gas molecules from the total volume of the container to get a more accurate measure of the empty space available for the gas molecules. a and b are measured constants for a specific gas (and they might have some slight temperature and pressure dependence).
This equation may look way more complicated than the ideal gas law, but they are actually very closely related. Note that when V is relatively large and n is relatively small (the low pressure situation), the van der Waals equation simplifies to the ideal gas equation.
At low temperatures and low pressure, the correction for volume is not as important as the one for pressure, so Z is less than 1. At high pressures, the correction for the volume of the molecules becomes more important so Z is greater than 1. At some range of intermediate pressure, the two corrections cancel out and the gas appears to follow the relationship given by the ideal gas equation.
Try deriving the formula for Z for a non-ideal gas by starting from the van der Waals equation in the cases when P is very high or the intermolecular forces are taken into account!
At high pressure, P is much greater than , so the equation for compressibility simplifies to Z, equals, 1, plus, start fraction, b, P, divided by, R, T, end fraction​. You can see that the "error" in Z, ​​, gets larger as P increases.
At low temperature and pressure, we can ignore the volume correction and the equation simplifies to Z, equals, 1, minus, start fraction, a, n, divided by, V, R, T, end fraction. Here you can see that lowering T increases the magnitude of the ​​ term.

Summary

In a nutshell, the ideal gas equation works well when intermolecular attractions between gas molecules are negligible and the gas molecules themselves do not occupy a significant part of the whole volume. This is usually true when the pressure is low (around 1, space, b, a, r) and the temperature is high. In other situations such as high pressures and/or low temperatures, the ideal gas law might give answers that are different from what we observe experimentally. In these cases, you can use the van der Waals (or a similar) equation to take into account the fact that gases do not always behave as ideal gases.

Attributions:

This article was adapted from the following articles:
  1. "Non-Ideal Gas Behavior" from OpenStax Chemistry, CC-BY-NC-SA 4.0
  2. "Real Gases" from UC Davis ChemWiki, CC-BY-NC-SA 3.0
The modified article is licensed under a CC-BY-NC-SA 4.0 license.

Additional References:

Kotz, J. C., Treichel, P. M., Townsend, J. R., and Treichel, D. A. (2015). Nonideal Behavior of Gases. In Chemistry and Chemical Reactivity, Instructor's Edition (9th ed., pp. 399-401). Stamford, CT: Cengage Learning.