## Featured Articles

Check out the latest featured articles.

## File Library

Check out the latest downloads available in the File Library.

## New Article

Product Viscosity vs. Shear

## Featured File

Vertical Tank Selection

## New Blog Entry

Low Flow in Pipes- posted in Ankur's blog

0

# Peng Robinson 1978 Equation Of State Workbook

excel udf peng robinson equation of state thermo thermodynamics

2 replies to this topic
|

### #1 steve.calderone

steve.calderone

Brand New Member

• ChE Plus Subscriber
• 3 posts

Posted 24 July 2017 - 04:32 AM

Hello All -

I have been a member here since 2006 but this is my first post. This site has been helpful to me in the past and I have been feeling some guilt for not having given back to the community.

When I graduated with my BS in ChE in 1982 I had a working knowledge of thermodynamics but I have never felt like I 'owned' this area of study. I have used Apsen, Hysys and Prosim/Simulis in the past but felt like I was using a black box and felt too removed from the calculations. I have always been interested in gaining a better understanding how to link together VLE, ideal gas heat capacity and non-ideal departure functions to calculate non-ideal enthalpy and entropy. Two years ago I decided that in my spare time I would develop Excel user defined functions (UDF's) as a means of becoming more proficient in thermodynamics. I basically wanted to look inside the black box.

Attached find a workbook that provides user defined functions for the 1978 Peng-Robinson equation of state for multi-component mixtures. This workbook is free to use, distribute (with attribution) and modify/extend. These functions are valid for multi-component mixtures. This workbook includes functions for temperature-pressure flash, bubble point temperature, dew point temperature, fugacity coefficient, compressibility,  non-ideal enthalpy and non-ideal entropy calculation. NIST Webbook heat capacity data is incorporated for a small number of components and I show how to add data for additional components through data regression and the use of the Shomate equation. These equation of state functions allow for the use of binary interaction parameters.

I have provided many references and calculation examples. Many of the example problems require Solver. I have provided a worksheet where the variables in the various equation of state quantities are mapped to the variables used in the VBA code. I do this in case anyone wants to see how the functions are programmed. I am a self taught programmer so this is not be the most optimized code but I believe it is reasonably easy to follow. The code relies heavily on arrays, the management of array indexes and named ranges in the 'PData' worksheet.

I hope you find this useful. Comments are welcome.

Thanks,
Steve Calderone

### #2 Napo

Napo

Gold Member

• Members
• 316 posts

Posted 25 July 2017 - 11:20 AM

Steve,

Many Thanks for share your information.

You have worked very hard for to obtain this archive, in this momento I´m trying to understand well the content.

I´m accord with you about the comercial simulators many of them are "black box" and professionally is very important to know the origen of this calculation for to be sure about the result.

Now almost everybody can employ the simulators but few can give a profesional explication about the origen of the calculs.

Napo.

### #3 steve.calderone

steve.calderone

Brand New Member

• ChE Plus Subscriber
• 3 posts

Posted 26 July 2017 - 01:47 AM

Thanks Napo!