A piston compresses a vapor-liquid equilibrium mixture of water adiabatically and reversibly. The initial temperature is 425 K, and the initial pressure is 0.5 MPa. Use the sliders to set the initial vapor quality (fraction of water that is vapor) and the final pressure. The initial state (green dot) and final state (blue dot) are shown on log pressure versus log volume (P-V), log pressure versus temperature (P-T), and temperature versus entropy (T-S) plots. Select two of these plots to display from the drop-down menus. The initial vapor quality determines whether the quality increases or decreases as the mixture is compressed.
For a reversible process, the change in entropy $\Delta S$ from the initial state 1 to the final state 2 is zero, so $S_2 = S_1$. The Peng–Robinson equation of state is used to calculate the entropy of state $i$:
$$S_i = \left(S_i^{ig} - S_R^{ig}\right) + \left(S_i - S_i^{ig}\right) + S_R^{ig},$$
where $S_i$ is entropy (J/[mol K]), the superscript $ig$ represents an ideal gas, the subscript $R$ refers to the reference state, $\left(S_i - S_i^{ig}\right)$ is the entropy departure function for a real gas, $S_R^{ig} = 123\ \text{J/[mol K]}$ is the ideal gas entropy at the reference state, and $i = (1,2)$.
$$S_i^{ig} - S_R^{ig} = C_{PA}\ln\frac{T_i}{T_R} + C_{PB}(T_i - T_R) + \tfrac{1}{2}C_{PC}\left(T_i^2 - T_R^2\right) + \tfrac{1}{3}C_{PD}\left(T_i^3 - T_R^3\right) - R\ln\frac{P_i}{P_R},$$
$$S_i - S_i^{ig} = R\ln(Z_i - B_i) - R\,\frac{A_i}{2\sqrt{2}\,B_i}\cdot\frac{\kappa\sqrt{T_i/T_c}}{\sqrt{\alpha_i}}\,\ln\!\left[\frac{Z_i + (\sqrt{2}+1)B_i}{Z_i - (\sqrt{2}-1)B_i}\right],$$
where $C_{PA}$, $C_{PB}$, $C_{PC}$ and $C_{PD}$ are heat capacity constants ($C_{P_i} = C_{PA} + C_{PB}T_i + C_{PC}T_i^2 + C_{PD}T_i^3$); $T_i$ is temperature (K); $P_i$ is pressure (MPa); $R$ is the ideal gas constant (J/[mol K]), not to be confused with the subscript $R$; $T_c$ is the critical temperature (K); $\alpha_i = \left[1+\kappa\left(1-\sqrt{T_i/T_c}\right)\right]^2$ is a constant, and $\kappa = 0.375+1.542\omega-0.270\omega^2$, with $\omega=0.344$ as the acentric factor.
$$A_i = 0.457\,\frac{P_i}{P_c}\left(\frac{T_c}{T_i}\right)^2\alpha_i,\qquad B_i = 0.078\,\frac{P_i}{P_c}\,\frac{T_c}{T_i},$$
where $A_i$ and $B_i$ are constants, and $P_c$ is the critical pressure (MPa).
The compressibility factor $Z_i$ is found by solving for the roots of:
$$Z_i^3 + (B_i-1)Z_i^2 + \left(A_i - 3B_i^2 - 2B_i\right)Z_i + \left(B_i^3+B_i^2-A_iB_i\right) = 0.$$
Volume (cm$^3$/mol) is calculated using the compressibility factor:
$$V_i = Z_iRT_i/P_i.$$
When in vapor-liquid equilibrium, the temperature is the saturation temperature. Antoine's equation is used to calculate the saturation temperature:
$$P_i = 10^{\,A - \frac{B}{C+T_i}},$$
where $A$, $B$ and $C$ are Antoine constants.
This simulation was created in the Department of Chemical and Biological Engineering at University of Colorado Boulder for LearnChemE.com by John L. Falconer using Claude AI. It is a JavaScript/HTML5 implementation of a Mathematica simulation by Rachael L. Baumann. It was prepared with financial support from the National Science Foundation (DUE 2336987 and 2336988). Address any questions or comments to LearnChemE@gmail.com.