Advanced Process Modeling Using HYSYS
Advanced Process Modeling Using HYSYS
Getting Started
1
© 2004 AspenTech - All Rights Reserved.
EA1000.32.02
01 Getting Started
2 Getting Started
Workshop
In the Getting Started module you will build the flowsheet around which
most of the rest of this course is based.
Learning Objectives
Once you have completed this section you should have revised your
basic HYSYS knowledge. You will also be able to:
Prerequisites
This course is aimed at people who have had some experience of using
HYSYS before. Hence the instructions are deliberately brief in places
where previous HYSYS users are likely to already know what to do.
If you have problems at any stage you can ask the course instructor.
2
Process Overview
Column Overview
Getting Started 5
5
6 Getting Started
The LNG (Liquefied Natural Gas) exchanger model solves heat and
LNG icon material balances for multi-stream heat exchangers and heat exchanger
networks. The solution method can handle a wide variety of specified
and unknown variables.
The LNG allows for multiple streams, while the HEAT EXCHANGER
allows only one hot side stream and one cold side stream.
For the LNG exchanger, you can specify various parameters, including
heat leak/heat loss, UA or temperature approaches. Two solution
methods are employed; in the case of a single unknown, the solution is
The Tube Side and Shell calculated directly from an energy balance. In the case of multiple
Side streams can come
unknowns, an iterative approach is used which attempts to determine
from different Flowsheets.
This is one way of using the solution that satisfies not only the energy balance, but also any
different fluid packages on constraints, such as temperature approach or UA.
each side of the exchanger
Figure 1
6
Getting Started 7
If you prefer you can add the other streams to the flowsheet manually.
Alternatively typing the name of a new stream into the Sides box will
create it.
Figure 2
7
8 Getting Started
Heat Losses will not be considered. All streams on the same side with the
Equilibrate checkbox checked are considered to be in equilibrium
before entering the exchanger calculations. Thus the driving force will
be reduced.
Two extra specifications (in addition to the Heat Balance spec - i.e.,
conservation of energy) will be added.
Just after the streams have been added the Degrees of Freedom display
shows 6 (i.e., 7 unknown variables, 1 constraint so far). By adding two
new specs this is reduced to 4. Later on when more of the flowsheet is
built, these 4 degrees of freedom will be used up and the exchanger will
have enough information to solve.
Figure 3
8
Getting Started 9
Figure 4
If the Est. checkbox is checked then HYSYS will use the spec value as an
initial estimate in its iterative solution. Hence specifications can be used
for more than just being an active spec. They can:
9
10 Getting Started
Add a Cooler
10. Add a Cooler to stream 1A. This should have the following
parameters:
Name E-100
Cooler Outlet Stream 2
Pressure Drop 20 kPa (2.9psia)
Outlet Temperature -62°C (-79.6°F)
Energy Q-100
Add an Expander
13. The Separator vapour is then expanded to 2800 kPa.
14. The outlet is Stream 5.
15. The Expander should have the following properties:
Name K-100
Outlet Pressure 2800 kPa (406 psia)
Adiabatic Efficiency 75% (This is the default)
Energy QK-100
10
Getting Started 11
Add a Separator
16. Add another Separator to the Expander outlet.
17. The feed is the outlet from the Expander.
18. The vapour product is Stream 7 which has already been added and
linked to the LNG exchanger.
19. The liquid product is Stream 6.
This is done using a HYSYS Set operation. This relates two HYSYS
parameters. It can be used to make them identical or to force a fixed
Multiplier and Offset between them.
Name SET-1
Set icon Target Variable Stream 8 Pressure
Source Stream 5
Multiplier 1
Offset 0 kPa (0 psia)
11
12 Getting Started
Figure 5
12
Getting Started 13
If psi is not the pressure unit HYSYS is currently using you can enter a psi
value by using the unit drop-down to the right for the number entry
field.
Figure 6
Connections
Column Name LPG Recovery
Distillation Column icon No. of Stages 5
Feed Stream / Stage 8 / at stage 1
Condenser Type Full Reflux
Overhead Vapour Product 9
Bottom Product 10
Condenser Energy Stream Q-102
Reboiler Energy Stream Q-103
13
14 Getting Started
29. Since the product stream pressures have already been set (with the
Set operations), the Pressure Profile page automatically picks these
up. Go to the Optional Estimates page by clicking the Next > button.
30. Click the Next > button to move to the final page.
The final page of the Column Input Expert always has some typical
specifications for the particular type of column. In this case, different
Once the Input Expert has specifications will be used. These must be added after the Input Expert
been completed it cannot be has been completed.
accessed again unless the
column is deleted and
added back. However all the 31. Click the Done button to complete the Input Expert. The Column
information that was entered Property View will now appear.
can be changed using the
column property view.
Figure 7
14
Getting Started 15
Figure 8
Since no values were entered for the Specs in the Input Expert, no values
are present here.
Note that since the column has fully defined feeds, the pressures are
known, and 2 specs are activated the Degrees of Freedom display is
showing 0.
15
16 Getting Started
First Spec
Type Column Duty
RVP (Reid Vapour Name Ovhd Duty
Pressure) is a volatility
measure commonly used in Energy Stream Q-102 @ Col1
the Refining industry. It is Spec Value 0.001 kJ/h
the pressure at which the
vapour and liquid have a 4:1
volume ratio at 100°F. Second Spec
Type Column Vapour Pressure Spec
Name Btms RVP
Stage Reboiler
Type Reid Vapour Pressure
Phase Liquid
Spec Value 200 psia
36. Ensure the Ovhd Duty and Btms RVP specs are set to be Active and
Estimates, and that the Ovhd Vap Rate spec is set as an Estimate.
The other unused specs can be deleted by going to the Specs (SS) page
on the Design tab and pressing the Delete button, or by double-clicking
the spec on the Monitor page on the Design tab and clicking Delete.
16
Getting Started 17
37. If the column hasn't run automatically, click the Run button. You
should see some messages in the Trace Window (bottom right white
pane) as the column solves. When the column has solved, the LNG
should then be solved as now both Streams 7 and 9 are fully defined.
38. Mix Stream 7A and 9A using a Mixer operation. The outlet is Stream
11.
39. Add a Compressor, keep the standard Adiabatic Efficiency of 75%.
The outlet is Stream 12 and the energy is QK-101.
40. Install another Set to link the heat flow of the compressor energy
stream (QK-101) to the Expander energy stream (QK-100).
41. Add another Cooler to cool the mixed compressed gases to 30°C.
The Cooler has a 0.2 bar pressure drop.
42. Finally, install an Export Gas Compressor to take the product gas to
70 bar. The compressor has an Adiabatic Efficiency of 75%.
17
18 Getting Started
HYSYS can also solve for a flow rate given an otherwise fully specified
feed stream, a duty and an outlet pressure.
Advanced Modeling
The Column is a special type of sub-flowsheet in HYSYS. Sub-flowsheets
contain equipment and streams, and exchange information with the
parent flowsheet through the connected streams. From the main
environment, the Column appears as a single, multi-feed multi-product
operation. In many cases, you can treat the Column in exactly that
manner.
18
Getting Started 19
Workbook button
19
20 Getting Started
44. From the Workbook menu, select Setup. The Setup view appears as
shown below:
Figure 9
The left side of this section allows you to add new tabs to the Workbook.
The right side allows you to configure the properties that appear on each
tab.
45. Add a new Workbook tab. Choose the object type to be Stream-
Material Stream on the window that appears.
46. Change the tab Name to Other Props.
47. Change the tab to show the following variables: Molecular Weight,
Mass Heat Capacity and vapour phase Cp/Cv.
20
Getting Started 21
When using multiple PFDs it is a good idea to have one 'working' PFD
that shows all the streams and operations.
49. Create a PFD named Presentation using the Add a PFD option from
the PFD menu. Choose to Clone the existing PFD.
Figure 10
50. Hide all the Set operations on the Presentation PFD by right-clicking
on their PFD icons and choosing Hide on the object inspect menu.
To unhide objects that have
been hidden, right-click on 51. Add a PFD workbook table for the Other Props Workbook tab by
the PFD background and object inspecting the PFD background and choosing the Add
choose Reveal Hidden Workbook Table option.
Objects.
21
22 Getting Started
Figure 11
There are two places in HYSYS that these correlations are controlled:
22
Getting Started 23
Figure 12
Sort Ascending
Save Correlation Set to File The Correlation Set can then be loaded with
the View Correlation Set List function.
23
24 Getting Started
View All Correlation plots See all correlation plots for the stream.
Currently greyed out as none of the
correlations have plots.
1. Open the property view of the Feed Gas stream. Click the Remove
All Correlations button to clear all the correlations from the stream.
2. Using the Append New Correlation button, add the following
properties:
• Gas - HC Dew Point
• Gas - Higher Heating Value
Don’t forget to click Apply to
add these properties. • Gas - Lower Heating Value
• Gas - Wobbe Index
• Standard - Act. Volume Flow
Figure 13
3. On the Feed Gas stream Properties page, select the Higher Heating
Value [Gas] row in the table.
24
Getting Started 25
Figure 14
Property correlation
parameters can only be
edited using the Correlation
Manager.
The meaning of the Status
group is explained below.
A window appears giving details of the property, note that here the
Reference temperature option cannot be changed (i.e., it appears in
black).
5. Click the Save Correlation Set to File button to save the properties
in this stream as a correlation set called Gas CorrSet.
If the existing correlations
are not first removed, then
6. Open the Properties page for the Export Gas stream. Remove all the
any new ones in the existing correlations and add the Gas CorrSet correlation set to the
Correlation Set are added to stream using the View Correlation Set List button.
the bottom of the list.
Figure 15
All user defined correlation sets are stored, by default, in the file
StreamCorrSets.xml in the \Support subdirectory of the HYSYS
25
26 Getting Started
installation. The name and location of this file can be configured on the
Files-Locations page of the Preferences window (Tools-Preferences
menu option). This file is not created until a correlation set is added.
Figure 16
26
Getting Started 27
Delete Cloned Correlation From List Only enabled when a previously cloned
property is selected in the Clone part of the
tree, and when no streams are showing the
property.
Activate Selected Global Correlation Adds the selected property correlation to all
the streams in the case.
Remove All Global Correlations Removes all the property correlations from all
the streams in the case.
Some properties (like the Higher Heating Value property viewed above)
have user adjustable parameters.
Note that now the cloned 4. Click the Clone Selected Correlation button to clone the Higher
Higher Heating Value Heating Value property.
correlation is now present in
all the streams in the case.’ 5. Find the new cloned property in the Clone section of the tree.
6. Add this correlation to all the streams in the case using the Activate
Cloned correlations can be Selected Global Correlation button.
renamed by typing a new
value into the Display Name 7. Set the reference temperature for the cloned correlation so that it is
cell. different from the original correlation.
27
28 Getting Started
Compare the values of the two correlations for the Feed Gas and Export
Gas streams.
Figure 17
The following table describes the six bars contained in the Status group:
The View Global Correlation Set List button in the Stream Correlation
Set Controls (Global) group allows a previously saved Correlation Set to
be displayed for all the streams in the case.
View Global Correlation Set
List button
28
Getting Started 29
Figure 18
In most cases the standard property set will be being used anyway, so it
does not matter which option is chosen.
29
30 Getting Started
Figure 19
30
Getting Started 31
Each stream has a status indicator on the Properties page that indicates
whether the Activate Property Correlations option is checked in the
Preferences. The Correlation Manager window also has a similar status
indicator.
Figure 20
31
32 Getting Started
32
Extensions 1
Extensions
1
© 2004 AspenTech - All Rights Reserved.
EA1000.32.02
02 Extensions
2 Extensions
Introduction
One of the most powerful features of HYSYS is that users are able to
create and add their own unit operations to the program through
extensibility. In this module, the power of this feature will be
demonstrated, however the process required to build an extension in
HYSYS will not be covered.
With unit operation extensions users can create models for unit
operations that are not available in HYSYS. Unit operations can also be
used to perform calculations, much like the depressuring utility also
examined in this course.
The Virtual Stream extension to be used in this module allows the user
to transfer information from one stream to another, creating a “Live
Link” between them.
Learning Objectives
By completing this module, you will learn how to:
2
Extensions 3
Registering Extensions
Before extensions can be used in a simulation, they must be registered.
Figure 1
3
4 Extensions
Figure 2
Figure 3
4
Extensions 5
Figure 4
If an extension that has just been registered does not show in the list of
available extensions, then restart HYSYS.
5
6 Extensions
Workshop
In this workshop, you will add the Virtual Stream extension to various
Don’t worry if you haven’t
built the Turbo Expander streams in the Turbo Expander case built in the Getting Started module.
plant case. You can use the
“ADV1_GettingStarted_Soln The files for this extension (VirtualStream.dll, VirtualStream.edf and
.hsc” file.
Virtual Stream User Guide.doc) have been supplied to you on the course
disk. In addition to this extension, there are several others available on
the AspenTech support website (support.aspentech.com).
It is not important where on the hard disk you copy these files, but
remember the location as you will need to find these files in order to
register them with the system.
2. Once the files have been copied to the hard disk, move to the
Extensions tab of the Preferences view. (Accessed through the Tools
menu in the main menu bar.)
3. Click the Register an Extension button, and use the file explorer to
locate the VirtualStream.dll file. Opening this file will register it with
the system and allow you to use it in the simulation.
4. Return to the PFD of the simulation and add the extension using the
procedure described previously.
5. On the extension’s Connections tab, use the drop-down list to select
the Reference stream as Feed Gas, and for the Target Stream create a
new stream called Feed Gas VS.
6
Extensions 7
If the Feed Gas stream doesn't appear in the Reference stream drop-
down then the Allow Multiple Stream Connections option must be set
in the preferences (Tools-Preferences menu).
Figure 5
7
8 Extensions
Figure 6
This means that stream Feed Gas VS automatically maintains the same
Pressure, Molar flow, and composition as the Feed Gas stream, but will
always have a vapour fraction of 0. In this way, the temperature of Feed
Gas VS is always the bubble point of stream Feed Gas.
Challenge
Connect to the web and investigate the additional extensions available
within the Sample Macros and Extensions section of the Knowledgebase
on the AspenTech support web page at http:\\support.aspentech.com.
In order to access the Knowledgebase you will need to have previously
registered and obtained a login ID.
These can be downloaded and registered in exactly the same way as the
Virtual Stream extension.
8
Advanced Columns 1
Advanced Columns
1
© 2004 AspenTech - All Rights Reserved.
EA 1000.32.02
03 Advanced Columns
2 Advanced Columns
Workshop
Most users are familiar with the prebuilt columns that are available in
the main HYSYS Environment. This module will introduce the concept
of custom columns. HYSYS allows users to build columns without using
the prebuilt configurations. This is useful for simulating columns that
do not fit into the usual configurations.
HYSYS also includes a Column Sizing utility that can size and rate
column tray sections.
Learning Objectives
After completing this module, you will be able to:
Prerequisites
Before beginning this module, you should be able to:
2
Column Overview
4 Advanced Columns
Custom Columns
The most common way of adding a column to a simulation is to use the
prebuilt columns that HYSYS offers. There are four prebuilt columns
available:
4
Advanced Columns 5
Property View, double click the column icon on the PFD. With the
Column Property View as the active view, click the Column Environment
button. This will make HYSYS enter the Column Environment. The
operations within the column can be deleted, modified, replaced, and
controlled just like ordinary unit operations in the Main Environment.
The reboiler on this column is also of the generic type. An energy stream
is supplied and the liquid product from the last stage is boiled up. The
vapours return to the column and the liquid leaves the column as a
liquid product.
5
6 Advanced Columns
Figure 1
Because the generic reboiler that had no pressure drop is being replaced
with a heat exchanger that will have a pressure drop, a pump must be
added to the simulation to “push” the fluid through the exchanger.
6
Advanced Columns 7
However in this case the pressure at the bottom of the column is set by
the pressure in the bottoms liquid product stream (10), which is linked
to the Turbo Expander outlet pressure.
Be sure to pick the 8. Add a Separator after the Heat Exchanger, with the vapour product
Separator operation from returning to the bottom stage of the column, and the liquid product
the object palette, rather leaving the Column Environment as stream 10. (See the Column
than one of the Condensers
which have similar icons. Overview at the beginning of the module for the column PFD).
7
8 Advanced Columns
RVP Spec...
Type Column Vapour Pressure Spec
Name Btms RVP
Stage V-100
Type Reid Vapour Pressure
Phase Liquid
Spec Value 200 psia
Since the Heat Exchanger was installed in the Column Environment it's
specifications appear on the Monitor page along with the specifications
of the column. Heat Exchanger specifications can be activated and
deactivated just like Column specifications; they can also be added in
exactly the same manner as Column specifications.
10. Return to the Main Flowsheet and ensure that the three active
specifications for the column are: Ohvd Duty, Btms RVP, and E-100
Heat Balance.
Figure 2
8
Advanced Columns 9
11. Run the column; after it has converged, answer these questions:
9
10 Advanced Columns
Figure 3
As this is now a
Custom Column, the
Connections page of
the Design tab no
longer shows a
Distillation Column.
10
Advanced Columns 11
This way of modelling the reboiler is just as accurate as adding the heat
exchanger to the column sub-flowsheet although it does not look quite
as good.
11
12 Advanced Columns
Figure 4
Stage and Phase the Check this box to make the stream
Type the name of
stream will represent appear on the main flowsheet
the internal stream
12
Advanced Columns 13
Column Sizing
HYSYS contains a Tray Sizing utility that greatly simplifies the
mechanical design of a distillation column. A user can size full towers, or
sections of towers, by specifying information related to the trays, tower
internals, the downcomers, and the weirs.
The most common use of the Tray Sizing utility is to identify a tray
section, and then make HYSYS size the tower into sections based on
your input, then if desired, perform a rating analysis on the column.
While HYSYS is able to size and rate tray sections, the values that it
provides are only rough estimates and should be treated as such.
13
14 Advanced Columns
2. Select Tray Sizing from the list of available utilities and click the Add
Utility button.
Figure 5
3. Click the Select TS... button, and select LPG Recovery as the
Flowsheet and Main TS as the Object.
4. Click the Add Section... button. Accept all of the default values that
are presented.
HYSYS will calculate the dimensions of the column using preset values
for the column internals and for the various parameters.
14
Advanced Columns 15
What is the maximum pressure drop per tray in the Distillation Column?
15
16 Advanced Columns
Exercise
Head office is desperate to build a distillation column, but the
fabrication mill is working overtime and there are very lengthy delays for
special orders. The mill has the following trays in stock:
Obtain the flow parameters and pressure drops for a column that uses
the trays as given above. The following requirements must be met in
order for the column to be constructed.
• Maximum% Flood = 85
• Maximum weir loading = 80 m3/h-m (860 ft3/h-ft)
• Maximum downcomer backup = 50%
1. On the Design tab, click on the Specs page and set the Mode to
Rating.
2. Set the diameter and number of flow paths, and move to the
Performance tab.
3. Leave all the other specs at the default values.
16
Advanced Columns 17
Case Number 1 2 3
Diameter, m (ft.) 0.75 (2.5) 1.0 (3.3) 1.25 (4.1)
NFP 1 1 1
Weir Load
Flood
DC Back Up
Total Delta P
Compare the table above with the specifications on the previous page; which
set of trays will best meet the restrictions? Remember that smaller trays will
be less expensive.
Challenge
The Export Pressures button on the Tray Sizing Utility Performance tab
allows the calculated pressure drops to be exported to the column
pressure profile.
Use this feature to supply the LPG Recovery Column with the rigorously
calculated pressure profile.
Hint: Currently the condenser, reboiler, top and bottom tray pressures
appear as calculated (black) numbers. You will need to make them
specified (blue) before the Export Pressures function will work.
17
18 Advanced Columns
18
Templates and Sub-Flowsheets 1
1
© 2004 AspenTech - All Rights Reserved.
EA1000.32.02
04 Templates and Sub-flowsheets
2 Templates and Sub-Flowsheets
Sub-Flowsheets
HYSYS has a multi-flowsheet architecture. This allows a large process to
be split up into smaller sections or Sub-Flowsheets. Each Sub-
Flowsheet, has its own streams and operations, PFD and workbook, and
can be independently linked to a Fluid Package.
Templates
A Template is a special sort of HYSYS case, which has been set up ready
for easy insertion as a Sub Flowsheet into other HYSYS cases. Template
files have the file extension *.tpl.
Workshop
A typical use for templates is to construct a library of ready-made plant
sections ready to be installed into other models. In this module a
refrigeration loop template will be constructed and then installed into
the Turbo Expander plant model.
Learning Objectives
By completing this module, you will learn how to:
2
Templates and Sub-Flowsheets 3
Creating a Template
There are three ways to create a template:
3
4 Templates and Sub-Flowsheets
1. On the PFD, select all unit ops and streams you wish to "capture".
2. Right-click on any of the selected objects and select Cut/Paste
Objects and then Copy Objects to File (Export). Save the group of
objects to a *.hfl file.
3. From the File menu, select Open, then Cut/Copy/Paste, then
navigate to the *.hfl file you just saved.
4. Convert the new case that is created to a Template as in the
“Convert a Whole Flowsheet into a Template” section above.
4
Templates and Sub-Flowsheets 5
Figure 1
2. Initially set Chill-Q to 1E6 kJ/hr, make sure the case solves and looks
acceptable.
3. Ensure that the refrigerant flow rate is positive. If it is not, consider
why this might be. Check your PFD carefully and make the
appropriate changes.
4. Save the case as Mixed Refrig.hsc.
5
6 Templates and Sub-Flowsheets
Template Properties
The properties for the template can be set on the Main Properties
window (Simulation - Main Properties or CTRL M). The first few tabs of
this window are the same as for any simulation case. However, the two
final tabs are exclusive to Templates. These are Exported Connections
and Exported Variables. These two tabs only appear when the case has
been converted into a template.
Figure 2
The Exported Connections tab lists all the feed and product boundary
streams in the flowsheet, and allows a Transfer Basis to be set, this will
be used when the stream is linked between flowsheets. Connections and
Transfer Basis are covered in more detail shortly.
The Template Tag is used to identify the flowsheet within the case.
6
Templates and Sub-Flowsheets 7
The Installed Simulation Basis option controls what Fluid Package the
flowsheet will use when it is imported into another case.
Figure 3
Key variables within the flowsheet can be configured here and then
easily monitored on the sub-flowsheet's property view when it is
imported into the parent flowsheet.
It is not necessary to make any changes on these two tabs, all settings
can be configured later when the template is imported as a sub
flowsheet into another case.
7
8 Templates and Sub-Flowsheets
Figure 4
Connections Tab
On the Connections tab, you can enter all the Feed and Product
connections between the sub-flowsheet and the main flowsheet. Feed
connections are material or energy streams into the sub-flowsheet,
products are out of the sub-flowsheet.
7. Click on the External Stream box along side Chill-Q and select Q-
100 from the pull down menu.
8. For the other two streams there are no existing streams in the main
Internal streams refer to flowsheet so give them new stream names as in Figure 6.
streams in the sub-
flowsheet. External streams
9. Rename the sub-flowsheet to Mixed Refrig Unit.
are in the main flowsheet.
8
Templates and Sub-Flowsheets 9
Figure 5
Figure 6
9
10 Templates and Sub-Flowsheets
Template Tag
Tags are short names used to identify the sub-flowsheet associated with
a stream or operation when viewed outside the sub-flowsheet. The
default Tag name for sub-flowsheet operations is TPL1 (e.g.: strm6@
TPL1).
When more than one sub-flowsheet operation is installed the default tag
increases, TPL2, TPL3 etc. You may give sub-flowsheets proper names
(e.g.: refrig1).
Figure 7
Notice that the values of these variables are now displayed on the
Parameters tab.
10
Templates and Sub-Flowsheets 11
Note that since the default Internal Basis option was used when
configuring the template, the refrigeration loop sub-flowsheet is using a
different fluid package to the main flowsheet. If required the fluid
package used by each sub-flowsheet can be changed in the right table.
Figure 8
11
12 Templates and Sub-Flowsheets
Transfer Basis
HYSYS has the option to model a sub-flowsheet using a different fluid
package to the main flowsheet. This allows, for example, the modelling
of a Gas Sweetening process as a sub-flowsheet using PRSour within a
main flowsheet using PR.
In this case no transfer basis is required since only energy streams pass
across the flowsheet boundary.
12
Templates and Sub-Flowsheets 13
Figure 9
Challenge
In this case the chiller is simulated using a cooler in the main flowsheet
linked with an energy stream to a heater in the sub-flowsheet. It is
possible to replace the heater and cooler with a single heat exchanger.
One of the features of the HYSYS heat exchanger is the option to have
the streams on each side of the exchanger in different flowsheets.
Replace the heater and cooler with a single heat exchanger in the main
flowsheet. What advantages does modelling the chiller in this way have?
If you try this challenge, make sure to save your case with a different file
name and revert back to the separate heater and cooler case for
subsequent modules.
13
14 Templates and Sub-Flowsheets
Figure 10
Figure 11
14
Templates and Sub-Flowsheets 15
Figure 12
Figure 13
15
16 Templates and Sub-Flowsheets
Figure 14
The Environment label at the top right corner of the HYSYS window
indicates which environment is currently active. To return to the main
flowsheet, press the Enter Parent Environment button.
16
Templates and Sub-Flowsheets 17
17
18 Templates and Sub-Flowsheets
18
Spreadsheets and Case Studies 1
1
© 2004 AspenTech - All Rights Reserved.
EA1000.32.02
05 Spreadsheets and Case Studies
2 Spreadsheets and Case Studies
Workshop
The HYSYS Spreadsheet is a powerful tool that allows the user to apply
Spreadsheet functionality 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. In this module,
the Spreadsheet will be used to calculate a simplified profit for the
operating plant.
Learning Objectives
After completion of this module, you will be able to:
2
Spreadsheets and Case Studies 3
3
4 Spreadsheets and Case Studies
The value in any • Drag and Drop. Position the cursor over the Spreadsheet cell
spreadsheet cell can be that is to be exported. Click and hold the right mouse button; the
exported, except if it is an cursor should now change to the "bulls' eye" type. Move the
imported value. "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
Spreadsheet into the Simulation environment by placing the
cursor on the exportable cell in the Spreadsheet and clicking (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, click 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.
4
Spreadsheets and Case Studies 5
Figure 1
Figure 2
5
6 Spreadsheets and Case Studies
4. Set the Cost of Power (cell D1) to be 0.05 $/kWh and the LPG value
to be 0.2 $/kg.
5. Enter the formulae below.
Notice that HYSYS assigns variable types of Heat flow to cell D6 and
Mass flow to cell D8. This is because these are the variable types of the
cells involved in the calculation.
Figure 3
Remember in HYSYS The only cell remaining to be completed is B9. This is going to be used to
process variables appear as control the temperature of the refrigerant in the Mixed Refrig Unit.
blue numbers, calculated
ones as black, and in
spreadsheets any
7. Add a formula in cell B9 such that it is 5°C cooler than the Chiller
calculated numbers are exit temperature
shown in red.
6
Spreadsheets and Case Studies 7
To delete the temperature In order to make it easier to access and use the spreadsheet cells in
there is no need to enter the another unit op (e.g. an Adjust) or in the Databook, cells can be named.
Refrigeration sub-flowsheet
environment, simply right This is done either by selecting the cell on the Spreadsheet tab and
click the sub-flowsheet icon typing a name in the Variable field above the spreadsheet, or on the
and press 'Open PFD’
Parameters tab.
Figure 4
With a process temp of -62°C and a turbo exit pressure of 28 bar we have a
profit of $493.8 /h.
Change the chiller exit temp to -60°C and the expander exit pressure to 20
bar.
What is your new profit?
7
8 Spreadsheets and Case Studies
Use of Spreadsheets
The spreadsheet can be a very useful tool in HYSYS to:
Note that when copying and pasting, spreadsheets links are not always
maintained. To ensure all links are maintained convert the relevant part
of the case to a template.
Challenge
As you can see the simulation can be "driven" from the spreadsheet, by
changing the temperature of stream 2 and the pressure of stream 5 and
looking at the new profit.
Do you think you could use the spreadsheet to optimise the cooler exit
temperature and turbo expander exit pressure to give the maximum
profit available? You could but it would take a long time using trial and
error.
8
Spreadsheets and Case Studies 9
Figure 5
9
10 Spreadsheets and Case Studies
The first step is to configure all the variables of interest, both variables to
be varied in the Case Study and the results. HYSYS will do a series of
simulation runs and record the results for each case. If you omit a
variable from the list you will not be able to look at it once the runs are
complete. All data except for that declared is lost. Consider what you
might want to observe before you commit to running the Case Study.
Figure 6
10
Spreadsheets and Case Studies 11
3. Repeat the above until you have added the following variables.
Remember to add all the variables first and then edit their
descriptions.
Figure 7
Note, at any time before you actually run the case study you may add or
delete variables from this list.
4. Go to the Case Study tab and click on Add to set up a new case study.
Call it Operating Analysis.
All the previously configured variables are listed along with two columns
The Independent and Ind and Dep·
Dependent variable
checkboxes are only
enabled when you add a • Independent variables are the ones that will be varied by the
case study. It is not case study. These must be specified variables (i.e. blue
necessary for all the numbers).
variables to be ticked for • Dependent variables are the results to be monitored.
each case study, a minimum
of one dependent and one
independent variable is
required.
11
12 Spreadsheets and Case Studies
Figure 8
}
Here you can Add, or Delete case Here you check the Independent
studies, or view the variables set up for variables that are to be used in this
the highlighted case study. Case Study and the Dependant
variables you want to monitor.
6. Press View and configure the bounds as shown below. (Note the
Pressure and Temperature units here are kPa and °C.)
Figure 9
12
Spreadsheets and Case Studies 13
7. Press CTRL U to open the list of Utilities and then view each tray
sizing utility in turn and set it to Ignore.
8. Click Start to set the study running. The Failed States tab will show
any combination of independent parameters that fail to solve. While
the case study is running, or when it has finished, you can review the
results.
9. Either press the Results button on the Case Studies Setup window or
on the Case Studies tab of the Databook.
Figure 10
13
14 Spreadsheets and Case Studies
Figure 11
13. Size and arrange the windows so that you switch the graph between
the three dependent variables.
Figure 12
14
Spreadsheets and Case Studies 15
Figure 13
The main interest of course is the Overall Profit and the combination of
Chiller exit temp and Expander exit pressure that will give us the
maximum Operating Profit.
Figure 14
14. Right-click on the graph, and experiment with the tools available.
Try removing Hidden Lines, Rotation, and Plane Cutting.
15. In order to view the graph with the colours shown previously, right-
click on the graph and select Colour Control. Set the ranges as
above. Note that the red colour appears because there is a
discontinuity in the entered ranges between 410 and 430.
15
16 Spreadsheets and Case Studies
16. Before you leave this module, reset the chiller exit temperature to
-62 ºC and the Turbo expander exit pressure to 28 bar.
16
Advanced Recycle Operations 1
1
© 2004 AspenTech - All Rights Reserved.
EA1000.32.02
06 Advanced Recycle Operations
2 Advanced Recycle Operations
Introduction
This module will introduce you to several advanced topics concerning
the operation and convergence of the Recycle unit operation. The
HYSYS Recycle logical operation is used to solve looped systems where
downstream material is mixed back in upstream in the process. The
Recycle is a logical operation; it does not transform the stream that
passes through it.
Workshop
The export gas compression section of the Turbo Expander plant is to be
modified to deal with an additional hydrocarbon stream from elsewhere
in the process.
To cope with this additional load it has been decided to replace the
existing single export gas compressor with a two-stage compression
system. Each compressor is to be equipped with an after cooler and
knock out drum. Liquids from each separator are to be recycled back to
the previous stage.
2
Advanced Recycle Operations 3
Learning Objectives
In this module, you will learn how to:
Prerequisites
Before beginning this module, you should have a reasonable
understanding of the HYSYS program, and be able to add streams and
operations, including the Set and Spreadsheet operations.
3
4 Advanced Recycle Operations
Recycles are sometimes The Recycle operation allows HYSYS to solve looped system iteratively. A
also know as ‘Tears’.
set of conditions are assumed and used to solve the recycle loop. The
assumed values are compared with the calculated values and updated.
This is repeated until the values match within a specified tolerance. The
Recycle operation now allows information to be transferred both
forwards and backwards (i.e. the assumed value to be in either the outlet
Forward and backward
information transfer is
or inlet stream), although usually information is only transferred
discussed later in this forwards (i.e. assumed value in outlet).
module.
When the Recycle operation is first added, initial estimates need to be
provided for all the assumed values. Typically this is done by allowing
HYSYS to solve before closing the recycle loop. This is illustrated in the
Workshop.
4
Advanced Recycle Operations 5
5
6 Advanced Recycle Operations
6
Advanced Recycle Operations 7
Figure 1
Tolerances are calculated using HYSYS internal units - These units are
essentially the SI System with pressures in kPa (as shown in the table
above).
But how does HYSYS calculate the actual tolerance of the Recycle
operation? To answer this question, take the example of Temperature.
Multiplying the default relative tolerance of 10 by the set absolute
tolerance of 0.01 gives a tolerance of 0.1. This means that the
temperature of the Recycle's outlet stream must be within 0.1°C (0.18°F)
of the temperature of the Recycle's inlet stream in order for the
operation to be solved.
For flow rate the tolerance quoted in the table is relative. The absolute
tolerance is calculated by multiplying the flow rate in internal units
(kgmole/s) by the factor 0.001. For example with a flow rate of 100
kgmole/s and the standard multiplier of 10 the actual tolerance is
calculated as follows:
7
8 Advanced Recycle Operations
• Not transferred
• Transfer forwards
• Transfer backwards
The Not Transferred option can be used if you only want to transfer
certain stream variables. For example, if you only want to transfer P, T,
composition and flow, the other variables could be set to Not
Transferred.
When the checkbox is deactivated, the Recycle operation waits until the
inlet stream is completely solved before performing the next calculation
step. The default setting for the checkbox is inactive.
• Wegstein Acceleration
• Dominant Eigenvalue Acceleration
8
Advanced Recycle Operations 9
Figure 2
9
10 Advanced Recycle Operations
XN + 1 = Q × XN + ( 1 – Q ) × Y (1)
N
HYSYS chooses the value of Q that it will use depending on the amount
of change that has occurred between successive iterations. A larger
value of Q will be used when the change between successive iterations is
large, and vice-versa.
10
Advanced Recycle Operations 11
This can be accomplished using one of two methods; either set the
Acceleration Delay term to a large value, e.g.100, or set both Qmax and
Qmin to 0.
11
12 Advanced Recycle Operations
In the Simultaneous
example, the number of
recycle operations may be
reduced to one if placed in
the correct stream.
12
Advanced Recycle Operations 13
13
14 Advanced Recycle Operations
Information Summary
Using the Recycle Operation
• The Recycle operation is used to solve looped systems where
downstream material is mixed back in upstream.
• Initial estimates are needed for all assumed values.
Recycle Tolerances
• Calculated as the product of the relative tolerance (user
specified) and the absolute tolerance (set in the program).
• Tolerances are calculated using HYSYS internal units.
• Recycle streams that have very low concentrations of important
components, may require lower relative tolerances for the
composition specification.
Multiple Recycles
When using Multiple Recycles set the Calculation mode as follows:
Flash Types
• The flash type can be changed.
• Use default PT flash choice for most cases
• PH flash is better for very pure recycle streams.
14
Advanced Recycle Operations 15
Figure 3 - Exercise 1
15
16 Advanced Recycle Operations
How many recycles are needed in this flowsheet, where should they be
placed, and why?
____________________________________________________________
Figure 4 - Exercise 2
16
Advanced Recycle Operations 17
Exercise 3
Assume that the Feed is fully defined, Shell and Tube Side pressure
drops are known, as well as the Column Feed temperature.
How many recycles are needed in this flowsheet, where should they be
placed, and why?
_____________________________________________________________
Figure 5 - Exercise 3
17
18 Advanced Recycle Operations
Exercise 4
Assume the Feed is completely defined, shell and tube side pressure
drops for E-100 and E-101, and the temperatures of streams 3 and 4 are
known.
How many recycles are needed in this flowsheet, where should they be
placed, and why?
____________________________________________________________
Figure 6 - Exercise 4
18
Advanced Recycle Operations 19
Exercise 5
Assume the Feed is completely defined, and the shell and tube side
pressure drop for E-100 are known.
How many recycles are needed in this flowsheet, where should they be
placed, and why?
____________________________________________________________
Figure 7 - Exercise 5
19
20 Advanced Recycle Operations
Exercise 6
Examine the three stage compression plant PFD on the next page.
This flowsheet has five physical recycles and six HYSYS recycle
operations.
20
Advanced Recycle Operations 21
Figure 8 - Exercise 6
21
22 Advanced Recycle Operations
Workshop
Building the Simulation
This module will continue with the case built in the Getting Started
module. This is a Turbo Expander plant with an export gas compressor.
To simplify the main PFD the two stage export gas compression system
will be constructed in a new sub flowsheet.
22
Advanced Recycle Operations 23
Process Overview
Figure 9
23
24 Advanced Recycle Operations
Name Feed HC
Temperature 35°C (95°F)
Pressure 3000 kPa (435.1 psia)
Flow rate 6000 kgmole/hr (13228 lbmole/hr)
Component Feed Stream
Nitrogen 0.005
CO2 0.015
Methane 0.32
Ethane 0.24
Propane 0.11
i-Butane 0.075
n-Butane 0.075
i-Pentane 0.065
n-Pentane 0.05
n-Hexane 0.045
24
Advanced Recycle Operations 25
25
26 Advanced Recycle Operations
Figure 10
Now the product stream from this first mixer is always at the lowest
pressure of either of the two feed streams.
5. Add another mixer ready to take the returned liquid from the first
compression stage. The Mixer will have two feeds: Mixed feeds and
one from the recycle. For now, just set Mixed Feeds as the inlet. Call
the output To LP Sep.
The mixed feed streams are then fed to a separator, compressor, and
after cooler.
26
Advanced Recycle Operations 27
Cooler
Inlet Stage 1 Out
Outlet E-Stage 1 Out
Pressure Drop 25 kPa
Energy Stage 1 Eq
Set the temperature of stream E-Stage 1 Out to 30°C and the pressure to
5000 kPa.
The second compression stage is an exact copy of the first. Hence here is
a good place to make use of HYSYS' Copy / Paste functionality.
A question box may pop up if you did not also select all the attached
Since the objects are being
streams for any of the operations you selected.
pasted immediately to the
same flowsheet, the Clone 11. Unselect the objects, then right click on the PFD background and
function could have been choose Paste Objects from the fly out menu.
used. This is equivalent to
Copying then Pasting. 12. HYSYS automatically renames the pasted objects so the stream
names will need to be changed. Rename streams according to the
flowsheet on page 20.
13. Install a final knock out drum and the product gas stream.
14. Modify the second compression stage so that the product gas will be
at 70 bar.
The liquid from the MP and HP Sep knock out drums is to be returned
upstream, and hence must be flashed to the appropriate pressure. Since
this may be altered in the design process it is sensible to link the
returning liquid pressures to the compressor inlet pressures.
15. Install valves and valve outlet streams on the MP and HP Separator
liquid products. Use a Set operation to make the valve outlet
Object Palette Set icon pressure the same as the appropriate compressor inlet pressure.
27
28 Advanced Recycle Operations
Think carefully about the source streams for these pressures. Ensure the
source stream is upstream of any operations effected by the returning
flashed liquid.
16. Install a Recycle on the outlet of the let down valve from the MP
The physical recycle is often
a convenient place to put separator.
the Recycle operation 17. Add an outlet stream.
initially. Although it is not
always the best place!
In this case (as in the majority of all situations) the default parameters
are appropriate.
28
Advanced Recycle Operations 29
21. Open the Recycle property view and look at the Tables page of the
Monitor tab.
22. Look at the Worksheet tab for each Recycle. Complete the following
table:
Exercise
Part of the design process for this new multi-stage compression plant is
to choose an inter-stage pressure to balance the load between the two
compressors.
The details of setting up the In this exercise you will calculate the duty ratio for the two compressors
spreadsheet are not using a HYSYS Spreadsheet, and then use an Adjust to change the inter-
covered here. If you have
stage pressure such that the load is balanced across the two
any problems with this
section, ask the instructor. compressors.
Figure 11
30
Advanced Recycle Operations 31
Figure 12
31
32 Advanced Recycle Operations
The Calc Levels of all the objects in a flowsheet can be viewed and
changed by going to the Simulation / Main Properties menu option and
choosing the Calc Levels tab.
32
Advanced Recycle Operations 33
Figure 13
Hence the default calculation levels for Adjusts and Recycles mean they
solve after the rest of the flowsheet, but are at the same level of priority
in the solver list.
28. Change the Calc Level of the Adjust to 4000 so that it solves after the
recycles.
29. Unignore the Adjust, it should now solve.
33
34 Advanced Recycle Operations
Deliberately displace the simulation from the load balance point (e.g. by
changing the inter stage pressure to 40 bar). Compare the solution time
between the two calculation modes.
The Author found that for a displacement to 40 bar the Nested recycles
took around 13 seconds to solve, whereas the Simultaneous recycles
solved in just 4 seconds. In this case the step size is probably too small
since the Adjust requires many small steps to work up to the solution.
34
Advanced Recycle Operations 35
Challenge
You complain to your boss, Grayson Streed, that your simulation takes
too long to converge on your computer because of the multiple recycles
and use this opportunity to petition for a new high-speed computer.
Grayson has a look at your simulation and denies your request on the
basis that you can reduce your convergence time by eliminating one of
the recycles in the simulation. Is your request justified or is Grayson
correct?
Hint: visualize the two recycle loops in the case, and try to see if there
are any overlaps. If you find that Grayson was right, eliminate one of
your recycles. Think carefully about the best way to proceed. Remember
that you'll need to provide an initial estimate of the recycle outlet
stream. What is the best way to obtain this estimate?
With one recycle eliminated how long does the simulation take to recover
from a disturbance now?___________________________________________
35
36 Advanced Recycle Operations
solving method they may interfere with each other while they are
solving. This is because each Adjust considers only its adjusted and
target values, and does not cooperate with any of the other adjusts.
Figure 14
36
Advanced Recycle Operations 37
What feed flow rate is required to give an export gas flow of 100
MMSCFD?___________________________________________
Figure 15
37
38 Advanced Recycle Operations
Parameters Tab
The Parameters tab allows you to modify the tolerance, step size, and
max and min values for each Adjust. It also displays the residual,
number of iterations the SAM has taken and the iteration status. This tab
also allows you to specify some of the calculation parameters as
described in the table below:
Parameter Description
Type of Jacobian Calculation Allows you to select one of three
Jacobian calculations:
• ResetJac. Jacobian is fully
calculated and values reset to initial
values after each Jacobian calculation
step. Most time consuming but most
accurate.
• Continuous. Values are not
recalculated between Jacobian
calculation steps. Quickest but allows
for ‘drift’ in the Jacobian therefore not
as accurate.
• Hybrid. Hybrid of one of the above
two methods.
Type of Convergence Allows you to select one of three
convergence types:
• Specified. SAM is converged when
all Adjusts are within the specified
tolerances.
• Norm. SAM is converged when the
norm of the residuals (sum of squares)
is less than a user specified value.
• Either. SAM is converged with
whichever of the above types occurs
first.
Max Step Fraction The number x step size is the maximum
that the solver is allowed to move during
a solve step.
Peturbation Factor The number x range (Max - Min) or the
number x 100 x step size (if no valid
range). This is the maximum that the
solver is allowed to move during a
Jacobian step.
Max # of Iterations Maximum number of iterations for the
SAM.
38
Advanced Recycle Operations 39
Answer Key
Exercise 1
Examine the PFD above. This Flowsheet has three physical recycles and
three HYSYS recycle operations. What is the minimum number of recycle
operations that are needed?
Exercise 2
How many recycles are needed in this flowsheet, where should they be
placed, and why?
Exercise 3
How many recycles are needed in this flowsheet, where should they be
placed, and why?
39
40 Advanced Recycle Operations
Exercise 4
How many recycles are needed in this flowsheet, where should they be
placed, and why?
There is no need for a Recycle in the small loop containing the two
exchangers and separator V-101 because the pressures and
temperatures in streams 3 and 4 are known, hence stream 4 can flash
fully before the exchangers are solved.
However, the column will not be able to solve unless its feed stream is
fully defined, hence a Recycle is need somewhere in the main loop -
for example in stream 9, 1 or 7.
Exercise 5
How many recycles are needed in this flowsheet, where should they be
placed, and why?
40
Advanced Recycle Operations 41
Three
Recycle 5 is superfluous since the first feed separator can solve fully
with the other Recycles in place.
Recycle 6 is also superfluous since both feed streams to E-103 are fully
defined as E-104 has a specified outlet temperature.
41
Answer Key PFD
2 3
Advanced Recycle Operations 43
43
44 Advanced Recycle Operations
44
Troubleshooting 1
Troubleshooting
Workshop
In this module, you will be presented with cases derived from the HYSYS
Steady State course. There have been errors introduced into the cases
that prevent them from solving. It is left up to you to find these errors
and solve the cases. Of course, the instructor will be willing to assist you
in any way that he/she can.
In order to save time, all of the cases can be found on the supplied
Starter disk. The solved cases are also provided on the Solutions disk.
Also included in this module are several troubleshooting tips that you
can use both for this module and for troubleshooting your own cases.
Learning Objectives
After competing this module, you will be able to:
Prerequisites
Before beginning this module, you should be able to:
2
Troubleshooting 3
Figure 1
3
4 Troubleshooting
4
Troubleshooting 5
Figure 2
5
6 Troubleshooting
3. Click the Add Utility button. The Property Balance Utility view
appears.
Figure 3
Figure 4
6
Troubleshooting 7
Figure 5
Figure 6
7
8 Troubleshooting
Figure 7
8
Troubleshooting 9
Degrees of Freedom
Degrees of freedom play an important role in the operation of the
HYSYS solver, but their role is most obvious when working with column
operations. The DOF can be checked on the Monitor page. They must
be zero before the column solver will attempt to converge the column.
The number of active specifications that the column requires depends
on the configuration of the column and can be determined using this
formula:
In the above formula, reboilers and condensers (any type) are counted
as side exchangers.
This is a tricky question because many people forget that each pump around
and side stripper also has its own individual side draw. So the actual
number of required active specifications is 13, not 7.
When you are defining the active specifications for your column
operations, ensure that you are not entering conflicting specifications.
For example, with a generic distillation column (a condenser and a
reboiler) do not specify both the reboiler duty and overhead rate as
active specifications. These values are linked and are really the same
specification; so specifying both as active will probably not allow the
column to solve.
It is also a good idea to spread the active specifications between the top
of the column and the bottom. For example, do not specify the
condenser temperature, overhead vapour rate, and reflux ratio as your
three active specifications. These specifications all focus on the top of
the column; it would be much better if the three specifications were
reflux ratio, bottoms draw rate, and overhead vapour rate. This means
that the bottom of the column will be partially specified as well.
9
10 Troubleshooting
Another common mistake is that the HYSYS user will specify the
product flow rates as their active specifications. This is commonly done
when attempting to model an existing column because product flow
rates are often readily available. The problem here is that if all of the
product flow rates are fixed, HYSYS has no flexibility in determining a
solution. It is much better to specify the flow rates as estimates, and use
other specifications as the active specs.
All feed streams to a column must be fully defined before the column
can solve. Columns can not calculate the conditions of a feed stream
based on product streams. Likewise, all product streams should not
contain any user specified information. A product flowrate specification
must be listed with the column’s other specifications on the Monitor
page, not specified as the flow rate for that stream in the worksheet.
10
Troubleshooting 11
Column Diagnostics
Once all of the required information is entered and the column solver is
able to begin calculations, there is no guarantee that the given
specifications will lead to a solved column. As many HYSYS users are
aware, finding the specific reason for convergence failure can be a
difficult and frustrating challenge.
The following five situations can occur if the column fails to converge.
Each situation has possible causes, which may help you find the source
of the problem.
Condition 3 - The Heat and Spec Error oscillates and fails to converge:
11
12 Troubleshooting
• Check that the top stage calculated temperature is not too cold. If
it is, a side water draw may be required.
• Check the material balance around the column, make sure that
your specifications are not preventing the column from solving.
Working on Cases
This is your opportunity to apply the tips that were presented on the
previous pages. The instructor will let you work through the problems
individually; however, if you require assistance, please, ask the
instructor for help.
Case 1
Open the HYSYS case called Case 1.hsc located on the Starter course
disk. This case is a multi-stage compression plant with liquid recycled
upstream.
12
Process Flow Diagram - Case 1
14 Troubleshooting
Case 2
Open the HYSYS case called Case 2.hsc located on the Starter course
disk. This case is a simple gas plant where the separator temperature is
set to meet a dew point temperature specification on the export gas.
14
Process Flow Diagram - Case 2
16 Troubleshooting
In this case, there are five errors distributed among three operations.
Start at the beginning of the simulation; remove all of the errors and
solve the simulation.
In order to solve this simulation, you need to think about the purpose of
the Balance operation, and the solving behaviour of the Adjust
operation. The balance operation can perform material and energy
balances over it's connected streams. If the Mole balance type is chosen
then component mole flows are balanced, the Mass balance type
balances overall mass flows.
Case 3
Open the HYSYS case called Case 3.hsc located on the Starter course
disk. This case simulates demethaniser and deethaniser columns.
16
Process Flow Diagram - Case 3
18 Troubleshooting
In this case, there are four errors that prevent the two columns from
converging. It is important to remember what a column needs in order
to solve. Once again, start at the very beginning of the simulation and
work your way through the case.
Case 4
Open the HYSYS case called Case 4.hsc located on the Starter course
disk.
18
Process Flow Diagram - Case 4
20 Troubleshooting
In this case, there are only two things that must be changed, finding the
errors could prove challenging; things are not always as they appear.
Remember to think twice before deleting anything; once it is gone, you
might not be able to get it back. In this case, it will help to consider the
purpose of every operation.
20
Depressurisation: A Practical Guide
This guide has been prepared based upon questions frequently asked regarding the Dynamic
Depressuring utility introduced in HYSYS 3.0. It should provide users with an explanation how to use the
utility and correctly interpret the results. It is divided into three sections:
1.0 Overview
2.0 Adding and Configuring the Utility
3.0 Example Problem
1.0 Overview
Why are there two Depressuring utility options?
The original Depressuring utility in HYSYS was a pseudo-dynamic calculation based on a series of
steady state calculations. The Dynamic Depressuring utility was introduced in HYSYS 3.0 to allow users
to perform proper time-dependant calculations. A HYSYS Dynamics licence is NOT required to use this
new utility.
The Depressuring utility can be used to simulate the depressurisation of gas, gas-liquid filled vessels,
pipelines and systems with several connected vessels or piping volumes depressuring through a single
valve. References to “vessel” in this guide can also refer to piping or combinations of the two.
• Fire Mode is used to model a vessel or pipe under fire conditions. This mode has three sub-types:
Fire, Fire Wetted and Alternative Fire.
• Adiabatic Mode is used to model the blowdown of pressure vessels or piping with no external heat
supplied.
A Depressuring utility can be added to the case by selecting "Tools" ! "Utilities", highlighting
"Depressuring - Dynamics" and pressing the "Add Utility" Button. You may note that the original
Depressuring model is still shown on the "Available Utilities" menu, this option will be discontinued after
version 3.0.1 and all existing models will be converted to the new Dynamic utility.
Connections
On the "Design" tab, "Connections" page, choose the stream that represents the fluid you want to use as
the source for the depressuring. If you have a single vessel, for example, the stream would be the feed
stream into the vessel. Attaching the stream to the utility is accomplished as shown in the view below.
Ideally, the vessel size will be known and this data can be entered into the appropriate fields on the form
shown above. If the vessel size is unknown, then the vessel sizing utility in HYSYS can be used to
estimate the required parameters.
The initial liquid volume is normally calculated at the normal liquid level (NLL). The heads of the vessel
are not taken into account so the volume will be the liquid in the cylindrical portion only. If the feed stream
is two-phase, the equilibrium composition of the liquid will be calculated. If an initial liquid volume is not
specified, HYSYS will take a volume equal to the volumetric flow of the feed liquid over one hour. This
may be disproportionate to the total vessel volume.
HYSYS does not take account of the heads in a vessel so volumes and areas are calculated as for a
cylinder. The total vessel volume is calculated from the diameter and height (or length for a horizontal
vessel). To account for piping or head volume contributions, a small amount can be added to the height
or length of the vessel.
If the condition of the system at settle out are such that the vapour is superheated, HYSYS will not allow
a liquid inventory. The settle out conditions for mixed sources and volumes are calculated on a constant
enthalpy, volume and mass basis.
Correction Factors allow for adjustments to the amount of metal in contact with the top or bottom of the
vessel. This can also be used to account for additional nozzles, piping, strapping or support steelwork in
close contact with the vessel. HYSYS will use the heat content of this metal when performing the
• Fire Mode can be used to simulate plant emergency conditions that would occur during a plant fire.
Pressure, temperature and flow profiles are calculated for the application of an external heat source
to a vessel, piping or combination of items. Heat flux into the fluid is user defined using the following
equation:
LiquidVolumetime=t
Q = C1 + C2 × time + C3 (C4 − TVESSEL ) + C5 ×
LiquidVolumetime=0
The Fire equation can also be used to simulate the depressuring of sub-sea pipelines where heat
transfer occurs between seawater and the pipeline. If C3 was equal to UA, C4 was equal to T1 and C1,
C2 and C5 were equal to zero, the above equation would reduce to:
• Fire Wetted Mode uses similar heat flux parameters to those used in Fire mode. Three
coefficients: C1, C2 and C3 must be specified. The equation used by HYSYS is an extension to the
standard API equation for heat flux to a liquid containing vessel. A wetted area is required and used
to calculate the heat transfer into the vessel.
The following notes are based on extracts from Guide for Pressure-Relieving and Depressuring
System, API Recommended Practice 521, Forth Edition, March 1997.
The amount of heat absorbed by a vessel exposed to an open fire is affected by:
The following equations are based on conditions where there is prompt fire fighting and adequate
drainage of flammable materials away from the vessel.
Environmental Factor
Table 5 on Page 17 of API 521 lists F factors for various types of vessels and insulation. For a bare
vessel, F = 1. For earth-covered storage, F = 0.03. For below-grade storage, F = 0. For insulated
vessels, users should consult the reference and select an F value based on the insulation
conductance for fire exposure conditions.
Wetted Area
The surface area wetted by the internal liquid content of the vessel is effective in generating vapour
when the exterior of the vessel is exposed to fire. To determine vapour generation it is only necessary
to take into account that portion of the vessel that is wetted by liquid up to 7.6m (25ft) above the
source of the flame. This usually refers to ground level but it can be any level capable of sustaining a
The HYSYS equation is an extension of the standard API equation. Therefore, in field units, C1 will be
21000 multiplied by the environmental factor, F and C2 will 0.82. (In most cases, C1 will be equal to
21000).
Q = C1 × (WettedAreatime=t )
C2
C3
Liquid Volume 1 0.75 0.5 0.25 0
Time Volume Ratio Wetted Area Wetted Area Wetted Area Wetted Area Wetted Area
(minutes) (m3) (m2) (m2) (m2) (m2) (m2)
0 6 1.0 500.0 500.0 500.0 500.0 500.0
5 4 0.7 333.3 375.0 416.7 458.3 500.0
10 3 0.5 250.0 312.5 375.0 437.5 500.0
15 2 0.3 166.7 250.0 333.3 416.7 500.0
Therefore if a C3 value of 0 is used, the initial wetted area is used throughout the calculations. This could
represent a worst case scenario. Alternatively, if a C3 value of 1 was used, the volume would vary
proportionally with the liquid volume. This would represent a vertical vessel.
Depressuring Heat Flux Equation is incorrect if Field units are selected. If the fire wetted equation is used
while field units are selected (i.e.: BTU/h), the heat flux equation used by the Depressuring utility will be
incorrect. There is a problem with the conversion between SI and Field units. Instead of using the normal
API coefficient of 21000, the value of C1 should be multiplied by 7 (i.e.: 147000). This will correct for the
unit conversion problem. Because of this defect, the following equations should be:
API Equation Equation Units Area Units
Q = 147000 * F A 0.82 BTU/h ft2
Q = 155201 * F A 0.82 KJ/h m2
Q = 43.116 * F A 0.82 KJ/s m2
• Alternative Fire Mode uses the Boltzman constant to take into account radiation, forced
convection, flame temperature and ambient temperature. The method may be considered as an
alternative method to the API standard.
( ( )
Q = Atotal × ε f × ε v × k (T f + 273.15 ) − (TV + 273.15 ) + outsideU × (Tamb − TV )
4 4
)
where:
A total = total wetted surface area
εf = flame emissivity generally ranges from 0.2 to 0.5 (for burning heavy HCs)
εv = vessel emissivity generally ranges from 0.5 to 1 (for polished metal)
k = Boltzman constant equals 5.67*10 - 8 W/m2 K4
Tf = flame temperature 1500 K and upwards
Tv = vessel temperature
outside U = convective heat transfer between vessel and air
Tamb = ambient air temp
• Use Spreadsheet is an option that allows the user access to the spreadsheet used by the
depressuring utility. Values can be altered in this spreadsheet and additional equations substituted
for calculation of the heat flux. It is recommended that this option only be used by advanced users.
2. Simple: allows the user to either specify the heat loss directly or have it calculated from specified
values
3. Detailed: allows the user to specify a more detailed set of heat loss parameters
Simple Model
• Heat Transfer Area is the cylindrical area of the vessel with no allowance for head area. This value is
calculated using the vessel dimensions specified on the "Connections" page.
• Using the Simple Heat Loss Model, heat loss from the vessel is calculated using the following
formula:
Q = UA(T fluid − Tambient )
Detailed Model
The duty can be applied to the vessel wall or directly to the fluid. The former would be used to model a
fire and the latter to model a heater. There are four portions of the model to be set up. They are General,
Conduction, Convection and Correlation Constants.
General
The General section allows the user to manipulate Recycle Efficiencies and the ambient temperature.
The default value for all three Recycle Efficiencies is 100%. This means that all material in the vessel has
been flashed together and is in thermodynamic equilibrium. If the Recycle Efficiencies were to be reduced
a portion of the material would by-pass the flash calculation and the vapour and liquid would no longer
Conduction
The Conduction parameters allow the user to manipulate the conductive properties of the wall and
insulation.
The metal wall thickness must always have a finite value (i.e.: it cannot be <empty>). To model a vessel
without insulation, the insulation value thickness should be zero. Users are also required to enter the
specific heat capacity of the material(s), the density of the material(s) and the conductivity of the
material(s).
Convection
The Convection view allows users to manipulate the heat transfer coefficient for inside and outside the
vessel as well as between vapour and liquid material inside the vessel.
Correlation Coefficients
This feature gives users the opportunity to manipulate the coefficients used in the heat transfer
correlation. By selecting "Use Specified Constants", the user may manually enter the constants used in
the heat transfer correlations.
The equation which determines the outside heat transfer coefficient for air is:
m
∆T
h = C ×
length
The equation used for the other three correlations is:
Nu = C × (Gr × Pr )
m
Valve Parameters
The Valve Parameters page allows users to select the type of valves to be used for both vapour and
liquid service. In most cases, either the Fisher or the Relief valve should be used for valve sizing. Their
equations are more advanced than some of the others and can automatically handle choked conditions.
Furthermore, these two valve types support other options that can be accessed through the valve
property view accessible through the Depressuring sub-flowsheet. The seven available valve types are
described in the sections that follow.
Fisher
The Fisher option uses the standard valve option in HYSYS. It allows the user to specify both valve Cv
and percent opening. By pressing the "Size Valve", the valve can be sized for a given flow rate.
Relief Valve
The relief valve option uses the standard HYSYS relief valve. The user can specify orifice area (or
diameter), relief pressure and full open pressure. The user is required also to specify an orifice discharge
coefficient. To have the relief valve open at all times, enter a full open pressure that is lower than the final
expected vessel pressure and a set pressure that is only slightly lower than the full open pressure.
Supersonic
The supersonic valve equation can be used for modelling systems when no detailed information on the
valve is available. The discharge coefficient (Cd) should be a value between 0 and 1. The area (A) should
be a value between 0.7 and 1. P1 refers to the upstream pressure and ρ1 the density.
F = C d × A × (P1 × ρ 1 )
0.5
Subsonic
The subsonic valve equation can also be used for modelling systems when no detailed information on the
valve is available but the flow is sub-critical. This can occur when the upstream pressure is less than
(P + P )× (P1 − Pback )
0.5
F = Cd × A × 1 back ρ1
P1
Pback refers
Back Pressure
It is possible to have the depressuring scenario cycle between pressure build-up and relief. To perform
this analysis, ensure a reasonable pressure differential and increase the number of pressure steps.
Masoneilan
This equation was taken from the Masoneilan catalogue. It can be used for general depressuring valves
to flare. When this option is selected, the user must specify Cv and Cf. The remaining parameters in the
equation are set by the Depressuring utility.
F = C1 × Cv × C f × Y f × (P1 × ρ1 )
0.5
where:
General
The General valve equation is based on the equation used to calculate critical flow through a nozzle as
shown in Perry's Chemical Engineers' Handbook 1. It should be used when the valve throat area is
known. Note that this equation makes certain limiting assumptions concerning the characteristics of the
orifice.
F = Cd × Av × K term × (g c × P1 × ρ1 × k )
0.5
where:
Cd = discharge coefficient
Av = throat cross sectional area
k +1
Kterm = 2 2( k +1 )
k + 1
No Flow
Use Spreadsheet
Recommended only for advanced users, this option allows the user to customise a valve equation by
editing the valve spreadsheet found inside the Depressuring sub-flowsheet.
Discharge Coefficient
When the relief, supersonic, subsonic or general valve is selected, the user is required to specify a
discharge coefficient. This correction factor accounts for the vena contracta effect. Values ranging from
0.6 to 0.7 are typically used. In order to disregard this effect, set the discharge coefficient equal to 1.
Options
Operating Conditions
Operating Parameters
Operating pressure refers to the initial vessel pressure. By default, this value is the pressure of the inlet
stream. The time step size refers to the integration step size. It may be a good idea to reduce the step
size if the flow rate is significantly larger than the volume or if the vessel depressurises in a relatively
short amount of time (~3s).
Either the Dynamic Depressuring utility can solve for the final pressure or the Cv/Area required to achieve
a specified final pressure.
The "Calculate Pressure" option uses the specified area/Cv to determine the final pressure.
"Calculate Area" is available for Relief, Supersonic, Subsonic and General valves. "Calculate Cv" is
available for Fisher and Masoneilan valves. The two options differ only in the type of value calculated.
Based on API, it is normal to depressure to 50% of the staring pressure or to 100 psig. Before the
calculations start, the user must specify an initial Cv or area. If the depressuring time is reached before
Performance
Once all the required information has been submitted, a yellow bar that reads "Ready To Calculate" will
appear at the button of the Depressuring view.
Once the utility has run, users can go to the "Performance" ! "Summary" page to view the results.
In the exercise, the required valve size for depressuring a vertical vessel to 50% of its operating pressure
in a Fire Wetted case will be calculated.
Select the Peng-Robinson equation of state, add the required components and then add a stream with
the following properties and molar flows:
2) Press "Create…"
1) Go to "Attachments" ! "Utilities"
Enter the following information on the "Heat Flux Parameters" section of the "Heat Flux" page:
On the "Options" page, enter a PV Work Term of 90%. On the "Operating Conditions" page, select
"Calculate Cv" and enter a final pressure of 500 kPa (72.52 psia).
Once you have submitted the required information, press the "Run" button to execute the calculations.
Explore the strip charts, analyse the results and answer the following questions:
Using the default values provided, try the "Simple" heat loss model.
What Cv is calculated?
What is the peak flow? kg/h
Using the default values provided, try the "Detailed" heat loss model.
What Cv is calculated?
What is peak flow? kg/h
1
© 2004 AspenTech - All Rights Reserved.
EA1000.32.02
09 Compressor and Pump Curves
2 Compressor and Pump Curves
Workshop
In this module, compressor and pump curves will be used to model the
behaviour of simulated compressors and pumps. Using curves to model
these unit operations allows HYSYS to accurately simulate actual plant
equipment.
Learning Objectives
Once you have completed this module, you will be able to:
Prerequisites
Before beginning this module, you should have a reasonable
understanding of the HYSYS program, and be familiar with adding and
basic configuration of Pumps and Compressors.
2
Compressor and Pump Curves 3
Compressor Curves
Using compressor curves in your HYSYS simulation allows you to
Don’t worry if you haven’t
built the case mentioned. accurately model existing plant equipment. You can determine if an
existing compressor is able to meet the specifications of your process.
The Using compressor curves allows HYSYS to calculate heads and
“ADV6_AdvancedRecycles_ efficiencies that are dependant on the flow rate. If the flow rate through
Soln.hsc” file contains this
case. the compressor is known to be constant, a single pressure rise and
efficiency can be supplied. If, however, the flow rate is expected to
change, using a compressor curve will allow HYSYS to calculate new
heads and efficiencies based on the current flow rate.
Workshop
In this workshop, you will add a set of multiple curves to the K-stage 2
compressor in the Advanced Recycle Module simulation.
3
4 Compressor and Pump Curves
Figure 1
2. Ignore the Adjust that controls the outlet pressure of the 1st stage
(ADJ-1).
3. On the Curves page (on the Rating tab), select the Adiabatic radio
button in the Efficiency group. Click the Add Curve button, and
enter the data as shown here:
Figure 2
4
Compressor and Pump Curves 5
Instead of manually typing the data you can paste it in from the Excel
file 'Compressor Data.xls'. Before the compressor curve window will
accept a table of pasted data it must first be set to have the correct
number of rows. This can be accomplished by typing dummy data
points into the left-hand column to give the required number of rows.
Figure 3
Figure 4
5
6 Compressor and Pump Curves
Figure 5
4. Activate the individual curves on the Curves page and ensure that
the Enable Curves box is checked.
6
Compressor and Pump Curves 7
5. Click the Plot Curves button. A graphical view of the curves and
operating point is shown.
Figure 6
Operating
Point
Optional Exercise
It is desired to have an outlet pressure of 7850 kPa at the battery limits to
the facility (i.e. stream New Export Gas). How can you achieve this?
7
8 Compressor and Pump Curves
Pump Curves
As with compressor curves, pump curves are used to allow HYSYS to
accurately model existing pumps. Pump curves allow the pressure rise
across the pump to be dependent on the flow rate of liquid. The pump
curves are entered into HYSYS using a form different to that used for
compressor curves. With pump curves the coefficients of an expression,
up to the fifth order, are entered into HYSYS rather than the actual data
points.
Figure 7
8
Compressor and Pump Curves 9
Figure 8
9
10 Compressor and Pump Curves
10
Using Neural Networks in HYSYS
Introduction
HYSYS includes a Neural Network calculation tool that can be used to
approximate part (or all) of a HYSYS model. It can be trained to replace either
the first principles calculations usually done by HYSYS, or to simulate a unit
operation that cannot be modeled using first principles.
Using a Neural Network solver offers a number of advantages:
It is significantly faster than a first principles solution.
It offers increased robustness so that a result will always be possible.
When using a Neural Network, always be aware that results are valid only
within the range over which the Neural network was trained.
Workshop
In this module HYSYS’ Neural Network capability will be used to replace the
standard HYSYS solver for the Turbo Expander plant that has been constructed
in this course.
Additionally an Exercise is included where the Parametric Unit Operation is
trained with tabular input data.
Learning Objectives
After completion of this module, you will be able to:
Use the Parametric Utility to incorporate a Neural Network into a HYSYS
model.
Use the Parametric Unit Operation with tabular data to model a unit
operation as a ‘black box’.
Prerequisites
Before starting this module you should be familiar with the HYSYS interface
and be able to add and configure streams, operations, utilities and case studies.
2
Using Neural Networks in HYSYS
Neural Networks
3
Using Neural Networks in HYSYS
Process Overview
4
Using Neural Networks in HYSYS
Workshop
Process Description
In this module HYSYS’ Neural Network capability will be used to replace the
standard HYSYS solver for the Turbo Expander plant that has been constructed
in this course.
1. Open the Turbo Expander plant case if it is not already open.
This module assumes that the case has had at least the changes from the
‘Templates and Sub-flowsheets’ and ‘Spreadsheets and Case Studies’
Don’t worry if you
modules made to it.
haven’t built the Turbo The main process variables that will be manipulated are the cooler outlet
Expander plant case. temperature (stream 2) and the Turbo Expander outlet pressure (stream 5).
The file If you have completed the Advanced Recycles module and have added the
‘ADV5_Spreads&CaseS multi-stage compression sub flowsheet to your Turbo Expander plant, it is a
tud_Soln.hsc’ contains good idea to ignore the Adjust operations to reduce the calculation time.
this case.
5
Using Neural Networks in HYSYS
Notice that now the Next> button is enabled to move the view to the next
tab.
It is possible to only model a subset of operations in the flowsheet. Operations
can be added and removed using the buttons marked >>>>> and <<<<<.
6
Using Neural Networks in HYSYS
7
Using Neural Networks in HYSYS
11. Choose the Observable radio button and review the variables that will be
calculated by the Neural Network.
8
Using Neural Networks in HYSYS
21. By clicking the View Graph or View Table buttons, the results from the
HYSYS model can be compared to those from the Neural Network model.
In this case, the error should be negligible for all of the variables.
9
Using Neural Networks in HYSYS
10
Using Neural Networks in HYSYS
Conclusions
Neural Networks can be significantly faster than a first principles solution.
The Neural Network part of the calculation is typically about 1000 times
faster than the standard solver, however HYSYS needs to do many other
tasks as well (data storage, interface updates, etc.) that can reduce the
actual speed increase seen.
Robustness is increased; a result will always be possible. Whereas the
standard solver may fail in certain circumstances.
Neural Networks are only as good as the data they were trained with. If a
parameter is changed so that it is outside the training range then the results
may not be valid, and could include large errors.
Neural Networks will not predict the effect of changes in variables not
included in the training data.
11
Using Neural Networks in HYSYS
Exercise
3. Click Add.
12
Using Neural Networks in HYSYS
4. Select the Inputs from a data file option and choose the Column data
format option. Set the Number of Inputs to 3 and the Number of Outputs
to 3 as shown.
By clicking the View Data button, the contents of the data file can be displayed.
7. On the Setup page, map the Input 1, 2, 3 variables to the Fuel Temperature,
Pressure and Mass Flow respectively. Similarly, map the Output Variables
to Exhaust Temperature, Pressure, and Mass Flow.
The red cross in the Bad Data column means the data is OK. If
the data is bad, a green checkmark appears.
13
Using Neural Networks in HYSYS
14
Using Neural Networks in HYSYS
15
Real Separators in HYSYS
Introduction
The HYSYS Separator unit operation normally assumes perfect phase
separation, but it can also be configured to model imperfect separation by
using the HYSYS Real Separator capabilities.
The real separator offers the user a number of advantages:
Includes carryover so that your model matches your process mass
balance or separator design specifications.
Predicts the effect of exit devices on mitigating carryover.
This workshop will introduce the user to the concepts needed to use these
real separator features. The workshop will then step the user through a
typical real separator application.
Workshop
The workshop will focus on using the HYSYS Real Separator capabilities to
model imperfect separation in a 3-phase oil-water-gas separator.
An exercise is included where a demister pad is added to the model as a
secondary separation device to reduce liquid carryover into the gas.
Additionally, a demonstration is given of the carryover feature in a dynamic
model.
Learning Objectives
After completion of this module, you will be able to:
Account for carryover in process design problems.
Calculate carryover based on vessel geometry and inlet conditions using
several basic correlations.
Model an exit device to reduce carryover in the vapour product.
Understand how carryover effects are accounted for in a dynamic
model of a separator.
Prerequisites
Before starting this module you should be familiar with the HYSYS interface
and be able to add and configure streams, operations, utilities, and case
studies.
2
Real Separators in HYSYS
Modeling Separators
Carryover Option
As with many other unit operations, HYSYS allows you to increase the
fidelity of your separator model to account for non-ideal effects. HYSYS 3.2
introduces Real Separator capabilities like the carryover option. This option
can be used to model imperfect separation in both steady state and
dynamic simulation. Gas and liquid carryover can be specified or
calculated (three different correlations are available for this purpose).
Vessel Internals
Internals used to reduce carryover can be included in your separator model
with some of the provided carryover correlations.
Internals used to reduce liquid carryover in the gas product are termed “exit
devices”. Weirs are used to improve heavy liquid - light liquid separation in
horizontal vessels.
Nozzle Calculations
Included with the carryover correlations are calculation methods for inlet
and outlet nozzle pressure drop. Inlet and outlet devices can be included in
these calculations. The user can also specify pressure drop if the carryover
option is not in use.
3
Real Separators in HYSYS
Specifying Carryover
The HYSYS separator allows the user to directly specify what fraction of
each of the feed phases is entrained in the other phases. Product-based
specifications are also allowed. This gives you a simple method to match
your material balance to your design assumptions or your real world
separator.
4
Real Separators in HYSYS
Correlation Details
Three different correlation models are provided: Generic, Horizontal Vessel
and ProSeparatorTM.
Generic Correlations
The generic correlations should be used when your only criterion for
separation is specifying a critical droplet size. Inlet phase dispersion is
calculated using a generic method that ignores vessel geometry — the user
specifies inlet splits and Rossin Rammler parameters and these are used to
calculate the inlet dispersion. Carryover is calculated by assuming that all
droplets smaller than a user-specified critical droplet size are carried over.
Horizontal Vessel Correlations
The Horizontal Vessel correlations are designed with the horizontal 3-phase
Separator in mind. Inlet phase dispersion is calculated using inlet device
efficiency (rather than specified splits) and user-supplied Rossin Rammler
parameters. Primary separation is calculated based on settling velocities
rather than critical drop size. Each phase has a residence time in the vessel.
A droplet will be carried over if it does not travel far enough (back to its
parent bulk phase) in the time allowed.
ProSeparator Correlations
The ProSeparator correlations are rigorous but are limited to calculating
liquid carryover into gas. Both light liquid and heavy liquid entrainment are
calculated, so 3-phase Separators are also supported, but no carryover
calculations are done for the liquid phases. Inlet phase dispersion is
calculated based on inlet flow conditions and inlet pipe size. (ProSeparator
calculates its own Rossin Rammler parameters using this information.)
Primary separation is based on critical droplet size; however, the critical
droplet size is not user-specified but calculated using gas velocity through
the vessel.
Exit Devices & Other Calculations
Secondary separations accomplished by exit devices (e.g., demisting pad)
can be calculated by specifying a critical drop size (Horizontal Vessel) or
through the use of device specific correlations (ProSeparator).
Inlet flow regime, Nozzle Pressure Drop, Exit Device Sizing can also be
calculated using one of the various Horizontal Vessel correlations.
Rossin Rammler Parameters
Rossin Rammler distributions are defined by:
F = exp(-d/dm)x)
Where:
F = fraction of droplets larger than d
dm is related to d95
x = RR index
d95 = 95% of droplets are smaller than this diameter for the specified
dispersion
RR Index = exponent used in the RR equation (also known as the “spread
parameter”)
5
Real Separators in HYSYS
Using Sub-calculations
If desired, the user can use a different correlation for each of the calculation
steps. In this case, a correlation is specified for each sub-calculation, rather
than specifying an overall correlation. Only those parts of the correlation
that apply to the particular sub-calculation will be used.
Example
If the Generic correlation is used for the Inlet device and ProSeparator is
used for primary L-L and G-L separation calculations, then the user-
supplied data for the generic inlet calculations (i.e., inlet split and Rossin
Rammler parameters) will be used to generate the inlet droplet dispersion.
The ProSeparation primary separation calculations will then be performed
using this inlet dispersion. As ProSeparator correlations will not be used to
calculate the inlet conditions, any ProSeparator inlet setup data is
ignored. Likewise, any critical droplet sizes entered in the Generic
correlation will be ignored as the ProSeparator is being used for the primary
separation calculations.
6
Real Separators in HYSYS
Process Overview
7
Real Separators in HYSYS
Workshop
Process Description
In this workshop, a 3-phase Separator is used to separate an oil/water/gas
mixture. Entrained liquids in the gas product have been identified as a
potential process issue. The HYSYS Real Separator will be used to account
for liquid entrainment in the model.
Carryover of liquids can be troublesome, especially if the gas is then passed
through a turbine/compressor where liquid droplets can cause major
damage to the internals of the machine. We will determine if a demisting
pad is appropriate to prevent carryover and how to size it appropriately.
The separator considered in this workshop is based on the LP Separator
used in the two-stage compression module of the Turbo Expander plant
constructed in the Process Modeling Using HYSYS course.
You will begin building the case by creating a copy of the existing separator.
This means that while experimenting with the parameters of the separator,
the rest of the Turbo Expander plant (recycles, adjust, … etc.) does not have
to solve each time.
An exercise later will be to incorporate the rigorous separator into the full
model.
8
Real Separators in HYSYS
10. Open the separator unit operation and select the Worksheet tab.
What is the vapour fraction and molar flow of the product stream?
Vapour ______________________
Light Liquid ______________________
Heavy Liquid ______________________
3. Examine the product streams and the C.Over Results page and
compare to the ideal separation case.
9
Real Separators in HYSYS
4. DP / Nozzle Setup (radio button): Enter the following values for nozzle
location (this is the horizontal or radial distance from the feed location):
Feed 0.0 m, Vapour 6.0 m. Keep the default values for nozzle diameter
and height.
10
Real Separators in HYSYS
b) Open the Rating tab and select the C.Over Results page. To view
the carryover details, click the View Dispersion Results button. You
should see results similar to this:
Open the Rating tab and select the C.Over Setup page. Click the View
Correlation button and open the Results tab.
11
Real Separators in HYSYS
Exercise 1
It is expected that the inlet hydrocarbon flow to the separator may vary by
up to 25%. Anticipating that the separator may not be able to handle this
increased flow, the engineer decides to model the new conditions in the
separator and design a demister pad to remove the larger droplets.
1. Increase the flowrate of the To LP Sep Clone stream by 25%.
2. Select the C.Over Results page, then click the View Dispersion Results
button.
Perform the analysis yourself; how thick should the mesh pad be?
_______________________________________________________
Now what is the vapour fraction of the Vapour product stream?
________________________________________________________
12
Real Separators in HYSYS
Exercise 2
Connect the real separator into the two-stage compression loop to replace
the ideal separator that is currently in use. Keep the Water feed stream
connected. Is the real separator still capable of stopping 50 micron drops
reaching the compressor suction?
13
Real Separators in HYSYS
Demonstration
1. Open Dynamic Real Separator.hsc.
2. Click on the strip charts to bring them to the foreground.
3. Click the Dynamic Mode button.
4. Start the Integrator. When the liquid carryover flow achieves a steady
value, stop the integrator.
5. Change the position of VLV-100 to 25% open. Re-start the integrator.
When the liquid carryover flow achieves a steady value stop the
integrator.
6. Change the position of VLV-100 to 75% open. Re-start the integrator.
When the liquid carryover flow achieves a steady value stop the
integrator.
Is the mesh pad thick enough to account for all process conditions?
_________________________________________________________________
A thick pad creates more pressure drop; are there other mitigations to
consider?________________________________________________________
14
Reactions 1
Reactions
Workshop
In this module, you will simulate a Synthesis Gas Production facility.
This will introduce you to the powerful reaction modelling capability of
HYSYS.
In most synthesis gas plants, four reactors are used. However, in our
simulation five reactors will be used to model this process. This is
because the combustor, a single vessel, will be modelled as two reactors
in series, with two different reaction types. The first reactor is a
Conversion reactor and the second is an Equilibrium reactor.
Learning Objectives
After completing this module, you will be able to:
Prerequisites
Before beginning this module, you need to know how to:
2
Reactions 3
3
Process Overview
Reactions 5
Add the following components to the simulation: CH4, H2O, CO, CO2,
H2, N2, and O2.
Figure 1
5
6 Reactions
2. Click the Add Rxn button, and choose Conversion as the type from
the displayed list. Enter the necessary information as shown:
Figure 2
Figure 3
4. Repeat Steps 2 and 3 for two more Conversion reactions. Use the
following data.
Base
Name Reaction Co
Component
Rxn-2 CH4 + 2H2O → CO2 + Methane 65
4H2
Rxn-3 CH4 + 2O2 → CO2 + Methane 100
2H2O
6
Reactions 7
1. Still on the Reactions tab, Click the Add Set button. Call the first set
Reformer Rxn Set, and add Rxn-1 and Rxn-2. Reactions are added
by highlighting the <empty> field in the Active List group, and
selecting the desired reaction from the drop down list. The view
should look like this after you are finished:
Figure 4
7
8 Reactions
Once all three reaction sets are added to the Fluid Package, you can
enter the Simulation Environment and begin construction of the
simulation.
Reformer Combustor
Name Natural Gas Air
Steam Steam
Temp., 370 (700) 250 (475) 16 (60) 250 (475)
°
C (°F)
Pressure, kPa 3500 (500) <empty> <empty> <empty>
(psia)
Molar Flow, 90 (200) 240 (520) 90 (200) 140 (300)
kgmole/hr
(lbmole/hr)
Molar 100% - CH4 100% - H2O 79% - N2 100% - H2O
Composition 21% - O2
8
Reactions 9
9
10 Reactions
Figure 5
10
Reactions 11
3. On the Parameters tab, set the Multiplier at 1 and the Offset at 0. For
this operation we want a y=x (1:1) relationship. A multiplier of 1 and
an offset of 0 will result in this type of relationship.
Figure 6
11
12 Reactions
12
Reactions 13
1. Select the Adjust Operation button from the Object Palette, and
enter it into the PFD.
Adjust Operation icon 2. Enter the information as shown:
Figure 7
13
14 Reactions
Figure 8
You don’t have to be on the 4. Move to the Monitor tab, and click the Start button. HYSYS will
Monitor page to start the adjust the steam flow rate until the desired condition is met.
Adjust Operation, but it shows
you the values that HYSYS is
using in the calculations.
A second Adjust Operation will be used to control the Air Flow rate. The
Air Flow rate determines the ratio of H2 to N2 in the synthesis gas
product. We want this value to be set at 3.05.
14
Reactions 15
Figure 9
In this case the two Adjust operations may interfere with each other
while they are solving. This is because changing either adjusted variable
effects both target variables. To prevent this interference the Adjusts can
be set to solve simultaneously. This uses a different solution algorithm,
which makes the Adjusts solve cooperatively at the end of each
flowsheet calculation step.
15
16 Reactions
Figure 10
16
Rating Heat Exchangers 1
Workshop
A heat exchanger is a vessel that transfers heat energy from one process
stream to another. A common physical configuration for heat
exchangers is a shell and tube exchanger, where a bundle of tubes sits
inside a shell. There is no mixing of fluid between the shell and the
tubes.
Learning Objectives
In this workshop, you will learn how to:
Prerequisites
Before beginning this workshop, you need to:
2
Process Overview
4 Rating Heat Exchangers
M (H –H ) –Q – M (H – H ) –Q = BalanceError (1)
cold out in cold leak hot in out hot loss
H = Enthalpy
4
Rating Heat Exchangers 5
The Heat Exchanger duty may also be defined in terms of the overall
heat transfer coefficient, the area available for heat exchange and the log
mean temperature difference:
Q = UA ( LMTD )F = M ( H – H ) –Q = M (H –H ) –Q
(2)
t hot in out hot loss cold out in cold leak
∆T – ∆T
1 2 (3)
LMTD = ---------------------------------------
-
Ln ( ∆T ⁄ ∆T )
1 2
∆T 2 = T hot,in – T cold,out
The LMTD can be either terminal or weighted. This means that it can be
calculate over the exchanger as a whole (terminal) or over sections of
the exchanger (weighted). The need for this type of calculation is shown
on the next page.
5
6 Rating Heat Exchangers
The following plot is a heat loss curve for a single phase stream. It
compares the temperatures of the process streams with the heat flow
over the entire length of the exchanger. For single phase streams, these
plots are linear.
Figure 1
Figure 2
6
Rating Heat Exchangers 7
7
8 Rating Heat Exchangers
1. Open the HYSYS case, Gas-Gas.hsc on the disk that was supplied
with this module.
2. Double-click the Gas-Gas heat exchanger, and answer the following
questions.
8
Rating Heat Exchangers 9
Figure 4
The radio button selection in the Sizing Data group will dictate the type
of information shown at any given moment. Each parameter will be
defined later on in this module.
9
10 Rating Heat Exchangers
The TEMA Type is selected as part of the Overall sizing data. There are
three drop down lists which allow you to specify the geometry of the
front end stationary head type, the shell type and the rear end head type
for the exchanger. The following tables provide brief descriptions for
each designated TEMA Type letter. Drawings of the various TEMA types
can be found on page 11-4 of Perry’s Chemical Engineers Handbook,
Sixth Edition.
10
Rating Heat Exchangers 11
Rating Parameters
Brief explanations are provided below for each Simple Rating
parameter. The parameters are categorized according to the radio
buttons in the Sizing Data group box. Some of these parameters are
only available when the model on the parameters page is selected as
Detailed.
Overall Information
• Number of shell passes
• Number of shells in series
• Number of shell in parallel
• Tube passes per shell
• Exchanger orientation. The orientation of the exchanger, used
only in dynamic simulations.
• First tube pass flow direction
• Elevation. The height of the base of the exchanger, used only in
dynamic simulations.
• TEMA. Described earlier.
11
12 Rating Heat Exchangers
If you want HYSYS to use general correlations to determine the shell and
tube side pressure drops and heat transfer coefficients, select the
Detailed model on the Parameters page. This will allow HYSYS to
calculate the desired terms.
12
Rating Heat Exchangers 13
What is the temperature of the Sales Gas using this exchanger? ___________
Previous experience has shown you that after about six months in
operation, the exchanger becomes fouled and the fouling factor for both
shell-side and tube-side is 0.0001 °C-h-m2/kJ.
What will the temperature of the Sales Gas be after 6 months of service?
____________________________________________________________________
Will this exchanger be adequate after 6 months of service? ______________
Challenge
Why was the Recycle needed in this Flowsheet?
For an interesting challenge, disconnect the recycle operation and
stream 1. Connect the stream LTS Vap in place of stream 1.
14
Automation Introduction 1
Automation Introduction
1
© 2004 AspenTech - All Rights Reserved.
EA1000.32.02
12 Automation Introduction
2 Automation Introduction
Introduction
Automation is the ability to programmatically interact with an
application through objects exposed by that application.
Workshop
In this module you will review and begin to understand an Automation
front-end to the Turbo Expander case using Microsoft Excel.
Additionally a simple HYSYS User Variable will be created.
Learning Objectives
In this module, you will gain an understanding of the possibilities that
Automation access to HYSYS can bring. The examples given should give
a starting point for any further learning.
2
Automation Introduction 3
Prerequisites
No prior programming experience is assumed. However before
beginning this module, you should have a reasonable understanding of
the HYSYS program.
The benefits that you will see from HYSYS Automation will depend
entirely on what you use HYSYS for. If you find yourself performing the
same task or calculation several times during a project, writing a MLE
macro or a User Variable will save a lot of valuable project time. This will
be especially true if the calculation is complex or requires several
variables simultaneously.
3
4 Automation Introduction
Rather than typing a large amount of code into the Excel Visual Basic
Don’t worry if you haven’t Editor, in this Workshop you will review some prewritten code using
built the Turbo Expander
plant case. VBA's debugging tools.
The file
“ADV5_Spreads&CaseStud The instructor may choose that the class does this individually, or as a
_Soln.hsc” contains this group.
case.
Preparation
1. Open the Turbo Expander HYSYS case.
2. Open the Microsoft Excel file: “Adv Automation - Solution.xls”.
3. In order to use VBA macros in Excel you need to tell Excel to Enable
Macros.
Figure 1
In Excel 2000 you may need to change the Security setting to Medium
on the Tools... Macro... Security menu option, before you see this
window on opening the file.
The Excel spreadsheet has already been set up with some labels and
values.
4
Automation Introduction 5
Figure 2
5
6 Automation Introduction
Figure 3
6
Automation Introduction 7
Figure 4
VBA Basics
The intention of this section is to introduce the very basics of
manipulating VBA code rather than to teach the details of HYSYS VBA
programming.
The techniques described here will be used later when examining the
prewritten code.
Running Macros
To run a macro, place the cursor within the macro in the VBA Editor, and
click the Run Sub / UserForm toolbar button.
7
8 Automation Introduction
Figure 5
Macros can also be run within the VBA Editor, from the Run menu or by
pressing F5.
Figure 6
8
Automation Introduction 9
Next trigger the code as above. When VBA encounters the breakpoint
execution will stop and the code window will appear. The line of code
that is about to be processed is highlighted in yellow.
Figure 7
9
10 Automation Introduction
HYSYS Objects are organised into a tree: The object hierarchy. The
objects that will be accessed in this example are illustrated below:
Figure 8
is used. This sets up the object variable hyApp to refer to the HYSYS
application. The resulting object is of type Application.
10
Automation Introduction 11
To link to further objects within the tree, dot notation is used. For
example the Turbo Expander Excel interface uses the line:
i.e. to refer an object on the next layer down in the tree a full stop is
used.
Figure 9
The object browser window will appear. By default the object browser
will list the objects available in all the type libraries that are selected in
the References lists (Tools … References). In order to limit it to just
HYSYS objects change the <All Libraries> drop-down at the top left to
HYSYS.
11
12 Automation Introduction
Figure 10
Clicking on an object (or 'Class') in the left hand list then shows all the
members (objects or properties) that are associated with that object.
The Object Browser also allows searching.
It is good practice to declare When accessing HYSYS via Automation, an Object Variable can be used
all variables at the top of the in the code to link to a HYSYS object.
procedure.
12
Automation Introduction 13
Figure 11
Figure 12
If the variable is an object variable then it will appear with a '+' sign next
to it, clicking this will show any sub-objects and properties within the
object.
13
14 Automation Introduction
Figure 13
14
Automation Introduction 15
Figure 14
2. Add a breakpoint to the On Error line and start the code running. (If
you need to, you can refer back to page 8 for details of breakpoints,
and making the code run.) Make the Set hyApp … line execute.
Figure 15
3. Add a Watch for the hyApp variable, click the '+' sign next to the
variable to show the properties of this object, note that
ActiveDocument is one of them, and that it's type is SimulationCase.
15
16 Automation Introduction
4. Execute the next line of code, add a Watch for hyCase and note that
it shows the same information as the ActiveDocument property of
the hyApp object.
5. Use the object browser to view the HYSYS Application object. Note
again that the type of the ActiveDocument property is
SimulationCase.
Figure 16
The next section of code checks if there was a case open in HYSYS using
the VB 'Is Nothing' construction.
Figure 17
16
Automation Introduction 17
Try running the code with no case open. What happens now?
Figure 18
What is the type of this variable? Where in the Object Browser could this
object type be found?
17
18 Automation Introduction
Figure 19
8. Add a Watch for the hyStream object. Look at all the properties this
has. Note that the Type of this variable is ProcessStream.
9. Execute the hyCase.Solver.CanSolve = False line. In HYSYS the solver
is now turned off (Red Traffic light).
Now the temperature in the stream can be set using the two values that
were retrieved from the Excel spreadsheet earlier.
Figure 20
10. Execute this line - check that the value in the HYSYS case matches
that entered in Excel.
11. Look up the ProcessStream object in the Object Browser and find
the Temperature property. This is of type RealVariable.
18
Automation Introduction 19
Figure 21
RealVariables are special HYSYS objects that hold numerical values, but
also contain other information that is useful for the programmer.
19
20 Automation Introduction
The first parameter is the new value to be set, and the second is the unit
to set the value in. Note that the square brackets mean that the second
parameter is optional. If it is not supplied then HYSYS assumes the value
is being supplied in it's internal units. (°C in the case of temperature.)
Look at the Temperature in the Watch window. What are the values of some
of the properties listed above?
13. Execute the code down to the line just above where the HYSYS solver
is turned back on.
Figure 22
14. Add a Watch for the hyExpander object and look at some of the
properties it has.
20
Automation Introduction 21
15. Reposition the VBA editor window and the HYSYS window so that
both are visible.
16. Execute the line hyCase.Solver.CanSolve = True, and observe that
HYSYS resolves the case.
The next parts of the code retrieve various information from the newly
modified HYSYS case.
Figure 23
Flowsheets are referred to by their Tag (not their Name). This can be
found on the Connections tab.
21
22 Automation Introduction
Next a new stream is assigned to the hyStream variable, using the Item
property of the EnergyStreams collection of this new sub flowsheet
object. The EnergyStreams collection contains only the Energy streams
in the flowsheet.
Variables can be reused
when they are finished with. The ProcessStream object type can hold both Material and Energy
There is no need to declare
a different variable for each stream objects, however Energy streams have far fewer accessible
stream or operation that is properties. In this case the HeatFlow property is used.
accessed.
The GetValue method is then used. This is analogous to the SetValue
method except that it takes only one parameter: the required unit.
Similarly the compressor duty and LPG product mass flow are obtained.
Note that there is no need to obtain an object variable for a stream or
operation before running the GetValue method against one of it's
properties. However if the same object is to be used more than once it
makes sense to create an object variable for it.
Figure 24
22
Automation Introduction 23
The next section of the code retrieves some additional values from some
operations on the main flowsheet.
Figure 25
The final sections of the code deal with obtaining component specific
properties.
Figure 26
23
24 Automation Introduction
Note that each time execution reaches the Next IntCount line, it jumps
back up to Set hyCpt = … line. This is the first time a VB loop has been
used in this code. Each time the loop executes the value of the IntCount
variable is increased until it reaches the number of components minus
one.
All the HYSYS collections are “zero based” - The first term is at position
zero.
The result of this loop is that if Methane is present in the case then it's
position in the list of components will have been placed into the
IntCH4Idx variable.
Figure 27
24
Automation Introduction 25
All HYSYS values that contain arrays of data (e.g. component mass
fractions, or mole flows, or tray by tray data in a column) have a special
object type called RealFlexVariable.
What is the value in this array at the position held in the IntCH4Idx
variable? Does this agree with the Methane mole fraction displayed in
HYSYS?
Finally all the component mass fractions in the Product LPG stream are
to be reported.
25
26 Automation Introduction
Figure 29
Here the VarHyArray variant array is first filled with the names of all the
components and then the component mass fractions, and each are
written into the spreadsheet.
26. Examine the ProcessStream object in the Object Browser. Note that
each of the properties also has a corresponding …Value property.
(e.g. Temperature and TemperatureValue or Pressure and
PressureValue)
26
Automation Introduction 27
In each case the …Value property simply returns a value of type Double
(in the case of single valued properties like temperature), or Variant (in
the case of component properties), in the HYSYS internal calculation
units.
RealVariables and
RealFlexVariables also have
properties called Value and Rather than use the...Value properties of the ProcessStream object, it is
Values, which return generally better practice to use the.Value(s) property of the
numbers in HYSYS internal Real(Flex)Variable.
units.
The final lines of the main code, clear all the object variables and then
instruct VBA to skip the error handler if no error has occurred.
Figure 30
27
28 Automation Introduction
The first two examples can be found in Section 5.7 of the Customization
Guide. In this exercise a User Variable will be implemented that relates
the heater pressure drop to the flow rate in one of the exchangers in the
Turbo Expander Case.
28
Automation Introduction 29
Object Location
Operations (except Logicals) Design tab... User Variables page
Streams Worksheet tab... User Variables page
Logical Operations User Variables tab
Flowsheet Flowsheet menu... Flowsheet User
Variables option
Simulation Case Simulation menu... Simulation Case
User Variables option
When any of these locations is opened the view will be similar. (Below is
the view for a stream).
Figure 31
29
30 Automation Introduction
To add a new User Variable, click the Create New User Variable icon. The
Create New User Variable dialog box then appears.
This window is the same for all types of user variables. The only
difference is the available macro types.
The only way to close the This choice sets when the code gets called. For Streams, Operations and
window and save any Flowsheets the choices are before and after the object does it's
changes made is to click the
OK button. calculations. Simulation Case user variables are only ever executed
when the user clicks the button on the User Variable window.
Before the User Variable code window can be closed (by clicking OK), a
name must be set for the User Variable.
30
Automation Introduction 31
The Show / Hide Variable Details icon (green triangle) in the top right
corner of this window is used to toggle the display of the User Variable
details tabs.
Show / Hide Variable
Details icon In order to edit an existing User Variable, click the Edit the Selected User
Variable icon on the User Variable page of the HYSYS object, or double-
click the user variable value cell.
Figure 33
Figure 34
31
32 Automation Introduction
Figure 35
There is also a built in Object Browser. Since the code is executed from
HYSYS there is no need to make a reference to the HYSYS type library -
this is already set internally.
The code that is written in the User Variable uses almost exactly the
same VBA syntax as when accessing HYSYS from Excel. The only
difference is how to connect into the HYSYS object hierarchy, and how
to interact with the displayed user variable value.
32
Automation Introduction 33
1. ActiveObject
• This returns on object for the owner of the code. The type of this
object depends on what kind of User Variable is using it:
• Stream User Variable = Returns a ProcessStream type object for
the stream containing the user variable.
• Operation User Variable = Returns an object for the operation
containing the user variable. (Type of object depends on the type
of operation.)
• Flowsheet User Variables = Flowsheet object for owner
flowsheet.
• Simulation Case User Variables = Not supported - use
ActiveCase object instead.
2. ActiveCase - Always returns a SimulationCase object for the case
containing the User Variable.
33
34 Automation Introduction
Figure 36
2. Select the User Variable to export then click the Export button.
3. On the file dialogue that appears set the file name of the required
User Variable export file (This will have a .huv extensions).
34
Automation Introduction 35
Parameter Value
Name Pressure Drop Calc
(Tag will automatically be set to the
same)
Type Real
Dimensions Scalar
Units Pressure Drop
Execution (Macro tab) PreExecute()
Activation (Attributes tab) User Enabled
Variable... Calculate Only (Security tab) Checked
35
36 Automation Introduction
4. Either type the code below into the code window, or paste it from
the supplied text file. (“Adv Automation - UV Code.txt”)
Figure 37
36
Automation Introduction 37
Figure 38
5. Place a breakpoint on the Sub PreExecute() line, then make the code
run by changing the flow rate of the Feed Gas stream.
6. Step through the code and ensure that it is behaving as expected.
Note that the first time the code is called after the change is made, the
mass flow through the cooler is not known hence the code in the If
It’s best to trigger the User hyFeedStrm.MassFlow.IsKnown=True Then … End If section is not
Variable for debugging by executed.
changing a value in the
flowsheet, and hence
making HYSYS call the This is because when the solver performs steady state calculations there
code. are two solve passes which it performs: the forget pass and the calculate
pass. When the value of a variable changes, the solver first does one
If the code is triggered by solve pass with the value marked as unknown. This is the forget pass.
clicking the Start / Resume
toolbar button then any
This allows HYSYS to correctly propagate the effects of any change.
ActiveObject references will
not point to the correct 7. Export the User Variable and import it into another case. (You could
object. try one of the HYSYS sample cases, or one of the solution cases for
this course.)
Challenge
Try using this code in a similar User Variable for a Heater operation or a
Valve. Does it work? What modifications need to be made?
Try adapting the code to base the pressure drop on some other
parameter - for example the molar flow, or the density, or the
composition of a particular component.
37
38 Automation Introduction
38