Entropy change in free expansion (source code)

= Entropy change in free expansion
{title2=$\Delta S=nR\ln(V_2/V_1)$ for an ideal gas}

For the insulated gas-only <free expansion> of an <ideal gas>, the equilibrium endpoints are $(T,V_1)$ and $(T,V_2)$ with $V_2>V_1$. Because <entropy> is a <state function>, calculate their difference along a hypothetical <reversible thermodynamic process>: an <isothermal expansion> using a frictionless piston and a <thermal reservoir> at $T$. This comparison process receives <heat> and delivers <work>, even though the actual <free expansion> does neither. Its reversible <heat> increment is $\delta Q_{\rm rev}=p\,dV=nRT\,dV/V$, so
$$
\Delta S=\int_1^2\frac{\delta Q_{\rm rev}}{T}
=nR\int_{V_1}^{V_2}\frac{dV}{V}
=nR\ln\frac{V_2}{V_1}>0.
$$
Here $R$ is the <molar gas constant>, and the <logarithm> acts on a dimensionless ratio. The reversible reference gives the correct endpoint <entropy> difference because <entropy> is a <state function>; putting the actual $Q=0$ into $\Delta S=Q/T$ would misuse a relation requiring reversible <heat> transfer. For the actual isolated gas, all this increase is <entropy production>. Thus an <adiabatic process> can increase <entropy> and need not be an <isentropic process>. https://openstax.org/books/university-physics-volume-2/pages/4-6-entropy[OpenStax, section 4.6: reversible reference path for the entropy change of free expansion]{ref}

\Image[/free-expansion-entropy-reference-path.png]
{title=The reversible reference calculates <entropy> without supplying a path for the actual <free expansion>}
{description=Toy <ideal gas> example with $n=1\,\mathrm{mol}$, $T=300\,\mathrm K$, $V_1=0.025\,\mathrm{m^3}$ and stipulated $R=8.314\,\mathrm{J\,mol^{-1}\,K^{-1}}$. The plotted curve belongs only to the hypothetical reversible <isothermal expansion>; the actual release has the same equilibrium endpoints but no equilibrium curve between them. The table refers to the <gas>, with <work> positive outward. No points are experimental data.}

In the figure's volume doubling, the <ideal gas law> gives $p_1=99.768\,\mathrm{kPa}$ and $p_2=49.884\,\mathrm{kPa}$, while $\Delta S=R\ln2\simeq5.763\,\mathrm{J\,K^{-1}}$. The reference process receives and delivers $nRT\ln2\simeq1728.85\,\mathrm J$ as <heat> and <work>; its <thermal reservoir> loses the same <entropy> that the <gas> gains. The actual <free expansion> has $Q_{\rm in}=W_{\rm out}=0$ and produces that <entropy> internally. Reversibly compressing the <gas> back at $300\,\mathrm K$ would require $1728.85\,\mathrm J$ of <work> input and rejection of equal <heat>. Restoring the gas alone therefore changes the surroundings: the actual release is irreversible.

For a <real gas> the final <temperature> may differ, so the ideal-gas <logarithm> formula cannot simply be copied. Evaluate $S(T_2,V_2)-S(T_1,V_1)$ using that gas's equilibrium properties or a suitable reversible comparison path. If the walls and water exchange <heat> with it, the <Second law of thermodynamics> constrains the total <entropy> of the isolated apparatus; the gas alone is then not an <isolated system>.