Logo of AmsterCHEMAmsterCHEM released today a new CAPE-OPEN Unit Operation where the model can be written as a Python script. The simplicity of the Python language is appealing to many: reading Python is much like reading English. This is the reason why it is so easy to learn, understand, and code Python. At the latest CAPE-OPEN Annual Meeting, use of Python for developing process engineering models was repeatedly mentioned by participants as a must to have.

This new CAPE-OPEN Unit Operation from AmsterCHEM complements a rather extensive list of similar CAPE-OPEN Unit Operations by AmsterCHEM such as the Scilab Unit Operation, the MATLAB® Unit Operation and the Microsoft Excel Unit Operation. All of these CAPE-OPEN Unit Operations have been put to much use already within many organizations.

Prior to its official release, Martin GAINVILLE, from the Fluid Mechanics Department at IFP Energies Nouvelles had the opportunity to test rather extensively the Python CAPE-OPEN Unit Operation and here is his report (Disclaimer: the views expressed here are do not necessarily reflect the views or policies of IFP Energies Nouvelles): “I was able to quickly and successfully use the Python CAPE-OPEN Unit Operation, starting with the examples provided by AmsterCHEM (Examples 1 to 11 worked fine, encountered an issue with example 12 while importing scipy.optimize Python package¹, and examples 13 and 14 need to be further looked at).

In addition, I prototyped a simple pipe with the Python Unit Operation, calculating pressure drop and heat exchange with the pipe surroundings on a 1D mesh and dealing with all the present phases. For the model, I relied on a previously developed Python script working with the Python CAPE-OPEN Thermo Import by AmsterCHEM. This Python Unit Operation was integrated into a COFE flowsheet where the pipe diameter (a parameter of the Python Unit Operation) was tuned using a controller to reach the output pressure specification (15 bar). Calculations were performed using either a TEA Property Package (PR: CO2 + WATER) or a Multiflash Property Package (CO2, H2O, DODECANE).

COFE Flowsheet with Pipe as Python Unit Operation

Pressure, temperature and phase fraction profiles were plotted in the Python Unit Operation GUI and calculation results were written into a report accessible to the flowsheet environment.

Plot of results calculated by a Pipe developed using the Python CAPE-OPEN Unit Operation

The Python Unit Operation is really useful for integrating existing Python scripts into a flowsheet environment and to get access to Property Package methods for calculations internal to the Unit Operation.The “Help on Python Unit Operation” web page provides all the necessary information about object structures and methods. The next step will be for me to validate the interoperability in third-party CAPE-OPEN flowsheet environments such as Aspen HYSYS, Unisim Design or Pro/II.

CO-LaN welcomes this new addition to the list of available CAPE-OPEN Unit Operations. This will further increase the use of CAPE-OPEN based interoperability in process engineering. It is worth noting that AmsterCHEM used COBIA for the development of this new Unit Operation.

 

¹ AmsterCHEM: the issues underlying the use of scipy in win32 Python in example 12 are unrelated to the Python Unit Operation itself. It appears to be a bug in the win32 anaconda distribution of scipy for Python 3.8. The x64 anaconda distribution of scipy works fine. Also CPython / win32 with scipy from pip works fine.