Giter Site home page Giter Site logo

a-jminor / python-aspen-plus-connected-model-for-the-calculation-of-equipment-costs Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 5.04 MB

Python code packages for the calculation of CAPEX (using cost correlations of Seider et al. (2009)) of equipment pieces (e.g. reactor, heat exchangers, distillation columns, etc.) that were simulated in Aspen Plus (connected python and aspen plus model).

Python 100.00%

python-aspen-plus-connected-model-for-the-calculation-of-equipment-costs's Introduction

Python Aspen Plus Connected Model for the Calculation of Equipment Costs

Python model for the calculation of equipment costs (e.g. for the CSTR reactor, heat exchangers, RADFRAC distillation columns, etc.) that were simulated in Aspen Plus. The python code retrieves data from Aspen Plus, applies cost correlations of Seider et al. (2008)1 using this data, feeds input variables to Aspen Plus (if necessary), runs the simulation (if necessary) and gives the dimensions as well as equipment costs as output.

Prerequisites

In this repo, the prerequisites are just mentioned or shortly explained here. There is a detailed example providing an entire python and aspen plus file at @edgarsmdn. There, a sensitivity analysis is performed where the python code is feeding / retrieving data to / from Aspen Plus.

Connection between Aspen Plus and Python

The connection between Aspen Plus and Python is first required, which is done by pywin32 to provide access, control and automation of Aspen Plus from python. Hence, each package starts with this connection, and an example code for assessing an aspen plus backup file with the name "simulation" can be found below.

# 0) Import packages
import os                          # Import operating system interface
import win32com.client as win32    # Import COM

# 1) Get path to Aspen Plus backup file called simulation
file_name = 'simulation.bkp'
aspen_path = os.path.abspath(file)

# 2) Initiate Aspen Plus application and file
Application = win32.Dispatch('Apwn.Document') # Registered name of Aspen Plus
Application.InitFromArchive2(aspen_path)

# 3) Application becomes visible with 
Application.visible = 1

Obtain an input/output Variable from Aspen Plus

To be able to use Aspen Plus as a blackbox model, and control its variables from Python (e.g. change the input variables of or get the results of an Aspen Plus simulation process), the "path" of the required Aspen Plus variables are needed. Those path IDs can be found at the Customize tab at Variable Explorer in Aspen Plus and need to be copy pasted to python. A screenshot explaining how to obtain a certain variable such as the value of the mole fraction of heptane is shown in the Aspen Plus Python Connection Example. An example python command to save this molefraction of stream "C7" as variable x is shown below.

x = Application.Tree.FindNode("\Data\Streams\C7\Output\MOLEFRAC\MIXED\HEPTANE").Value

Equipment Cost Correlations

To obtain the CAPEX of a chemical process, e.g. through Lang factor method, equipment costs are often required. Those equipment costs can be computed by cost correlation functions, that were established in the past by correlating the costs to a certain size factor. For example, to compute the costs of a heat exchanger, the area is required as size factor, and a cost function to compute the purchase costs ($) in terms of the area A can be found in the literature1 dependent on the different types of heat exchangers:

copied from Seider et al. (2008)1

Hence, this cost correlation is implemented in the python code, which retrieves the value for the heat exchanger area from the Aspen Plus simulation. This python package can be found at the subfolder Heat Exchanger.

Included Packages

The costs of the following equipment were computed using the connected python Aspen Plus model:

Heat Exchangers

Distillation Columns, Reflux Drums, Reboilers, Condensers

Reactors

Pumps

Vacuum Systems

Evaporators

References

Footnotes

  1. W.D. Seider, J.D. Seader, D.R. Lewin, Product and Process Design Principles: Synthesis, Analysis and Design, 3rd Edition, Wiley New York, 2008. 2 3

python-aspen-plus-connected-model-for-the-calculation-of-equipment-costs's People

Contributors

a-jminor avatar

Stargazers

kevin avatar  avatar Michael Lejeune avatar  avatar  avatar  avatar  avatar Edgar Ivan Sanchez Medina avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

chenhsmuyi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.