Giter Club home page Giter Club logo

aspen_hysys_python's Introduction

Aspen HYSYS-Python connection using spreadsheets

This repo contains an Aspen HYSYS - Python connection using spreadsheets.

Since accesing the variables paths in Aspen HYSYS is sometimes problematic. The use of spreadsheets is an easy and fast way to access the variables we want.

Function Aspen_connection in HYSYS_python_spreadsheets.py

Aspen_connection(File_name, Spreadsheet_name, Unit_operation_name, hy_visible=1, active=0)

Inputs

        1. File_name of the Aspen HYSYS file you are working with.

               E.g. 'Test_1.hsc'

        2. Spreadsheet_name is a list of names for the specific spreadsheets within the Aspen HYSYS file that we are connecting with Python.

               E.g. ('SS_Flash', 'SS_turbine', 'SS_Distillation')

        3. Unit_operation_name is a list of the names of the unit operations present within the Aspen HYSYS file. This is useful for example when dealing with distillation columns and their specific flowsheet window.

               E.g. ('Cooler', 'Flash Drum', 'Heater', 'Valve', 'Reactor', 'Distillation Column', 'Turbine', 'Pump')

        4. hy_visible whether to make Aspen HYSYS visible or not. 1=visible, 0=No Visible. Default 1.

        5. active whether the Aspen HYSYS file is currently active or not. 1=Active, 0=No Active. Default 0.

Output

The output is a class Hysys with the following methods:

        1. Hysys.HyCase is the complete Aspen HYSYS case. From here you can access all the variables usign the specific variable paths. To find this paths you can use the "Object browser" from Excel VBA or Matlab and the "HYSYS Customization Guide" pdf file. As I said, this is sometimes problematic. So you can work directly on spreadsheets.

        2. Hysys.SS is a dictionary with the connections to the spreadsheets.

        3. Hysys.Solver is the solver in Aspen HYSYS. This is specially useful to turn it ON/OFF when changing input values to the simulation.

        4. Hysys.MaterialStreams is the connection to material streams in case you want to use (and know) the full path to the variable of interest here.

        5. Hysys.EnergyStreams is the connection to energy streams in case you want to use (and know) the full path to the variable of interest here.

        6. Hysys.UO is a dictionary with the connection to the unit operations. With this you can access the specific options of each unit if you know the path.

Example case-study Test_1.py

An example of use is provided in the Test_1.py where I show the importance of waiting for the solver to finish when working with the Python connection. Enjoy!

License

This repository contains a MIT LICENSE

aspen_hysys_python's People

Contributors

edgarsmdn avatar

Watchers

 avatar

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.