How to vary the total number of trays in a distillation column using ActiveX automation?

Download as pdf : 
Products: Aspen Plus 
Last Updated: 03-Nov-2020
Versions: 
Article ID: 000055624
Primary Subject: 
Converted from "104344_Default.txt"

Creation Date: 22-Dec-2000 01:29AM

Applicable Version(s):

Aspen Plus 10.1 and higher


Problem Statement:

Is it possible to automatically vary the total number of trays in a distillation column using ActiveX automation?


Solution:

The attached example shows how to run multiple cases with different feed tray location and total number of theoretical stages in a RadFrac block. As those parameters are changed for a given column, it is important to account for any possible change in pumparound, heater, or other feed locations within the column as they might change as well.

It is possible, though somewhat difficult, to use a Sensitivity analysis within Aspen Plus to vary the feed tray location and the number of trays in a column model. (See document 3615 for an example.) Using ActiveX automation will make it possible to also do so from a Visual Basic, C++ or Java application.


Steps:

  1. Open the attached Excel spreadsheet

  2. Open the Visual Basic Editor in Excel (Tools -> Macro - Visual Basic Editor)

  3. Select Sheet1 in VB Editor - Modify the path to your Aspen Plus simulation in line :
        Set my_sim = Getobject ("D:\work\mch.bkp")

  1. Go back to the Excel spreadsheet and click on the Run button. The Aspen Plus simulation will be opened and the three cases will be run, reporting for each case the distillate composition, temperature and pressure.


Comments about the Visual Basic Code:

  1. For Tray Sizing and Tray Rating, the location for the last tray is modified for every case using a For Each structure. This is quite efficient as it will handle cases where no tray sizing or rating is specified but also if multiple cases (like here) are specified to compare different tray configurations.

  2. In this example a pseudo stream from the last equilibrium stage before the reboiler is specified. As the total number of trays change, it is obviously necessary to change the specification for the pseudo stream. The same thing will need to be done for columns where heaters and pumparounds are specified.

  3. To use this example with other Aspen Plus simulation, the following would need to be changed in the code:

    • path to the Aspen plus file
    • column name (here 'C1')
    • pseudo stream name (here 'PSEUDO')
    • stream report (make sure mass fraction is selected under Report Options in Aspen Plus)
    • distillate stream name (here 'TOP')

  4. This example can actually handle more than three cases as it is using a While ... Wend Structure to browse through the various cases.


KeyWords:

ActiveX, COM, VBA, VB, Visual Basic,RADFRAC, Feed tray, Number of Trays,Visual Basic automation


Attachments
Filename Date Added
RadFrac_Trays.zip 18-Jan-2017