Implementing an Equation of State without Derivatives: teqp
Ian Bell, Ulrich K. Deiters, Allan Leal
This work uses advanced numerical techniques (complex differentiation and automatic differentiation) to efficiently and accurately compute all the required thermodynamic properties of an equation of state without any analytical derivatives─particularly without any handwritten derivatives. It avoids the tedious and error-prone process of symbolic differentiation, thus allowing for more rapid development of new thermodynamic models. The technique presented here was tested with several equations of state (van der Waals, Peng–Robinson, Soave–Redlich–Kwong, PC-SAFT, and cubic-plus-association) and high-accuracy multifluid models. A minimal set of algorithms (critical locus tracing and vapor–liquid equilibrium tracing) were implemented in an extensible and concise open-source C++ library: teqp (for Templated EQuation of state Package). This work demonstrates that highly complicated equations of state can be implemented faster yet with minimal computational overhead and negligible loss in numerical precision compared with the traditional approach that relies on analytical derivatives. We believe that the approach outlined in this work has the potential to establish a new computational standard when implementing computer codes for thermodynamic models.
, Deiters, U.
and Leal, A.
Implementing an Equation of State without Derivatives: teqp, Industrial and Engineering Chemistry Research, [online], https://doi.org/10.1021/acs.iecr.2c00237, https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=933725
(Accessed February 29, 2024)