Dehydration equilibrium with ideal-gas fluid (source code)

= Dehydration equilibrium with ideal-gas fluid
{title2=$\Delta_rG=0$}

For a <mineral> reaction producing one mole of water, let $H^\circ,S^\circ$ refer to the $P^\circ$ <standard state> and let the solids’ volume change $\Delta V_s$ be constant. If $A_s$ is the product/reactant solid-activity ratio, the <Gibbs energy of reaction> is
$$
\Delta_rG=H^\circ-TS^\circ+\Delta V_s(P-P^\circ)
+RT\ln\left(A_s\frac{f_{\mathrm{H_2O}}}{P^\circ}\right).
$$
For temperature-independent specified activities and fugacity, equilibrium gives
$$
T=\frac{H^\circ+\Delta V_s(P-P^\circ)}
{S^\circ-R\ln(A_sf_{\mathrm{H_2O}}/P^\circ)}.
$$
The gas <pressure> work is already represented by the fugacity term; adding a second constant water-volume term double counts it. For an <ideal gas>, $f=P$; a given <fugacity coefficient> gives $f=\phi_fP$. If these quantities depend on <temperature>, the equilibrium equation must instead be solved implicitly. <Pressure> units in the solid volume correction must match those used for $\Delta V_s$.