During a discussion on thermodynamics of ideal and real gases. A colleague, who is actually my prof, recently, claimed that during compression, work done on a van der Waals gas is lower due to intermolecular attractions, that the gas molecules are attracting each other, overall being attracted towards the 'inward' direction making it easier to do work on the gas. In other words, since the molecules attract each other, it is easier to compress the gas, or for compression (atleast) $W_{\text{vdW}} < W_{\text{prefect}}$. I had three problems with this.
The 3 Problems
- No matter what the gas, or any material is, as long as it follows the same curve on the $P$—$V$ graph, the work, vis (negative of) the area under the curve, would remain the same. I am quite sure about this, but could someone verify?
Edit: Some comments have resolved this problem.
If we consider the frictional nature of real gases, in general, to carry out any process, more work should be done on a system of real gases for any process.
Even if the system is neither frictional nor following the same curve and the process, considering the external influences used to bring about the changes decides the work, there should be a difference in the work done on more compressible and less compressible gases (I am talking about the compressibility factor here).
The formula for reversible work done on a perfect gas undergoing an isothermal process is going from initial to final volume $v_1$ and $v_2$, repectively, is given by: $$\left(W_\text{perfect}\right)_T = -nRt\ln(\dfrac{v_2}{v_1})$$
The formula for reversible work done on a van der Waals gas undergoing an isothermal process is going from initial to final volume $v_1$ and $v_2$, repectively, is given by: $$\left(W_{\text{vdW}}\right)_T = -nRt\ln{\dfrac{v_2-nb}{v_1-nb}} - an^2\left(\dfrac{1}{v_2}-\dfrac{1}{v_1}\right)$$
My approach
Now, my first thought was to calculate $\left(W_{\text{perfect}}\right)_T-\left(W_{\text{vdW}}\right)_T$ and show that it is not positive for all values of $n$, $T$, $v_1$, and $v_2$; however, multivariable calculus isn't my forte, so I didn't do this analysis. Instead, I did a simulation. The code is shown at the end of the question.
Conditions for the simulation: I considered $1$ atm pressure, $1$ mol of gas, temperatures between $500$ and $2000$ Kelvin and volumes between $10$ and $200$ liters; I considered van der Waals constants corresponding to ammonia, butane, carbon dioxide, and helium. I calculated the mean and variance of the difference in isothermal works performed on the perfect and van der Waals gases $(W_{\text{perfect}})_T-(W_{\text{vdW}})_T$. The corresponding results I obtained are as follows.
Notes
Now, I have tried to choose appropriate values of volumes and temperatures, to obtain an idea of how gases behave in real conditions. There seems no particular relation between the two works, except that both are very close to each other (mean$\approx 0\ \text{L atm}$), with a variance of the order of $0.01\ \text{L}^2\ \text{atm}^2$, which is significant, especially, if one converts it to SI units, but surely one is not more than the other as a general rule.
Questions
Could someone help me get to these results more rigorously? I am guessing that analysis might be useful here. Have I reached the right conclusion that the works of perfect and van der Waals gases cannot be compared simply based on some vague interpretations of intermolecular forces? Furthermore, I am not sure how to go about analyzing an irreversible process; some help here would be appreciated.
Comments upon the answers
The comments and answers seem to be talking about unrealistic pressure limits to infinity. To illustrate that the question is well within the realm of real laboratory/industry conditions, refer to the plot below for ideal and van der Waals $P$—$V$ graphs for carbon dioxide.
My Code
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 13 14:12:12 2023
van der Waals and perfect gas isothermal work
@author: ananta
"""
n = 1 # 1 mol gas
R = 0.0821 # atm l / K mol
T = [i for i in range(500,2001,100)]
V = [i for i in range(10,201,10)]
C = [(4.225,0.0371),(14.66,0.1226),(3.64,0.04267),(0.0346,0.0238)] # van der Waals constants
from math import log
from statistics import mean, variance
for (a,b) in C:
D = [] # difference of vdW and perfect gas isothermal work
ca = 0
cb = 0
cc = 0
cd = 0
Wp = [] # work of perfect gas
Wv = [] # work of van Der Waals gas
V1 = [] # initial volume
V2 = [] # final volume
for t in T:
for v1 in V:
for v2 in V:
V1.append(v1)
V2.append(v2)
wp = -n*R*t*log(v2/v1)
wv = -n*R*t*log((v2-n*b)/(v1-n*b))-a*pow(n,2)*(1/v2 - 1/v1)
Wp.append(wp)
Wv.append(wv)
D.append(wp-wv)
print('(',a,b,'):', mean(D), variance(D))