The gas constant (represented by the letter R), also known as the ideal gas constant, is a function of the pressure (P), volume (V), temperature (T), and moles of a gas (n) in a stoichiometric equation. The equation PV = nRT is known as the ideal gas law. The value of R can be found by rearranging the equation to read R = (PV) / (nT). In other words, the gas constant is the pressure of the gas multiplied by its volume, divided by the number of moles of the gas multiplied by its temperature in Kelvins.
Ideal gases are hypothetical — they strictly obey all simple gas laws and have a molar volume of 22.4141 liters at standard temperature and pressure (STP), which is 273 Kelvin, 1 atmosphere. At STP, however, most gases behave like ideal gases, so the value of R is generally 0.0821 L atm / mol K or 8.3145 J / mol K. For instance, the ideal gas law and the gas constant can be used to find the pressure of 0.508 moles of oxygen in a 15 liter container at 303 Kelvin. The volume, temperature, and number of moles are known.
P = (nRT) / V = (0.508 mol x 0.0821 L atm x 303 K) / 15.0 L mol K = 0.842 atm
Things change when a gas is at a low temperature or under high pressure. Under these conditions, gas molecules are moving closer together and more slowly, so intermolecular forces, called van der Waals, cause the measured pressure to be lower than expected. When the molecules are closer together, the volume of the actual molecules also becomes a higher fraction of the total volume of the gas.
To compensate for the behavior of real gases, the van der Waals equation comes into play. The expression (n2a) / V2 compensates for the intermolecular forces of attraction, and the expression nb compensates for the volume of gas molecules. Together, these terms make up the van der Waals equation:
[P + (n2a) / V2] x (V-nb) = nRT
The expressions n2a and nb are called van der Waals constants, and must be determined experimentally. The van der Waals equation is only necessary when the gas is at a high temperature or low pressure. If the gas is at or above room temperature and at a pressure less than a few atmospheres, the ideal gas law would apply.