Compressibility Factor Of Gases

In the general equation of the compressibility factor $Z$, we define $Z$ as
$$Z=\frac{pV}{nRT}$$
Here, what is $p$? Is it $p\_\text{real}$ or $p\_\text{ideal}$?
Also, what is $V$? $V\_\text{real}$ or $V\_\text{container}$?




Both quantities are of the real gas.


Note that for the ideal gas behaviour, the [compressibility factor](https://en.wikipedia.org/wiki/Compressibility_factor?wprov=sfla1) $$Z=\frac{V\_\text{real}}{V\_\text{ideal}}=\frac{pV\_\text{real}}{nRT}=1$$  

 for any combination of $p, V, T$.


But real gases, in contrary to the ideal gas, have nonzero volume of molecules and there are intermolecular interactions.


The volume of molecules increases $Z$, as it makes the pressure higher, because the collision frequency is higher.


The cohesive forces between molecules decreases $Z$. As molecule attraction, like hydrogen bonds or dipole interactions, decreases the effective number of molecules and therefore pressure.


This is reflected in the [van der Waals equation](https://en.wikipedia.org/wiki/Van_der_Waals_equation?wprov=sfla1) - probably the simplest state equation of real gases, for not too high pressure: 
$$\begin{align}
\left(p + \frac{an^2}{V^2}\right)\left(V - nb\right)&=nRT \\
\left(p + \frac{a}{V\_\mathrm m^2}\right)\left(V\_\mathrm m - b\right)&=RT
\end{align}$$


$$\begin{align}
Z &= \frac{p\cdot V\_\text{real}}{nRT} \\
Z&= \frac{p\cdot V\_\text{real}}{\left(p + \frac{an^2}{V\_\text{real}^2}\right)(V\_\text{real} - nb)} \\
Z&= \frac{1}{\left(1 + \frac{an^2}{p \cdot V\_\text{real}^2}\right)\left(1 - \frac{nb}{V\_\text{real}}\right)} \\
Z&= \frac{1}{\left(1 + \frac{a}{pV\_{\mathrm m,\text{real}}^2}\right)\left(1 - \frac{b}{V\_{\mathrm m,\text{real}}}\right)}
\end{align}$$


For $|x|\ll1, 1/(1+x)=1-x$


For not too far from ideal behaviour, we can apply the above approximation.


$$\begin{align}
Z&=\left(1 - \frac{an^2}{pV\_{\mathrm{real}}^2}\right)\left(1 + \frac{bn}{V\_{\mathrm{real}}}\right) \\
Z&=\left(1 - \frac{a}{pV\_{\mathrm m,\text{real}}^2}\right)\left(1 + \frac{b}{V\_{\mathrm m,\text{real}}}\right) \\
\end{align}$$


We can therefore also afford to neglect minor terms.


$$\begin{align}
Z&=1 - \frac{an^2}{pV\_{\mathrm{real}}^2}+ \frac{bn}{V\_{\mathrm{real}}}\\
Z&=1 - \frac{a}{pV\_{\mathrm m,\text{real}}^2}+ \frac{b}{V\_{\mathrm m,\text{real}}}\\
\end{align}$$


To address clarified scenario, as a the same amounts of the ideal and real gas
are under the same temperature and pressure:


$$V\_\text{ideal gas}=\frac{nRT}{p}$$
$$V\_\text{real gas}=Z \frac{nRT}{p}$$


There is need to perform iteration for probably the easiest way to get the result. 
With the $V\_{\rm{ideal gas}}\ $ as the first approximation. The other option is to solve the root of the cubic equation what we probably do not want to.


$$\begin{align}
V\_\text{real}&=Z(p, V\_\text{real})\frac{nRT}{p}\\
V\_\text{real}&=\frac{1}{\left(1 + \frac{an^2}{p \cdot V\_\text{real}^2}\right)\left(1 - \frac{nb}{V\_\text{real}}\right)} \frac{nRT}{p} \\
V\_\text{real}&=\left( 1 - \frac{an^2}{pV\_{\rm{real}}^2}+ \frac{bn}{V\_{\rm{real}}}\right) \frac{nRT}{p} \\
\end{align}$$


The van der Waals equation can also be expressed in terms of reduced
properties


$$\left( P\_r + \frac{3}{V\_\rm{r}^2}\right) \left( V\_{\rm r}-\frac{1}{3}\right) = \frac{8}{3}T\_\mathrm r$$


This yields a critical compressibility factor $3/8$.


The values of pressure, temperature and volume are divided by the
respective critical values of the given gas.


 4

Compressibility factor for a gas is defined as the ratio of the volume of real gas to the volume of ideal gas .
Thus 
$$ Z = \frac{V\_\text{real}}{V\_\text{ideal}} $$
Using the ideal gas equation
$$ PV\_\text{ideal} = nRT $$
$$ V\_\text{ideal} = \frac{nRT}{P} $$
So 
$$ Z = \frac{V\_\text{real}}{\frac{nRT}{P} } $$
$$ Z = \frac{PV\_\text{real}}{nRT} $$ 
Hence except $V\_\text{real}$ all other quantities are ideal.


 1