feos-org / feos

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

bug in the peng robinson helmholtz implementation #146

Closed iurisegtovich closed 1 year ago

iurisegtovich commented 1 year ago

hi, i put together the following notebook 🔗 colab to show a bug in the expression for the helmholtz energy of the peng robinson eos (both the python version of the examples " core_user_defined_eos.ipynb" and "core_working_with_units.ipynb" as the rust version of the package)

in summary, the current version does give the correct pressure, but the helmholtz energy is not correct (or at least not consistent with the conventional definition of "A_fluid(state) - A_idealgas(same T, same V)", isometric residual)

the bug can be observed as $\ln \phi$ does not go to zero at infinite volume (zero density) with the current pr implementation,

the notebook shows a proposed correction to the helmholtz energy, and shows that the proposed correction has the same trend as the current pcsaft implementation.

the notebook does not contain the complete derivation for the correct helmholtz energy, but points to three references (smith van ness & abbott; elliott & lira; reid praunitz & poling)

g-bauer commented 1 year ago

Hi Iuri,

thanks for the issue and the nice notebook. We will look into the details and come up with a solution/fix soon.