For dilute thermodynamic conditions, the ideal-gas equation of state (EoS) provides sufficiently accurate results in modelling the fluid thermodynamics. This occurs in general for low values of reduced pressure and high values of reduced temperature, where the term reduced refers to the ratio of a certain thermodynamic quantity and its critical value. For some fluids such as air, the assumption of considering ideal conditions is perfectly reasonable and it is widely used.
On the other hand, when thermodynamic conditions approach condensation and the critical point or when high pressures are involved, real-gas models are needed in order to capture the real fluid behavior. In these conditions, in fact, intermolecular forces and compressibility effects come into play.
A measure of the fluid non-ideality is given by the compressibility factor , defined as
where
*  is the pressure [Pa];
*  is the specific volume [m/kg];
*  is the specific gas constant [J/(kg K)], namely the universal gas constant divided by the fluid's molecular mass;
*  is the absolute temperature [K].
The compressibility factor is a dimensionless quantity which is equal to 1 for ideal gases and deviates from unity for increasing levels of non-ideality.
Several non-ideal models exist, from the simplest cubic equations of state (such as the Van der Waals and the Peng-Robinson models) up to complex multi-parameter ones, including the Span-Wagner equation of state.
State-of-the-art equations of state are easily accessible through thermodynamic libraries, such as FluidProp or the open-source software CoolProp.