Professional Documents
Culture Documents
The HYSYS Spreadsheet PDF
The HYSYS Spreadsheet PDF
ADV 4_1.pdf
2 The HYSYS Spreadsheet
Workshop
The HYSYS Spreadsheet is a powerful tool that allows the user to apply
the functionality of Shreadsheet programs to flowsheet modelling. The
Spreadsheet has complete access to all process variables; this allows the
Spreadsheet to be virtually unlimited in its applicability and function.
Learning Objectives
After completion of this module, you will be able to:
Prerequisites
Before beginning this module, you should be able to:
2
Process Overview
4 The HYSYS Spreadsheet
4
The HYSYS Spreadsheet 5
In order for a variable to be • Drag and Drop - Position the cursor over the desired item; then
dragged out of a particular press and hold the right mouse button. Move the cursor over to
view, that view must be "un- the Spreadsheet. Once over the Spreadsheet, the cursor’s
pinned" or non-modal. Click appearance will change to a "bull’s eye" type. Release the right
on the pin to convert the view. mouse button when the "bull’s eye" cursor is over the desired
cell. The specific information about the imported variable will
appear in the Current Cell group.
• Variable Browsing - A variable may also be imported into the
Spreadsheet by placing the cursor on an empty cell in the
Spreadsheet and pressing (and releasing) the right mouse
button. Choose Import Variable from the list that appears, and
select the variable using the Variable Navigator.
• Connections Page - On the Connections page, press the
Add Import button and select the desired variable using the
Variable Navigator. After selecting the variable, choose the
desired cell from the Drop Down list.
• Drag and Drop - Position the cursor over the Spreadsheet cell
that is to be exported. Press and hold the right mouse button;
the cursor should now change to the "bulls’ eye" type. Move the
"bull’s eye" cursor over to the desired cell. Release the right
mouse button, the transfer should be completed.
• Variable Browsing - A variable may be exported from the
The value in any Spreadsheet Spreadsheet into the Simulation environment by placing the
cell can be exported, except if cursor on the exportable cell in the Spreadsheet and pressing
it is an imported value. (and releasing) the right mouse button. Choose Export
Formula Result from the list that appears, and select the
desired location for the variable using the Variable Navigator.
• Connections Page - On the Connections page, press the
Add Export button and select the desired variable using the
Variable Navigator. After selecting the variable, choose the
desired cell from the Drop Down list.
5
6 The HYSYS Spreadsheet
Some examples of the HYSYS functions and their form follow here:
6
The HYSYS Spreadsheet 7
Logical Operators
The HYSYS Spreadsheet supports Boolean logic, essentially a true/false
logic. A true statement has a value of 1, and a false statement has a
value of 0. For example, suppose that the cell A1 has a value of 10, and
the cell A2 has a value of 5. If the logical statement +A1<A2 were entered
into cell A3. The cell would display a value of 0 because the logic
statement is false.
IF/THEN/ELSE Statements
The HYSYS Spreadsheet also supports the basic IF/THEN/ELSE
Statement. The form of this statement is:
7
8 The HYSYS Spreadsheet
1. Add a Mixer to the PFD. Attach both streams as feed streams and
create a product stream named Comb. Feed.
2. Ensure that the pressure assignment on the mixer is set to "Set
The addition of a V/L
Separator allows the user to Outlet to Lowest Inlet"
calculate orifice areas for both 3. Set the Molar flowrates of both feed streams to 460 kgmole/hr
vapour and liquid streams (1000 lbmole/hr).
separately.
4. Add a V/L Separator to the system, with the feed stream as Comb.
Feed, the vapour product stream as PSV Vapour and the liquid
product stream as PSV Liquid.
The formulas that will be used to calculate the orifice area are based on
API-520. The formula for orifice area for the vapour stream is:
M× T×Z
A V = ------------------------------------------------------------------------
-
C × K d × K b × Kv × P × MW
And the equation for the orifice area required for the liquid flow is:
G × SG
AL = -------------------------------------------------------------------
-
22.8 × K d × K w × Ku × ∆P
8
The HYSYS Spreadsheet 9
Area in2
9
10 The HYSYS Spreadsheet
10
The HYSYS Spreadsheet 11
B12 +(b2*@sqrt(b3)*@sqrt(b4))/
The formulas must be entered (b5*b6*b7*b9*b10*@sqrt(b8))
exactly as they are given here.
A missing parenthesis or * will D4 +d3/62.4
cause an error.
D7 +d5-d6
Cell labels are not case
sensitive. D12 +(d2*@sqrt(d4))/
(22.8*d8*d9*d10*@sqrt(d7))
C14 +b12+d12
11
12 The HYSYS Spreadsheet
12
The HYSYS Spreadsheet 13
Exercise 1
Compare with the Depressurizing
Utility
In this module, and the previous one, depressurizing of a system was
examined. It may not be obvious, but the numbers used in this module
were derived from the previous module. The flow rate used here was
found by averaging the flow rate through the PSV found in the
Depressurizing module. The streams in both modules share the same
composition, the same flow and the same pressures.
Because of the similar nature of these two streams, one would expect
that inputting the orifice area that was found in this module into the
depressurizing utility would yield similar results to those found in the
Depressurization module. Well, let’s try it.
13
14 The HYSYS Spreadsheet
Isentropic Efficiency 25 % 25 %
14
The HYSYS Spreadsheet 15
Calculate the utility and move to the Plots page, select the Pressure
radio button.
Exercise 2
Constant Rate Depressurization
As an additional exercise, model the value in the Depressurizing utility
as a subsonic valve with the following information:
C1 72,000 32,400
C2 0 0
These settings set the valve as a constant rate type valve. If C2 = 0 then
pressure has no impact on the valve’s flow rate.
15
16 The HYSYS Spreadsheet
Challenge
The Macro Language Editor
HYSYS contains a Macro Language Editor, that lets the user write
programs that can access information from the HYSYS Simulation, and
calculate a value or a series of values.
This language editor uses the WinWrap Basic script, a language very
similar to Microsoft® Visual Basic®. The Macro Language Editor allows
users to develop, test, and execute programs. Programs can also be
saved and reopened in any number of HYSYS cases.
1. Access the Macro Language Editor under Tools in the Main Menu
Bar.
2. With the provided disk in the A: drive, open the file A:\PSV.wwb.
3. Run the Program by selecting Run under Macro on the Menu Bar.
4. Enter a Relief Pressure of 15.5 bar (225 psig), and select Two
Phase Relief. Otherwise, accept all of the default values.
16