feos-org / feos

FeOs - A Framework for Equations of State and Classical Density Functional Theory
Other
115 stars 22 forks source link

Fix error in Peng-Robinson equation of state #151

Closed prehner closed 1 year ago

prehner commented 1 year ago

This issue was raised in #146. The implementation of the Peng-Robinson equation of state in feos-core and two example notebooks did not align with expressions found in literature.

The implementation was tested on phase equilibria for which the results were satisfying. Upon further inspection the difference between the code and the references was found to come from the neglection of a lower bound in the integral

$$A^\mathrm{res}=N\int\limits_0^\rho\frac{p^\mathrm{res}}{\rho^2}\mathrm{d}\rho$$

Therefore most intensive properties (except for the pressure) had a constant offset and extensive properties like the Helmholtz energy a linear offset w.r.t. the number of moles. Phase equilibrium calculations were not affected by that and also the error should have cancelled for calculations of, e.g. enthalpy differences.

With this PR the implementation should be correct and align with other implementations.

Thank you @iurisegtovich for bringing this to our attention.