Hey guys,
i have been stuck when i was trying to send over from excel towards HYSYS. i was able to do it for my material streams. but i am having problems with unit operations. in this case it is my plug flow reactors
|
Posted 30 January 2015 - 02:14 AM
Hey guys,
i have been stuck when i was trying to send over from excel towards HYSYS. i was able to do it for my material streams. but i am having problems with unit operations. in this case it is my plug flow reactors
Posted 01 February 2015 - 03:55 AM
Hi,
If I understand you correctly, then the problem you are facing is that; you need the codes to export PFR input values (e.g. Total Volume or Void Fraction etc.) from excel sheet to Hysys file.
1. To transfer from Excel to Hysys, pl. use below codes;
Public PFR_2 As PFReactor
Dim VoidFraction As Double
Dim TotalVolume As Double
Set PFR_2 = simCase.Flowsheet.Operations.ITEM("PFR_2")
PFR_2.VoidFraction = Worksheets("PFR").Range("J20").Value
PFR_2.TotalVolume = Worksheets("PFR").Range("J21").Value
'Note: PFR_2 is the name of the PFR.
' Void fraction value saved at "J20" box in "PFR" sheet.
' Total Volume value saved at "J21" box in "PFR" sheet.
2. To transfer from Hysys to Excel, pl. use below codes;
Worksheets("PFR").Range("K20").Value = PFR_2.VoidFraction
Worksheets("PFR").Range("K21").Value = PFR_2.TotalVolume
'This will transfer void fraction and total volume value from Hysys to Excel.
3. When you Type PFR_2. then several parameters get activated for you to select one of your interest.
Regards.
Ajay S. Satpute
Posted 01 February 2015 - 04:04 AM
Thank you for your input Ajay,
However as i am still building my reactors, i was hoping to let excel detect the PFR name from a cell value("B2") and then input the values into hysys after detecting the name in Excel.
previous i defined the pfr name as a string . as defining it as an ITEM didnt work for me.
please advice further
Hi,
If I understand you correctly, then the problem you are facing is that; you need the codes to export PFR input values (e.g. Total Volume or Void Fraction etc.) from excel sheet to Hysys file.
1. To transfer from Excel to Hysys, pl. use below codes;
Public PFR_2 As PFReactor
Dim VoidFraction As Double
Dim TotalVolume As DoubleSet PFR_2 = simCase.Flowsheet.Operations.ITEM("PFR_2")
PFR_2.VoidFraction = Worksheets("PFR").Range("J20").Value
PFR_2.TotalVolume = Worksheets("PFR").Range("J21").Value
'Note: PFR_2 is the name of the PFR.
' Void fraction value saved at "J20" box in "PFR" sheet.
' Total Volume value saved at "J21" box in "PFR" sheet.
2. To transfer from Hysys to Excel, pl. use below codes;
Worksheets("PFR").Range("K20").Value = PFR_2.VoidFraction
Worksheets("PFR").Range("K21").Value = PFR_2.TotalVolume
'This will transfer void fraction and total volume value from Hysys to Excel.
3. When you Type PFR_2. then several parameters get activated for you to select one of your interest.
Regards.
Ajay S. Satpute
Posted 01 February 2015 - 04:48 AM
I have also encountered problems with the object not being defined. my PFRs are labelled from PFR-100 onwards. therefore when i tried to input that in together with some minor troubleshooting, the object was not able to be defined.
thank you for your assistance
Posted 01 February 2015 - 05:03 AM
Hi,
You may use IF-THEN command;
If Worksheets("PFR").Range("B2") = "PFR_2" Then
PFR_2.VoidFraction = Worksheets("PFR).Range("J20").Value
PFR_2.TotalVolume = Worksheets("PFR").Range("J21").Value
End If
'PFR_2 is just one of the PFRs. You could add another as PFR_3. But make sure you define the same as you did for PFR_2.
Regards.
Ajay S. Satpute
Posted 01 February 2015 - 11:52 AM
You should get some sample codes from AspenTech support site. Ajay is quite helpful, but you want to start coding using good practice, not quick and dirty. The samples illustrate good practices in coding.
Bobby
Answered
Steam Pressure Requirements For Limpet Batch ReactorStarted by Guest_golegolegole_* , 10 Apr 2024 |
|
|
||
How To Find K-Values Of A Hydrocarbon Mixture On Aspen Hysys?Started by Guest_Alexis Azamar_* , 08 Apr 2024 |
|
|
||
Falling Film Reactor Design CalculationStarted by Guest_Emranm02_* , 07 Apr 2024 |
|
|
||
Falling Film Sulfonating ReactorStarted by Guest_Emranm02_* , 07 Apr 2024 |
|
|
||
Extension Reaction Kinetic In HysysStarted by Guest_Ulbert Zsolt_* , 29 Mar 2024 |
|
|