Advanced Process Modelling Using Aspen HYSYS
Contents
Contents List of Modules Getting Started Extensions Advanced Columns Templates and Sub-flowsheets Spreadsheets and Case Studies Advanced Recycle Operations Troubleshooting Dynamic Depressuring Compressor and Pump Curves Using Neural Networks in Aspen HYSYS Modelling Real Separators in Aspen HYSYS Reactions Rating Heat Exchangers Automation Introduction
©2005 AspenTech. All Rights Reserved.
Aspen Technology, Inc.
Contents
Aspen Technology, Inc.
Advanced Process Modelling Using Aspen HYSYS
11
©2005 AspenTech. All Rights Reserved.
Getting Started
Getting Started
© 2005 AspenTech - All Rights reserved. EA1000.04.07 01_GettingStarted.doc
1
2
2
Getting Started
Getting Started
3
Workshop In the Getting Started module you will build the tlowsheet around which most of the rest of this course is based. The process is a Turbo Expander plant. LPG Product is obtained from a Feed Natural Gas stream by cooling, expanding, separating, and distillation. The remaining gas is then re-compressed for export.
Learning Objectives Once you have completed this section you should have revisted your basic Aspen HYSYS knowledge. You will also be able to: •
Use the Aspen HYSYS LNG Exchanger to simulate multi-pass exchangers
•
Add Columns using the Input Experts
•
Add extra specifications to columns
•
Customise the Workbook and PFD
•
Use stream property correlations
Prerequisites This course is aimed at people who have had some experience of using Aspen HYSYS before. Hence the instructions are deliberately brief in places where previous Aspen HYSYS users are likely to already know what to do. If you have problems at any stage you can ask the course instructor.
3
.,..
Process Overview
Fee~
Simplified Turbo Expander Plant
2
1 30.00 1C
Pressure
1 5D.oO 1b. r
Molar Flo"
-§-~
t:
,
lA
~
7
Q-100
-....
Gas
TemperEiture
2968
Feed
I kgmolel11
Gas
Q~
:~~11
~
LNG-l00
-
12
MIX-100
SA
I
%~.
E-101
9
~3~ ~,port ..
.
as
K-101
:or. I
-+--------Jof
T L V-100
K-100
V·l01
I
K-102
I
• ( SET-3
__
O1her Props
QK-
Feed GM 110
SET-4
urbo
Molec" I. r Weigtrt
Expander
....,. 4
Export Gas Compressor
Recompressor
i
--
QK-l02
QK-l01
Mass He Ill:
SET-1
"i>4-VLV-100
C~pacrt
Phase CplCy
10 Temperat ure
8
10
LPG Recovery
LPG
Product
6986 C
Pressure
2800 bar
Mol~r
6e.91
Flow
kgmolelh
17.69 1 46.64
y
(V~pour
kJl1
PhMe)
Export
G~s
17.01
251313557
2.546
1 467
1365
Column Overview
To Condenser
9 Condenser
6 8
Q-102
Reflux Main T8
0-103 Boilup Reboiler To Reboiler UI
10
6
Getting Started
Building the Simulation Some stream and operation names can be obtained by referring to the PPD at the start of this section.
Defining the Simulation Basis 1.
Start a new case using the Peng Robinson Equation of State.
2.
Use the following components: Nitrogen, C02, Methane, Ethane, Propane, i-Butane, n-Butane, i-Pentane, n-Pentane and n-Hexane.
3.
Enter the Main Simulation Environment.
Add the Feed Gas Stream 4.
6
The Feed Gas stream has the following conditions and composition: Name
Feed Gas
Temperature
30"e (86"F)
Pressure
5000 kPa (725.19 psia)
Flow rate
2988 kgmole/h (6587.3 Ibmole/hr)
Component
Mole Fraction
Nitrogen
0.0149
CO2
0.002
Methane
0.9122
Ethane
0.0496
Propane
0.0148
i-Butane
0.0026
n-Butane
0.002
i-Pentane
0.001
n-Pentane
0.0006
n-Hexane
0.0003
Getting 8talrted
7
Add the Multi-pass Exchanger Multi-pass exchangers are known as LNG Exchangers in Aspen HYSYS. LNG icon
The LNG (Liquefied. Natural Gas) exchanger model solves heat and material balances for multi-slream heat exchangers and heat exchanger networks. The solution method can handle a wide variety ofspecified and unknown variables. The LNG allowa for multiple slnam., while the HEAT EXCHANGER allowa only one hot side stream and one cold aide atnNIm.
The Tube Side and Shell
Side streams can come from dlff8'8l'1t AowsheelB. This is one way of using
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 ofa single unknown, the solution is calculated directly from an energy balance. In the case ofmultiple tmlmOWD.!l, an iterative approach is used which attempts to determine the solution tbat satisfies not only the energy balance, but also any constraints, such as temperature approach or UA. S.
Add B LNG operation.
6.
Select the Connections page on 1he DeaIgn tab and enter the following information:
different fluid pecksges on eacl'l side of the exctIanger.
(Note that the Pressure Drop lmits in the saeenshot are kPa)
I!I~Ei
• LNG lOll
Harne I~G'l00
Design
Connections
I
S'
P.,.mole, (55)
~su._
OUllOl
lA 714
7
USSf VAMblAa
__ 9_
Nole.
Any number of Sides may be added simply by selecting the Add Side button. To remove a elde,
Ple..ur.O,oD HOI/Cold 20.0000 Hot 20.0000 Cold
S~ ......
reed G••
SQ.cIISSJ
-
~
20.~
-
Cold
FJowSheel I ee•• (Mei!'J_ eel·IMein) ees. Mein
-
4J~-
select the Delete Side
==._-
=
AddSocle
button after positioning the
=jJ, I D.iel. Sid. I
cursor In the appropriate
raw.
~
~
De•. , I Ra~
Delel.
I '....oobheel I
Ir
PeJfnrmance
I Dynamcs I
HTFS - MUSE
NOI Solved
r
[gnOled
7
8
Getiing Started
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 For each exchanger side:
7.
•
An inlet stream and outlet stream are required.
•
A Pressure Drop is required.
•
The Hot/Cold designation can be specified. This will be used as an estimate for calculations and will also be used for drawing the PFD. If a designated hot pass is actually cold (or vice versa), the operation will still solve properly. The actual Hot/Cold designation (as determined by the LNG) can be found on the Performance tab in the Results page.
Switch to the ParameterI (SS) page. These values will be left unchanged.
1!!l1iI Ef
• LNG 100
He,;1 L•• IULOl......." "
O.,ign
(:" None
r
EJo:tremes
("', Proportional
P.._ers(55) 5 poe> ISS)
E,ch.nge Qel.il. Pou N~m,=
U""Variables
-
IrUrv~l~
t -f. I
Eouilibr& j'
Oew.lBub "-
I
10 7·7141 10 SI4 S· t-1 0
Fee
N_
M ~
~
n r r
I I
SleD T_
Eoyol E.-.hoII:Jy
Ples:t. Profile Consl dPdH Consl dPdH
EQu.IE~
CaNt dPdH
EqualE~y
I
!
T I
.
I
r
8
I
I
"""'"
The Weighted method i8 required for exchangers with more than two 8ides.
II
!g-oor.d
The Exehanger DeI1gn (Weighted) method is used to split the heating curves into intervals. (Rather than simply considering the end points.) The number ofintervals is set in the Exchange Details table. The Step Type parameter sets whether Aspen HYSYS splits the curves by temperature, enthalpy or automatically to minimise the errors. By ticking the DewlBub pt. checkboxes Aspen HYSYS will include points on the heating curves for any phase changes that occur. The Prell. Proflle options set how Aspen HYSYS decides the pressure profile whilst iterating.
Getting Started
9
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. These options are discussed in more detail in the Aspen HYSYS Operations Guide. This is a good time to learn how to access/search the Acrobat PDF documentation.
8.
Go to the Specs (SS) page.
Two extra specifications (in addition to the Heat Balance spec, for example, conservation of energy) will be added. Just after the streams have been added the Degrees of Freedom display shows 6 (for example, 7 unknown variables, 1 constraint so far). By adding two new specs this is reduced to 4. Later on when more of the tlowsheet is built, these 4 degrees of freedom will be used up and the exchanger will have enough information to solve.
I!lIiII3
• LNG-100
Url
SoIve_
Design
rC*,ence
Comeclions
p..amelers (55)
CUffent EnOl' Maximum Iterations
Specs (SS)
11""'00
Notes
> 25 0
Unknown V..iabIe, Con,tlms De ees of Freedom
UsetVat~s
VolUe
1.000e·04
7
3 4
Te iotUle011A Fbw0l7 TempelatUle 01 7 TompelalUle 0I7A Fbw 019 T_alUle 01 9
~
Spec.'c~ion,s----------------------____,
I+-~N":9ame~="f_'S~c"".ie"'d--"Volues;:_+__"C"'Uf"'l!nI"':-V=olue"7'_+__'R-"'elal=ive"_'E"'IIIC':_+)I.:::.Ac'?lI;::·ve'-t-';E;;;sl.+Heat Balance
0.00 kcal/h
'"
r
V......
I
~
f---iC=oId=Ou:;:-ts:;.:a=me:+-_----'0"iOO~C+--_-;:+---:<_=em=Pt:':y>+_.;:::"'.__+-;r=_l- ~ AppIoach Temp
10 C
'"
r
I-------+-----+----+------+----+-+_
~
HTFs· MUSE
Design
Delete
II
Not Solved
The two specs that will be added are: •
Cold Stream Outlet temperatures are the same (O°C or OaF)
•
Minimum approach temperature in the exchanger (lO°C or 18°F)
9
10
Getiing Started
9.
Add these two specs as follows: Fillure4 ~ Cold 0 ut Same
Name Type SlreamFT STreanil-) iSD8CValue
~ Approach Temp
111m EJ Cold Oul Same I I Della Temp 7A SA 0.00 C I
Name Type
PiiSS I'SpecVafue
I!!lIii Ef Approach Temp I Min Approach Overall 1000 C I
J
Parameters
Delele
LNG exchangers, like normal Aspen HYSYS Heat Exchangers and Columns, allow the user to enter as many specifications as required. Only the active specifications are used to solve the operation. Ifthe Eit. checkbox is checked Aspen HYSYS will use the spec value as an initial estimate in its iterative solution. Hence specifications can be used fur more than just being an active spec. They can: •
Provide an initial estimate only (Uneheck Active, Check Est.)
•
Be used to monitor how important variables change as the operation iterates (Uncheek Adlve and Elt.)
Add a Cooler 10. Add a Cooler to stream lA This should have the following parameters:
Note that in a lat. module the Cool. operation will be linked to en Aspen HYSYS sub-nowsheet that represents en ethane/propane refrigeration loop.
10
NEI.
E·100
Cool. Outlet Stream
2
Pressure Drop
20 kPa (2.9psia)
Outlet Tempwature
-aTC (.79.(50F)
EnqyStream
Q-100
The Cooler outlet stream (2) should now be fully defined.
Getting Started
11
Add a Separator 11. The Cooler product stream should be sent to a Separator vessel. 12. The liquid product is named 4 and the vapour product is named 3.
Add an Expander 13. The Separator vapour is then expanded to 2800 kPa. 14. The outlet stream is named 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 Stream
QK-100
Add a Separator 16. Add another Separator to the Expander outlet. 17. The feed is the outlet from the Expander. 18. The vapour product stream is named 7, which has already been added and linked to the LNG exchanger. 19. The liquid product stream is named 6.
Add a Valve and Set 20. The liquid from the first Separator is flashed down to the same pressure as the Expander outlet. Add an Aspen HYSYS Valve operation to do this. 21. The valve outlet stream is named 8. When the simulation is manipulated later the Turbo Expander outlet pressure is one of the process parameters that will be changed; hence it makes sense to link these parameters within Aspen HYSYS rather than manually changing both. This is done using a Set operation. This relates two Aspen HYSYS parameters. It can be used to make them identical or to force a fixed Multiplier and Offset between them.
11
12
Getiing Started
22. Install a Set with the following parameters: set icon
NEle
SET-1
Target Variable
stream 8 Pressure
Source
Stream 5
Multipli.
1
0ffMt
okPa (0 psis)
FigureS
1!l1iIE3
• SET-l
!iillre !SET-l T..g.IV....bl. Object
18
Vori!trle:lp,.....•
~CJ.I!amel.el.-----------------,;;;;"'"
••=--.----__UL-""""II"i'_1.O!i000~1 Off~8l r o.661dJ kP.!l I-=Mu;""'liP~h [kP.8]
~
Y. (1T'X. (0) (kP.1 y. M_i.1 SI'.... (8) Pr...
u,.
-
X = Miteriol Sl,oam (5) Pressure
Conroediln.
P.r_.111 U••rV....bl.,
r
LPG Recovery Column This will be simulated using the Aspen HYSYS Distillation Column operation. This column has 5 stages, a Condenser and a Reboil.er. Stream 8 is fed to the top tray and stream 6 is fed to the Condenser.
Rather than defining the column pressures within the column operation, as would be nmmal practice, Set operations will be used to relate the column top and bottom pressures to the Turbo Expander outlet stream. The purpose ofthis is to allow the flowsheet to be manipulated later by changing several key process parameters (including the Turbo Expander outlet pressure).
Set the Column Pressures 23. First add the bottoms liquid product stream (10) to the PFD. 24. Install a Set operation to ''Set'' the pressure ofstream 10, so that it is the same as stream 5. 25. Install another Set to make stream 9's pressure 5 psi less than stream 5's.
12
Getting Stlirted
13
Ifpsi is not the pressure unit Aspen HYSYS is currently using you can enter a psi value by using the unit drop-down to the right for the number entry field. Figuree _ 01 x
tv tBII5l
II
Parameters
I
Multiplier Olkel kPa
1.0000
11-5
y
~
kPa aim al kg/cm2 pSI
(l)"X + (·5) [kPal
'y' = Material Stream (9) Pressure
I: = Malerial Stream (5)
Pressure
IbIJflZ!\I
. ~
"'"'
-J
torr
mmHalOC
-=
Connections
Pill amelers
I
I
User I) ariable:s
~
r
Not Solved
Delele
I
r
jgnored
Add the Column 26. Add a Diltillation Column operation. The Input Experts provide the new user with 81ep-byal8p lnatructlone for defining a column. They can be switched off In the AspenHYSYS
By default Aspen HYSYS includes an ''Input Expert" to guide the user 1brougb setting up the column. The Input Expert has four pages; you must enter aU the required information on each page before the NeD > button will become active. 27. Double-click the ColllllUl PID icon to start the Input Expert.
Preferences.
28. Enter the following information on the Connections page: Connections Distillation Column icon
Column Name
LPG Recovery
No. atSta• •
5
FHd Strum 1Stage
81 at stage 1
Conden.... Type
Full Reflux
Overhud Vapour Product Stl'ellm
9
Bottom Product SlrelIm
10
Conden... Energy Stream
0-102
Reboil.. Energy SlrelIm
0-103
13
104
Getting Started
29. Since the product stream pressures have already been set (with the Set operations), the Prenure ProOle page automatically picks these up. Go to the Optional Eltimates page by clicking the Next> button. Temperature estimates are used to help the column come to a solution. If you already have an idea ofthe conditions in the column (for example, ifyou are modelling an existing plant) then you can enter the information. In this case the temperatures are not known, so these estimates will be left blank. 30. Click the Next> botton to move to the final page.
Once the Input Elcpert has been completed it cannot. be accessed again unless the column is deleted and added back. However. all the information thai was entered can be changed using the column property view.
The :final page ofthe Column Input Expert always has some typical specifications for the particular type ofcolumn. In this case, different specifications will be lliled. These moo be added after the Input Expert has been completed. 31. Click the Done button to complete the Input Expert. The Column Property View will now appear. Figure 7 I Column I PG Recove.p J COIl FlUId Pl:q ~as.s-l J Peng Rohmson S'*'-Fbw
I!I~
~
rUoo~~
r
T""I
Condl!tlta E~r!li! SIII!l!ll'n
r. FulReliu.
I
::oJ
19
::oJ
IQ-102
r Pa,,,,1
Ei
Oyl1dll.""lI 0 ..1..
(]pllOn.i!l1 Su~ Dt~t
1")elS••"",
I....ISI 1 M.i,
'ode"'..
0
I
I Reb
-51.... flL.rilem,.,------,
r.'
lopDOtI,In
r
I3Cl110MUp
1
D"'te
A...
I
5."'1
10.103
a
90110"" LgJi~ Dull.. 110
:.::J
I
Before the column is ready to ron, some more information must be entered: •
Additional Feed Stream
•
New Specifications
32. Connect stream 6 up in the Inlet Streams box; it should enter the Condenser.
14
Getiing Started
15
33. Go to the Monitor page on the Design tab. The existing column specs are visible.
I!!lIiI Ei
Column: LPG P.eccwc,y ) (OLl flUId Pkg: 8d\i.ls. 1 I Peng-R:obJnsun
0"'9>
r :......,,,,"".. _T ..,,'l'_
V'ttNJlnili.!1 E"tiln!l!.6t...
Comec6:1m NOMOI
IlbfiLm
10 Ten'll
eo!/
e
50=
,
Pres. Flow.
SPOC.l S'lllWTl/JIY
'lID
<1m
"'" 'IID
'lID
=
5u~oIrlg
IDDO
1
2
J
~
6
::i
Notes
S ciiedVoiJe ReIlu,Ralio Ol'lldl/ Rate
)
(e
V'I8\Of•..
AOd 50oe ..
t>
G.1O~A.etr...
U~al.eln~i~
-= 0"'9>
I D~tee~t:lF.eet:lO'tt. r DYM~:S
DelOle
(Wrn El1\IiIClirenl..
A",
R~el
W Uodale Dullei,
r
1l1lCfed
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 Degree. of Freedom display is showing O. This column will actually be solved with two different specifications.
•
Condenser Duty oro. Stream 6, the cold expanded liquid stream, enters the condenser so provides the necessary cooling effect.
•
LPG product RVP (Reid Vapour Pressure) specification.
34. Add these two specs as follows: Firat Spec
RVP (Reid Vapour
Pres8ure) i8 a volatility measure commonly u8ed in
Type
Column Duty
N8I1Ie
OYhd Duty
Enqy Str8lIm
Q-102@Col1
SpecValua
0.001 kJJh
the Refining industry. It is
the pressure at which the vapour and liquid have a 4:1 volume retia at 100"F.
15
16
Getting Started
Second Spec Type
Column Vapour Pressure Spec
Name
Btms RVP
Stage
Reboiler
Type
Reid Vapour Pressure
Phase
Liquid
Spec Value
200 psia
An estimate of the column overhead vapour rate will also be provided. One of the specs already added by Aspen HYSYS will be used. 35. Modify the existing Ovhd Yap Rate spec as follows: Existing Vent Rate Spec Name
Ovhd Vap Rate
Draw
9@Co11
Flow Basis
Molar
Spec Value
1600 Ibmole/hr
36. Ensure the Ovhd Duty and Btms RVP specs are set to be Active and Estimates, and that the Ovhd Yap Rate spec is set as an Estimate. The other unused specs can be deleted by going to the Specs 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. 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. What is the flow rate ofthe Overhead vapour stream?
Was the "Vent Rate" estimate a good one?
16
Getting Started
17
Completing the Simulation The simulation is now almost complete. The two product gas streams from the LNG must be mixed and re-compressed for export. 38. Mix streams 7A and 9A using a Mixer operation. The outlet stream name is named 11. 39. Add a Compressor; keep the standard Adiabatic Efficiency of75%. The outlet stream name is 12 and the energy stream is QK-101. 40. Install another Set to link the heat flow of the compressor energy stream (QK101) 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 of75%.
I ----------Save your case!
Compressor Degrees of Freedom In this Aspen HYSYS case there are two compressors specified differently: •
K-101 has a fully specified inlet stream and a specified duty.
•
K-102 has a fully specified inlet stream and a specified outlet pressure.
Aspen HYSYS can also solve for a flow rate given an otherwise fully specified feed stream, a duty, and an outlet pressure. Additionally, Aspen HYSYS compressors can be supplied with head and efficiency curves. This is covered in a later module.
Advanced Modelling The Column is a special type of sub-flowsheet in Aspen 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.
17
18
Getiing Started
The Column Sub-flowsheet provides a number of advantages:
The presence of the green ·Up Jvrow" ica1 in the Button Bar and the Environment: Name (COL1) indicatflB that you are in the Colurm Subftowsheet.
•
Isolation of the Column Solver - The Column Build Environment allows you to make changes and focus on the Column without the re-caIcu1ation of the entire flowsheet.
•
Optional Ule of different Fluid Packagea - Aspen HYSYS allows you to specify 8 unique (different from the Main Environment) fluid package for the Column Sub-flowsheet. This may be useful in instances when a different fluid package is better suited to the Column (for example, 8 Gas Plant using PR may contain an Amine Contactor that needs to use the Amines Property Package), or the Column does not use all of the components used in the Main Flowsheet and so by decreasing the number ofcomponents in the column you may speed up column convergence.
•
Construction of eUltom templates - In addition to the defiwlt column configurations, which are available as templates, you may define column set-ups with varying degrees of complexity. Complex custom columns and multiple columns maybe simulated within a single sub-flowsheet using various combinations of Sub-Flowsheet equipment Custom column examples include; replacement of the standard condenser with a heat exchanger, or the standard kettle reboiler with a thennosyphon reboiler.
•
Ability to solve multiple towers simultaneously - The Column Subflowsheet uses a simultaneous solver whereby all operations within the subflowsheet are solved simultaneously. The simultaneous solver permits the user to install multiple interconnected columns within the sub-flowsheet without the need for Recycle blocks.
The Object Palette is different in the CoIurm Sub-f1owsheet.
Enter Parent Simulation Environment ica1
You can enter the Column Sub-flowsheet by clicking the Column Environment button on the Column Property View. Once inside the Column Environment you can return to the Parent Environment by clicldng either the Parent Environment button on the Column Runner view or the Enter Parent Simulation Environment button in the Button Bar.
Customising the Workbook and PFD Aspen HYSYS allows the user to customise the Workbook and PFD.
Customising the Workbook Workbook button
18
43. Show the workbook by pressing the Workbook button on the toolbar (or by using the Workbook option on the Tools menu).
Getting St.-ted
11
44. From the Workbook menu, select Setup. The Setup view appears as shown below:
Workbook Tabs--------, oT ab Conlenl Unit Ops
Add Delete
pbjec Name: Type:
II!IlIIIlI I
Stream
Qrder..
1
Nel'llYpe
1
lJ"e SeL
I
:larlableu
W
Variabl", Vapour Fraction Temp eralure PreHure Molar Flow Mass Flow Sid Ideal Liq Vol Flow Heal Flow Molar Enlhalpy
Formal 1:4 fi~ed 4 sig fig higfig· 4 ~ig fig 4 sig fig 4 ~ig fig 4 tig fig 4 sig fig
Md... D~lele
formal... Older..
J
I
I I
The left side of Ibis section allows you to add new tabs to the Warkbook. 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 1he tab Name to Other Props. 47. Change 1he tab to show the following variables: Molecular Weight, Mus Heat
Capacilyt and vapour phase CplCv.
Ph888 specific properties all start with ·Phase.... in the alphabetical variable list.
By using the OrderlHidel.Reveal Objeetl option on the Workbook menu it is possible to customise which objects appear on each tab. 48. Change 1he Other Props tab so that it displays only the terminal streams (Feed Gas, Export Gas and 10).
19
20
Getting Started
Customising the PFD Aspen HYSYS allows multiple PFD views to be configured for each flowsheep. These PFDs are just different views on the same set of objects, so deleting a stream from one PFD will mean it is deleted from all the PFDs. Using multiple PFDs allows various possibilities: •
Creation ofa "Presentation" PFD thathss some streams! operations hidden to produce a PFD ready for output
•
Define a number ofviews on the same flowsheet (for example, a zoomed out view and a number ofviews zoomed in to particular areas ofthe process).
When using multiple PFDs it is a good idea to have one "working" PFD that shows all the s1reams and operations. 49. Create a PFD named Presentation using the Add a PFD option from the PFD menu. Choose to Clone the existing PFD.
~ Add a PfD
t!
New PFD Name:
I
Presentetiorl
P'
Clone from E~isting PFD
l;;ancel
I
PFD to Clone
50. Hide all the Set operations on the Presentation PFD by rigbt-elick:ing their PFD icons and choosing Hide on the object inspect menu. To unhide objects that have been hidden, rtghtclick the PFD background and choose Reve81 Hidden Objects.
20
51. Add a PFD workbook table for the Other Props Workbook tab by object inspecting the PFD background and choosing the Add Workbook Table option.
Getiing Started
21
Customising Stream Properties The Properties page of the material stream property view can be customise4 Figure 11
I!lIiIEI
Feed Ga§
Work;theet
Condilions Properties
Camp osil io n KValue User Vari~bles No~es
Cos~ Paramel ers
Feed G
Siream Name Molecular Weighl M0 la r De mily [kgm 01 e/m3] MaM Densil,Y [kg/m3] Act, Volume Flow [m3!h] Mass EnthalpJ [kJ Ikg] Mass Entropy [kJ/kg·C] Heal Ca pa ci I,Y [kJ Ikgmole· C] Mass He
17.69 2,235 38.55
133.7 ·4329 8.604 44.47
2,513 S.520e~005 4.S15e~OO4
•
~
Properly Correlalion Conlroloc-----------,
fIii::
0 , " .{.
AZ~
~
,-,-"
IiII
Prei erence 0 ption: -.:=
Worksheet
Define from Other
S~ream".
.. ..
The user can: •
Add or remove properties (these are also referred to as Property
Correlations) •
Change the order ofproperties
•
Save sets of property correlations and apply them to other streams, or to the whole case
There are two places in Aspen HYSYS that these correlations are controlled: •
•
Property Correlation Controls section on the smam Properties page Allows the correlations for an individual stream to be customised. Also allows sets ofcorrelations to be saved.
Correlation Manager on the Tools menu - Allows changes to be made to the property correlations in use for the whole case.
21
The property carrelatians displayed for a particular stream are controlled using 1he buttons at 1he bottom ofthe stream window on the Properties page. Figure 12
These have the following functions: Buttan
~
cO
.... .... AZ~
X
~
!III
FIybyTIIXt
Notes
View Correlation Set Ust
Allows the user to pick from a list of previously defined correlation sets.
Append New Correlation
Brtngs up a window whEn all cCIT8lat1ons are displayed in a tree, and can be selected and added. Correlations are added to the bottom of the list.
Move Selected Correlation Down
Move Selected Correlation Up
Sort Ascending
Remove Selected Correlation
Remove All Correlations
Save Correlation Set to File
The Correlation Set can then be loaded with the View Correlation Sel List function.
View selected Correlation
See settings specific to the selected correlation.
View All Correlation Plots
See all correlallon plots for the stream. Currently greyed out as none of the correlations have plots.
Il\ .~">i; --
22
Gdlng Started
1.
Open the property view ofthe Feed G1lS stream. Click the Remove All Correlation. button to clear all the correlations from the stream.
2.
Using the Append New Correlation button, add the following properties:
Don't forget to click Apply to acid these properties.
•
Gas - He Dew Point
•
Gas - Higher Heating Value
•
Gas - Lower Heating Value
•
Gas - Wobbe Index
•
Standard. - Act. Volwne Flow
23
Figure 13 ~ Correlation Picker
BOOm
Available Stream COllelalions IH· Black Oil 00,· Eleel rol~ Ie
~
$.• ;
'HC Dew Poinl
!- Higher Healing Value
!- Lower Heall ng Value ! Mass DenSity (S td. Con d)
By clicking the blue stream arrow button next: to the stream name, 8 different stream can be selected.
:
i
!- Waler Contenlln Mg/m3 !- Waler Dew POlnl 'Wobbe Inde,
'-
.:J
$:' ,Ry!, Plot, .... 1
3
jAil Feed Gas Clo~e
3.
On the Feed Gas stream Properties page, select the IDgber Heating Value [Gal] raw in the table.
23
204
Getting Started
4.
Click the View Selected CorrelBtlon button. Figure 14 ~ Hluher Heiltlnll Yalue
13
DispldY Nom" I Higher Heating Value[G a~ I Correl-ation Name: , - - - - - Higher He-ating Valu-e---Paramel"r"--------------, ~sliialiiuiii~ ReI. Tern, 0 lion ~
Property correlation parameters can only be edited using the Correlation Manager. The meaning mthe Status group is explained below.
Stre-am Connections:
A window appears giving details of the property, note that here the Reference temperature option cannot be changed (it appears in black).
If the existing ccrrelatlons are not find. removed, then any new ones in the Correlation Set are added to the bottom the list.
m
5.
Click the Save Correlation Set to File button to save the properties in this stream as a correlation set called Gu CorrSet.
6.
Open the Properties page for the Export Gas stream. Remove all the existing oorrelaticms and add the Gas CarrSet correlation set to the stream using the View Correlation Set Lilt button. Figure 15
Ei
~ CorreliltlQn Set Picker
Available Stream Correlation Sets
8· Gas CorrS et HC Dew Point Higher Heating Value Lower Heatl ng Va lu e Wobbe Inde, Act. Volume Flow
File Path:
t\ pp Iy
24
I
S upport\$treaIllCorrSel~,~1lI1 12elete
J
.cancel
Getiing Started
25
All user defined correlation sets are stared, by defil.ult, in the file StreamCorrSe1:l.xm1 in the \Support subdirectory of the Aspen HYSYS installation. The name and location ofthis :file can be configured on the liles-Locations page of the Preferences window (Tools-Preferences menu option). This file is not created until a COlTelation set is added.
Customising Properties for the Whole Case Aspen HYSYS includes a Correlation Manager where global changes for the whole case can be made. This is accessed from the Toois-Correlation Manager menu item. Fillure16 DEII8ils cI the selected correlation
............
_ Ll x
C o n l i g u r a l i o n - - - - - - - - - - - - - - -....... ---"o,......... ..:. ... ---------------,
oisp lay N"me; I
Available Slream Correlation. ~
I±I Black Oil
$.. E ledrolyte $"Gas He Dew Point
;
:
Hig her Healing Value Lower Healing Vaiue Mass OenSily (Sid. Cond) \;j aler Conlenl In Mgim3
;
\;j obbe
:
i
I
~u,", ","
!
I
Correlation Name:
'Water Dew Point
,par_ame_lers:
-
Index
Higher Healing Value[G"s] Higher Healing Value
","" , -------.J
.lalU
SIream Conneclions:
$RVP "Solid Plot:
IAll
!Slream Correlalion Conlrols (GIOba~1 p I 0 I' IS !ream COO~liOnSel Conlrols (Global) 'Ej I'@l ')S-; . / . / / Ac~iv et re erence p Ion -l.!if I ~~~~~~i:...~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~
i
-p.
_
..".
,/
Add or Remove correlations
".
/
Load in B previously saved correlation sal
'-
"streams displaying the selected correlation
The meaning ofthe Stream Carrelation Controls (Global) buttons are similar to those for the individual stream. except any changes apply globally (to all the streams in the case). The functions ofthe buttons are 88 follows:
25
Getting Started
2&
Button
W ~
FIybyTex:t
Notn
Scan System Carelation8
Click this icon to manually scan the system registry and build a list of aYailable property correlations.
Clone Selected COIT8lat1on
Only enabled when a property with var1able pslImeters Is selected (details are given In the following sections).
~
../
X
~
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.
AcIivat& Selected Global Correlation
Adds the selected property carelation to all the streams in the case.
Remove Selected Global Correlation
Removes the selected property correlation from 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.
1.
Open the Correlation Manager using the Toolt menu.
2.
Select the Gas-Hlgber Headog Value property in the tree. The right side of the window now shows a similar view to that seen previously. However. now the reference tempen.ture can be changed.
3. Change the reference temperature and note that the values calculated in the Feed Gas and Export Gas streams change. When you change a correlation's parameters, all the streams displaying the correlation will use the new parameters. Hence Aspen HYSYS has a clone feature that allows multiple copies of the same correlation to be used. Cloned correlations can have different parameter values to the original correlation. 4.
Click the Oone Selected Correlation button to clone the Higher Heating Value property.
5.
Find the new cloned property in the Clone section of the tree.
6.
Add this correlation to all the s1reams in the case using the Activate Selected Global Correladon button.
7.
Set the reference temperature for the cloned correlation so that it is different from the original correlation.
Note that now the cloned
Higher Heating Value CClIT8Iation is now present in all the streams in the
case. Cloned correlaUons can be renamed by typing a new value into the Display Name cell.
26
X1
Getiing Started
Compare the values ofthe two COlTelations for the Feed Gsa and Export Gsa streams.
Il!!lIiII3
~ Correlation Man ag er
Configuration-------------------------------,
Available Stream Correlations
Display Name: IHigher HealingValue_Clone-' Correlation Name:
I!I Black Oil ItI Elecl,olyle I!IGa, I±IRVP i- Solid $.. Siandard
I
Higher Healing Value[GasJ
pa'amele'''-----,.SI8IU Ref. Temp. Oplion no deg C :
:····User
S·· Clone :.... Highe, Healing Value_Clone-' Stream Connections:
IAll
Plot:
*"
Sl,eam [orrel"lion [onl,ol,(Global
~
ITh ~
c'
X
II' Preference Oplion: [S I~"m Correlalion Sel Conl'o" (Glob"l) _ _ iij; / Active Sel:
The following table describes the six bars contained in the Status group: Statu. Bar
Deacription
Str8llm
Indicates that the carelation can only be applied to material streams.
PointiPlotiable
IndicatflB whether the property correlation ie a point or plottable properly.
Black OilJElectrolytai G8lIIRVPJSoildi StandM'dllJllwIClone
IndicatflB which correlation type the properly correlation reeidflB within the Available Correlatione list
ActIve/Inactive
Indicates whether the property correlation has been activated by the carelation manager. If the status bar is green, any new stream added to the flowsheet with the earne fluid type 88 the correlation will automatically have the property correlation added.
View Global Correlation set List button
In UaeJNot in Use
IndicatflB whether the property correlation ie being used by a etream in the case.
Available/Unavailable
Indicates whether the property correlation exists in the window registry rlthe system.
The VIeW Global Correlation Set Lilt button in the Stream CotTelation Set Controls (Global) group allows 8 previously saved Correlation Set to be displayed fur all the streams in the case.
28
Getting Started
8.
Using the Correlation Manager, remove all the existing correlations for all the streams in the case, then load the previously created Gas CorrSet Correlation Set 80 that it is used by all the streams.
Wamlng Message: Loading aCue When you load a previously saved case, you may see the following message: Figure 18
E3
HV5V5
Your preference file i< set up to append a full list of properties to all ,t"am<, (Tool/Preference
?
The file you are loading already has properties attached to streams wnch may be different from the full list. Do you w ish to a)pend the fulllis:t to every str eam?
This conFrmation message can be turned oFF in the preFerences, (Tools/PreFerences/Simulation Page - Options ply).
The wording of this measage and the Preferences options are slightly different for Aspen HYSYS versions before 3.2, although the effect of choosing each option is the same.
•
Yel will append. the standard set ofproperties to any streams 1bat may have had properties removed. Any custom properties added will remain.
•
No will leave all stream property views as they were when the case was saved.
In most cases the standard property set will be used anyway, 80 it does not matter which option is chosen. The Aspen HYSYS preferences include several optima relevant to this message.
I!!lliIl3
" Se§slon Preference§ (hll§lI~·PRF)
Simulation Options
'General O p l i o n s - - - - - - - - - - - - - - - - - - - - - , II f.IICl~:NLJ:lti~I~?Ir~~~:G~00~~liCl:6~ ~ Use Inpul EHperts P View New Sireams upon Cre"lion P' Confirm Deletes
r
Errors
r
Use Modal Properly Views
~
Confirm Mode Swilches
Desldop
Record Time When Noles Are Moditied
r
Enable Single Click AClions
Naming
P P'
Enable Cross Hair~ 0 n PFD
r;
Enabla Cell Edit Button
Tool Tips
p,
Save Xlvi LFluid Package To User Defined File
Dynamics Perlorrilance
Show Properl.\' Package Wamin,a-----------------, II
Licensing
p" Show Prop erty Package Warnin g
RTI Server
.s.tream Property Correlations----------==-<=::-----, II
Coluriln
~ Aclivale Property Correlatiol'ls
Slatus Windo
P
Confirm Belore Adding il Active Correlations "re Present
Trace Window
Simulation S,,>!e Preference Set...
28
LOlld Preference Set. ..
Getiing Started
2SI
•
Checking Adlvate Property Correlationl tells Aspen HYSYS to add the standard correlations upon opening a case.
•
Checking Confirm Before Adding If Active Correlations are Present makes Aspen HYSYS show the previous message when every case is loaded.
•
Unchecking Confirm Before Adding if Active Correlationl are Prelent is equivalent to clicking Yes each time the message appears.
The safest choice of options is the defimlt Unchecking the Confirm Before Adding if Active Correlationl are Prelent is probably worthwhile, unless you are dealing with cases where the correlations have been customised. Each stream has a status indicator on the Properties page that indicates whether the Activate Property Correlations option is checked in the Preferences. The Cmrelation Manager window also has a similar status indicator. Figure 20
1l1iIt3
Feed Ga§ Work;!;heet
Conditions Properties
Camp osit io n K Value User Vari~bles No~es
Cosl Paramet ers
Stream Name Molecular Weight M0 la r De mitJ [kgm 01 e/m3] Ma~s Del'lsity [kg/m3] Act, Volume Flow [m3!h] Mass Enth"lpJ [kJ IkgJ Mass EntroPJ [kJ/kg'C] HMt Capacity [kJ/kgmole·C] Mass He
I ~ """""D'~'i~'i~ ".".".".''jl '--_ _
D_el_ine_l_ro_m_O_lh_er_S_lre_"_m_"._ _....J
Feed G
17.69 2,235 39.55 1337 -4329 8.604 44.47
2,513 8.520e~005 4.8.l5e~004
.. ..
29
30
Getting Started
9.
Save and close your case.
10. Go to the Simulation-Options page of the Aspen HYSYS Preferences (select the Tools-Preferences menu option). 11. Ensure that the two checkboxes in the Stream Property Correlations group are activated. 12. Reload the case. Click Yes on the message box. Notice that all the streams in the case now have the standard set of correlations in addition to any customisations. 13. Reload the case again. Click No on the message box. Notice that now the streams only show the correlations in the Gas CorrSet correlation set.
30
Extensions
Extensions
© 2005 AspenTech - All Rights reserved. EA1000.04.07 02_Extensions.doc
1
2
2
Extensions
Extensions
3
Introduction One of the most powerful features of Aspen 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 Aspen HYSYS will not be covered. If you want to learn more about creating unit operation extensions or other tools, using the extensibility feature of Aspen HYSYS; AspenTech offers another course that will meet your needs. For more information, ask the instructor. With unit operation extensions users can create models for unit operations that are not available in Aspen 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: •
Register extensions in Aspen HYSYS.
•
Use a prebuilt extension in an Aspen HYSYS simulation.
3
4
EDenaiana
Registering Extensions Before extensions can be used in a simulation, they must be registered.
1.
Open the ToollI menu and select Preferences.
2.
Click the Extenllions tab. Fillure1
I!lliIl3
., Se<
Regislered
E~lension"-------------------,
Reg isl.",Ii on
Type:
CLSIO, ProglD. Lpca~on;
Slaws;
Switch To Directory:
BegisJer an E:-:tens:ion...
Resources
3.
4
!:!.nregbler Exterrsion,..
Extensions
Click the Register an Extension button. The Select an Extenllion to be Registered view appears.
Extension.
5
4. Navigate to where your extension :file is located and doubl.e-click. it to register it with the system. Figure 2
II EI
HYSYS E"tenslOn RegIstratIon
rege,tn: Ver'lon 01 Jun 252003 13 52.28 Regislered G \Program Files\Hyprotech,HYSYS\E>tenslonsWirtuaIS Iream dll Scanning G \Program Files\Hyprotech,HY5YS\E>tenslomWirtuaIS Iream edl. . Adding ke~s SoFlw~r~ \H y Prot~~h I.HY SYS" 1 1I.E t~n",omWirtuaIS Iream edl -< d~laull>' Vlrlual Stream E'In v1 1.3 E,Ienslon Type UnilO peral,on Logical
OK
Once an extension is registered., it will appear on the Enenaiona tab, and you will be able to use it in your simulation. Figure 3
I!lliIl3
, Se«i<>n I',efe,ences (h ysys.I'RF)
[ ..Ien.ian. Reg islrali on
Registered
E~tension,,---------------------,
Virlual Stream E
Type: CLSID, ProglO' Location: Slatus:
Swilch To 0 ireclory:
!Jnregisler E,ten"ion...
Simulation
Resources
Extensions
Saye Prelerence SeL
5.
Close the Session Preferences view.
There is no need to restart your computer, although Aspen HYSYS may need to be restarted.
5
EDenaiana
IS
Adding Extensions to Your Simulations Extensions are added just like any ordinary unit operation in Aspen HYSYS. The only difference is that they do not have an icon on the Object Palette. The simplest way to add an extension to your simulation is to follow the steps below: 1.
Press the hot key to bring up a menu ofunit operations.
2.
Select the Extension. radio button from the column on the left. The extensions that are registered with the system will appear in a column on the right.
3.
Select the desired extensions and click: the Add button. Figure 4
I!lIiI EI
:: Unitops - Case (Main)
Cate,gories-------,
A:,:ailable Unil 0 peralion
r, All Unit 0 ps
:Virlual Slrearil E~tn vl 1 3
r, Ve,
(' Heal Transfer Equiprilenl Rol
~.
6 dd
J
.cancel
1
r.:
r
r r r r
r-
r
r r
Shorl Cut Columns Sub·FIowshee I~ Logicals btemiQm User Op< Eleclrol.\'le EQuipmenl Updream Ops
Restart Aspen HYSYS if an extension that has just been registered does not show in
the list of available extensions.
6
Extensions
7
Workshop In this workshop, you will add the Virtual Stream extension to various streams in the Turbo Expander case built in the Getting Started module.
Da1't WOITY if you haven't buiH the Turbo Expander plant C888. You can U8e the "ADV1_GetlingStsrted_ SoIn.h8c" file.
The files for this extension (VirtualStream.dlI, VirtualStream.edf and V1rtuaI 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.). 1.
Copy these files to a location on the computer's hard disk.
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 Toola menu in the main menu bar.)
3.
Click: the Reg1ater an Extension button, and use the file e:xplorer to locate the VIrtualStream.dll file. Opening this :tile 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 Connectiona 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.
7
8
EDenaiana
If the Feed Gas stream does not appear in the Reference stream drop-down then the Allow Multiple S1ream Connections option must be set in the preferences (ToolsPreferences menu). FigureS
l!!IliIEi
" Se<
Simulalion
n
Options
~ l!i'ifo'0' Heifi, pi ~:'s:i';~~0,,~~0~ ~~i'i'o'ii'~
~ Use Inpul bpe rls
P'
P
Error,
rUse Modal Properl~ Vi ew,
~ Confirm Mode 5 wilches
Desklop
P
r
Naming
~ Enable Cros, Hairs On PFD
Tool Tips
P
View
ew
reams upon
reation
Record Time When Notes Are Modified
Confirm Deletes: Enable Single Click Adom
~ Enable Cell Edit Bulton
Sav e XM L Fluid Package To Use r 0 efined File
Dynamics Performance
Liceming RTI Server
P
Show Properly Package Warning
;;'Iream Properly C o r r e l a l i o n . - - - - - - - - - - - - - - - - - - - , II
Column
[7 Adivate Property Correlations
S 1~lu, Wi ndow
r
Trace Windo w
8
Show Properly Package W a r n i n n - - - - - - - - - - - - - - - - , II
Confirm Before Adding if Aclive Correlalion, are Pr"enl
Extensions
6.
9
On the Parameters tab, configure the extension to transfer the Pressure, Molar Flow, and Composition, with a specified Target Vapour Fraction, as below. Figure 6 TIck checkboxes to transfer information to Target Stream.
..
\
\
_ DIX
II
\.
Transfer irlomu.ltiJ
I Pressure [kPa] MeXaJ Flow (kgmolelh Mas, Flo., (kglh) Ideal Sid Liq Vol Flow (m31h MeXaJ Enlha1py IkJJkgmole)
iMu\J:iljier
Reference value \.
5000
29B8 5.287.
~ " " ~
, ~
I
,
0"1
Taroet v~ue 0.0000 ~ ·75.g, 5000 F I 2900 I 5.287••004 166.4 I
1000 1000
0.0000 0.0000
<~ly>
I
-85lJ8e+0lJ4
17
Composition
Connections Qelele
\
10000 3[00
VOOOlJ Ffaction Temperature (C]
=
Specify Multiplier and Of fset for transferred variables.
Parameters
I
I
I Waksheet I Abcul
,,
/
,!gr<>fOO
Type Target value for any remaining degrees of freedom.
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 ofO. 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.coml. In order to access the Knowledgebase you will need to have previously registered and obtained a login ill. These can be downloaded, and registered in exactly the same way as the Virtual Stream extension. Alternatively you may have some others already stored on your company network or your computer.
9
10
10
Extensions
Advanced Columns
Advanced Columns
© 2005 AspenTech - All Rights reserved. EA1000.04.07 03_AdvancedColumns.doc
1
2
2
Advanced Columns
Advanced Columns
3
Workshop Most users are familiar with the prebuilt columns that are available in the main Aspen HYSYS Environment. This module will introduce the concept of custom columns. Aspen 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. Building custom columns allows users to replace reboilers with heat exchangers; the heat exchangers can then be rated and sized. Likewise, thermosyphon reboilers can be used in place of generic reboilers. Aspen 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: •
Build custom columns in Aspen HYSYS
•
Replace generic reboilers with sizable heat exchangers
•
Perform Tray Sizing and Rating calculations
Prerequisites Before beginning this module, you should be able to: •
Navigate the Main Simulation
•
Add unit operations to the PPD
•
Add, and converge, a generic prebuilt column
3
.,..
Column Overview
9
To Condenser
8
Reflux
Main TS
0-102 Condenser
Boilup
Steam In
To Reboiler
Reboiler Pump Out Pump
V-100 E-100
Reboiler Out
Pump Duty Steam Out
10
Advanced Columna
5
Custom Columns The most common way ofadding a column to a simulation is to use the prebuilt columns that Aspen HYSYS offers. There are four prebuilt columns available: •
Absorber - the simplest of all towers, no reboiler or condenser.
•
Refl1ID:d AbIorber - an absorber tower with a condenser on the top stage that allows for a re:t1uxing stream in the column.
•
Reboiled Ablorber - an absorber tower with a reboiler at its base, and no condenser at the top.
•
Diltillation Column - an absorber tower with both a condenser and a
reboiler. Customising a Column gives the user greater control over the simulation. For example, replacing the reboiler with a Heat Exchanger allows the user to use steam as a heating medium and size the exchanger based on the required duty. Custom Columns can be built in two ways, either by modifying a prebuilt column, or by constructing a new column from the beginning. In thiB module, a prebuilt LPG recovery column will be modified.
The Column Sub-Flowsheet Whenever a column is added to an Aspen HYSYS simulation, a Column Subft.OWIIheet is created. The sub-flowsheet is essentially another layer in the Aspen HYSYS simulation. It is located under the Main flowsheet layer, and can be seen by selecting ToollIPFDs in the main menu bar, or by pressing the hot-key CTRL P. The nature ofthe layering scheme can be seen in the displayed list as the Column's PFD is indented under the Main PFD. Selecting the desired PFD and clicking the VIeW button will open that particular layer fur viewing. In Aspen HYSYS Vel'8ion
3.1 and onward it is not necessary to enter the Column Environment to edit it Changes can be made by opening the PFD and editing it, although it is still recommended to enter the Column Environment.
Alternatively the PFD of a particular column can be seen by right-clicking the column PFD icon and choosing Open PFD. In order to edit the column, fur example, to add and modify operations, it is best to enter the Column Environment. The Column Environment is accessed through the Column Property View. To bring up the Column 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 Aspen 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
5
IS
Advanced Columna
When in the Column Environment, returning to the Main Environment can be accomplished by clicking the Enter Parent Simulation Environment button located on the Main Toolbar. Enter Parent Simulation Environment icon
Adding operations to the column is very similar to adding operations in the Main Enviralment The choice of operations is reduced, but the method ofinstallation is identical.
Building the Simulation This module will continue with the column built in the Getting Started module. This column is an LPG Recovery unit for a Turbo Expander plant Don't WOITY if you haven't buiU the Turbo Expander plant C888. The file "ADV_GetlingStsrted_ SoIn.h8c" contains thi8 C88e.
6
This column was constructed as a generic distillation column. The condenser is a ''Total Reflux" type; this means that there is no liquid product from the condenser, rather all of the condensed liquid is sent back into the column to provide a re:t1uxing
liquid stream. The reboiler on this column is also ofthe 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.
Advanced Columna
7
Replacing the Reboiler The generic reboiler will be replaced with 8 shell and tube heat exchanger. This will allow the user to supply steam to the column as the heat medium, and size, or rate, the heat exchanger. Modified HTSIM Inside-Out is a general-purpose solver that allows Heat ElCChangE11'8 and other operations in the Column Environment.
1.
Before modifying the column, it is necessary to change the Column Solving Method to Modified HYSIM IDllide-Out. The Solving method is accessed through the Solver page (on the Parameten tab) ofthe Column Property View.
I!!I[!J EI
Column: LPG Il.eccwc,y l (OL 1 FluId Pkg: 8dl>ls 1 I Peng Roblflson
Parameteu:
0
~
~~ll:fl:lticrrr,- - - - - - -
pilon,
Ptolio<
M~iroom rJ~D6 of 1le'~1"I1: £'lUili!:lfiLln ~flOt TcMfo!lr'lOl!l:
E.stirnates
!-lIM! J SlWe [flo.' T(Ilefo!lr.t1!'
Ellicier-oel
SolwJ 1I3 Ph•••
S,wl!! So~ilYl:!i:
lOIlJ[ OllJo-lJ5
P"
'--
Il.... P...
Low
r; fi'tfJd
r r
Fi:Ked Darn·
r
A1l~i~
r
medlad. Good for
~r~r.vnlil!ll'lll!lr.!ll!ls:Es.t.MljLJ'U
lrlitial E!till\3te !2enerato' Pararne:ler.-----, DJ"'l";c lol..".,o;on I" lEG
r
Dyt'l.Y't'ic. E..sti~teJ
D.I".
1.000
Fadol
(t' ~t!lr'ld!td Inil~liUltiDr'l
IHYS '''' Imide-Dol """IP'~"'"
SmploK
T'OIILiocOdFkJid
Ti~tenWora TQlerat'K;~
Generallx.lIpo~ ~I,,/jon
/>,""...,.... Kv.... & H l>IodoJ P..."",I..,
SCOooMJ4
Initial E:&l:il'Mtl!l
S",,0' C,lie" H",,*,g 1.1 odol T,,,,,.Lovol Inlioli,. Itol1lld••,K', T"" Liocjj,Choool<. B"",d on
r
Irte!J~lct .._
IV Upd... OUilel'
r
llJ1".d
2.
In the Basis Environment, add Water to the list ofcomponents.
3.
Ifnecessary click: the Run button to recalculate the column.
4.
Enter the Column Environment and delete the existing reboiler and energy stream from the PFD.
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.
7
8
Advanced Columna
5.
Add a Pump to the Column Environment with the following parameters: In Thia Cell...
Em....
Name
Reboiler PuI11J
Inlet StnNIm
To Reboiler
OUtlet Stream
Pump aut
En.,., Stream
Pump Duty
Delta P (on Design-Parameters page)
75 kPa (10.9 psia)
6.
After the newly created pump, add a Heat Exchanger to the Column's PFD, with the following parameters:
Heat Exchanger iean In Thia Cell...
Em.
Name
E-100
Tube Side Inlet Stream
steam In
Tube Side Outlet StnNIm
steam aut
Shell Side Inlet Stream
Pump aut
Shell Side Outlet Stream
Reboiler aut
Tube Side Preuure Drop
50 kPa (7.25 psia)
Shell Side Preuure Drop
75 kPa (10.9 psia)
7.
Define the Steam In stream as saturated pure steam at 2000c (392°F). The mass flow rate is 2500 kgIh (5511Iblhr).
Normally when the reboiler is deleted from the column Sub-flowsheet the pressure that was specified at the bottom will be lost, and hence must be added back on the Parameten page in Profiles tab. However, in this case the pressure at the bottom ofthe column is set by the pressure in the bottoms liquid product stream (10) which is linked to the Turbo Expander Be sure to pick the 8eparator operation from the object paletle, rather than one of the Condensers that have 8imi!. iCon8.
Enter Parent Simulation Environment iean
8
outlet pressure. 8.
Add a Separator after the Heat Exchanger with the vapour product returning to the bottom stage ofthe column, and the liquid product leaving the Column Environment as stream 10. (See the Column Overview at the beginning ofthe module for the column PFD.)
9.
Return to the Main Flowsheet Environment using the Enter Parent Simulation Environment button on the main toolbar. Make sure the main Aspen HYSYS
solver is switched on.
Advanced Columna
II
10. Because the R.eboiler was deleted, Aspen HYSYS removed the Reboiler liquid RVP spec. Add this spec back: RVPSpec...
If you can't S68 'V·100' in the list rI stages, make sure the main Aspen HYSYS solver is switched
on.
Type
Column Vapour Preasure Spec
N8I1Ie
Btms RVP
Stage
V-100
Type
Reid Vapour Preasure
Phase
Liquid
Spec Value
200psia
Since the Heat Exchanger was installed in the Column Environment, its 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. 11. Ensure that the three active specifications for the column are: Ohvd Duty, Btms RVP, and E-l00 Heat Balance.
.11I
l!!!I~Ei
Colum" LPG Ruco... y (COU)
Bdio
Oeo;g-, VrfN,J Inils.!1
Ctimecti:lm
E.ttilM~t .._
..lD
No"b,
Ilbfilln
..I
Spou 5p~5lJrrwnary
Ii'
rr-
""!'
llllD
"'lD
Pre" I....,
=:
·llllD
Sub:
oEIIIJD.
::!
~
,
II!!
II!!
,
•
9
~ote.a
o"",,Ouly
BI... FlVP [·100 H... 8.1"". O,h:W.pA!lIo
S er",dV""e 1.000e-01l1 WI> 13791:P. 0.0000 WI> IEJJOk 01011>
,.
E'1UDUA
Curerl: Y~lue
I
1.00<-Crl3 1.380.003
381
''''rl»I
\.J.Jl Enol
·0.0002 ,0.0000 ,.~Iy>
,0.7819 "~Iv)
I
A.di~
E:!'r.n*
~
P:
" 0 0
C!..alenl
~ 0
R;
n
0
0
DMigri
E!.e>"
r
Ul'I"'. Ourlel'
r
llJ1a.d
9
10
Advanced Columns
12. Run the column. After it has converged, answer these questions: What is the UA ofthe Heat Exchanger?
What is the LMTDfor this exchanger?
What is the vapour fraction ofthe outlet steam?
Column Troubleshooting If your column does not solve consider the following troubleshooting points: •
If the column will not even start solving but does not display any error then check that all the feed streams to the column are fully solved. Columns cannot solve with undefined feed streams.
•
Make sure that enough specifications are activated so that the column has zero degrees of freedom.
•
Make sure the pressure profile inside the column is defined. Remember that the pressures in the product streams calculated by the Set operations control the column pressures. It is necessary to set delta pressures in all the newly added operations so that Aspen HYSYS can calculate the pressure on the bottom tray.
I -----------Save your case!
Connecting Streams between Flowsheets
10
1.
Look at the Main PFD. Notice the streams Steam In and Steam Out are not visible here. This is because they were created in the Column Sub-tlowsheet, and have not been connected to the Main Flowsheet.
2.
Streams are connected between the Main and Sub-tlowsheet on the Connections page on the Design tab. Notice that there are two types of streams listed here, Internal and External. Internal streams are those on the Column Sub-tlowsheet. External streams are the corresponding streams on the main Flowsheet. Currently Steam In and Steam Out do not have any linked external streams.
Advanced Columna
3.
11
Internal streams are connected to the Main Flowsheet by typing a name in the External Stream column. Add the appropriate names to the External S1:reamI column, and cheek to make sure that these streams appear in the Main PFD. Fillure3 I!!I[!] El
Column: LPG Recove,y / COL 1 FlUId P~y: Odsis 1 " Peng RobInson
Oetign CON"lection..
ColJlM
Inl"nolS''''''
Mo"or ;pou
As this is now a Custom Column, the Connections page of the Design tab no longer shows a Distillation Column.
N.... JLPG Aeeov",y 8
6 F\on Doi.
SP~ Sl,lnwnat)l Subco,*,~
S""·Fb..."""1 log
~
Ir~et%eaill'1s-G---------------------"rSLl!)'N.m:.er~
E,letnolS~• ..,
r. Ict>DOAn
a
rB*~~
"Slr.. -m->~
Edill,,.,,--
_ _ ~I'ii'~,,:,::I;·~;:+-<";";<"S;"'r:"::"':;':'-~-+~""-"'-
r
II
SrJjll,*l,
Nlltes
Dut6et 5lre-jilii d' lop 10.0000 kP~
,_ _-",O--,,1OO'*'t ,-
9
--'1""0
SreamOul
_ _-_NeVI'·
Q-l02
NonoRorid
10
P-H Flash V-l00:-f-i-l-+--';;-P-HFlosh
9
~~..::
«Str..~ __
-Eiillosh
P Too:
12766 kPo
d' Bot 10.0000 kPo P 801:
121100 kP.
Dol...
The Steam In flow rate was defined in the Column Environment; therefore, it is not a specifiable parameter in the Main Environment Some users prefer to have all the feed streams visible and editable in the Main Environment. 4.
Delete the flow rate of Steam In in the Column Environment, and enter the same value as a flow rate for Steam In in the Main Environment. The column will automatically resolve.
5.
Delete the other Steam In specifications on the column sub-flowsheet (Vapour Fraction, Temperature, and Composition) and transfer them to the main flowsheet.
I -----------Save your casel
11
12
Advanced Columns
Exercise - Simulating the Reboiler on the Main Flowsheet Using Internal Streams Another method of simulating the reboiler with a Heat Exchanger is to use the Internal Stream feature of the column to make a copy of the reboiler on the main flowsheet. Here this will be added to the case where a rigorous heat exchanger has already been added to the column sub-flowsheet. However, this technique works just as well with columns using the standard Reboiler operation. 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. An "Internal Stream" is a special Aspen HYSYS stream that represents a fluid inside the column. For example, the vapour leaving the top tray, or the liquid leaving the bottom tray. Internal Streams show with a cyan colour on the column sub-flowsheet.
1.
Go to the F1owsheet-Internal Streams page of the column, press the Add button and configure the table as below: Figure 4
'
..
.. . ..\
\
..'\.
:
I
Inte\t stlecsms----~
Flowshecl
"
Blm Tray Liquid
/
.'
"\......
St~ce
Stream
Setup
Cheek this box to make the stream appear on the main f10wsheet
Stage and Phase the stream will represent
Type the name of the internal stream
T,c.
5 ManTS
NetiTolai
l.iq.OO
Total
Vari3bles
_ D x
"
E'OOII
.-
8dJ Delete
7'
InternlJl Slreams
I
lAapPfig
I I
I I I I I
I I I I
/
L.,
Design
Delete
I
P~f~meters
I
I Side Ops I Roling I \IIOfbh:.et I
Coo..m Envircnment...
I
Rill
I
Perform!Jnle
Re,J
,
Flowsheet
I Reoctions I DyMnOCS
I
Iv
U~te OUI1els
Only relevant for streams with external draws. Net = exclude ef feet of external draws (consider flows in column only) Total = include draws (I.e. tot al flow leaving the st age)
12
r
jgnaed
Advanced Columns
2.
Re-run the column to calculate the internal stream.
3.
Locate the stream on the main tlowsheet; check that its properties are the same as those for the liquid leaving the column.
4.
Add a pump, heat exchanger, and steam streams as mentioned earlier in the module.
13
Pump Details... Pump Name
Reboiler Pump
Inlet Stream
Btm Tray Liquid
Outlet Stream
Pump Out
Energy Stream
Pump Duty
Delta P
75 kPa
Exchanger Details...
5.
Exchanger Name
Copy of Reboiler
Tube Side Inlet Stream
Steam In 2
Tube Side Outlet Stream
Steam Out 2
Shell Side Inlet Stream
Pump Out
Shell Side Outlet Stream
ReboilerOut
Heat Exchanger Model
Exchanger Design (Weighted)
Tube Side Pressure Drop
50 kPa
Shell Side Pressure Drop
75 kPa
Steam In 2 conditions
Saturated pure steam at 200·C. Mass flow 2500 kg/h.
Use a Set operation to specify the Reboiler Out stream temperature to be the same as the column bottom product stream.
I ----------Save your case!
Column Sizing Aspen HYSYS contains a Tray Sizing utility that greatly simplifies the mechanical design ofa 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.
13
14
Advanced Columna
The most common use ofthe Tray Sizing utility is to identity a tray section, and then make Aspen HYSYS size the tower into sections based on your input, then if desired, perform a rating analysis on the column. While Aspen HYSYS is able to size and rate tray sections, the values that it provides are only rough estimates and should be treated as such.
Column Sizing in Design Mode 1. 2.
Select TooWUtiUtiel from the Main Menu bar, or press the hot key CrRL U. Select Tray Sizing from the list of available utilities and click the Add Utility
button. FigureS I!I~ EI
TraJl !> "ing· TraJl !> "ing-l Detign Selup Specs Tray J nternals:
Nole.
Name
Tray Section
IT raJ' Sizing·ll
Select TS ...
Setup Seeti on
Seeti on N~rne Start
End Internals
Mode Active Stalus Design Limi Limiting Sfag e
Use Tray Vapour to Size
Delete
3.
I
Ask Each Time
r
::EJ
jgnored
Click the Select TS-. button, and select LPG Recovery as the Flowsheet and Main TS as the Object.
Aspen HYSYS allows users to select Tray Sections instead of entire columns so that users may size Side Strippers independently from the Main Column. 4.
Click the Add Seetion.•• button. Accept all ofthe defimlt values that are presented.
Aspen HYSYS will calculate the dimensions ofthe column using preset values for the column internals and for the various parameters.
14
Advanced Columns
15
Summaries of the calculations are presented on the Performance tab. A brief explanation of the terms follows: •
Number of Flow Paths. The number oftimes liquid crosses the tray, most trays are single-pass, or have NFP of 1.
•
Maximum Downcomer Backup. Represents the maximum amount of liquid hold-up in the downcomer that can be tolerated by the column before flooding occurs.
•
Maximum Weir Loading. Measures the amount ofliquid flowing over the weir.
•
Pressure Drops. Estimates the total pressure drop over the section and the maximum pressure drop per tray.
What is the maximum pressure drop per tray in the Distillation Column?
Over which tray does this pressure drop occur?
What is the diameter ofthe trays inside the column?
What is the total section height?
Column Sizing in Rating Mode In rating mode, Aspen HYSYS allows you to perform rating calculations based on a
specified tower diameter and fixed tray configuration.
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: Diameter, m (ft.)
NFP (Passes)
1.0 (3.3)
1
1.25 (4.1)
1
1.5 (4.9)
1
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 m 3/h-m (860 fl?/h-ft)
•
Maximum downcomer backup = 50%
For each case, follow these steps: 1.
On the Design tab, click the Specs page and set the Mode to Rating.
2.
Specify the maximum flooding on the Design-Specs page and the maximum loading and downcomer backup on the Design-Tray internals page. These settings are used to display a warning if the constraints are exceeded.
3.
Set the diameter and number of flow paths, and move to the Performance tab.
4.
Leave all the other specs at the default values.
5.
Complete this table with the information provided by Aspen HYSYS.
Case Number
1
2
3
Diameter, m (ft.)
1.0 (3.3)
1.25 (4.1)
1.5 (4.9)
NFP
1
1
1
Weir Load Flood DC Back Up Total Delta P
16
Advanced Columns
17
Compare the table above with the specifications on the previous page; which set oftrays will best meet the restrictions? Remember that smaUer trays will be less expensive.
I -----------Save your case!
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, and 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
18
Advanced Columns
Templates and Sub·Flowsheets
Templates and SubFlowsheets
© 2005 AspenTech - All Rights reserved. EA1000.04.07 04_TemplatesAndSubflowsheets.doc
1
2
2
Templates and Sub·Flowsheets
Templates and Sub·Flowsheets
3
Sub-Flowsheets Aspen HYSYS has a multi-tlowsheet 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 Aspen HYSYS case, which has been set up ready for easy insertion as a Sub Flowsheet into other 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: •
Build a template and/or a sub-tlowsheet
•
Install a template into a case
•
Move objects between Flowsheets
•
Efficiently use templates and sub-tlowsheets in your simulations
3
4
Templates and Sub·Flowsheets
Creating a Template There are three ways to create a template: •
Convert a whole tlowsheet into a template
•
Create a new template
•
Convert part of a tlowsheet into a template.
Convert a Whole Flowsheet into a Template 1.
Access the cases Main tlowsheet's Property view (SimulationIMain Properties or press CTRL M) and select the Convert to Template button. You will be asked to confirm changing the case to a template, and whether you want to save the simulation (as an ordinary *.hsc case file) first before converting it to a template.
2.
Set the Template Tag, Transfer Basis (if a material stream) and other optional template information ifrequired. These settings are covered later in this module.
3.
When you save the simulation, it will be saved as a template.
Create a New Template
4
4.
From the File menu, select New I Template.
5.
Follow the standard procedure for building your simulation.
6.
Access the cases Main tlowsheet's Property view (SimulationIMain Properties or CTRL M) and set the Template Tag, Transfer Basis (if a material stream) and other optional template information ifrequired.
7.
When you save the simulation, it will be saved as a template.
Templatea and Sub-Flowaheeta
5
Convert Part of a Flowsheet into aTemplate There are two possible approaches. The easiest is as follows: 1.
On the PFD, select all unit ops and streams you wish to ''capture''.
2.
Right-click any ofthe selected objects and select CutlPaste Objeetll and then Copy Objeetll to File (Export). Save the group of objects to a "'.hf1 file.
3.
From the File menu, select Open I CutiCopyJPaste, then navigate to the III .bfl 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.
Alternatively, a group of objects can be copied and pasted into a new Template using a combination of the two methods above. The disadvantage of this approach is that some fluid package assignments may need to be manually adjusted.
Example - Refrigeration Loop For this example, a refrigeration loop Process Template will be constructed. This template will then be installed as a sub-flowsheet into the Turbo Expander plant simulation built so :tar in this course. Dan't worry if you haven't buiU the Turbo Expander plant case. The file •ADV1_GettingStarted_ SoIn.h8c" contains thi8 case.
The required power loads will then be determined and displayed on the main flowsheet. 1.
Build the following simulation as a new case. Use PR as the property package.
Fillure1
chit-1
1 Vapour Frattl on Tem perature Comp Mole Frat (Ethome) Camp Mole Frat (Propane)
o 0000 o 0000 o 9000 o1000
Vap 0 ur Fra ellon
C VLV·100
~ Chiller
1<-100
3
Temperalu re
,----------.-1.><.-J--
I I
1 0000 -52 00
I IC
L-------~.----·-.4------,
C-
100
Condenser
Duty
Adl a b~llc Effiel e ney
Comp-HP K·100
5
IS
Templatu and Sub-Fla.-heeta
2.
Initially set Chill-Q to lE6 kJJhr, make sure the case solves and looks acceptable.
3.
Ensure that the refiigerant flow rate is positive. Ifit is not, consider why this might be. Check your PFD carefully and make the appropriate changes.
4.
Save the case as Mixed Refrig.hlc.
Now the simulation needs to be converted to a template, by following the instructions above. However, before doing this you IIlUBt make sure the template is "ready to run". If it is converted and saved as it is now, then when it is installed into a case, Aspen HYSYS will generate a consistency error. This is because there are no unknown variables in the Refrig unit, so when a chiller duty is set :from the main flowsheet the model will be over specified. To overcome this, the specified Chill-Q value needs to be removed, thus leaving the loop unsolved. Now when the chiller duty is set by the main flowsheet the loop will solve carrect1y.
5.
Remove the Chiller duty, then convert the case to a telnplate following the instructions given on page 4, use the name MW:d refrlg.tpL
Template Properties The properties far the template can be set on the Main Properties window (SimulationIMain Properties or CTRL M). The first few tabs ofthis window are the same as for any simulation case. However, the two 1inaI tabs are exclusive to Templates. These are Exported Connections and Exparted Variables. These two tabs only appear when the case has been converted into a template. Fillure2 ~ §imulation Case: Case
.:
Imlalle!! Simulalion 8a,i,---==:<"1' Co" !nlernal ~ Avoid Duplicalion .EHlernal Feed St!eam I n f n - - - - - - - = = = = = = = = = = = : : ;
~
Templale TJ:!g
r·
___%",affi$_
Chill·Q Comp-HP
Bound.ar Labe Is Ghill·q Comp-HP
Transfer Ba$is No.ne Req'd
",,,,"'I •••• l9C
Produci Stream InlStreams Condense r Du1'1 O:::;;;;;_U
.
__
no
._
••
FV Balanq, Lock
6
Transfer _Basis None Req'd
Ex porled Conne c1ion ~
E> porle d Variable,
Templatea and Sub-Flowaheeta
7
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 identity the flowsheet within the case. The Installed Simulation Basis option controls what Fluid Package the flowsheet will use when it is imported into another case.
•
Internal- Use the Fluid Package it has now
•
External- Use the Fluid Package ofthe parent flowsheet
Ticking Avoid Duplication tells Aspen HYSYS to try to use existing fluid packages when the template is imported into another simulation case. Fillure3 ~ Simulation Case: l:ase E~temelly Aeces~ible
,.,
Variebles------------------,
Dele Source
=
,,
PV Belene. Lock
Descri .lion
I
E~porled Conneetioos
_._._._._~~d:
jl
fdi,..
I
~ele
I
Exporled Variablelt
Key variables within the flowsheet can be configured on the Exported Variables tab
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
Templatu and Sub-Fla.-heeta
Installing a Template in a Simulation rLDIt' SHEET
6.
F10wsheet icon
Reactivate the flowsheet :from the previous module. To install click: the Ftowsheet icon on the object palette and select Read an E:dsting Template. Select the template you have just saved. Figure 4 ~ 5ub-Flowsheel Option
SO\Mce lor Sub-Flowsheet-----,.
1(·.,~.,~·]j~~ij~(~:~~J~~~:,:·~:·.·~JI Stllll With II BIIlnk Flowsheet.,. P asl~
~~pOll~d obj~ctL
Once the template is installed as a new sub-flowsheet any subsequent changes made only affect this instance, they do not affect the template :from which the subflowsheet was derived.
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.
Internal streams referto 8treams in the 8ubfIow8heet. External streams are in the main fIow8heet.
8
7.
Click the External Stream box along side ChilI-Q and select Q-I00 :from the pull down menu.
8.
For the other two streams there are no existing streams in the main flowsheet so give them new stream names as in Figure 6.
9.
Rename the sub-flowsheet to Mixed Refrig Unit.
Tempi. . . .nd SuWlowahHta
9
Flgu... S "'" Sub-FloY/sheet Operation - FLOW-I
T~g ITPLl
!,!ame IFLOW-l
In!et Conl'leclions to Sub-Flol'Isheet-----------------------, Inlernal SIrearn
bt.ernal Stream Chill-Q Comp-HP •• New"
(em t>
O!jllet Conl'leclions to Sub-Flol'Isheel:---------------------, Inlernal SIream Condenser Duly •• New··
-c::;;;:
EHterMI Str ea m (empty> (empty>
Conneclion:t Sub·Flol'I£heel En:,tironmenl. __
Delele
Flgu.... " ... Sub-FloY/sheet Operation - Mixed Refrig Unit
!'!affie
jM iHed Relrig Uni~
Inlet Conneclions to
T"g !TPLl
Sub·Flol'I£heel----------;=------------~
EHtern al Str ea m
Internal SIream
0-100
0-100
·Comp·HP "New"
Comp·HP (empty>
O!jllet Conneclions to Sub·Flow£heel:---------------------,
EHtern al Str ea m
Inlernal SIream
Condenser Duly
" New"
Delele
Sub-Flol'Isheet Enyironmenl._
I
You will notice the Chill-Q stream on the sub-tlowsheet is automatically renamed Q100 to match the main flowsheet stream name.
9
10
Templatu and Sub-Fla.-heeta
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 defimlt Tag name for subflowsheet operations is TPLI (for example, strm6@ TPLI). When more than one sub-flowsheet operation is installed the defimlt tag increases, TPL2, TPL3, etc. You may give sub-flowsheets proper names (for example, refrigI).
Exporting Sub-Flowsheet Variables 10. Use the Variables tab to export the following variables:
•
Condenser Duty, Heat Flow
•
Camp-HP, Power
•
Stream 1, Mass Flow
[These streams are on the sub-flowsheet] 11. Edit the variable descriptions to show what the variables represent. Figure 7 "'" 5I1b-Flo\Ysheet Oper
Variable
Sub-Flow,heel En::iironmenL
Notice that the values of these variables are now displayed on the Parameters tab.
10
Templates and Sub·Flowsheets
11
Reviewing the Simulation Basis 12. Enter the Simulation Basis. 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-hand table.
, SimulatIOn BasIs Manager
CU!fent Fluid P a c k a g e s - - - - - - - - - - - - - ,
Basis-2
NC: 2
PP: Peng-Rabinsan
~ew ...
Bdl...
Flowsheet - Fluid Pkg AssociaborJ's-s- - - - - 1
Aowsheet Case Main Mixed Aefrig Unit ( LPG RecavelY @f
Fluid Pka To Use
B~~ I-Basis-2 Basis-'
Delete Cop~
Qelault Fluid Pkg
Components
IBasis-l
iJ
Fluid Pkgs
Enter po./r Environment ..
Retyrn to Simuklhon Environment...
Transfer Basis Aspen 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 PRo
11
12
Templatu and Sub-Flo.-heeta
Aspen HYSYS lIlUBt do a flash for any streams passing between flowsheets as each fluid package could calculate different properties. The Transfer Basis sets what kind offlash is dane. Flash Type
Description
P·H Flash
The Pressure and Enthalpy of the material stream are paased between flowsheet8. A new temperawre and vapour fraction will be calculated. Since the Enthalpy basis may be different for each properly package this option is only recommended when the same fluid package is in use for bolt1streams.
T·PFlash
The Pressure and Temperature rlthe Material stream are paased between flowsheet8. A new Vapour Fraction will be calculated.
VF-TFluh
The Vapour Fraction and Temperature rlthe Material
stream are passed between nowshests. A new Pressure will be calculated. VF-PFluh
The Vapour Fraction and Pressure of the material stream
are passed between nowsheets. A new temperature will be calculated. None Required
No calculation is required for an En8rllY stream. The heat
now will simply be paased between flowsheet8.
In this case no transfer basis is required since only energy streams pass across the flowsheet boundary.
Finish this Section 13. Tidy up the PFD, and add a PFD table for the sub-flowsheet to show the exported variables. (PFD tables are added by rigbt-clicking the object and choosing Show Table.). Figure II
.....-----,----r~cr--~
Mixed Refrlg Unit
I 5 335 e+D06 I kJ/h (Compressor Power) 6285 I kW I (Refrigerant Mass Flow)1 1 123e+D04 I kg/h
Comp-HP
Condenser Duty
Exported Variables (Condenser Duty) Exported Variables Exported Variables
I
Q 100 -
Mixed Refrlg Unit
I -----------Save your casel
12
Templates and Sub·Flowsheets
13
Challenge In this case the chiller is simulated using a cooler in the main tlowsheet linked with an energy stream to a heater in the sub-tlowsheet. It is possible to replace the heater and cooler with a single heat exchanger. One of the features of the Aspen HYSYS heat exchanger is the option to have the streams on each side of the exchanger in different tlowsheets.
Replace the heater and cooler with a single heat exchanger in the main tlowsheet. 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.
Creating and Manipulating Sub-flowsheets Sub-tlowsheets can be created without first creating a template by choosing one of the other two options when adding a tlowsheet. Figure 10 ~ Sub-Flowsheet Option
Source for Sub.Flowsheell-----,
IL...E~~~LilJ1Ix.istir:l9}~p1~I~;:: .. il Start With a Blank Flowsheet.. I Paste exporled objects... I ~anc~ I The Paste exported objects button allows a sub-tlowsheet to be created that contains a group of objects that have previously been saved as a *.htl file (by using the PFD right-click Cut/Copy Objects ... Copy Objects to File function). A sub-tlowsheet can also be created to contain a group of objects that already exist on the main tlowsheet.
1.
On the Turbo Expander plant PFD, select Cooler E-I0l, compressor K- 102, their energy streams, and stream 13.
13
14
Tempi. . . and Sub·Flowsh• •
Figure 11
12 &port Gas
2.
Right-click any ofthese objects and select CutJPatte Objeetll and then Combine Into Sub-FlOWllheet.
This group of objects are then combined into a sub-tlowsheet. Aspen HYSYS automatically sets up all the stream connections Flgur.12
-----~ &:pon Gas
3.
Right-click the sub-flowsheet icon and choose CutIPute Objectll, then Move Contents To Owner Flowsheet. Flgur.13
Aspen HYSYS returns everything back: to the main tlowsheet level. 4.
14
Select the sub-tlowsheet icon and delete it 8S it is now empty.
Tempi. . . .nd SuWlowahHta
15
Viewing and Editing the Sub-Flowsheet Pressing the Sub-Flowsheet En\'ironment button on the sub-flowsheet operation window causes Aspen HYSYS to enter the sub-flowsheet environment. (Ibis is equivalent to pressing the Column Environment button an the column to entet the column sub-flowsheet environment) Figure 1<4 "'" Sub-FloYlsheet Operation - MiKed Refrig Unit !lame !Mi,ed Relrig
Uni~
T~g !TPLl
In!et Conl'leclions to Sub-Flowsheel-------------------==J Inlernal SIrearn
Q-100 Comp-HP •• New"
O!jllet Conl'leclions to
Q-100 Comp-HP
Sub-Flowsheel~-------------______,
IrJiernal SIream Conaenser Duly •• New··
Delele
E,tern al Str ea m Condenser Duly
Sub·Flowsheel En:'{ironmenl._.
The Environment label at the top right corner ofthe Aspen HYSYS window indicates which environment is currently active. Press the Enter Parent Environment button to return to the main flowsheet.
When in the sub-flowsh.eet environment, the Aspen HYSYS solver will only solve the streams/operations within the sub-flowsheet. To see the effect of any changes on the whole case it is necessary to return to the top-level flowsheet. It is also possible to open the sub-flowsheet PFD and make changes whilst remaining in the main f10wsheet environment Hence any changes made in the sub-f1owsheet immediately affect the whole case. To open the PFD for the sub-flowsheet: 1.
Right-click: the PFD icon ofthe sub-flowsheet
2.
Choose Open PFD. Alternatively use the Tools I PFD. menu option.
15
16
Templates and Sub·Flowsheets
In Aspen HYSYS versions prior to 3.1, it was necessary to enter the sub-tlowsheet environment to make any topology changes to the sub-tlowsheet (for example, change stream connections, add/delete objects, etc.), however this restriction has now been removed.
Use of Templates and Sub- Flowsheets Consider the following possibilities: •
A case can contain multiple layers ofsub-tlowsheets
•
Your company could develop a library of templates for everyone to access. These become company standards, and can be more easily maintained and approved
•
Using library templates saves time in modelling and improves QA
•
Complicated simulations are much easier to handle if split into subtlowsheets
•
Large PFDs are easier to read if you use sub-tlowsheets
•
Several engineers can work on the same overall simulation by using templates
Note that links are not dynamic. If a template is modified, it needs to be reloaded into the simulation case for the changes to be incorporated.
16
Spreadsheets and Case Studies
Spreadsheets and Case Studies
© 2005 AspenTech - All Rights reserved. EA1000.04.07 05_SpreadsheetsAndCaseStudies.doc
1
2
2
Spreadsheets and Case Studies
Spreadsheets and Case Studies
3
Workshop The Aspen HYSYS Spreadsheet is a powerful tool that allows the user to apply Spreadsheet functionality to tlowsheet 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 Turbo Expander plant.
Learning Objectives After completion of this module, you will be able to: •
Import and export variables to and from the Spreadsheet
•
Add complex formulae to the Spreadsheet
•
Use the Aspen HYSYS Spreadsheet in a wide variety of applications
•
Use the case study utility to evaluate your tlowsheets
3
4
Spreadsheeta and Cu. Studies
The Aspen HYSYS Spreadsheet With complete access to all process variables, the Spreadsheet is a very powerful tool in the Aspen HYSYS environment The power of the Spreadsheet can be fully realized by the addition of formulae, fimctions, logical operators, and basic programming statements. The Spreadsheet's ability to import and export variables means that seamless transfer of data between the Simulation Environment and the Spreadsheet is a simple matter. Any changes in the Simulation Environment are immediately reflected in the Spreadsheet. and vice-versa. The Spreadsheet has several common applications. For example, the Spreadsheet can be used to: •
Collect together key inputs and results between flowsheet objects.
•
Include known relationships in the model; for example, relate the pressure drop in a Heat Exchanger to the flow rate.
•
Perform mathematical operations using variables from the simulation.
Importing and Exporting Variables Any variable in the case can be imparted into the Spreadsheet The contents of any Spreadsheet cell can be exported to any specifiable (blue) variable in the case. There are three ways of importing values into the Spreadsheet
Note that it is not possible to impart into, and EIJlPOrt from the same cell, instead use two cells one for the import and one for the EIJlPOrt, and link them together with 8 simple "=A1" type formula.
4
•
Drag and Drop. Position the cursor over the desired item, then click and hold the right mouse button. Move the cursor over to the Spreadsheet. Once over the Spreadsheet, the cursor's appearance will change to a ''bull's eye" type. Release the right mouse button when the ''bull's eye" cursor is over the desired cell. The specific information about the imported variable will appear in the Current Cell group.
•
Variable Browsing. A variable may also be imported into the Spreadsheet by placing the cursor on an empty cell in the Spreadsheet and clicking (and releasing) the right mouse button. Choose Import Variable from the list that appears, and select the variable using the Variable Navigator.
•
Connections Page. On the Connections page, click the Add Import button and select the desired variable using the Variable Navigator. After selecting the variable, choose the desired cell from the drop-down list.
SprudshMts and en. Studle.
S
Exporting variables from the Spreadsheet into the Simulation environment is also a simple procedme. The methods for doing this are very similar.
The value in any spreadsheet cell can be 8lCPOrtecI, except if it i6 an imported value.
•
Drag and Drop. Position the cursor over the Spreadsheet cell that is to be exported. Click and hold the right mouse button; the cursor should now change to the "bull' s eye" type. Move the "bull's eye" cursor over to the desired cell. Release the right mouse button; the transfer should be completed.
•
Variable Browaing. 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 IDmlSe button. Choose Export Formula Result from the list that appears, and select the desired location for the variable using the Variable Navigator.
•
Conneetiont 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.
Building the Spreadsheet In this module a Spreadsheet to calculate 8 simple profit margin will be added to Ihe Turbo Expander plant
1. Add a Spreadsheet to your model by double-clicking the Spreadsheet icon on the Object Palette. Rename the spreadsheet Profit Analysil. 2. Don't wony if you haven't bulU the Turbo Expander plant caee. Use the nle ADV4_Templates_SoIn.hsc.
Add the following text labels on the Spreadlheet tab: Figure 1 R~
Jj'!' Profit Analysis
CurrenI Cel
r
E~porlable
IA1'
Variable:
I
angles in,
I A Chiller E~il Temo Ex pandeI EHil Pre ssu Ie
1 2 3 45 G
B
.-
Co st of Powe; $/h
LPG Producl Relrig J emp
Value of LPG $/h Profil $/n
7 8 9
Mi~ed
J
C Power $/kWh LPG Value $/ kg
Relrig Camp HP E
EJ
D
10
~Ll
--=
Conneclions Oelele
~
lop arameters oj
Formulas_ 5 preadsheet ._ C"lculaliofl D Ideol
FJdncrion Help...
5preadsheet 0 nl,l!...
r
~ !gnoled
5
5
Spreadsheeta and Cu. Studies
Set up the required imports.
3.
Fillure2 I
Imporled ',I ari able Db-eel
Cell
81 82 84 85 88
2
5 Comp-HP
-
QK-102 10
V ~r iable Descr io lion Temperalure Pressure Power Power Mas, Flow
Edill mporl __
I
Add Import __
Delelelm~1
Try each ofthe methods described on page 3. 4.
Set the COlt of Power (cell 01) to be 0.05 $/kWh and the LPG value to be 0.1 $/kg.
5.
Enter the formulae below: In thia Cell...
Em....
B5
"'84+85
06
"'D1-B6
08
"'DTB8
01
"'08-06
Notice that Aspen HYSYS assigns variable types ofHeat flow to cell 06 and Mass flow to cell 08. This is because these are the variable types ofthe cells involved in the calculation. 6.
Using the Variable Type drop-down list above the spreadsheet, change the types ofthese ce1lB to unitless.
The spreadsheet should now look like this:
6
Spreadsheets .nd Cu. Studies
7
Figure 3 I!!I~
- P,,,fit Analysis Current Cel
r
[~portable
I"A1
Variable:
6ngle$ in:
B
A 1 2
Chiller E
-g200 C 2eOO kP,
EJ
1
C Power $JKWh LPCi Valye $!kG
D 5.0008·002
0,2000
3 4
R-e Irig Camp HP
5
E"port CQm pre$O r,p 0 wer
713. 6 k\.\' 2267 kW
h
TntPiI Pnl/lJ~r
?gRn klA'
LPG Prod~cl Mi.ed Refrig Temp
3214 kg!h
rn~t
nf PnlAlp.r $/hl
14g n
7
8 9 10
c=: Connections ) Parameters
Delele
Remember In Aspen HYSYS, process variables appear as blue nuntlers. calculated ones as black, and in spreedsheeis any calculated numbenl are shown in red.
To delete the temperature. there is no need to enter
the Refrigeration subf10wsheet envi'onmenl. sirJ1)ly righl-click the subf10wsheet icon and press "Open PFO."
V.I~e
of LPG $Ihr PROFIT $Ihr
-(empll')
I Formulas
Fl!nclion Help.. ,
S I'r" a d. heel
642,8 493,8
Cal cula lion 0 rder
Spread$heel OnI1.. ,
r
jgnored
The only cell remaining to be completed is B9. This is going to be used to control the temperature ofthe refrigerant in the Mixed R.efrig Unit. 7.
Add 8 formula in cell B9 such that it is SOC cooler than the Chiller exit temperature.
8.
In the Mbed Refrlg Unit sub-flowsheet, delete the temperature in stream 3.
9.
Export the tempeIature :from B9 to stream 3.
Cells can be named in order to make it easier to access and use the spreadsheet cells in another unit op (for example, an Adjust) or in the DataBook. This is done either by selecting the cell an the Spreadsheet tab and typing 8 name in the Variable field above the spreadsheet, or an the Parameters tab.
10. Name cells D6, D8, and D9 as in the following example:
7
8
Spreadsheeta and Cu. Studies
Figure 4
I!lIiI 13
..:.i, Profit Analysis
Spreadsheet Parameters-------, Number of Col umn s 4 Number of Rows 10 Units 5et 515
Dynamic EHecutiorr--------, Before Pressure-Flow Ste Alter Pressure-Flow 51ep Each Comp os ition Ste p Alwa~ Update EHpo rts
E~port
C't'isible in Spreadsheel's Variable L i s t ) - - - - - - - - - - - . Vi~ible Name Variab Ie Name D6 - 06: Cost 01 POv-ler Cost of Powe r D2 D2: 89 B9: lemper.alure Temperalure Temper.alure I--;;:D"9-t-----~· D9: P'-ro"fil--+-------'--------;P"'"r'ot,,-il+--~ .._----'-------Cell
D8
D8: Value of LPGS ale~
B6 D1-
86Dl
Ppwe,
[
Co nn eel io ns Delete
V.alye 01 LPG Sales
FjJnction Help",
Spreadsheet Dnl.l'" ,
With II procetJs temp D/-6ZOC IIIUl II tlriD expantIer a:It press",. 0/18 Nr we' IItIW II proftt 0/1493.8111.
Save your casel
I
-------Use of Spreadsheets The spreadsheet can be a very useful tool in Aspen HYSYS to:
•
Pull together important parameters in the simulation into a single unit cp. Use it to try ''what ifs" by changing process variables and seeing if your target variables change, and in the right direction.
8
•
Perform additianal calcu1atians that are not possible in Aspen HYSYS directly, such as the profit calculation you have just done.
•
Combine data from process streams, energy streams or utility streams and use multiple spreadsheets to calculate your total cooling water requirements or power requirements.
Spreadsheets and Case Studies
•
Careful use of spreadsheets can save you from having to open several windows in Aspen HYSYS in order to input information, or examine results.
•
You can see that a spreadsheet can be used to set various parameters in the tlowsheet as a result of a calculation on another variable. So in our tlowsheet the three sets controlling the pressures of streams 8, 9 and 10 could be replaced with a spreadsheet doing the same thing.
9
Note that when copying and pasting, spreadsheet 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.
The Case Study The Case Study tool allows repeated runs with varying input parameters to be automated. In the next section you will set up a case study to vary the Cooler exit temperature and Expander exit pressure between defined limits. For each case various results are recorded for later analysis. 1.
Open the DataBook from Tools I Databook, or by pressing CTRL D.
With the DataBook, Aspen HYSYS provides a location from which a systematic approach to data analysis can be taken. The DataBook allows you to monitor key process variables in Steady State and in Dynamics mode. Variables for all DataBook features are selected in a single location. You can then activate variables from the main list for each application. There is only one DataBook in each Aspen HYSYS case, containing variables from all Flowsheets. All of the following features are defined and accessed through this single DataBook:
9
10
Spreadsheets and C... studle.
FigureS I!!I~
.<; Data800k
m
Ayailable Data E n l r i e s - - - - - - - - - - - - - - - - - - - - - - - , Obiecl
Variable
Profit Anal}lsis
5 2
Pro lit E,pond" E,it Pr~"u" Chiller Exit Temperature
Profit Analysi:s
Cost of Power
-= Variables
Insert ..
Delete
Process: Data Tables
The first step is to configure all the variables of interest, both variables to be varied in the Case Study and the results. Aspen 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. Click. Inter1 and add the first variable as shown:
2.
Figure I I!I~
VarIable NavIgator
objecl
Flowsheet
o timizer - S
readsh eet
SET-' SET-2 SET-3 SET-4
B4: Power 85: Power
obiecl Fjlte r
Flowshee t
r
Case
r
08: Volue 01 LPG Sale, D9: Prolit
Basis
User Variables
r
Utility
Variab Ie 0escription:
.QK 6dd
88: B8: Mass Flow 01 D2:
Navi,gato r Scop
106: Cost 01 Power
13
B1: Temperature
89: Phase Temperature (
a-
V
82: Pressure
LPG Recovery
Mi,ed Relrig Unit
Variable
rAil Streams
r
UnitOps
(:" Logicals
r
r
ColumnOps
Custom Custom...
hancel
Note that the variable descriptions shown for spreadsheet cells correspond to the Visible Name of each ofthe cells. Since these are blue parameters they can be edited here. Removing the cell reference will tidy up the Case Study and make the :final graphs look more presentable. It is best to add all ofthe required variables in one go. Click. Add, press OK, and then return and edit their descriptions, rather than adding and editing each in tum
10
Spread.heat.and CaN Studie.
11
3. Repeat the above until you have added the variables below. Remember to add all the variables first and then edit their descriptions. Flgur.7 I!!I~ Ef
4 Datallook
A:;:;::ailable Data E n t r i e s - - - - - - - - - - - - - - - - - - - - - - - - - ,
Objecl
Variable
Prolil An~ly,;,
Pro Iii
5
E:-
2
Chiller Exit Temperature Cost of Power
Profil Analysis
)merl. ..
Delele
I.
~ Variable.
Pro~". Dol" T"bl"
Note, at any time before you actually nm the case study you may add or delete variables from this list. The Independent and Dependent variable checkbaxes are only enabled when you add a case study. It is not necessary for all the variables to be ticked fel' each case study. A minimum of one dependent and one independent Yariable is requi red.
4.
Go to the Cue Studiel tab and click Add to Ret up a new case study. Call it Operating Analysis.
All the previously configured variables are listed along with two columns; Ind and Dep.
•
Independent variables are the ones that will be varied by the case study. These must be specified variables (i.e., blue nmnbers).
•
Dependent variables are the results to be monitored.
11
12
Spreadsheeta and Cu. Studies
5.
Select the independent and dependent variables.
_IDlx
•.. : I' ,!;Yailable Case S I~die
Case
Ql!.e.ra linQ6na IY,.i.L.
(
r'i";t",,. G liffil:lD
r-
~I
I! Vala bles
...
Agd
I
Delele
I
r
Qlli~~
Proli IAnal)'"i, Pr oli I Anal)'"i, Pr oli I Anal)',is 5
2
lOpe raling An alysis Variable Co"1 01 Power Value of LPG Sale, Overall Proti~ E,pander Exil Pressure Chiller Exil Temperalure
Ind
Dec'
(~
Ii!,
rt,;, r:i: ~
N:
~
R:i
D D
L... ~
J
I]
I
flelrl Les ,
- --I
Seleclion
Currenl Case Siudy
I
:!iew
Sl~dies Da~a
I
--- --- ----
Pro cess Dal a Table~
1_
SIrip Chari,
r
-- -I
Da~a Recorder ~'C.ue Studies
I
/
I
I
/
Here you can Add or Delete case studies, or view the variables set up for the highlighted case study.
6.
Here you check the independent variables that are to be used in this Cs8e study and the Dependent variables that you want to monitor.
Press View and configure the bounds as shown below. (Note the Pressure and
Temperature units here are kPa and °c.) Figure II
I!lIiii EI
~ Cas e S lud,es S elul' - lot a,n Case S t!ddies
lOpe"ling Analy,i,
operating Analysis
V",i"ble E
Numbe, 01 Siaies Low Bound
Hick Bound
2000 -65.00
4000 -45.00
J25 S'teo Si,e II 500.0 5.000
".I Display Properties
A~d
Delele
St~'1
Five di:fferent temperatures with:five different pressures, means a total of25 states in all. For each of the states in the case study the whole case is solved, including any utilities. Since in this case the results from the tray sizing utilities are not needed in the case study, it makes sense to ignore the tray sizing utilities to speed up the case study.
12
Spread.heeta and Cue Studiu
13
7.
Press CTRL U to open the list of Utilities and then view each tray sizing utility in tum and set it to Ignore.
8.
Click: Start to set the study running. The Fa1Ied States tab will show any combination of independent parameters that tail 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 Cue Studies tab ofthe DataBook.
!Iii! Ei
~ Case S lud,es - lot am
Siale ExpanderExil Pressure [kPal Cniller Exil Temperalure [CJ CosfOf Power kWI Value of LPG 5ales [kg/nl Overall P"rofil Siale
Siale 1 2000 -65.00 207.9 682.9 475.0 Siale 6 2500 -65.00 179.1 668.5 489."4 Siale 11 3000 -65.00 156.4 647.7 491.3 Siale 16 3500 -65.00 137.6 617_1 479.5 Siale 21 4000 -65.00 121.6 571.9 450.3
Expander Exit Pressure [kPal
Chiller Exil TemperafUre [CI COS! of Power [kWI Value of ePG Sales [kg/hi Overall Profit
State Expander Exit Pressure IkPal
Chiller Exit Temperature C
COSlOf Power [kWI ValUeOf LPG Sales [kg/hi Overall
prom
Siale Expander E)o:ifPressure [kPal Chiller Exit Temperature [C
Cosl of Power [kW Value of LPG kg/hi
sare,
Overall Profit
Siale ExpanCfer Exit Pressure [kPa] Chiller ExirT em eralure [CI Cosl of Power [kWI l7arueorrPG Sores [Kg71i] overall Profil
Siale 2 2000 -60.00 181.5 668.0 486.5 Siale 7 2500 -60.00 154.1 647.9 4938 Siale 12 3000 -6elOO 132.9 619.8 486.9 Siale 17 3500 -60.00 115.7 580.7 465.1 Siale 22 4000 -60.00 101.4 527.5 4261
Slale 3 2000 -55.00 164.8 649.2 484.4 Slale 8 2500 -55.00 138.4 621.6 4832 Siale 13 3000 -55.00 118.3 584.5 466.3 Siale 18 3500 -55.00 102.2 535.8 4337 Siale 23 4000 -55.00 89.07 4718 384.7
Siale 4 2000 -50.00 1535 6258 472.3 Siale 9 2500 -50.00 127.9 589.0 461.1 Siale 14 3000 -50.00 108.5 541.5 4330 Siale 19 3500 -50.00 9324 482.4 389.2 Siale 24 4000 -50.00 80.96 411.2 330.2
Siale 5 2000 -45.00 145.6 5973 451.7 Siale 10 2500 -45.00 120.6 549.8 429.2 Siale 15 3000 -45.00 101.8 481.4 389.5 Siale 20 3500 -45.00 87.12 422.0 334.8 Siale 25 4000 -45.00 75.45 342.1 266.7
I
operating Analysis Delete
r.
Tabl~
r
(;;raph
Re-Number
Setup...
The results can also be displayed graphically: 10. Select Graph on the CalC Studies tab. 11. Select Setup.
13
14
SpreadahMta and Cu. studle.
12. Click the Display Properties tab. Flgu,.11
I!Ill!I Ei
~ Case Sludies Selup - Main
["oe Sljjdies
Curren 1Djgpla~------------------.,
o~p~~d, nl V"riabl~s
Ope, aling Analysis
D~.o,i
r
tion
Tabje
r; graph
Display Proper Ii e. Delele
The graph displayed will be the fil'8t variable thai is checked In the II8t here, In !hill C888 LPG 5aI88. Change the eeIectecI variable to 888 c:thar graphs.
13. Size and arrange the windows so that you switch the graph between the three dependent variables.
I
CunriDjsN DflCIWI:lI!lhl V!ti.a~&!
Oe\;'C'i
i' Di""'"
~n
CM.riPo~ell ,
.
-
LPG S"':,rt-J I
~'/~,
-
I
14
r
t I
r,~
r. U".,n
Spread.heeta and Cue Studiu
15
Figure 13
o..,,,,,D,,,,1.o, Depen.:lerltVal~l~
D._
D~Cfiotil:f"l
Cos.! i:lPCaWeIi
VdA'. oIlPG s.~ • .!)""a1 Pr",~
-
t'lallj.
p-
I" jl,oc/1
C. r
f---l
I
Of course, the main interest is the Overall Profit and the combination of Chiller exit temp and Expander exit pressure that will give us the maximum Operating Profit.
~ Case 5 ludies - Main
I!lIiIIEI
Colour EdItor
II
rD ala R"nge Colourincr------, Range Min Ma, Colour Ac live
f1[266T PO.
(;I
]2j430~_ R
rr-~~- Iv C4~~ 15~
[ffi7 _
Iv
rv
Iv E: nable Range Colouri ng .clear
Ca~e
B.esel
Stud, 1
Ddele
Sel~p_
14. Right-click the graph, and experiment with the tools available. Try removing Hidden Unea, Rotation, and Plane Cutting. 15. In order to view the graph with the colours shown previously, right-click: 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.
Save your case! ---------
1..
15
16
Spreadsheets and Case Studies
What can you see about the peak area ofthe operating surface? How many areas give you more than $470/hr profit (Turquoise)?
What could this lead you on to study further?
16. Before you leave this module, reset the chiller exit temperature to --62 °C and the Turbo expander exit pressure to 28 bar. This will allow the next module to perform correctly.
16
Advanced Recycle Operations
Advanced Recycle Operations
© 2005 AspenTech - All Rights reserved. EA1000.04.07 06_AdvancedRecycleOperations.doc
1
2
2
Advanced Recycle Operations
Advanced Recycle Operations
3
Introduction This module will introduce you to several advanced topics concerning the operation and convergence of the Recycle unit operation. The Recycle 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. The Recycle operation can be used several times in a given simulation. Every time a recycle operation is added, the total time needed for the simulation to successfully calculate and converge increases. The information presented in this module can be used to reduce this time and achieve greater success with the Recycle unit operation.
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.
Learning Objectives In this module, you will learn how to:
•
Build simulations using Recycles.
•
Position Recycle operations for optimum performance.
•
Use the various numerical parameters to help reduce convergence time.
•
Consider interactions between Adjusts and Recycles and how to control them with Calc Levels.
•
Use Simultaneous mode when the tlowsheet contains multiple, interacting Adjusts.
3
4
Advanced Recycle Operations
Prerequisites Before beginning this module, you should have a reasonable understanding of the Aspen HYSYS program, and be able to add streams and operations, including the Set and Spreadsheet operations.
Structure of this Module This module is split into four main sections:
4
•
An information section discussing use and positioning of Recycle operations. The key points from this section are summarised on page 14.
•
A series of exercises on Recycle positioning.
•
A workshop where a new plant section that requires the use of Recycles is added to the Turbo Expander plant model.
•
An exercise to illustrate the use of Simultaneous Adjusts.
Advancecl Recycle Opel'lltians
5
Recycle Operation Information Using the Recycle Unit Operation Recycle icon
The Recycle logical operation is used to solve looped systems where downstream material is mixed back in upstream in the process. Aspen HYSYS employs a non-sequential solving method, which allows information to be propagated. both ups1ream and downstream. This allows some looped systems to be solved explicitly (particularly heat recycles, andrefri.geration loops). However,
for material recycles when downstream material is mixed back: in upstream, a R.ecycle operation is needed. Recycles are sometimes also known as "TeaI5:
The Recycle operation allows Aspen HYSYS to solve looped system iteratively. A set ofconditions are assumed and used to solve the recycle loop. The assumed values are compared with the cal.cul.ated 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 (for example, the assumed value to be in either the outlet or inlet stream), although usually information is only transferred furward.s (for example, as8UlIled value in outlet). Forward and backward
Infcrm&l:lon transfer Is dlecul!l8ed later In this module.
When the Recycle operation is first added, initial estimates need to be provided for all the assmned values. 1)'pica11y this is done by allowing Aspen HYSYS to solve before closing the recycle loop. This is illustrated in the Workshop.
The Recycle Unit Operation and Dynamic Simulations The Recycle operation has a role only in Steady State simulations. While operating in Dynamics, it is perfectly acceptable to return a product stream to an upstream operation without using a Recycle operation. If a Recycle operation is used, it will be ignored while operating in the Dynamic mode; the inlet and outlet streams will always be equal.
5
6
Advanced Recycle Operations
Positioning the Recycle Operations for Optimum Performance It is possible to have numerous Recycle operations in a single simulation. When several Recycle operations are used together, the total calculation time can be reduced by carefully selecting the location of the Recycle blocks. When a user is deciding on a Tear (Recycle) location, the first choice is often in the actual recycling stream. This is an acceptable choice if only one Recycle operation is being used. Ifmore than one block is being used, however, a better location may reduce the calculation time needed to solve the simulation. Try to locate recycles:
6
•
To define multiple streams (i.e., before Tees, after Mixers). See Exercise 2.
•
In streams with fixed conditions (e.g., cooler and heater outlets). This means fewer variables need to be iterated on.
•
To avoid conflicts with Adjust operations. This is illustrated later in the Workshop.
•
In major flow streams. These are likely to be more stable.
Advanced Recycle Opwationa
7
Setting the Recycle Tolerances After the Recycle operation has solved the inlet and outlet streams will match each other within certain tolerances. Aspen HYSYS allows the user to set these tolerances to match the requirements of their simulation.
The actual tolerance of the Recycle operation is calculated as the product of the absolute tolerance for the given property (fixed within Aspen HYSYS) and the relative tolerance (specified by the user). The absolute tolerance is dependant on the specific property in question, and is set by the Aspen HYSYS program. The following table gives the absolute tolerances for each property.
The Internal Vapour Fraction tolerance, when multiplied by the defaJlt rElC)(:le tolerance, is 0.1, which appears to be very loose. However, in most situations, if the other rElC)(:le variables have converged, the vapour fraction in the two streams will be identical. The loose Vapour Fraction tolerance is critical for close-boiling mixtures, which can vary widely in vapourfrsclion with minimal difference in other properties.
Property
Absolute Tol. .nce
Vapour Fraction
0.01
Temperatura
0.01
·C
Pressure
0.01
kPa
Flow
0.001 (this is a relative error)
kgmolels
Enthalpy
1
kJikgmole
Composition
0.0001
Internal Unit
Ticldng the Use Component Sensitivities checkbox allows different tolerances to be used for each component While the absolute tolerances are set within the program, the user specifies the relative tolerances. The default relative tolerance for all properties is 10, which Aspen HYSYS inserts automatically. Yau are able to specify any value here; remember, however, that smaller tolerances will require more calculation time. When connected to energy streams, the hcycle operation uses an absolute internal tolerance of 0.1 kW. (kW is the Aspen HYSYS internal unit for energy). The tolerance sensitivity multiplier used is Enthalpy.
7
8
Advanced Recycle Operations
Figure 1
I!lIiIEf
~ R(Y-l @TPlZ Parameters
Variables
Vapour Frac lion TeMper,lure
Numerical
Pressure
Flow Enthalpy Compositi on Entropy
5emil ivili~, 1000 1000 1000 0.1000 1000 1000 1000
Transfer Di,-e,tion I
r
Take Par lial Slep,
Forw~rd$
Forw~rd,
Forwards
Forwards Forwards Forwards Forwards
r u,. Componenl Sen,ilivilies
=
Connections
Delete
Par amelers
Contin!de
r
ignored
Tolerances are calculated using Aspen HYSYS internal units. These units are essentially the SI System with pressures in kPa (as shown in the table above). But how does Aspen HYSYS calculate the actual tolerance of the hcycle 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 ofthe hcycle's outlet stream must be within 0.1 °c (0.180f') ofthe temperature ofthe hcycle's inlet stream in order fur 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 (kgmoleJs) by the fil.ctor 0.001. Far example, with a flow rate of 100 kgmoleJs and the standard multiplier of 10, the actual tolerance is calculated as follows: htual. Tolerm:e = Relative Tolerm:e x Absolute Tolerance = Relative Tolerm:e x 0.001 x Flow rate in kgmo1ela = 10 x 0.001 x 100 = 1 kgmolels
Hence, the flow will be solved ifit is within 99 -101 kgmoleJs.
8
Advanced Recycle Opwationa
II
If your simulation contains streams with very low (ppm) concentrations, you may want to set the concentration tolerance to a lower value. Otherwise the default tolerances work well in most applications.
Other Variable Parameters The Transfer Direction column allows you to select the transfer direction ofthe variable. There are three selections: • •
Not transferred Transfer forwards
•
Transfer backwards
The Not TransftTTed option can be used if you only want to transfer certain stream variables. For example, ifyou only want to transfer P, T, composition and flow, the other variables could be set to Not TransfeTTed. When the checkbox is deactivated, the Recycle operation waits mill the inlet stream is completely solved before performing the next calculation step. The defitu1t setting for the checkbox is inactive.
Using the Acceleration Parameters The Recycle operation can be set to use one of two types of mathematical algorithm in order to reach a converged solution faster. The two available acceleration methods
are: •
Wegstein Acceleration
•
Dominant Eigenvalue Acceleration
Fillure2 •
I!lIiII3
RCY-l @TPl2:
Paramele..
Calculalion Mode---------------, Mode:
r
Acceleration:
{." We,gstein
Variables
r.
Numerical
tl ested
(a
~§:(cii0i~aneou~
Properties Tolerancec--------,
IpSD
Properlies
11
1.000e-0031
Q.ominant Eigenvalue
Maximum Iterations Iteration Count
Flash Type
PT Flash
Wegstein Parameter
Acceleration Fre uenc Q Maximum
Q Minimum Acceleration Delay Connections
Delele
Parameters
Conlin!!e
r
jgnored
9
10
Advanced Recycle Operations
Using the Wegstein Acceleration There are several numerical parameters that define the operation of the Wegstein Acceleration. These parameters will be defined here: ....metar
Default Value
Definition
Accel.-.tlon Frequency
3
The nurmer rI iterations per number of accelerations. Using the default, ecceleration is applied to every third iteration.
Qmex
0
SEIl8 the maximum value for Q in Weg8tein equation.
Qmln
-20
Sets the minimum value far Q in Wegstein equation.
Accalwation Delay
2
The nurmer rI iterations before the first acceleration is applied.
The Wegstein equation is given here. This equation is used to determine the values passed to the outlet stream for each accelerated iteration. (1)
where: X = the value in the outlet stream (assumed) y = the value in the inlet stream (calculated)
N = the iteration number Q = the acceleration factor Aspen 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.
Adjusting the Wegstein Acceleration While Wegstein acceleration has been shown to reduce the number ofiterations needed to converge a Recycle operation in most cases, there are 8 few cases in which the defimlt Wegstein parameters will not help to converge the Recycle operation. In these cases it is necessary to reduce the amount of acceleration, or to ignore it all together. A positive Q will help dal11Hln out any oscillations that may occur. The Q..... should be increased if, and only if, oscillations are affeding the convergence rI the Recycle.
10
Setting the Omm value to a smaller negative number will reduce the amount of acceleration. The acceleration can be ignored completely by the Recycle operation if the Acceleration delay is set to a high enough value. Typically, Recycle operations will converge in less than 10 steps. Therefore, setting the Acceleration delay to a value much larger than 10 means that acceleration will not occur.
Advanced Recycle Operations
11
Very rarely, the Recycle operation will oscillate as it converges on a solution. If you find this happening in your simulation, you can increase the value of Qmax to a small positive value. This will provide a damping effect that will, hopefully, reduce the oscillating behaviour.
Using Successive Substitution In the rare cases in which Wegstein acceleration will not help to reduce the number of iterations in the Recycle operation, it may be necessary to set the operation to use Successive Substitution in order to reach convergence.
Successive Substitution is when the recycle's outlet stream properties are rewritten with the inlet stream properties without any type of acceleration applied. This is considered the most stable solving method; however, it is also the slowest. 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 o.
Using the Dominant Eigenvalue Acceleration Method The Dominant Eigenvalue Acceleration method is less adjustable than the Wegstein method. It is recommended for Recycle operations in systems that are non-ideal and/or where strong interactions exist between the components. This method has the advantage of examining the interactions between the variables during the acceleration process.
Information on Multiple Recycles When installing multiple Recycle operations, you have the choice between Nested or Simultaneous solution. They should be used as follows:
•
Nested - Single Recycle or multiple, non-connected recycles
RCY-2
RCY-1
Feed
MIX-100
TEE-100
1,IIX-101
TEE-101
Product
11
12
Advanced Recycle Operations
•
Simultaneous - Interconnected, interacting recycles <>
RCY-2 5 RCY-1
In this SimuHsneoue example, the nurmer rI recycle operations may be reduced to one if placed in the carect stream.
F.od
When Recycle operations are selected as Simultaneous, they will not be calculated with the other unit operations. Instead, they are listed in a separate solver, and calculated only after the ordinary solver has finished calculating all other unit operations in the flowsheet.
Some Troubleshooting Tips Typically, Recycle operations will converge in less than 10 steps. However, if the tolerances have been reduced, or the system is non-ideal, it may take mare than the 10 iterations that Aspen HYSYS has set as the defitult limit. Once the limit has been reached, Aspen HYSYS will stop and ask: the user ifit should leave the operation unconverged, or continue for 10 mare iterations. If your Rtlcycle operation has not converged in 10 iterations, it may be advant:ageous to stop the calculations and examine the flowsheet.
Monitoring the Recycle's Calculations The progress of the calculations performed by the Recycle operation can be cheeked on the Monitor page ofthe operation's property view. This is useful if the Recycle is having problems converging. The results can be seen in tabular format, or in a plot format
12
Advanced Recycle Opwationa
13
Choosing a Flash Type It is possible to choose the type of flash that the Recycle operation will perform. The defimlt choice is a PT flash.
canposilion and Flow rate valUflB
are always paased
through the Recycle operation, regardless rI the fta8h type.
A PT flash means that pressure (P), temperature (D, and composition values are passed through the Recycle operation, and other variables (vapour fraction (V), enthalpy (II), and entropy (S» are calculated in the other stream.
Choices of flash type include PH, PV, PS, and TV. While a PT flash will be suflicient for most applications, a PH flash is a better choice for very pure recycle streams. When dealing with very pure streams, a small change in T can make a big difference in H. Take a pure water stream at atmospheric pressure, for example, the enthalpy (II) ofthat stream will be very different if the temperature is 99.9°C (211.9°F) or lOCUoC (212.1 oF).
Information Summary Using the Recycle Operation •
The Rtlcycle 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 ofthe relative tolerance (user specified) and the absolute tolerance (set in the program).
•
Tolerances are calculated using Aspen HYSYS internal units.
•
Recycle streams that have very low concentrations of important components, may require lower relative tolerances for the composition specification.
Using the Acceleration Parameters •
There are two types ofacceleration available: Wegstein and Dominant Eigenvalue. Wegstein is the most common, and Dominant Eigenvalue is recommended for simulations where strong interactions exist between the components.
•
Wegstein acceleration can be controlled using the four motors available: Acceleration Frequency, Qmm, 0-, and Acceleration Delay.
13
14
Advanced Recycle Operations
Multiple Recycles When using Multiple Recycles set the Calculation mode as follows: •
Nested - Single Recycle or multiple, non-connected recycles
•
Simultaneous - Interconnected, interacting recycles
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.
Recycle Positioning Exercises Exercise 1 Examine the following PFD. This Flowsheet has three physical recycles and three Aspen HYSYS recycle operations. What is the minimum number ofrecycle operations that are needed?
Where should the recycle operation(s) be positioned? Figure 3 - Exercise 1
4. RCY-2
2. RCY-1
Feed
Product
Plant 3
6.
RCY-3
14
Advanced Recycle Opwationa
15
Exercise 2: Adding a Recycle Assume the condenser outlet stream is fully defined (except flow rate), the chiller duty and outlet conditions are known, the pressure drops across the condenser and chiller are known, and the stage 1 compressor outlet pressure is known.
Figure 4 - Ell:..ciae 2
r~1W~ 4
1
M;m
t:
Stage
2
V-l00
1
Camp
HP
9
SI:age
1 Camp
L~~~Q 7
c:1-Q
...:ondenser
Camp HP
2
1
VLV-100
1
Stage 2
Stage
3
6
SPRDSHT~
Camp
~hliler
_ --1
1
L-----------------{>
15
1&
Advanced Recycle Operations
Exercise 3 Assume that the Feed is fully defined, Shell and Tube Side pressure drops are known, and the Column Feed temperature is known.
Figure S - Ex.-clse 3
'f __ ~
-+-
Feed
Vapour
V-100
~
Liq
,------::;:====j---~
~
EM
I-+--~
Out
Cond-Q
~,-.---.-J Column Feed
E-100
-+Reb-Q
......
Column
]
'---------- - - - - - -
Column Blms
16
Advanced Recycle Opwationa
17
Exercise 4 Assume the Feed is completely defined, shell and tube side pressure drops for E-lOO and B-1 01, and the temperatures of streams 3 and 4 are known.
Figure 6 - Ex.-clse 4
Q~
J
K·l00
-
F~~d
~1t-~~1 l
~ I
MIX-'OD
;
.
~IDD
Y-IOO
8
4
i1
4
J 15
&'01
l!=W-
I- - - - - - -..... ------ ~ 13
J
""01
MIX-IOI
..
~ fj
11\.\"100
Q-,OO
7
"---'==--':=--10"
T-IDD
17
18
Advanced Recycle Operations
Exercise 5 Assume the Feed is completely defined, and the shell and tube side pressure drop for E-IOO are known.
Figure 7 - Ex.-clse S
!
i
if
T
~ 8 VLV-100 9
V-100
~-(--i---M::::::J----+-s,di' ~
1-_. ~ L-0+1
:J:C~-_
0-100
TEE-l00
K-100
Feed
17
Product
r
, - - - - - - ' - - -I- - . - I - - - - - - - - - - - - - - - - - - - - - - . J
4
5
3
18
L----'==J- l
T-100
Advanced Recycle Operations
19
Exercise 6 Examine the three-stage compression plant PPD on the next page. This flowsheet has five physical recycles and six recycle operations. What is the minimum number ofrecycle operations that are needed?
To answer this question, consider all the information about recycle positioning in this module and note the following: •
Every Exchanger in the PPD has pressure drops defined
•
EI03 has a VA specified
•
EI04 has an outlet temperature specified
Where should the recycle operation(s) be positioned?
19
Advanced Re
Ions
Figure 8 - Exercise 6
.....
>-
()
0::
20
Advanced Recycle Opwationa
21
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. In this workshop the existing compressor will be replaced 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 Dan't worry if you haven't buiU the Turbo Expander plant case. The file "ADV1_GetlingStarted_ SCIn.h8c" contains thi8 case.
stage. The reason for this modification to the plant is that an additional hydrocarbon stream must be processed.
To simplifY the main PFD, the two stage export gas compression system will be constructed in 8 new sub-flowsheet.
21
22
Advanced Recycle Operations
Process Overview Figure'
22
Advancecl Recycle Opel'lltians
23
Add the New Feed Stream Add the Feed BC stream with the following conditions and composition to the main flowsheet: Name
F. .d HC
Temperature
Pressure
Object Palette Sub Aowsheet button
3000 kPa (435.1 psis)
Flow rate
6000 kgmolelhr (13228 Ibmolelhr)
Camponent
F..dStream
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
Add a New Sub-Flowsheet Add a new !lUb-flowsheet and choose to Start wi1h a Blank FlOWlheet.
Make Feed Connections The Allow Multiple Stream Connections option allows any streams to be
connected anywhere. Wiltlout it, you can only make a feed connection for a stream that is not already connected _ a feed stream elsewhere.
Rather than delete 1he existing export gas compressor, 1he new system wi.11 be connected in parallel on the Aspen HYSYS PFD to allow for comparison (that is, 1he full export gas flow rate will go through both export gas compression options).
The "Multiple Stream Connections" feature of Aspen HYSYS must be enabled to allow this.
23
24
Advanced Recycle Operations
1.
Go to the Session Preferences window (via the Tools I Preferences menu
option). 2.
Tick the Allow Multiple Stream Connection. option on the Option. page on the Simulation tab.
Now stream 13 can be connected to the sub-flowsheet even though it is still the feed stream to the existing export gas compressor. 3.
In the sub-flowsheet operation window on the Connection, tab, connect up streams 13 and Feed HC as feed streams to the sub-flowsheet by using the
dropdown menu under e:xtema1 stream. 4.
Review the Tranafer Bal1, settings; here the defitu1t PH flash basis will be used.
5.
Change the Name ofthe sub-flowsheet to ~ Ga, ComprellioD.
Build the Flowsheet without the Recycle Operations You can find some of the required stream and operation names by referring to the PFD in the Process overview.
If a stream nama is changed in the subfIow8heat, the nsma of the linked stream in the main PFD is not changed.
24
1.
Ensure you are in the sub-flowsheet environment.
2.
Rename stream 13 to the more meaningful From Main Case.
3.
Mix the two feed streams. Name the outlet Mixed Feed!.
Advanced Recycle Opwationa
25
When mixing streams at different pressures the Aspen HYSYS Mixer operation offers a number ofpressure assignment options. These can be found on the Parameters page of the Design tab. Figure 10
I!lIiIEt
~ MIX-IOO
Design Connections
The Equalize All option will set the pressure rI any connected streams so they are all equal.
Par"meler~
User Variables
Noles
Aulomalic Pressure Assignmenl-------, \
r.
Equalize /',11 Se I 01!lIel 10 Lowesl I nle I
Design
L'·"·
4.
-b-;;;iei;;;-:J~1• • • • • • • • • • • • • • • • • • •
r
jgnored
Ensure the Automatic Prellure Assignment option for the Feed Mixer is set to Set Outlet to Lowest IDIet
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.
Since Aspen HYSYS knows the Cooler ouHet pres8ure and pra88Ure drop, it can back calculate the Compressor cuaet pres8ure.
6.
Install a separator. Call it LP Sep. The vapour stream is namtld LP Sep Vap and the liquid stream is named LP Sep Uq.
7.
Install a compressor and a cooler. Use the following parameters:
Compruaor Inlet StnNIm
LP5epVap
OUtlet Strum
stage 1 Out
En.,., Stream
stage 1 KQ
Cool_ Inlet Stream
Stage 1 Out
OUtlet Stream
E-Stage 1 Out
Pressure Drop
25 kPs
EnqyStraam
stage 1 Eq
25
2&
Adv.nced Recycle Oper.ltiana
Set the temperature of stream E-Stage lOot to 300C and the pressure to 5000 kPa. 8.
Install another :mixer in preparation. to take the second stage returned liquid. At the moment this will only have the first stage after cooler product as its feed stream. Call this mixer MP Mix and its product To MP Sep.
The second compression. stage is an exact copy ofthe first. Hence this is a good place to make use of Aspen HYSYS' Copy I Paste functionality. 9.
Select the entire first compression stage from the LP Separator, to the after
cooler product stream (EStage lOut). 10. Right-click: somewhere on the PFD and choose CutJPaste Objeett •••. Copy Selected Objettt from the pop-up menus that appear.
Since Itle objects are being pasted immediately to Itle same f1owsheet, the Clone function could have been used. Thl8ls equivalent to Copying then Pasting.
A question box may pop up ifyou did not also select all the attached s1reams for any of the operations you selected. 11. Unselect the objects then right-click the PFD background and choose Paste Objects :from the pop-up menu. 12. Aspen HYSYS automatically renames the pasted objects 80 the stream names
will need to be changed. Rename streams according to the flowsheet on page 22. 13. Install a final knock out dnIm 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 lIP Sep knock out drwns is to be retwned 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.
:<1 Object Pelette set icon
15. Install valves and valve outlet streams on the MP and lIP Separator liquid products. Use a Set operation to:make the valve outlet pressure the same as the appropriate compressor inlet pre8BlU'C. Think carefu.lly about the source streams for these press1D'e8. Ensure the source stream is upstream of any operations effected by the returning flashed liquid.
I
--------------Save your case!
28
Advancecl Recycle Opel'lltians
27
Installing the Recycles The PFD is now ready to add recycle operations. Initially Recycles will be added in the physical recycle streams. 16. Install a Recycle on the outlet ofthe let down valve from the MP separator. The physical recycle is often a convenient place to put the Recycle operation Initially. Although It 18 not always the best place!
17. Add an outlet stream. In this case (as in the majority of all situations) the default parameters are appropriate.
18. Review the settings on the Parameter. tab.
19. Connect the recycle outlet into the RCY-I Mixer. The first recycle wi111hen iterate to a solution. Object Palette Recycle
icon
20. Repeat this procedure :for the second liquid retwn.
I --------------Save your casel
Analyzing the Results Examine the convergence proces8 far the Recycles. 21. Open the Rocycle property view and look at the Tables page of the Monitor
tab.
22. Look at the Worlmheet tab :for each Recycle. Complete the following table: Recycle
RCY-1
RCY-2
InletVF OutletVF
th.
Inlet Temperature
Notice the pressures are exactly the same on both sides of each recycle. Since these are specified by the sel, there is no need
Inlet Preuure
3000 kPa (435.1 psia)
5000 kPa (725.2 psia)
Outlet Pressure
3000 kPa (435.1 psia)
5000 kPa (725.2 psia)
for Aspen HYSYS to
Inlet Molar Flow
Iterate.
Out.. Temp.-ature
Out.. Molar Flow Inlet Molar Enthalpy Outlet Molar Enthlilpy
27
23. Make any tolerance adjustments you feel are necessary.
Make the Product Stream Appear on the Main Flowsheet Return to the:main flowsheet and connect up an External stream for the product HP
gas stream.
your casel _ _Save __ __ _ _ _1.. Exercise Part of1he design process for this new multi-«tage compression plant is to choose an inter-stage pressure to balance the load between the two compressors. TI1e details of setting up the spreadsheet are not covered here. If you have any problems with this section, ask the Instructor.
In this exereise you will calculate the duty ratio for the two compressors using a Spreadsheet, and then use an Adjust to change the inter-stage pressure such that 1he load is balanced across the two compressors.
Add a Spreadsheet that calculates the Compressor Duty ratio. Figure 11
6.. SPRDSHT-Duty Ratio @TPL2~ Currenl Cel V"riable lYpe:
IB4
_ D )(
I
iI
I
V,,!iable: Duty Ratio
Ri
EHPorlable 6ngles in:
f'R.d3
l=b1/b2
A Siage 1 Duly Siage 2 Duty
1 2 3 4
8
Dut~ Ratio =11 Dyly i 2 Duly)
5 6
C
.1
D
7.988e+008 kJ ih 7.991 e+008 kJ ih
0.9997
7 8
~
-!.L
-=
-'.J
Connectio ns Delete
'-
28
1Parameters
I
l~
F.,!:!nction Help...
Spread.heell Calculation Order
I
Spreadsheet Onl~
los
Ir
.1 o Ignored
AdvIincecl Recycle Operations
2'
Adding the Adjust Adjust button
The Adjust operation is another Logical operation. It will vary the value of one stream variable (the Adjusted variable) to meet a required value or specification. (the Target variable) in another st:raun or operation. 24. Add an AdJUIt operation. 25. For the moment check the Ignored box to prevent the Adjust from solving before its calculation level hall been C011'edly set. 26. Set the Adjust to vary the first stage outlet pressure (Adjusted Variable). until the calculated duty mtio (Target Variable) is 1. Figure 12 •
1!!!l1iIi3
ADJ-1
Connections
L.:onnecllonl Noles
Adjust tl am e
IADJ-'
-AdiustedVariable-----------, Object: IE ·Stage lOut
Select "'or".
Variable: fressure TargetVariabl.------------, Select Va].._
Object: ~ ,tio@B4 Variable: IB 4: DUly Ratio
S pecifie,g Target Value
Delete
P
Sl;jrt
jgnored
27. On the Parameter. tab set the following values: In Thia Cell.••
Em....
Method
Secant
Tolerance
1 x 10"-3
Step Size
50 kPa (7.25 psia)
Minimum
3000 kPa (435.11 psis)
Mulmum
7000 kPa (1015.3 psis)
Maximum ltenltlons
50
29
30
Advanced Recycle Operations
A Brief Introduction to Calc Levels Calc(ulation) Levels are used to determine the order in which streams and unit operations are solved in Aspen HYSYS. Aspen HYSYS uses a non-sequential solution method (that is, it can solve both backwards and forwards). Each time the solver is triggered it constructs a list of objects (streams and operations) to solve. This list is arranged in order of the object Calc Level. The lower the calc level of an object the higher it will appear in the list, and hence the earlier it will be solved. When upstream or downstream objects are affected by new calculations they are added to the solver list. The solver continues until all items are solved. The default Calc Levels are listed in the table below: Item
Calc Level
Material and Energy Streams
500
Ordinary Unit Operations
500
(for example, Pumps, Heaters, Coolers...) Columns and Sub-f1owsheets
2500
Simple Logical Operations
500
(Set and Balance) Complex Logical Operations (Adjust and Recycle)
3500
The Calc Levels of all the objects in a tlowsheet can be viewed and changed by going to the Simulation I Main Properties menu option and choosing the Calc Levels tab.
30
Advanced Recycle Opwationa
31
Figure 13
I!!lIiJ Ei
~ Simulation Case: Case ~me
From Main Case Feed HC New E~polt Gas Mi~ed Feeds LP Ssp Yap LP Ssp Liq Stage 1 Oul E·Slage 1 Oul To MP Sep To LP Sep MP Sep Yap
.,;-=~==:....::=L=P=Ss::,:p;,:L;,:iq-.:.2 ( Stalus Iv! essage~ Con:-:erl to Templale
Aclive '"
Ri
Calculalion Level 500 500 500 500 500 500 500 500 500 500 500
~
500
R1 ~
Ri j;;j j;;j ~
Ri I!2i
Ri
Ca Ie Level ~
I
Main En~ilonmenl._.
Hence the defiwlt calculation levels for Adjusts and Recycles mean they solve after the rest of the flowsheet, but are at the same level ofpriarity in the solver list. Ifthe target of an Adjust is inside a recycle loop then sometimes the Adjust and Recycle can conflict In this situation it is best to set the Calc Level of the Adjust slightly higher so that it solves after the recycle has solved. 28. Change the Calc Level ofthe Adjust to 4000 so that it solves after the recycles. 29. Unignore the Adjust, it should now solve.
Exploring with the Simulation Since the two Recycles in this simulation are interconnected it would make sense to change their Calculation Mode (under Recycle Parameter tab, Numerieal page) to SimultaDeoUi rather than Nellted.. Deliberately displace the simulation from the load balance point (for example, by changing the inter stage pressure to 40 bar). Compare the solution time between the two calculation modes.
31
32
Advanced Recycle Operations
Which Calculation Mode makes the simulation solvejastest?
Try tightening all the tolerances to 0.1, what happens now?
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.
Exercise - Backward Pressure Transfer The Backward transfer feature of the Recycle operation allows the two Sets to be removed. Using the following steps, remove both the Sets in the multi-stage compression sub-tlowsheet. 1.
Ensure the upstream pressure is propagated into the recycle outlet stream by changing the mixer pressure assignment mode to 'Equalize All' (Design / Parameters page).
2.
Change the Transfer Direction for Pressure on the Recycle (Parameters / Variables page). Leave the Direction for all the other variables as Forwards.
3.
Delete the Set.
4.
Move the assumed value from the Recycle outlet stream to the inlet stream.
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?
32
Advanced Recycle Operations
33
Exercise - Using Simultaneous Adjusts It has been decided to split the export gas flow between the multi-stage export gas compression system and the existing single stage export gas compressor. There is a fixed product gas flow requirement of 100 MMSCFD from the multi-stage compression plant. The requirement to set the inter-stage pressure so that the compressor duty is balanced still holds. This will require the following modifications to the case: •
Remove the current multiple stream connections on stream 13 and add a Tee to split the flow between the two export gas compression systems.
•
Add an Adjust to vary the feed gas flow to the multi-stage compression system.
The compression sub-flowsheet will therefore have two Adjust operations. Since changing either adjusted variable (feed gas flow or inter-stage pressure) will affect both target variables (compressor load balance and product gas flow), if the Adjusts are left with the standard 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. 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. Use the following steps to adapt your existing model.
1.
Break the connections between the main flowsheet stream 13 and the main flowsheet export gas compressor (K-l02), and the multi-stage compression subflowsheet.
2.
Insert a Tee, and reconnect the streams as shown below. Remember the Feed gas from the main flowsheet (labelled To multi-stage comp) should be connected to the stream currently called From Main Case on the sub-flowsheet.
33
34
Advanced Recycle Opemlons
Figure 1<4
0-101
To E-101
single stage
TEE-100
Export Gas
camp
OK-102 K-102
To
multi-stage
comp
New Export Gas Feed
He
3.
Enter an initial flow of2S00 kgmolelh in the sub-flowsheet To multi-stage
eomp stream.
MMSCFD is one fA the available units for the Molar Row variable type; it uses the volume fA an ideal gas at standard conditions to do the convensalion.
4.
Add an Adjut to the sub-floWflheet to vary this flow rate with a target value of 100 MMSCFD in the New Export Gtu stream.
5.
Set both Adjusts in the sub-flowsheet to use the SimuitaneoUi Solution method.. (This is accomplished using a checkbox on the Parameters tab.)
6.
Start the Adjusts solving
The Simultaneous Adjust Managei' (SAM) allows all the simultaneous adjusts in the
case to be con1rolled in one place. The SAM can be accessed via a button on each Adjust or from the Simulation menu.
34
Advanced Recycle Operations
35
Figure 15 _Iolxl
WiMi!lifi,[§.IitJ'fiiM+;Fi,S, § A
AU.,cl1edO 'cct T0 ~i's~1Je CO~
ADJ·} alTPL
A
sledV~!~}e
IohQFlcwl P'8:l::\:lJIEl
E·Stage 1 011
Tel
0 "eel
NewE~ortGe~
Duly RiIlio@€4
TMQeIV~lIbAe Mo~
Flew.
84: Duty Ratio
Tel \V
-!..LJ""""":=========================-'"---'"---=~!J
~~
-------------------
r
jgnOled
The Configuration tab shows the set-up of each of the Simultaneous Adjusts. You can view the individual Adjust windows by clicking their names. The History tab shows iteration-by-iteration results for each Adjust.
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:
Type of Convergence
•
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.
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.
Perturbation 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.
35
36
Advanced Recycle Operations
Answer Key Exercise 1 Examine the PFD above. This Flowsheet has three physical recycles and three Aspen HYSYS recycle operations. What is the minimum number ofrecycle operations that are needed? One; there are 3 separate loops and they overlap in stream 1 (lliot: Visualize the separate loops in the system Which stream is included in all the loops?)
Where should the recycle operation(s) be positioned? At the outlet of the mixer
Exercise 2 How many recycles are needed in this flowsheet, where should they be placed, and why? There is no need for a Recycle operation in this refrigeration loop flowsheet due to the positioning of the specifications.
Exercise 3 How many recycles are needed in this flowsheet, where should they be placed, and why? Again, there is no need for a Recycle operation. The column feed stream is fully defined even though Exchanger E-l 00 hasn't completely solved, hence the column can solve and then E100 can solve.
36
Advanced Recycle Operations
37
Exercise 4 How many recycles are needed in this flowsheet, where should they be placed, and why?
J
K 100
,:::'
,.
~2V100
"'";lj 1
ViOl
J~'-
~I~----l~~" 13
""'01
~
Lb
'Ttoo
T.100
1 Recycle needed, 3 possible locations
There is no need for a Recycle in the small loop containing the two exchangers and separator V-WI 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 needed 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? The column requires both feed streams to be fully defined before it will solve. hence a Recycle is required in each of the two loops. for example a recycle in stream 4 and another in stream 1.
37
38
Advanced Recycle Operations
Exercise 6 Questions Examine the PFD ofa three-stage compression plant This Flowsheet has five physical recycles and six recycle operations. What is the minimum number ofrecycle operations that are needed?
To answer this question, consider all the infonnation about recycle positioning in this module and note the following:
All the Exchangers in the PFD have pressure drops defined EI03 has a VA specified EI04 has an outlet temperature specified. Where should the recycle operation(s) be positioned? See the PFD below for suggested positioning. Recycles 1 and 2 can be combined at the outlet of the mixer. Recycle 5 is superfluous since the first feed separator can solve fully with the other Recycles in place. Recycle 3 can be positioned anywhere in the loop containing the liquid return from the first stage of compression and the vapour produced from the second feed separator. Here it has been moved to one of the main streams as this is likely to be a more stable. (Larger flows and less fluctuation of flow rate as the case solves.)
Likewise Recycle 4 has been moved to one ofthe main streams. Recycle 6 is also sUoerlluous since both feed streams to E-I03 are fully defined as E-I04 has a specified outlet temperature.
38
Advanced Recycle Operations
39
t
.•~ 39
40
40
Advanced Recycle Operations
Troubleshooting
Troubleshooting
© 2005 AspenTech - All Rights reserved. EA1000.04.07 07_Troubleshooting.doc
1
2
2
Troubleshooting
Troubleshooting
3
Workshop In this module, you will be presented with cases derived from the Process Modelling Using Aspen HYSYS course. Errors have been 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.
All of the cases can be found on the supplied course 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 completing this module, you will be able to: •
Troubleshoot existing Aspen HYSYS cases
•
Recognise common problem areas in a Aspen HYSYS case
•
Understand the message Aspen HYSYS gives after a consistency error occurs
Prerequisites Before beginning this module, you should be able to: •
Navigate the PPD and Workbook Environments
•
Add and delete specifications for various unit operations
3
4
Troubleshooting
General Troubleshooting Tips These tips are given to help you complete this module, but they are generic so that they can be used when troubleshooting almost all Aspen HYSYS simulations. This list was compiled with the help of the Technical Support department and contains several of the problems that they encounter on a daily basis. 1.
Always check that the solver is not in "Holding" mode. Whenever a consistency error is encountered in the simulation, the solver is placed in this mode. When the Holding mode is active, streams and operations that are not solved can appear to be solved, and vice versa; this can make the troubleshooting process quite difficult. When the solver is holding, "Holding..." will appear in the Aspen HYSYS status bar and the red "traffic light" button in the tool bar will appear pressed in.
2.
Carefully examine all consistency error messages that Aspen HYSYS provides. They can often help you find the source of the error. All Consistency Errors will look something like this. Figure 1
_Iolxl
1>-M3'1.I
r
A consistency efrOI h3S occurred
A consistency errcr has occlJ'red. This can arise either when two ot1ects ca~cuate differing values for the same variab!e Dione objects ca~culal:ions are crntlding with ~iSlilg specificalioos. In general, this me
~~me of lnccmistert Va~cble
lolSSep Malelial Stream
bjecl Type
-
C~IClJ~lict"l S owce I riorm!!tion
Ok:! Ci:!lculatioo
NClHCalculatioo DS",
rva~.
500.4 DS",
C~k:tJ<'!Iled 8t' O~ed NcYne
tAi:.:er2 Mi:.:er
Calcyated By O~.ct Type
I
I
presslI'e·/
arne of Object
435.1
H
This tells you where the error is.
Variable!rlcrmati
Specilied lSpec'ic.-lion I C.~!ctio!'Jl:Dn
II
Calcl~aled
I
These cells tell you what operation calculated the new value.
This cell tells you how the old value was determined. [
4
3.
In order to locate a particular stream or operation on the flowsheet: right-click the PFD background and choose Select Objects ••• The chosen object is selected and the highlight flashes a few times. If it is not visible on the screen press the Home key to recentre the view.
4.
Always debug simulations in the direction of the process flow. For example, if the feed streams enter on the left and product streams exit on the right, debug from left to right. It is important that upstream operations be error-free before you attempt to debug downstream operations.
Troubleshooting
5
5.
The Aspen HYSYS Workbook is a handy debugging tool. You can quickly determine which simulation variables are user specified (blue) and which are calculated (black). Remember that in order for the workbook to accurately represent actual conditions, the solver must not be in "Holding" mode.
6.
Make use of the Choose Label Variable function on the PFD background rightclick menu. This changes the PPD stream labels from stream name to another variable. Importantly, specified variables are always shown with an asterisk (*). The shortcuts Shift T, Shift P, Shift F, or Shift M show temperatures, pressures, mole flows or mass flows. The shortcut Shift N toggles between names and the variable that was displayed last.
7.
Make sure that all required streams are fully specified. All column feed streams and, usually, all process feed streams are fully defined. Make sure all assumed values in Recycle operations are fully defined. In most cases these will be in the outlet stream, unless the recycle is set to transfer information backwards.
8.
Use the Status window and Trace window to their full potential when debugging Aspen HYSYS simulations. Carefully monitor all messages in both windows; pay special attention to messages in red or blue type.
9.
Check that no operations or streams are hidden or ignored. Ignored operations will not be solved, and hidden operations can affect other operations in the simulation resulting in errors. To determine if a case has any hidden objects, and to unhide them, right-click the PPD background and choose Reveal Hidden Objects •••
10. When dealing with Adjust operations there are several items to remember. •
Make sure that the step size and tolerance values are reasonable.
•
Use maximum and minimum values to limit the operation.
•
The adjusted variable must be user-specified or a consistency error will result.
5
IS
Troubleshooting
Using the Property Balance Utility to Check Overall Mass and Energy Balances The property balance utility displays material and energy balances across the whole flowsheet or across selected operations. It can be useful for troubleshooting. To add a property balance utility:
1.
Open the ToolIl Utilitiel menu, or press CTRL U. The Available Utilities view
appears. 2.
Select the Property Ba1aDee Utility. Figure 2 I!I~EI
AYallable Utilities
Data Recon Utilily D~pressuring . Dynamics .' Derivalive Ulilily En vel ope Utili l'/ FRI Tray Rating Hydrate Formation Utilily Para me tric Utilit~ Pi e Si2in
1'i~w
6
Utihb'...
6dd Utility
Troubleshooting
3.
7
Click the Add Utility button. The Property Balance Utility view appears. Figure 3
I!!!II!J E3
Property Dalan~e UtilIty: Propert y Bal an~e Ut Ihty-l
!lid!fflMI'€IIIP'11 ij nlll
Nar.ie
r.
.2cope Objecls
II
Selup - - - , Balance Rewlls
V_"!.i,,bk:> _
Alias «Empty?>
-<-
Descr i Iion
-u New Form ula> > u
Emply>:
I I~s ert V ~riable
I
Remove Var iabl e
I
Formul~
I
V"ri"ble T e Uni ILe
«E mply»
Remove
i'It ale.ial B ala nee
Ener 9.'1 Bdlance
Q.elete
Be/resh Scope Objecls
I
.close
Next, you IIlUBt choose the scope for the utility.
1. Click the Scope Objectl button. 2.
To select the whole flowsheet as the scope, select Case. (Ensure the Object Filter is set to the FlowSheet Wide radio button as shown.) Fillure4 !lI!II3
~ Target Objects: Property Balance Utlflty-l
r
biectsAv_le-e- - - - - - - - - - - - - - - - - .
F10:l$hOOI.
FlowShooIWd..------,
T-10D (COLl) TEG R'9"neralor
.:
Obioct Filt..-
rr
«
<.
rei r ~bea;ns:
r
J.!nilO
.6.ccepl List
!AliC
r.E!ii~~(~~
IJ
7
8
Traubluhooting
3.
Select the required flowsheet, and press the »»» button as shown.
Scope Obiecls--------, N~cethat
FlowSheetWlcle appears in your Scope Objects list.
»»»~ < < < <; < <
I Accept List
Cancel Ch an ges
A1tematlvely, the balance can be limited to selected operations.
4.
Click the Accept List button.
s.
Next choose variables to include in the material balance by using the Insert Van able button.
To view material balance results, click the Material Balance tab and select the B8lance Results radio button. Figure 6
ROO 13
Property Balan~e UtilIty: Propert y Sal an~e U t II Ity-l
Nar.ie
r
IliIfflM:t1gil1Q411 nnllll
S~lup
---Ii:
Inlet Mal~rial Stream, Inl~l Gas Water 10 Salurale
.2cope Objecls
Balan~~ R~
-----Balal'\ce Type
~
I( emp Iy>
Values
Oullel Material
-I
Stre~m$
Counted Values Gul W (em ply> P TEG only 17. _M_ak_~_U-,-p_T_E_G_-+--"P;_,_+-- _ _(_~rn-,-pt~,->+_._ _-;::X_S...,H:::-2-:0_+--ip.. .,I..-+-_ _(_~_mop.,,-ty_>+ Gas Oul P' (empty>
Total 01 Inlet Streams
Counted
I IFlowS~eetWide W~ler
Total of Outlet Slreams
jly>
Imbalance _ (Total 01 Oullel ~lream,)-ITolal ollnlel Stream,) ! Relalive Imbalance [%) = Imbalance/IT olal ollnlel Sireams] ., 00%
lr-(~-m->-ty-> - - - - -
Ener 9.'1 B"lance Q.elete
8
Belresh Scope Object,
I
Close
Troubleshooting
II
To view energy balance results, click the Energy Balanee tab. Figure 7
I!!!II!J E3
Property Dalan~e UtilIty: Propert y Oal an~e U t Ihty-l
Nar.ie !lid!fflMI'€ilIQ411 ij nlll Energy Balance
.2cope Objecls
I IFlowS~eelWide
Resul,,---------------------------,
Inlel Siream, Counled Values Oullel Streams Counled I Values Inlel Gas ~ ·4,261e+0071
..
Total all nlet SIreams 1·4.37Be+007IWh
TDial of Oullel Slreams
j-437Be+0071
Imbalance - (Total 01 Oullel Slreams)·ITolal ollnlel Streams)!·30,341
j-=-o-=-oo"-'? ::-.-----
E ne.!W Balance
flelresh Scope Objecis
I
.close
Column Troubleshooting Tips Columns are the key operations in many Aspen HYSYS simulations, and because their operation is more complex than most Aspen HYSYS operations, a separate section of this module is dedicated to tips that you can use to converge all types of column operations.
9
10
Troubleshooting
Degrees of Freedom Degrees offreedom play an important role in the operation of the Aspen 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: # of active specs =# of side exchangers + # of side draws + # of pumparounds + # of side strippers
(1)
In the above formula, reboilers and condensers (any type) are counted as side
exchangers. What wiU be the required number ofactive specifications for a column operation with a condenser, three side strippers, three pumparounds, and no reboiler?
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 ofrequired 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.
10
Troubleshooting
11
Another common mistake is that the Aspen 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, Aspen 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. Temperature estimates are not required for most columns; however, if they are specified, you may find that the column will converge faster. If you use temperature estimates in your simulations, remember to enter values for the top stage and bottom stage temperatures only; however, if a condenser is used as stage 1, enter a stage 2 temperature also. Often a steam feed is used to supply energy to the bottom stage in a column. If a steam feed is used, remember to attach a water draw at an appropriate location on the column to remove the excess water. All feed streams to a column must be fully defined before the column can solve. Columns cannot calculate the conditions of a feed stream based on product streams. Likewise, all product streams should not contain any user specified information. A product flow rate 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. The configuration of a column must be defined before the column can solve. This means that the following items must be fully defined: •
All feed streams and their respective feed locations
•
Number ofIdeal Stages
•
The Tower Pressure - specify both a top stage pressure and a bottom stage pressure. If stage 1 is a condenser, specify a stage 2 pressure (a condenser pressure drop) also.
•
The Type of Tower - Contactor, Refluxed Absorber, Reboiled Absorber, or Distillation.
•
Location and number of side strippers, pumparounds, and side draws, if applicable.
11
12
Troubleshooting
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 Aspen HYSYS users are aware, finding the specific reason for convergence failure can be a difficult and frustrating challenge. The following five situations can occur ifthe column fails to converge. Each situation has possible causes, which may help you find the source of the problem. Condition 1 - The Column fails almost immediately after start-up: •
A vapour-liquid mixture may not be possible at tower conditions. Check BP and DP of all feed streams at tower pressures and ensure that a V-L mixture is possible.
•
The mass balance around the column is failing. Check that the product flow estimates (specifications) do not sum to a value that is greater than the feed flow rate.
•
A component specification exists for a component that does not exist in the feed stream.
•
Columns with no condenser must have a top stage liquid feed, and columns with no reboiler must have a bottom stage vapour feed.
Condition 2 - The Heat and Spec Error fails to converge: •
The column may be unable to meet the desired purity specifications. If this is the case, increase the number of stages.
Condition 3 - The Heat and Spec Error oscillates and fails to converge:
12
•
If the components in the column have similar bubble points, allow looser component specs.
•
This condition can also result from a build-up of water in the column, which can be solved by adding a side water draw. This is usually added to the condenser, but may be added at any stage.
Troubleshooting
13
Condition 4 - The Equilibrium Error fails to converge. •
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.
Condition 5 - The Equilibrium Error oscillates and fails to converge: •
This occurs most often with non-ideal towers. In these cases, convergence may be reached by changing the damping factor to a number between 0.4 0.6. Another option is to set the damping factor at "Adaptive" rather than "Fixed". This will allow Aspen HYSYS to determine its own damping factor.
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 Aspen HYSYS case called Case l.bsc located on the course disk. This case is a multi-stage compression plant with liquid recycled upstream.
13
.....,..
Process Flow Diagram - Case 1
Ar--u:' Sop J'" vap
c~mp"'''ionf(-r[ .~p _
T
_ _....
LP
M•• r t
11 ut I CY
J@p
~
RC'{·'
rage
j;r--~St~g.-
t~Stag. ~'-r1f'), -"'L.b ..'~-"" _
°o ~r
.(JJ'----- c.....
--1 ~~"
......
rago
ut
oo.r
,
t
.."'\.
~
LOt Out
SIS : op
l.. .I
....
S.p
,
••
~D~o
IS S. ~
2
l,-,," Sop IS
M•• r 2
,
~LP
__ r-
J~. 2 Q
v..p
.....
Stage
Cooi.r 2 Out
2 Cool.r
Out
iii
2
""
ovm
Ga~
HP
2
m·,
~
HP
Sop Lq
Sop
Troubleshooting
15
Attempt to solve the case by adding and deleting specifications as needed. It is a good idea not to delete anything too quickly as you may need the value later 011. It is also a good idea to begin at the very beginning ofthe simulation and work your way through to the end. After opening the case, you may notice that it i8 in Holding mode. To resume the calculation8, click the "Green lighr button in the Main Menu Bar.
There are elTOl'S in three places in this simulation that must be removed before the simulation will solve.
WI",.' 'MIlD tltejirst tIIbrg tltlltyou clumgetl1
TheaectnUl?
_
_
Case 2 Open the Aspen HYSYS case called Cue 1.hse located on the course disk. This case is a simple gas plant where the separator temperature is set to meet a dew point temperature specification 011 the export gas.
15
....OJ
Process Flow Diagram - Case 2
LTS Vap
1 To Refrig
I'll I I
i"
Gas-Gas
Inletlep
Vap Inlet Gas Sep
it
>-V
~
L : Chiller to Sa~ Gas
~r >-V Q G;Jt1 t E-100
-
I
BAL-1
~
Inlet Sep Liq
LT
I
HC Dewpoln
L I
I
,.;t i;
LTS
0
I I
I
~
LTS
Liq
Troubleshooting
17
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 its connected streams. If the Mole balance type is chosen then component mole flows are balanced, the Mass balance type balances overall mass flows. What was the first thing that you changed?
_
Thesecond?
Thethird?
Thefourth?
_
_
_
And the last thing that you changed?
Case 3 Open the Aspen HYSYS case called Case 3.hsc located on the course disk. This case simulates demethaniser and deethaniser columns.
17
.... '*'
Process Flow Diagram - Case 3
Deethanizer
Demethanizer
DC2 DC2 Ovhd Cond 0
DCl Ovhd DC2 Dist
t
DCl Reb 0
DCl Btm
P-l00 ~
I P-l00-HP
.
DC2 Feed I
...
_~
, ,
DC2 I
I
Reb 0
.......
DC2 8tm
Troubleshooting
19
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. What was the first thing that you changed?
_
The second thing?
Thethirdthing?
_
_
And the last thing that you changed?
Case 4 Open the Aspen HYSYS case called Case 4.hsc located on the course disk.
19
~
Process Flow Diagram - Case 4
:l:R:6 ~
Sales -10 Cia.
'"
BAL-l
•
rI Inlol S@p
v..p
Gas-to (';05- Gas
Chill"
Chill@r
Sou..Gas 10
p;t 800ling
Prod
to
Cool
I
Prod 110
Storog@
Inlet (';05
~
510 rog@-VaPQyr
LTS
Sop
L-_ Inlet Sop Liq
51orog
r.~ FLOW-I
Sweet Gas 10
LTS
51orogo
LYs"JP~ ~ Pro d"<1: Valvo P"'~~" ",51 orogo
Liq
10
To@
Prod
Prod 210
~ Liquid 51orogo
Prody01
Troubleshooting
21
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. What operation contained both problems?
Why did you change in this operation?
_
_
Why does this operation need to be specified in this manner?
21
22
22
Troubleshooting
Dynamic Depressuring
Dynamic Depressuring
© 2005 AspenTech - All Rights reserved. EA1000.04.07 08_DynamicDepressuring .doc
1
2
2
Dynamic Depressuring
Dynamic Depressuring
3
Introduction Aspen HYSYS includes a utility to model the pressure letdown of a vessel. This Depressuring Utility can be configured with various valve models and heat transfer scenarios. The Depressuring utility uses the rigorous Dynamic solver from Aspen HYSYS Dynamics. This module is split into two sections: •
Depressurisation: A Practical Guide
•
Depressuring Workshop
The 'Depressurisation: A Practical Guide' document can also be found in the Knowledgebase on the AspenTech support website (support.aspentech.com)
Prerequisites Before beginning this module, you should have a reasonable general understanding of the Aspen HYSYS program. No knowledge of Aspen HYSYS Dynamics is required.
Workshop In the workshop the Depressuring Utility is used to simulate blowdown and fire scenarios for a vessel.
3
4
Dynamic Depressuring
Depressurisation: A Practical Guide Updated for Versions 3.2 & 2004 This guide has been prepared based upon questions frequently asked regarding the Dynamic Depressuring utility introduced in Aspen HYSYS 3.0.1. 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 2.1 Connections - Vessel Configuration 2.2 Configuring the Strip Charts 2.3 Heat Flux Parameters 2.4 Heat Loss Parameters 2.5 Valve Parameters 2.6 Operating Options 3.0 Example Problems 4.0 Appendices
1.0
Overview
Why has the old depressuring utility gone? The original Depressuring utility in Aspen HYSYS was a pseudo-dynamic calculation based on a series of steady state calculations. The Dynamic Depressuring utility was introduced in Aspen HYSYS 3.0.1 to allow users to perform proper timedependant calculations. An Aspen HYSYS Dynamics licence is NOT required to use this new utility. In version 3.2 onwards you now only have the option to run the new Dynamic Utility. The dyndepressuring.tpl file in the templates sub-directory of the Aspen HYSYS 3.2 install should be dated 19/0412004, or later. If you do not have this, download the latest version from the website. (See Knowledgebase Solution #113227 at supportaspentech.com)
What can this utility be used for? The Depressuring utility can be used to simulate the depressurisation of gas, gasliquid 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.
4
Dynamic Depressuring
5
What types of depressuring calculations can be performed? There are two major types of depressuring calculations available: •
•
Fire Mode is used to model a vessel or pipe under fire conditions. This mode has three sub-types: o
Fire
o
Fire Stefan Boltzmann
o
Fire API521
Adiabatic Mode is used to model the blowdown of pressure vessels or piping with no external heat supplied.
A more in depth discussion of the different methods follows in Section 2.0.
2.0
Adding and Configuring the Utility
How to add the utility A Depressuring utility can be added to the case by selecting 100ls I ![tilities on the main menu bar, highlighting 'Depressuring - Dynamics' and pressing the Add Utility button. Once selected, always rename the Utility to something that is recognisable the next time you open the case (for example, DP-V1234-Fire).
2.1
Connections and Vessel Configuration
How to connect the utility to a stream 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 Figure 1:
5
IS
Dynamic Depreuurlng
Design Connections
fead
Config. Strip Charls Heal
Flu~
Vessel Paramelers---------/
Valva Paramelars
Orienlation:
Options Flal End Vassel Volume [m3] Height 1m] Diameter [m] Ihitial Liguid Volume [m3] · Initial Liquid Percent [%]
Operating Conditions Notes
Heal Tramler Areas · C~lindrical Area Im21 Top Head Area [m2] ~~om I-!ead Area [m2]
1688 1.227 1.227
Correction Factors: Metallvl ass in Contact wilh Va our · Metallvlass in Contact wilh Liquid -r:::::::::;
Design
Worksheet
Delele
Run
Performance
.9.lop
r
Ignore
Entering Vessel Parameters 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 un knO\lVrt. then the vessel sizing utility in Aspen HVSYS can be used to estimate the required
pswnetenl.
The initial liquid volume is normally calculated at the normal liquid level (NLL). Aspen HYSYS does not take the volume ofthe heads into account &0 the volume will be the liquid. in the cylindrical portion only. Ifthe feed stream is two-phase, the equilibrium composition of the liquid will be calculated. If an initial liquid volume is not specified, Aspen HYSYS will take a volume equal to the volumetric flow ofthe feed liquid over one hour. This may be disproportionate to the total vessel volume.
I A more realistic hold up lime to U&e is 4 minutes. Aspen HYSYS does not take account ofthe heads in a vessel 80 volumes and areas are calculated 8S for 8 simple cylinder. The tota1 vessel volume is calculated from the diameter and height (or length for a horizontal vessel). To account for piping or head volume contributions, 8 small amount can be added to the height or length ofthe vessel.
6
Dynamic Depreuuring
7
Ifthe conditions of the system at settle out are such that the vapour is superheated, Aspen 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 ofthe vessel. This can also be used to account for additional noxzles, piping, strapping, or support steelwork in close contact with the vessel. Aspen HYSYS will use the heat content of this metal when performing the calculations. This is analogous to adding, for example, ten percent of the vessel mass to acoount for fittings. Nate that correction factors ... in kg or Ib .nd ... nat • simple %.
2.2
Configuring Strip Charts
When the Depressuring utility is run, all data is stored using strip charts. Three defitu1t strip charts are added when the utility is added. It is possible to remove variables by deselecting the appropriate variable in the Adive column. A variable can be added by pressing the Add Variable button and selecting it from the list of simulation variables. Any configuration to the strip charts should be done before the utility is run; otherwise any new variables will not be stored. Fillure2 Configure Strip CharI Logger Name
PressureProlile Temperature Profile
To view data in tabular form, press the "View Historical Data..." button.
IDepressuring - Dynamics-1-D L
-I
I 1000:00:1.00
Obiect Vapour@T Vapour@T VapourOut' VapourOul' Liquid@TP liquid@TP LiquidOut@ LiquidOut @ Vessel@TF Vessel@TF Ves;;;el@TF Vessel@TF
Inner Wall Tor' ~s (Liquid!)
.. J_.R_I
1.•.•
~Tr
Variable
I A~I
Active Pressure Mass Flow Temperature Mass Flow P,p~~,
,,,,
r-a,
~I
R1!
I~F
J;?]I r.:-1
......
To view data in graphical form, press the "View Strip B
Chart... " button.
E /'
InnerWall~ _.~
.J_II?,
Plot IL-,~Y·'~~. §.~.i"ip·,-,¢'h~!f-,:,·;-,:,-,-,-,-,-.I I -Delete--~
I. Add Variable
Sampling Interval
.....-:::. _._L ••• _.
.,.~
~r
: _.. :.J-'i~
~I l'""lI
I.'~
~y
Jiv~w Historical Data ·.. 1
II, -Create... FLARENET --- Plot
I
7
8
Dynamic Depreuuring
2.3
Heat Flux Parameters
On the Dellign tab, Heat Flux page, the type of depressuring to be performed is specified. The different modes and their respective equations are described here. There are five types ofHeat Flux models available: •
Adiabatic Mode - no external heat is applied
•
Fire Mode - models heat :from a fire using a general equation
•
Fire API 521 - models heat :from a :fire using an equation based on API521
•
Fire - Stefan BoltEmann - models heat :from a :fire using a radiation equation
•
Ule Spreadlheet - allows the user to customise the equation used
Adiabatic Mode This can be used to model the gas blowdown ofpressure vessels or piping. No external heat is applied so no parameters need to be entered in this section.. Heat flux between the vessel wall and the fluid is modelled as the fluid temperature drops due to the depressurisation. Typical use ofthis mode is the depressuring of compressor
loops on emergency shutdown. Fillure3
Heat Flux Parameler====================1
IrOper
Adi
II
Fire Mode Fire Mode can be used to simulate plant emergency conditions that would occur during a plant :fire. Pressure, temperature, and flow profiles are calculated fur the application ofan external heat source to a vessel, piping, or combination ofitems. Heat flux into the fluid is user defined using the following equation:
) C LiquidVolwnetime=t . + C3 (c4 - T Q = C1 + C2 X tzme VESSEL + s X -.--.------===---'--LzquzdVolwnetime=O
8
Dynamic Depreasuring
•
The Fire Equation can also be used to simulate the dcpressming of sub-sea pipelines where heat 1ransfer occurs between seawater and the pipeline. If~ was equal to UA. C4 was equal to T1 and CIt ~ and Cs were equal to zero, the above equation would reduce to:
Q=UA(AT) FIl1u~4
Heal Flux Parameler [lJperal ina f"i a8e-
Fife Equation:
Fire
C1 C2
Q = Cl + C2"Time + C3"(C4· Vessel Temp] + C5"LiqVal(lime=l)/LiqVolltime=OJ
0.0000 0.0000
C3 C4
C:.
III
Equalian Units
0.0000
I Btu/hr
fJl
Fire API 521 Fire API 521 uses similar heat flux parameters to those used in Fire mode. Three coefficients: CIt C2 and ~ must be specified. The equation used by Aspen HYSYS is an extensioo 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, Fourth Edition, March 1997.
The amount ofheat absorbed by a vessel exposed to an open fire is affected by: •
The type offuel feeding the fire
•
The degree to which the vessel is enveloped by the flames (a function of size and shape)
•
Any fireproofing on the vessel
The following equations are based on conditions where there is prompt fire fighting and adequate drainage offlammable materials away from the vessel.
API Equation (field units)
Q = total absorption to wetted surface (BTUIh)
Q = 21000xFxAo. 82
F = environmental factor A = total wetted surmee (~)
API Equation (metric units)
Q = total absorption to wetted surface (kI/s
Q = 43.116 X F X AO. 82
F = environmental factor
A
=
total wetted surfilce (m1
9
10
Dynamic Depreuuring
Environmental Factor Table 5 on Page 17 of API 521 lists F fil.ctors for various types ofvessels and insulation. Bare vessel At present Aspen HYSYS does not have the F factor shown in the equation. If you want to derate the heat input then after the 21000 or 43.116 figures accordingly.
F= 1.0 F=O.03 F=O
Earth-covered storage Below-grade storage
For insulated vessels, users should consult the reference and select an F value based on the insulation conductance for fire exposure conditions. Figure!
-Heal Flux Paramelers-s- - - - - - - - - - - - - - - - - - - - Fire API521 Cl [Blu/hr·ftl.64] C2
C3
2.'008+004 0.8200
J
Inilial Welted Area m2
--1.(ijJ
FireWetled Equalion: Q =C1 '[C3'Wetled Area (at time= ll]"C2
Q= C1 '[VJetled p.rea (time=tllT2 Wetled,6.rea [tlme=t] =\A!etl8d Area Itrme=Ol"
('·C3"['·LJqVolltime=lJ/LiqVol[lime=Dj]]
Note the Initial Wetted Area variable will only be completed ifcases from earlier versions of Aspen HYSYS (pre 3.2) are loaded. The Aspen HYSYS equation is an extension ofthe standard API equation.. Therefore, in field units, CI will be 21000 multiplied by the environmental mctor, F and C2 will 0.82. (In most cases, CI will be equal to 21000).
W8ttedArea The sur:fitce area wetted by the internal liquid content ofthe vessel is effective in generating vapour when the exterior of the vessel is exposed to fire. To determine vapour generation, API recommends that you only take into account that portion of the vessel that is wetted by liquid up to 7.6m (25ft) above the source ofthe flame. Individual companies may deviate :from this :figure, so do check. This usually refers to ground level but it can be any level capable of sustaining a pool fire. The following table indicates recommended volumes for partially filled vessels. Volumes higher than 7.6m are normally excluded as are vessel heads protected by support skirts.
10
Dynamic Depressuring
11
Type of Vessel
Portion of Liquid Inventory
Liquid full (for example, treaters)
All (up to 7.6m)
Ref API 520
Surge drums, knockout drums and process vessels
Normal operating liquid level (up to 7.6m)
Fractionating columns
Normal level in the bottom plus liquid hold up from all the trays dumped to the normal level in the column bottom. Total wetted surface only calculated up to 7.6m [Reboiler level is to be included if the reboiler is an integral part of the column.]
Working storage
Maximum inventory level (up to 7.6m)
Spheres and spheroids
Either the maximum horizontal diameter or 7.6m, whichever is greater
Ifa ~ value of 0 is used, the initial wetted area is used throughout the calculations. This could represent a worst-case scenario. Alternatively, if a C 3 value of 1 were used, the volume would vary proportionally with the liquid volume. This would represent a vertical vessel.
Fire· Stefan Boltzmann This mode uses the Boltzmann 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.
Where: A
lotal
Ef
=
Total wetted surface area
=
Flame emissivity
Generally ranges from 0.2 to 0.5 (for burning heavy RCs)
=
Vessel emissivity
Generally ranges from 0.5 to 1 (for polished metal)
=
Boltzmann constant
Equals 5.67*10 -8 W/m2 K."
=
Flame temperature
1500 K and upwards
=
Vessel temperature
outside U
=
Convective heat transfer between vessel and air
Tamb
=
Ambient air temp
11
12
Dynamic Depreuurlng
Figure •
Heal Flux P a r a m e l e r : ; - - - - - - - - - - - - - - - - - - - - -
IOperating Mode .
~ e Slephan Boli~man
Eminivil.l' of Flame II Emissivily of Vessel U Outside [l
I
Q = Surface Area' [ilame emmissivil.l'
< ves:;el eminivil.l' 'Boltzman Constant" [[Flame Temp[Kelvin)r'4]: Oulside U' [Ambienl Temp· Vessel Temp])
54.00 25.00
Use Spreadsheet This 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 substinned for calculation of the heat flux. It is recommended that advanced users aoly use this OPtion.
2.4
Heat Loss Parameters
There are three types ofHeat Loss models available: • •
None - does not acx:ount for any heat loss Simple - allows the user to either specify the heat loss directly or have it calculated from specified values
•
Detailed - allows the user to specify a more detailed set ofheat loss parameters
For aceu"'" calculations the detailed Heat Loss model Is the one that should be used otherwise the contribution of the metal could be completely Ignored.
Simple Model Figure 7
iHeat: Loss Parameter Heello$s Model
Simple
II
Ovefall U [kJ !h-m2·C]
54.00
TempeJatLis lei Heat Trender Area'{frafEnd Ve~ell [m21-
25.00 II
17.67
Using 1bis model the user must specify an overall U value and an ambient temperature.
12
Dynamic DlilPl'8Uurlng
13
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 Connecdonl page. Using the Simple Heat Loss Model, heat loss from the vessel is calculated using the following formula:
Detailed Model This mode allows the user to specify a more detailed set ofheat loss parameters. It considers heat transfer through convection between the vessel fluid and the wall, conduction through the wall, and any inRUlation and convection to the environment Hence, there are four portions ofthe model to be set up: General, Conduction, The duty calculsled can be applied to the vessel wall or directJy to the fluid. The former would be used to model 8 fire and the Ialler to model a heater.
Convection, and Correlation Constants. The radio buttons here switch the view to allow these to be configured.
General The General section a1IowB the user to manipulate Recycle Efficiencies and the ambient temperature.
Appl.\' Oul.\' Stream to Oul~ide Wall ("': Correlation Constanl~ Tolal Heal Transfer Area:
Liquid Phases
Vapour
'00.00 I 25.00
The Recycle efficiencies set how much of each phase is involved in the flash calculation. The default value for all1bree Recycle Efficiencies is 1000A>. This means that all material in the vessel has been flashed together and is in thermodynamic equilibrium.
13
14
Dynamic Depreuuring
Ifthe Recycle Efficiencies were to be reduced, a portion ofthe material would bypass the flash calculation and the vapour and liquid would no longer instantaneously reach equilibrium.. In this case, the phases may have different temperatures. Unfortunately, there is no single typical number suggested. fur these parameters. The best option would be to try various scenarios and observe the results.
Conduction The Conduction section allows the user to manipulate the cond1u:tive properties of the wall and insulation. Figure 9 ~eat
Loss Parameter
llReat [ass lYtodel General
Detailed
• Conduction
Tot"ll He"ll Transfer Are"l:
II
Appl}' Dut}' Stream to Outside Wall
Convection
12i11 2 m2
Correl"ltion Comt"lnts
.1 Metal 1000
TFiICKness Imm
Imulation 30.00
I~S~ Piec?iif?ic~Hi#e~at~C~ap="l=c=::itY=-n==w!K::::;U5='-C:.!;;T==t- _ _O=.c. 4;;;7,-,;;3;'-10 '1-_ _0.:.;;'8:::=2~070-t1 1 11--_ _"""5.,-:2::-:-°.-::-0-+ I.;D:--:e~ns~lt.... y .:..:[k":;s:9'/.:.;m;;;.3;,..1--,-:-=--+7:.:::8;.:.0-=--t 1 ConductiYity [Wlm-K] 45.00 0.1500
The metal wall thickness must always have a finite value (that is, it cannot be
Some typical values for metals are: Metal
D....slty
Th~ICanducUvBy
kglms
SIMclflcHut kJikgK
W/mK
Mik:lSteel
7860
OA20
83
Stainless steel
7930
0.510
150
Aluminium
2710
0.913
201
Titanium
4540
0.523
23
Copper
8930
0.385
385
Brass
8500
0.370
110
Convection The Convection section 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.
14
Dynamic Depreuuring
15
Figure 10
..Heat Lon Parameter IIRe~Lon
t"loBel
General
U~e
Fixed U
II
Appl.\' DUl.\' Stream to
• Convection
Conduction
Total Heat Transfer Area:
r.
Detailed
.~
Wall
Correlation Constants
I
l20.12 m2
Out~ide
1:!:,~:~:~!~~t,~,,~:~~i~i~.i.~,~:t~:H9.0,)1
Continuall.\' Update U
~hslae \lap pnaselKJifi·m2:cr lnsloeuq PnasB [KJ7fi·m2·Cj Ouhicfe 01rJ7h-m2TJ Yapour to Liqui(f[kJ)/i-m2-C]
9740 125,2 4.264 1.051e-076
To use a set offixed U values, the Uee Fbed U option should be selected. If the U values are unknown, the user can press the E,tlmate Coefficients Now button and have Aspen HYSYS determine the U values. In order to have Aspen HYSYS vary the U values throughout the depressuring scenario, select the Continually Update U value.
Correlation Coefficients This feature gives users the opportunity to manipulate the coefficients used in the heat transfer correlation. By selecting Use Specified Conltants, the user may manually enter the constants used in the heat transfer correlations.
Heat Lon Parameter:>======================""Jll IR~Con t"loBel
General
.. ~
Detailed
Conduction
Tolal Heat Transler Area:
II
Appl.\' DUl.\' Stream to'Out;sideWall
r.
t' Convection
FO,
Correlation Constants
I
12 m2 1.======.1 Auto Select Correlation Constants r. ~g:~:~::~,p,~,c::i:~!~~::~?~?,l~~~:~
C
,\i'ii~OlEide
m 0.2500
'.420 0.7750 0.7750 0.5400
Vapour - Nail
I Corre~ion Help __ I 0.2100 0.2100 0.2500
The equation, which determines the outside heat transfer coefficient for air, is: ill
h=Cx
AT
(length J 15
1&
Dynamic Depreuuring
The equation used for the other three COlTelations is:
Nu = CX(Gr xPrr Where:
Nu = Nusselt Number Or = GrashofNumber
Pr = Prandtl. Number
2.5
Valve Parameters
It Is nlCornrnended that either the Fisher or the Relief valve be used.
The Valve Parameters page allows users to select the type ofvalves to be used for both vapour and liquid service. In most cases, either the Fisher or the Reliefvalve 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. Figure 12
lOB
Fisher j..;;;;.;....==..;.;.;o!,
-'j
'!';
Si2e Valve ...
Relief
&~~-------l Supersonic Subsonic l-------'--=------------l Masoneilan General [No Flowl
Valve Equation Help ...
(No Flow)
lOB
16
Dynamic D. . . . .urlnl1
17
Fisher The Fisher option uses the standard valve option in Aspen HYSYS. It allows the USCf to specify both valve Cv and percent opening. By pressing the Size Valve button, the valve can be sized for 8 given flow rate.
Inlel r'ressure IKP
1.490e+004 28.01
SIzing Vi.lve' 0 penlng [~J Sizing Della FTKPa] Sizin'qrlow RalelKW~
-
50.00 250,0 1520
Once the appropriate Sizing Conditions have been entered, press the Size Valve button to calculate the valve Cv.
Valve Type and Sizing Methori==-------==I
63,78
Relief Valve The reliefvalve option uses the standard Aspen HYSYS dynamic reliefvalve. The can specify orifice area (or diameter), reliefpressure, and full opc:n pressure. The USCf is required also to specify an orifice discharge coefficient
USCf
Figure 14
Orifice Are
U -
314.1 20'00
lOOO 11.00 12.10
PSV hysterysis can be modelled by opening the depresswlng sub-flowsheet and navigating to the DynIJllies tab on the Spees page of the reliefva1ve as shown.
17
11
Dynamic Depr. .urlng
Figure 15 Dynilmicz;
Dynamic Parameler
SpeC:II
Della P fbarl Valve Lilt Percent
Holdup Advanced Stripch
W
8.9B7 00000
0,00
Enable Valve Hytterysis
Hyslerysis Parameter
I C10 s in a Pressur e
IR"seating Pressure
=.c;e;;j. Rating
~I
12,10
I
9.800
I
J Worbheet , Dynilmicsj
Note that the relief valve opemion is not added to the sub-flowsheet until the utility is run for the first time after the valve model ia changed.
It Is possible to model a deprasurlng valve using the PSV valve. Forcing the relief valve to be open at all times does this. Enter a full open preSSUN that I. lower than the final expected vaaaeI pr8S8ure and a sat prenure that is slightly lower than the full open pressure.
Other valve models Ple..e ... Appendix A for the other valve models (.. used In the original Aspen HYSYS DepresSUring utility).
2.6
Options
The Options page on the Dellgn tab allows the PV Work Term Contribution to be
set Flgu,.11
IIF'V WorR: Term Contri6utlon Thi~
I
9300 % JI
number i~ appfo~imatel,!,' the i~enlropic ellicienc}J, Higher value~ result In lower and temperatwes, Values u~ed here are commonl,!,' in the range of 87 %to 88 t.
pre~sures
PV Work Term Contribution refers to the isentropic efficiency ofthe process. A reversible process should. have a value of 10OOA! and an iBenthalpic process should. have a value of0%.
18
Dynamic Depressuring
19
For gas-filled systems, values range from 87% to 98%. For liquid filled systems the number ranges from 40% to 70%. A higher isentropic efficiency results in a lower final temperature. As no processes are fully isentropic nor isenthalpic, this parameter is used in all the different simulation models to tune the models in order to match conditions observed and has been requested by some of our users to use to match the test data they have available. This parameter is defined in Aspen HYSYS as: d.H (change in enthalpy) = percentage /100.0 * d.P (change in pressure) / phase_mole_density. In simple terms you can think of this as the work that the fluid in the vessel does to expel the material that is leaving. However, for design purpose, that is working without any test data, based on various publications on the subject, we can propose the following values as a guideline: For gas-filled systems - values range from 87% to 98% For liquid filled systems - the number ranges from 40% to 70% Furthermore, as you can see from the way the equation is defined, a higher isentropic efficiency results in a lower final temperature. Hence, if one is checking that the minimum temperature of the vessel will not fall below a certain value (for example, for validating the steel alloy grade), then 100% will give the most conservative result. Also, If one is checking that the final Pressure is below the safety regulatory limit after 15 minutes, it might be safer to make some checks with lower values such as 87%, to be more conservative, provided there is no significant heat transfer influence on the phase behaviour inside the vessel.
19
2D
Dynamic Dep....surlng
Operating Conditions The Operating Conditions page on the Design tab contains a nwnber ofsettings:
Operating Parameters i'Operaling Parameter
Opera6ngplessule [1<:P0l~ Time Slep 51ze
DepressurinaT,me
1000 :1 000:00:005 ,I 000:15: O. 00
Operating Pressure refers to the initial vessel pressure. By default, this value is the
pressure ofthe inlet s1ream, or the settle out presSlD'e ifmultiple streams are connected.
Change the calculated Operating Preuure by changing the pressure In the connected etream(s).
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 oftime, say 1 minute. The Depreuuring Time is the totalle:ngth of lrimulated time the u1ility will TIm fur.
Vapour Outlet Solving Option The Dynamic Depresswing utility can solve either for the final pressme or the CJArea required to achieve a specified final pressure. The Caleulate Prenure option uses the specified arealCv to determine the final
pressure.
The :final pressure is given when the Depressuring Time has elapsed.
Calculate Area is available for Supersonic, Subsonic, and General valves. Calculate Cv is available for Fisher and Masoneil.an valves. The two options differ only in the type ofvalue calculated.
20
Dynamic Depreuuring
21
Based on API, it is normal to depressure to 50% ofthe staring pressure, or to 100 psig. Hence Calculate Area can be used to find the cotTect size for the valve. Before the calculations start, the user must specifY an initial Cv or area. Ifthe depressuring time is reached before the final pressure is achieved, then the calculations stop and a new Cv or area is calculated using the final pressure. The calculations are repeated until the final pressure is reached in the given amount of depressuring time. The user may specify a maximum number of iterations and a
pressure tolerance to control convergence. Ifthe user wishes to stop the calculations at any time, the and keys together can be used, or the Stop button pressed. Figure 111
Vapour Outlet Solving Option==========;;;fI
When the utility has stopped running, the final calculated value
is displayed here.
This is the desired final pressure.
Performance Once all the required information has been submitted, a yellow bar that reads "Ready to Calculate" will appear at the button ofthe Depressuring view.
Delete
Read.,. To Calculate
r
Ignore
Press the "Run" button to start the calculations.
21
22
Dynamic D. . . .urlng
Once the utility has run, go to the Performance tab, Summary page to view the results. Figure 21
-
-Depressuring Summary Performance Summarjl
Slrip Charts
Iniliill Pressure rbarl finill Pressure [bar] Depressuring Time
17, 40 1
II
IVapour ev [lJSGPMl
10.01 5.507 000: 15:0.00
.=
.,i;;vIP T.3ble
I~
ap, Peak Info
111.~,ig:,:::~~~~..I.~!:~:J
"
Temperature Protil"
(." Vapour Phase Vessel Fluid
Inilial rCI Final [CI Minimum [el
r.:
Liquid Phase
Valve 0 utlel
107.987 897653 897653
96.4571 82,9916 132,9916
InnerINall
929576 927555 927555
i
Flow Protil Vilpour
II
Inihill Mass-rkal Finill Man [kg]
Il
Liquid
I
58.04 43. 75
IPeak Flow ThrouQh Valve lkg/h) ~
1584
;
I1 I 1
rI
12941 10151 0.0000
I
The three buttms provide access to the following information:
22
•
CvIP Table - When the Calculate Cv aption is used this gives a table of CvlArea vs. final pressure
•
Vap Peak Info - details about the vapour product stream at its peak. flow mte
•
Liq Peak Info - details about the liquid product stream at its peak flow mte
Dynamic Depressuring
23
Main Points to Remember •
You now only have the option to run the new Dynamic Utility. The old quasi dynamic method has been removed.
•
Aspen HYSYS does not take the volume of the vessel heads into account so the volume will be the liquid in the cylindrical portion only. Adjust the vessel size if you wish to allow for the head volume.
•
Aspen HYSYS defaults the liquid volume to be equal to the volumetric flow of the feed liquid over one hour. This will be disproportionate to the total vessel volume; a more realistic hold up time is 4 minutes.
•
Metal mass correction factors are in kg or lb and not a simple %.
•
At present Aspen HYSYS does not have the F factor shown in the API521 fire equation. If you want to derate the heat input then alter the 21000 or 43.116 figures accordingly.
•
It is possible to model a depressuring valve using the PSV valve. To do this you will have to force the relief valve to be open at all times. To do this, enter a full open pressure that is lower than the final expected vessel pressure and a set pressure that is slightly lower than the full open pressure.
•
PV work term gas-filled systems 87% to 98% liquid filled systems 40% to 70% A higher efficiency results in a lower final temperature.
•
API recommends depressuring to the lower of 50% of the initial pressure or 100 psig / 6.9 barg.
•
For accurate calculations the detailed Heat Loss model should be used. Otherwise the contribution of the metal is completely ignored.
•
Make sure you run with a small enough time step to capture the peak flow.
•
Thoroughly check your input data before running. If you are unsure of parameters do not make wild guesses ... ask!
23
24
Dynamic Depreuurlng
Appendix A This section contains information about the valve models not mentioned above.
Supersonic Figure 22
I JlVap-our Flow I:.qualion
- ~,
IfD i3charge Co-efficient, ca 'I IliArea[mm2J I
Superwnic
0.5000 0.8000
I I I
The supersonic valve equation can be used for modelling systems when no detailed information on the valve is available. The discharge coefficient (Coil should be a value between 0.7 and 1. PI refers to the upstream pressure and PI the density.
Subsonic Figure 23
Subsonic
05000 0.8000
Pback refers to Back Pressure
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-critica1. This can occur when the upstream pressure is less than twice the backpressure. The discharge coefficient (Coil should be a value between 0 and 1. The area (A) should be a value between 0.7 and 1. PI refers to the upstream pressure and PI the density.
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.
24
Dynamic Depressuring
25
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 C v and Cr. The remaining parameters in the equation are set by the Depressuring utility.
where: CI Cv Cr Yr Y PI PI
1.6663 (SI Units) 38.86 (Field Units) valve coefficient (often known from vendor data) critical flow factor y- 0.148Y expansion factor upstream pressure upstream density
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 (page 5-14, Equation 5.20 (6th Edition) & Page 10-15, Equation 10.26 (7th Edition». 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.
where discharge coefficient throat cross sectional area m
_2)2(:+:1) ( k+l ratio of specific heats (Cp/Cv) upstream pressure upstream density
No Flow This option indicates that there is no flow through the valve.
25
21
Dynamic Depreuuring
Use Spreadsheet Recommended for advanced users only, this option allows the user to customise a valve equation by editing the valve spreadsheet found inside the Depressuring subflowsheet. Fillure24 fV apour Flow Equalion
Use Spreadsheel
Edit the VapourFlowR at e spreadsheet in the correspondinq su -
I
View Spreadsheet:,.,....
A
B 1.490e+004 kPa 101.3 kPa 1737 kgim3 35.97 kJikgmole-C
C Area, Cd or C1: C2: [v, Cf or Area: Cf or conversion:
General:
Mass Flow 4053 4053 3.555e-002 2843
Conlribulion 10-1 j: 00000 00000 00000 1000
In
12
ACTUAL MAS S FL
00000 kg/h
[Wi II be e,porledj:
14
Unit conyer sian:
3600 1000 second, 0.0000 seconds
00000
1 2
Vessel Pres::sure: Back Pres::sure:
3
Mas::$: Densit~l
..,---
Molar Cp:
~ 11'-'-
8
Equation: Supersonic: Subsonic:
9
Ma,oneilan:
10
11 f!J' TS 17 18 19 20 21 2-2 23 24 25' 26
Slarlflo," at I ntegrator time:
Masoneilan yterm
Mas oneilan yf G ener al kappa
General klerm
D 0.7000 0_5000 3.155e-005 1000
.......
Pressing the "View Spreadsheet... "button will open the spreadsheet.
• ••• ••• • J
.
~
1624 1000 1495 kPa 0.5728
E1
II
Discharge Coefficient When the relief, supersonic, subsonic, or general valve is selected, the user is required to specify a diBcharge coefficient This correction mcto.r 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.
26
Dynamic Depressuring
27
Depressuring Utility Workshop This workshop will give the user an overview of how to use the Depressuring Utility in Aspen HYSYS to size or rate depressuring valves and PSV safety valves. We also recommend that the user read the Depressurisation: A Practical Guide document included earlier in this chapter or in the AspenTech support Knowledgebase. In these exercises the separator 'V-IOO' in the case 'ADV8_Depressuring Workshop
- Starter.hsc' will be considered. The utility will be used to: •
Size a Blowdown valve for the vessel
•
Size a PSV for Fire Case for the vessel.
1.
Size a Blowdown Valve for the Vessel
1.
Open the case 'ADV8_Depressuring Workshop - Starter.hsc'
2.
Save the Simulation Case under the new name'ADV8_Depressuring Workshop - Blowdown.hsc'
Sizing the Vessel Before we can start to size the valves we need to calculate a size for V-I 00 3.
Use the Vessel Sizing utility to calculate the size for a Vertical vessel. [Tools I Utilities I Vessel Sizing]
4.
Take the default specifications. Use the calculated height and diameter rounded up to the nearest 50mm.
What vessel size is calculated? Height?
_
Diameter?
Blowdown Valve Sizing 5.
Create a new Depressuring utility to consider the valve sizing for a blowdown case for V-IOO. [Tools I Utilities I Dynamic-Depressuring]
6.
Name the utility VIOO-BD.
27
28
Dynamic Depreuuring
First, we define the Connection.
7.
Set the vessel dimensions as calculated above. Note that Aspen HYSYS sets defiwlt head areas based on flat heads. This is a4equate for the purpose of this workshop. Set the initial liquid volume to 2.6 m 3 (approximately 5()OA! of the total volume)
In this first exercise no additional heat input (for example. :from a fire) will be considered, but the heat loss to the environment will be taken into acoount We will not add any additional metal mass. 8.
Make the following settings: Pararnetw
8eUings
Heat Flux
Operating Mode'" Adiabatic
Heat Loss Model '" None [Heat 1088 will be considered later in the Exercise] Valve Parameters
Valve Equation'" FISher Initial Cv estimate '" 20 USGPM Valve Opening'" 50%
Options
PV Work Term Contribution '" 90%.
Operating Conditions
Calculate cv aption Blow down the vessel to 50% of its operating pressure Depressuring Time '" 15 minutes Max Cv step size'" 5.0
In the next section the effect of changing several Heat Flux and options settings will be considered. The valve Cv will be kept the same as that calculated above. 9.
TheBe reaull8 can be found on the ~nce tab Summary page
28
Change the solving mode to Calculate Pressure. Keep the same Cv.
10. Fill in the table below showing the calculated final temperature of the vessel contents, the peak: vapour flow rate and the final liquid mass. All the settings mentioned can be found on the pages on the Deugo tab. Each time change only the specified settings, leave everything else the same.
Dynamic Depressuring
Settings
Final Vessel Contents Temperature (C)
Peak vapour flow rate (kg/h)
29
Final Liquid Mass (kg)
All Settings as above
Heat Loss Model set to Simple (with default Parameters)
Heat Loss Model set to Detailed, Zero insulation thickness (leave everything else at the defaults)
In this example the heat transfer settings do not make a significant difference to the results. However, this is not always the case when doing depressuring runs.
Save your case! ---------_ ......I
29
30
Dynamic Depressuring
2.
PSV Sizing Fire Case
11. Create a new Depressuring utility to consider the valve sizing for a Fire case for
V-I00. 12. Make the following settings: Parameter
Settings
Utility Name
V100-Fire
Connections
Set the stream connections, vessel dimensions and liquid volume as in the Blowdown case
Heat Flux
Operating Mode = Fire API521 Heat Loss Model = None C3 = 1
Valve Parameters
Valve Equation = Relief Orifice Diameter = 10 mm Discharge Coefficient = 1
The vessel and valve pressures are defined as follows. All in Barg Pressure Vessel
Vessel
Valve
Max Allowable Accumulated Pressure (MAAP)
Max Relieving Pressure for Fire 12.10
12.10
10.00
10.00
121% of design P for fire 110% for non fire relief Maximum allowable Working Pressure (MAWP) or Design Pressure (DP)
Maximum Operating Pressure (MOP)
Relief Valve
Fully Open Pressure
Set Pressure
9.80
Closing Pressure (valve starts to close)
9.25
Reseating Pressure (Valve fully closed)
9.00
Note: In order to set the valve hysterysis (closing and reseating pressures) you must access the relief valve operation on the sub-tlowsheet. The relief valve does not appear until the utility has been initialised.
30
Dynamic Depreuuring
31
13. Make the following settings: Panllrneter
settings
Valve Pararnewa
Vslva set and fully open pl'fl8llUI'Elll 88 shown above
Option.
PV Work Term Contribution '" 90%.
Openlltlng Conditions
CsIculate Pressure option Depre8suring Time '" 60 minutes
14. Now hit Run to start the calculations followed by Stop after a second or two. 15. Access the Depressuring sub-flowsheet (right-click it and choose Open PFD) and set the reliefvalve closing and reseating pressures as in the table above. Our objective now is to size a reliefvalve so that under the Fire Case scenario the pressure in the vessel never exceeds the MAAP 12.10 barg. At present Aspen HYSYS cannot do this automatically. Hence the valve orifice diameter has to be manually changed until the pressure objective is met
Setting Up aStrip Chart To help see what is happening with the system it is useful to create a simplified new strip chart to record only certain variable values and use this to monitor the pressure changes. 16. On the Design tab, Config. Strip Charts page, press Create Plot and create a strip chart with the following details: On the Contlg. Strtp ChMta page the variables shown will be for BOTH utilities in the case. The @TPL# in the variable name shows the Tag of the depl'fl8lluring su bfIow8heet. Take care to select the correct variable.' You will need to add the variables for the relief valve to the list before you can plot them.
Pal'ilrneW
SeUing.
LoggwName
PSV Fire C88e
Active V"'ables
Vapour stream Flow rate V888e1 vapour temperature V888e1 Pl'fl8lIure Vessel Liquid Mass Relief Valve % Open Velva Full Open Pressure Vslva Set PI'fl8lIure Velva Closing Pressure
17. Having selected the active variables, click View Strip Chart then right-click the graph and select Graph Control Here you can set the colours and style ofthe curves to make the plot more understandable. 18. On the Graph Control window press Set-up Logger to set the sampling Interval to 0.50 sec and the number of samples to 8000, this will ensure the plot captures all the relevant data.
Finding the Optimum PSV Size You can now position the windows so you can see the Strip chart and also the Design tab Valve Parameten page. ThiB will allow you to change the valve orifice diameter and then monitor the pressure pro:lile in the vessel.
31
32
Dynamic Depressuring
19. Find the orifice size required so that the maximum pressure in the vessel is less than 12.10 barg (the PSV fully open pressure), but the valve is still as small as possible. [Valves with the following orifice diameters are available: 10 mm, 12 mm, 14 mm, 16 mm] 20. When the best valve size is found, complete the table below: Result
Value
Orifice diameter (mm) Max flow through valve (kg/hr) Max opening of PSV (%) Fluid temperature at peak flow (e) Max pressure reached (barg) Time for valve to start opening (sees) Time to reach max opening (mins) Time till valve shuts (mins)
I ----------_...... Save your case!
32
Dynamic Depressuring
33
Additional Exercises Switch on the Detailed Heat Loss model; does this make a significant difference to the results in this case?
What happens if the valve is massively oversized (e.g. 100 mm diameter)?
What is the Q input into the vessel under the fire case?
Now open the Blowdown utility you used at the start of the workshop. (VlOQ-BD) •
Apply that same Q to the P Blowdown depressuring utility. [To do this use the 'Use Spreadsheet' heat flux option and modify the spreadsheet to specify a fixed heat in flow]
•
For the Blowdown case, use the 'Use Spreadsheet' vapour valve option to specify a fixed valve flow rate of 500 kg/hr starting at 1 minute into the depressuring run. [Before switching to the 'Use Spreadsheet' option you need to initialise the spreadsheet by running with one of the valve models that uses the spreadsheet, for example, General]
33
34
Dynamic Depressuring
•
34
Compressor and Pump Curves
Compressor and Pump Curves
© 2005 AspenTech -All Rights reserved. EA1000.04.07 09_CompressorAndPumpCurves.doc
1
2
2
Compressor and Pump Curves
Compressor and Pump Curves
3
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 Aspen HYSYS to accurately simulate actual plant equipment.
Learning Objectives Once you have completed this module, you will be able to: •
Specify and attach head and efficiency curves to compressors
•
Use single and multiple curves to model compressors
•
Attach head curves to pumps
•
Accurately model existing plant equipment with Aspen HYSYS
Prerequisites Before beginning this module, you should have a reasonable understanding ofthe Aspen HYSYS program, and be familiar with adding and basic configuration of Pumps and Compressors.
3
4
CamprullDf and Pump Curv••
Compressor Curves
Doo't Y«Irry if you haven't buil the CBBe mentioned. The
"ADV6_AdvancedRecycles _Soln.h8C'" file contains this
Using compressor curves in your Aspen HYSYS simula1im allows you to accurately model existing plant equipment. You C8Il determine if an existing compressor is able to meet the specifications of your process. Using compressor curves allows Aspen HYSYS to calculate heads mel efficiencies that are dependant on the flow rate. If the flow rate through the compressor is known to be constant. a single prellSUl'e rise and efficiency can be supplied. It: however, the flow rate is expected to change, using compressor curves will allow Aspen HYSYS to calculate new heads and efficiencies based on the current flow mte.
CaBB.
This results in greater accuracy in the simulation, and allows Aspen HYSYS to more closely model actual plllllt equipment.
From veman 3.4 onwards Aspen HYSYS allows multiple sets of curves to be added for different stream Molecular Weights. In this workshop only a single set ofcurves will be used.
Workshop In this workshop, you will add a set of curves to the K-stage 2 compressor in the Advanced Recycle Module simulation. 1.
On the Parameter. page, ensure that the Polytropic and Adiabatic Efficiency boxes both read qmpty>.
These values must read because the efficiencies will be calculated from the compressor curves, and defining the same value in two places will always result in a
consistency error.
4
Camp....aar and Pump CurYU
"
!I
,~
K-Stage 2 @TPl2
Efficiency
()e~ign
Adiabatic Efficienc Polytropic Efficiency
1 Con n,edions Parameters
_ll~,'
Links
Use rVariables Notes
------...
Duty
I
[0 per aling Mod ~ ~entrifu9al
•
Curv, Input O p t i o r r - - - - - - - - - - - , (: oS.ingle Curve r Mulliple,MVJ Curves
r,
Beciprocating ._-------'
r
Multiple IGV Curves
'Design
Delete
2.
II
W On
Unknown Duly
r
-!gn~red
Ignore the Adjlllt that con1rols the outlet pressure ofthe 1st stage (Alli-I).
3. On the Curvet page (on the RatIng tab), select the Adiabatic radio button in the EMdeney group. Click. the Add Carve button, and enter the data 88 shown here: Figure 2 ~ 5000 rpm for Ie-Stage 2 @TPL2
.curve S e l e c t i o l ' l r - - - - - - - - - - - - - - - - - - - - - , Make sure you use lt1e
carrect: unil8 for lt1e variables. and lt1ai you 8et the unils bet. . entering the curve data.
Harne 15000 rpm
Flow Units
15000000) rpm 300.00 550,00 850.00 1200.00
1m 4: Efficienc
Head
Flo"\'
3100.00
nOD
2950,00 2800,00
1750.00
900,00
76.00 78.00 71.00 66.00 49.00
.
'5:1100
ElEl~e
Head Units
IACT-,m3lh
Seleted
235000 1550.00
Erase
811
5
I
CDmpruaDf and Pump Curves
Instead of manually ~ing the data you can paste it in from the Excel file Compreuor Data-xii. Before the compressor curve window will accept a table of pasted data it must Drst 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 ofrows. Figure 3 ~ 7000 rpm for K-'Sti'lge 2 @TPL2
.curve S e l e c t i o n s - - - - - - - - - - - - - - - - - - - - ,
I
Flow Units ACT_m3/h
Hame 17000 rpm
I
u
Spee,g 170000000 rpm '"
Flow
~.
% Efficiencji
Head
1300.00 1550.00 1350.00 220000 2550.00
4600.00 4500.00 4250.00 3750.00 2600.00
72.00 76.00 73.00 71.00 66.00
~empty>
~empl.v>
II
-
Heild Unjts ~
Erase Seleted
Erase 811
Figure .... ~ 9000 rpm for K-'Sti'lge 2 @TPL2
.curve S e l e c t i o n s - - - - - - - - - - - - - - - - - - - - ,
I
Flow Units ACT_m3/h
Hame 19000 rpm
I
Spee,g 190000000 rpm
Flow
% Efficiencji
Head
1950.00 2150.00 2500.00 2350.00 3150.00
5400.00 5250.00 5000.00 430000 3300.00
72.00 76.00 73.00 71.00 66.00
~empty>
II
Erase Seleted
6
Head Unjts m
Erase 811
Compressor and Pump Curv..
7
FigureS ""~
11000 rpm for K-5tage 2@TPL2'
~urlle
Selection".---------------------.
!iame 111000 rpm
Flow Unils
IACT_m3/h
H8ild Unjts [~. ,
SpeeJ:j [11000,0000 rpm ~
Flo\';'
% EffiGienc~
Head
2800,00 3050,00 3350.00 370000 4150,00
6800,00 6650,00 6400.00 580000 4700,00
66.00
,
lJ
72.00 76.00 78.00
nOD
" Erase Seleled
4. Activate the individual curves on the Curves page and ensure that the Enable Curves box is checked. The pressme downstream mE-Stage 2 is fixed at 70 bar, so in this case the calculated variable on the compressor is the speed. As an alternative, the speed could be specified and the downstream pressure calculated.
7
8
Compressor and Pump CUrvN
S.
~
Click the Plot Curves button. A graphical view ofthe curves and. operating point is shown.
Compressor [urve" Profiles - K-St"ge 2 @TPl2;". Piol ryp_------,'I
Head CUllles
(0'. I;lead
,em y-----,----,------r----...------,--,---,-----,----,
~
.. £OXJr;....
•
OpU~lr(I
e=:J t--+_--+---+--+----t--t--+--,=:-+';;;em=~ ::i
=t--+_--+---+--+"'-~"'=.,j~-t--+.¢.
). ...
r
Efficiency
Curver--------, I Pdnl
'+
.a:o t--+_--+---+--'+-=----t--+.I---+--+_-__1 D:ijt---"'b-=+--+--+--'-t--~.___+--+---1
=t--+_--+----"-,,-+--+----t--t------''r--+_-__1
Cl,lrve Name 5000 rpm 10 7000 rpm fo 8000 rpm fo 11000 rpm f
Plol
G'J ~
G3
R:
lemt--+_--+---+-"rr-+----t--t--+-~+_-__1
oa:m~~.,j,."~.".,.~ . ....~'"""'~.......~~......~,j,-,,.~~""""'...\ O.c:o::J:D:)
!o)D::O
10Cl:100
W ~hQI'J Operaling PI.
Opendlng
Point
I --------------Save your casel
8
Camp.....,. and Pump Curve.
•
Pump Curves AJJ with compressor curves, pmnp curves are used to allow Aspen HYSYS to accurately model existing pmnpl. Pwnp curves allow the pre!l8Ul'e riRe II.CI'08S the pump to be dependent on the flow rate of liquid From version 2004 onwards Aspen HYSYS gives the choice of two forms ofpump
curves: •
Head curves using coefficients in a polynomial equation, this option is retained for legacy reasons
•
Head and Efficiency VB. Flow data as in the compressor, genera11ythis option is preferable
Since Head and Efficiency VB. Flow data has already been entered into the Compressor, pump curve coefficients will be entered in this workshop. With this form ofcurves the coefficients of 811. equation, up to the fifth order, are ent«ed into Aspen HYSYS rather than the actual data points. Add a pump to the main flowsheet with the following information: Figure 7 Q LPG EHport Pump
tl ame ILPG E,pori Pump
Design
Connections O~lIel
Parameters
IEiporl LPG
Curves
Links User Variables Notes Energy
lil-LPG Design
Delele
II
Unknown Duly
9
10
CamprullDf and Pump Curv••
6.
Ensure the AdiYate Curves box is ticked.
Flgu~8 ;::- LPG EHport Pump Design
I Connections Parameters
The coefficients CII1 be obtained from a spreadsheet program capable of nonlinear regression, such lIS Excel or may be supplied by the pump's menufacturer.
Curves
Links User Variables
:;. Pump Curve Equatio
W
Units for Head
1500 -2.000 -5.000e-003 00000 00000 00000
Coefficient A
Coefficient B ~efficientC Coefficient'D C~efficient' E Co~fficient' F
Notes
1m
iJ
Fjow Basis
IAct Vol Flow
iJ
Units for Flow
rm31h
iJ
A
Head = A + 8"Flow + C"Flow 2 A
A
A
+ D"Flow 3 + E"Flow 4 + F"Flow 5 (This curve is used in steady state only. Characteristic curves are now also handled in Steady State. It is recommended that the characteristic curves be used instead of coefficients.)
Design Delete
Dynamics
• • • • • • • • • • • • • • • • • • • • • • wOn
r
jgnored
I
---------------Save your casel
10
Using Neural Networks in Aspen HYSYS
Using Neural Networks in Aspen HYSYS
© 2005 AspenTech -All Rights reserved. EA1000.04.07 10_UsingNeuralNetworksl nAspenHYSYS.doc
1
2
2
Using Neural Networks in Aspen HYSYS
Using Neural Networks in Aspen HYSYS
3
Introduction Aspen HYSYS includes a Neural Network calculation tool that can be used to approximate part (or all) of an Aspen HYSYS model. It can be trained to replace either the first principles calculations usually done by Aspen HYSYS, or to simulate a unit operation that cannot be modelled 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 Aspen HYSYS' Neural Network capability will be used to replace the standard 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 ofthis module, you will be able to: •
Use the Parametric Utility to incorporate a Neural Network into an Aspen 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 Aspen HYSYS interface and be able to add and configure streams, operations, utilities, and case studies.
3
4
Using Neural Networks in Aspen HYSYS
Neural Networks What is a Neural Network? A Neural Network (strictly an 'Artificial Neural Network' as opposed to a 'Biological Neural Network') is a mathematical system with a structure based on that of the brains of mammals. The Artificial Neural Network is split into many basic elements (equivalent to neurons in biological systems), which are linked by synapses. Neural Networks model the relationship between input and output data. They are particularly suited to the kind ofproblems that are too complex for traditional algorithm based modelling techniques, for example, pattern recognition and data forecasting. There are a number of types ofNeural Networks; Aspen HYSYS uses a Multi-Layer Perceptron (MLP) type model. The Neural Network is trained through a learning process where synaptic connections between neurons are constructed and weighted. The Neural Network is trained in an iterative manner. A set of input data and desired output data is repeatedly supplied and based on the errors between the Neural Network calculated outputs and the desired outputs, the connections are adjusted for the next iteration.
Neural Networks in Aspen HYSYS The Aspen HYSYS Neural Network implementation allows part (or all) of the Aspen HYSYS tlowsheet to be approximated by a Neural Network solver. The Neural Network can either be trained with the results from the standard (first principles) solver, or can be supplied with tabular training data. In this way, it can be used as a 'black box' calculation engine based on experimental or plant data. There are two parts to the Aspen HYSYS Neural Network implementation:
4
•
Parametric Utility. This is where the Neural Network is configured, and trained.
•
Parametric Unit Operation (Optional). This allows the Neural Network to appear as a unit operation on the tlowsheet, and is typically used when taking a 'black box' approach.
Process Overview
E>
M.@d R.1ng Un~ (Conden.@r Duty)
Vanabl@~
1,622 e-ttlD 6 kJIh
E>
~
3683 kglh
g~~"" tit1Rte~fFiFi(~r----:l~======:;====~~ -=1
Ga~
",,"
\IS
EKpander
-
o~t
I
I
I
I
~
~
Lo=-JU='L ,
I
I>d--
I~
I
ti==. . L_
F•• d Gas
C kP3 kgmol.1h
feed GilS
- :;-t------>fi\
111
~
MIX-100
K-1D1
~"i\"
Tro~
U uid
q
3
P-1DD
camp
Bipon
•
LPG
Pump Ollt
Purnp OutV
Copy of Reboiler using Internal streams
St@am In 2
K-102
~ New E'
Pm1rt
kl:allysis
I
I
1~it1D2 Export GilS Compressor
&1DI
94.64 C
Product Elt-
To single o>tage
OK-1DI
Pump
'
Export Gas
J:a+----------,12
4I)OD kPa Pre.. u", Molar Flow " " 3~.37 kgmolelh »
~
Recompressor
10
T@[email protected]:urE!
1P
L
Steam Ollt
... gil.
1
St@3m
CII
LNG·l00
88·4
LPG RoMvery
Simplifiect Turbo E:
~
j
"III d-.. . l' ~1 V'":m"o
....
F•• d
........------' Ill. Un~
Q.100
157 0 klfll
$
Gas S ET-~
, • 1--
L
Co~y of Re oll@!r
_
~~ar
.:.
R.boil" Out
_1'=
_ Steps for using Neural Networks in Aspen HYSYS The procedure fur using Neural Networks in Aspen HYSYS is as follows: 1. Select scope - determine which streams/operations the Neural Network will calculate. 2.
Select and configure input and output variables.
3. Supply training data - either tabular data or data generated by the normal Aspen HYSYS solver. 4.
Train the Neural Network.
5. Validate the Neural Network. This is opticmal, but recommended.
Workshop Process Description In this module, Aspen HYSYS' Neural Network capability will be used to replace the standard Aspen HYSYS solver fur 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-f1owsheets' and 'Spreadsheets and Case S1ndies' modules made to it Don't WDITY if yoo haven't built the Tulbo Expander plant
caBe. The file 'ADV5_ Spree.d8&C888Stud_Soln.hsc'
The main process variables that will be manipulated are the cooler outlet temperature (stream 2) and the Turbo Bxpander ootlet pressure (stream S).
contains this case.
If you have completed the Advanced Recycles module and have added the multistage compression sub-flowsheet to your Turbo Expander plant, it is a good idea to ignore the Adjust operations to reduce the calculation time.
6
Using Neural Networks in Aspen HYSYS
7
Adding the Parametric Utility From the Tools I Utilities menu, add a Parametric Utility. Name the utility 'Whole FS NN'.
2.
_p;iilfinM1@@LiS Name
_Iolxl
f//hole FS NN
~~l~sis
LPG RocoveI'y Mixed Aelrig Unl Elop.)!t Ga~ COOlPIl~~si.
~ ~
SET-2
~m
~
~~;5oJ Rebolel
-
E-100
[-101 Expat Gas K-100
Com~le
..:J
~-~2!
~ A~moveA!11 Se!t1cted:
,
(C
r
r
Ad,,~nced
I AGw~heoet
option mode
-= Configuration
I
In llnitnp.<:
Select Vall
1:
j Data j
Delete
Trainflg
I Vakialion
r
!9nmed
Setting the Scope The first step in configuring the Parametric utility is to select the scope (that is, how much of the flowsheet will be calculated using the Neural Network). In this case, the Neural Network will be applied to the whole flowsheet. 3.
On the Configuration tab, ensure Case (Main) is selected in the left list box. Click the Add AU button.
4.
Click Accept List.
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 ««<.
7
•
Ualng Neural NlltwDrka In Allpen HYSYS
Selecting and Configuring Variables The variables that the Neural Network will uae must now be configured. There are two important classes ofvariables:
A Validation tool is included
to check the qUality of the NBlJral Netwa1t calculations.
•
Manipulated
•
Observable
The Neural Network solver will respond to changes in the Manipulated variables and calculate new values for the Observable variables based on the supplied training data. The quality ofthe Observable values calculated by the Neural Network solver is dependent 00 the quality ofthe data used to train it A Neural Network model is only as good as its training data. Going outside the range ofthe Manipulated variables used for training can lead to large em:n. In the Turbo Expander calle the Manipulated variables are the temperature of s1ream 2 and the pressure of stream S. while the Observable variables are the properties of all the streams in the flowsheet.
Clicking and dragging between the two columns in the header can 8llpand the Name cdumn.
S.
On the SeIed Variables tab, generate a list of all pouible Manipulated and Observable variables by clicking the Build Fluhable StrelJllJ button.
6. With the Manipulated radio button selected, click the Un-8e1ect AU button. 7.
8.
In the Selected Mnr column check the items: •
S\PresSUTe
•
2\Temperature
Click the Remove Unle1eeted button to display only these two variables.
Now you need to set the range of manipulated variables fur training the Neural Network.
9. Change the Low and High limits as follows: Changing the Range
5\Preuure
20 to 40 bar
2\Temperature
-6S to-45 °C
pllnlmeter above the table aebl all the l...ow and High
velues to a given frectlon above and below the Initial
(Current) value.
8
10. Click the Aceept Configuration button.
Using Neural Networks in Aspen HYSYS
sa
The utility should now appear as follows: FllJu", 2 _ D x
r.AJI
r
r
DbieelFil1:!'
N~e
F'la\'ll5hl!o=ltri~
'S\F'renUlc
BuIdSI,e-b'"I'l:s.! A~lI'C'o'eAJI
I
2\T~~U'~T
rV~Filet
Seb;ted UV.. Lr.wfLml '=0(1)) ~ ~ 2(1))0000 '4~a(l))'i p r-----'6S00CO
I
+
1
I1;Illl"lM<>Je CarY~r~~"
r
~I
~"IIilIP~
1000.0000
10lOCOO 10l0c00
·"UJUU
-
Bt.iIdF'lach.zlU!.5I:1eYT1'
(;
H<11 L;ml
1"'k1lJalu~
-~
-
-
-
-
----
I
ill
Dd""
.....J:=-.
.-
.,
---.-
.
,
•
I
11. Choose the Ob.ervable radio button and review the variables that will be calculated by the Neural Network.
Generating a Training Dataset Now data must be generated to train the Neural Network. This involves supplying a set ofvalues for each ofthe Manipulated variables, then nmning Aspen HYSYS to calculate the values ofthe observable variables fur each ofthese sets.
Values fur the Manipulated variables can either be supplied manually, read ftom a • .cav file, or may be generated using the Build Random dataset tool.
When supplying training data, It Is Iq:lOrtant to
provide e good representation of the region in which the Neural Network will be operating.
By default, the neural network output fll. go In
12. On the Data tab eI1lJ111'e the Create 81 New option is selected and supply the Output File Head Name 'TurboExpander'. 13. Set the Size ofthe ManIpulated Data Set to 32. This will give the Neural Network m
the \Suppa1subdirecfory of the Aspen HYSYS installation. If required specify a d ifferant directory
15. Click the Generate Data button. Aspen HYSYS will run and IiOlve for each of the datasets supplied and generate all the resulting 1raining data.
name.
If Aspen HYSYS displays any column errors or messages about empty wIues in the dataset simply OK them. Aspen HYSYS will offer to remove any empty 1raining data before training the Neural Network.
For more complicated systems, the generation of training data can take a significant length of time. In this case, it should take less than a minute depending on computer speed.
9
_ljMtIIIIiIiI
_
Training the Neural Network The next step is to train the Neural Network using the training dataset just generated. 16. Select the TraiDing 1ab and click the InitJRelet button. The InltlRest button should be used before the Neural Networtc: Is !reined for the fil'8t time end whenever it needs to be retral neel.
Ifprompted, choose the option to remove empty values from the dataset.
17. Click the Train button to train the Neural Network with the da1a generated. In this case, the training process should only take a few seconds. When it has
completed, you can view a comparison between the output of the parametric utility and the calculations from .Aspen HYSYS by using the View Table and VIew Graph buttons and choosing the Output radio button.
Validating the Neural Network Results The final step before using the Neural Network is to validate the results. In the validation process, a new set of input data is given to both the Aspen HYSYS model and the Neural Network and the relJU1ts are compared. 18. Select the Validation tab. Click: the Validation Setup button to configure the validation nDlS. Select OK to accept the defaults.
VBlidaiion is optional but recommended.
19. Click: the PM Run. buttons to run the Parametric model (that is, Neural Network). This nms quickly so it may seem that nothing happened. But if you look at the Trace window (the bottom. right white panel). it shows that the PM calculation was successful. 20. Click: the Aspen HYSYS RUDI button to TIm the traditional Aspen HYSYS model with the validation input The Trace window displays a comparison ofthe time taken by the Parametric utility and the standard Aspen HYSYS solver. Figure 3 Number of data set qenerated:
Hysys
5
A
successfully perfor~ed 15.41900 seconds
calcula~ion
Io~al Dura~ion
Hysys to PH
=
ti~e
ra~io
770.95000
21. By clicking the VIew Graph or VIew Table buttons, the results from the Aspcm HYSYS model can be compared to those from the Neural Network model. In this case, the emr should be negligible for all of the variables.
10
Embed the Neural Network into the Aspen HYSYS Flowsheet Now the Parametric utility is ready to use to replace the main Aspen HYSYS solver. 22. Return to the Configuration tab and check the Embedded into HYSYS FlOWlheet checkbox. If the Build Slreems button
Figura 4
wes clicked Instead cI the Build Fleshable Streems button, then at this point Aspen HYSYS will display warning mesBBg88 as it removes ell observed variables thai would lead to
,Calculation Options---------,
P
Embedded inlo
r
Advanced oplion mode
HYSYs Flowsheel
an over speclllcation.
-= Configuration J
II
Delete
Select Variables
~
l~
A Trace window message ('Using Whole FS NN for calculation') will appear. Aspen HYSYS is now using the Neural Network instead ofthe n.o:rmal solver.
Experiment with the Model
Find the CBSe study on the
Case Studies tab d the Datebook (Tools I Datebook menu).
To compare the speed ofthe Neural Network with that ofthe standard solver a Case Study will be used. Use the same Case Study that was set up in the Spreadsheets and Case Studies module (called 'Operating Analysis'). This varies the pressure and temperature over the same range as the Neural Network is trained for, and records the value ofthe Overall Profit from the spreadsheet. 1. With the Neural Network activated, start the Case Study. Keep track ofhow long it takes to run. 2.
Switch off the Neural Network solver using the Embedded. into Alpen HYSYS FlOWlheet checkbox, and rerun the case study.
11
12
Using Neural Networks in Aspen HYSYS
Other Possible Investigations Try changing one of the manipulated variables outside the training range. What happens?
If the Neural Network is switched on, what happens when a variable, which is not a manipulated variable, is changed? For example, change the temperature or composition ofthe Feed Gas stream. With the Neural Network switched on, try setting an unfeasible value in one of the streams (for example, set 55 bar for stream 5's pressure). Compare the response of the model when the Neural Network is enabled and disabled.
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 Aspen 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, 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.
12
Exercise Using the Parametric Unit Operation The Parametric Unit Operation aIlOWli the Neural Network to appear as a unit operatian an the flowsheet, and is typically used when taking a 'black box' approach to modelling an opcratim. In this case, the Neural Network can be trained with tabular dam from lab experiments or plant measurements, so a system can be represented that may not necessarily be able to be modelled using a first principles approach.
" is also possible to link the PlI"8metric Unit Operation to 8 Parametric Utility.
The ahortcut key for tha FI0W8heet-Add Operation menu ia F12.
In this exercise. a Parametric Unit Operatian will be used to model an operatian based on supplied mbular dam.
1.
Open the supplied.Aspen HYSYS case Parametric Unit Op Starter.1Ise..
2.
Add a Parametric Unit Operation. (The Parametric mrit operation does not appear on the object palette so it must be added using the Flowtheet-Add Operation mella) The Parametric Unit Operation is in the LogIcal. category.
:. Unitop!i - Ca!ie (Main) Cale.Qorie~--------,
r. r. r: r.
r r r r r
Piping Equipment Solids Handling Reactors Prebuilt Columns
r r.
Short Cut Columns Sub-Flowsheets Logicals Extensions
r o r
User Ops Electrolyte Equipment Upstream Dps
r
3.
AlIlJnit 0 ps Vessels Heat Transfer Equipment Rotating Equipment
rA.'!:ailable Unit Operations--_ I
Add ...::J ---.;----.;
Cause And Effect Matrix Digital Pt ' DMC Controller ' ,G Dry basis stream extension ;~ External Data Linker -;~ MPC Controller "m
J;;ancel
PID Controller Ratio Controller RecJ!c1e ,Selector Block Set Split Range Controller Spreadsheet Stream Cutter Surge Controller Transfer Function Block _ Virtual Stream Extn v1.1.3 ....
-
Click Add.
13
_ljMtIIIIiIiI
_ me
Select the Inputs from a data option and choose the Column data format option. Set the Number of Inputs to 3 and the Number of Outputs to 3 as
4.
shown.
~ PMU-IOO
~
!!.ame: Del:ign
IPMU-100
input T.\'pe--------::===~=-__=_____::___=__---===i i !.lM utilily dala Inpul Unil. From Dala File: inputs from a dal
CQnneclion~
I
r-
Setup
Data Ei Ie Ferma RoV'i ~ CQlumn Number of Inpul,>: 3 Lr fee p eHi sting str eam setu p
Noles
r
I
i?ata File Selec~" ~ata File:
I ------------"
II
Modeled Shearn, Fori npul•. 0 ulpul_ 11'1 ul Str~am$
oulnut SIleams
';!iew Dala
r
Nate that C. kPa and kg/h
are the units UBed in the 81 unit set, lIS selectec1ln the Input UnilB From Data File drop-down list.
ignored
S.
Click the Brmne button to navigate to the Parametrle Unit Op Data.c:1V data file and select it The file :filter needs to be changed to show cav file•. (Ignore 1he warning message about the lack of attached stream•.)
6.
.A1tach the Fuel and EIhaust streams as Input and Output respectively.
The ·Parametric Unit Op Data.csv' data :file contains the following data (in a comma separated value format). The table below shows the wriables that are being read by Aspen HYSYS.
Input Temperature (C)
Input Preuure (kPa)
Input M... Flow (kg/h)
Tllmperature (C)
Output Preuure (kPa)
Output Mau Flow (kgIh)
15
200
100
20
175
100
Output
18
225
125
23
190
125
20
250
150
27
210
150
22
275
175
32
225
175
24-
SOO
200
37
240
200
26
325
225
45
250
22S
28
350
250
52
260
250
By clicking the View Data button, the contents of the data :file can be displayed.
14
Using Neul1Il Networks In AlI~n HYSYS
7.
15
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 Exh811St Temperature, PrellBUl'e, and Mass Flow.
The red cross in the Bad Date column means the deta is OK. If the data is bed, a green checkmark appean.
N~btllJTlt~Pairt' v",1Jo
P V~l1
ldo;r~
Lu.V...,
I
,Y""
80:1D•• CuoolY""
1'l'JP
1r0i-T9 P.rSiJI< TrmP;j
r
8.
~
T6dnn.l ~a.·1
On the Training tab, click the Train button.
PMU-IOO U~ility
--.
Training l , I a r i a b l e ; : - - - - - - - - - - - - - - - - - - - - - - - - - - - - ,
Connecled Unit 0 peraliom:
11 UnilO ps
Name . PMU-100\PMUData PMU-100\PMUData PMU-100\PMUData
Selected
Low Value Hi hValue
15.00
2&.00
2000 2.778e'0(
3500 6.944e'0(
S~ream* are not lully *pecilied
C
ignored
15
16
Using Neural Networks in Aspen HYSYS
9.
Go to the WorkSheet tab and specify the Fuel stream as follows: Temperature
35 °C
Pressure
300 kPa
Mass flow rate
200 kg/hr
The unit operation should now solve fully. 10. Experiment with changing the Temperature, Pressure, and flow both inside and outside the range of the training data.
16
Modelling Real Separators in Aspen HYSYS
Modelling Real Separators in Aspen HYSYS
© 2005 AspenTech -All Rights reserved. EA1000.04.07 11_ModellingReaISeparators.doc
1
2
2
Modelling Real Separators in Aspen HYSYS
Modelling Real Separators in Aspen HYSYS
3
Introduction The Aspen HYSYS Separator unit operation nonnally asswnes perfect phase separation, but it can also be configured to model imperfect separation by using the Real Separator capabilities. The real separator offers the user a nwnber 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 Aspen 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 Aspen HYSYS interface and be able to add and configure streams, operations, utilities, and case studies.
3
4
Modelling Real Separators in Aspen HYSYS
Modelling Separators Real World Considerations In real world separators, separation is not perfect: liquid can become entrained in the gas phase and each liquid phase may include entrained gas or entrained droplets of the other liquid phase. Recent years have seen increasing use ofvessel internals (for example, mesh pads, vane packs, weirs) to reduce the carryover of entrained liquids or gases.
Real Separators in Aspen HYSYS Carryover Option As with many other unit operations, Aspen HYSYS allows you to increase the fidelity of your separator model to account for non-ideal effects. Aspen HYSYS 3.2 introduced 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.
4
Modelling Real Separators in Aspen HYSYS
5
Dynamic Models of Real Separators The dynamic model of a separator must account for changing pressure and flow due to liquid levels, nozzle pressure drop, and heat effects. As such, vessel geometry, including internals and nozzle geometry, and heat loss parameters need to be specified. Modelling imperfect separation with the carryover option and a specifiable PV work term are also available. Level taps can also be set for monitoring the relative levels of the different liquid phases. All of these items can be set up via the Rating tab. Limitations of the carryover option: As droplet distribution is not a stream property, this information is not passed onto the product streams. While droplet distribution is not passed on, product streams containing carryover will contain multiple phases with the phase flow rates equal to that predicted by the carryover calculations.
Specifying Carryover The Aspen 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.
Calculating Carryover and Related Properties There are also three sets of correlations available to calculate phase dispersion and carryover. A detailed description of each method is given in the next section. All three follow the same basic calculation sequence: 1.
Calculate the initial phase dispersion based on the inlet feed. All three methods assume the dispersion follows a Rossin Rammler distribution.
2.
Calculate the carryover after the primary separation (gravity settling) of each phase in every other phase; specifically:
3.
•
Light Liquid entrained in Gas
•
Heavy Liquid entrained in Gas
•
Gas entrained in Light Liquid
•
Gas entrained in Heavy Liquid
•
Light Liquid entrained in Heavy Liquid
•
Heavy Liquid entrained in Light Liquid
Based on the exit dispersion from step 2, calculate the affect of any installed secondary separation device (for example, demister pad or vanes) on the liquid carryover into the vapour product. (This is not applicable to the Generic correlations.)
5
6
Modelling Real Separators in Aspen HYSYS
Correlation DetaiIs Three different correlation models are provided: Generic, Horizontal Vessel, and ProSeparator™.
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 horizontal3-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 3phase 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 and Other Calculations Secondary separations accomplished by exit devices (for example, 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, and Exit Device Sizing can also be calculated using one of the various Horizontal Vessel correlations.
6
Modelling Real Separators in Aspen HYSYS
7
Rossin Rammler Parameters Rossin Rammler distributions are defined by: F = exp(--d/dm 'f)
where: F = fraction of droplets larger than d
dIn is related to d95 x=RRindex
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")
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. Sub-calculations will not used in this workshop.
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 (that is, 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.
7
8
Modelling Real Sepilmora in Aspen HYSYS
l.....
:::J
o
0.. CO
>
"0 Q)
OJ
LL
o
o ~
I
>< ~
0...
(1)
--.J 0.. C 0(1)0
1-(1)0 8
lIadIIlllnll Real Separatars In Aapen HYSYS
•
Workshop Process Description In this workshop, a 3-phase Separator is used to separate an oilJwater/gas mixture.
Entrained liquids in the gas product have been identified as a potential process issue. The Aspen HYSYS Real Separator will be used to account fer liquid entminmc::nt in the
model. Carryover ofliquids can be troublesome, especially ifthe gas is then passed through a turbinelcmnpre!l8OI' 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 ofthe Turbo Expllllder plant constructed in the Process Modelling Using Aspen HYSYS course. Yau will begin building the case by creating a copy ofthe existing separator. This means that while c:xperimcDting with the parameters ofthe separator, the rest ofthe Turbo Expander plant (recycles, adjusts, etc.) does not have to solve each time. An exercise later will be to incorporate the rigorous separator into the full model.
Build an Ideal Separator 1. Open the two-stage compression flowsheet ofthe Turbo Expander plant case.
2. Create a material stream called To LP Sep Clone. Don't worry if)'OU have nel built the Turbo expander plant Case.
3. Double-click the To LP Sep Clone s1ream.
The file ADV6_
4.
The stream property view appears. Click the Define from Other Stream button.
contains this CBle
5.
In the Available Streams list, select To LP Sep.
6.
In the Copy Stream Conditions group, check all the available conditions and click OK.
AdvancedRecycI__Soln.hsc
7.
Create a lrtream called Water, and specify its temperature and prellSUl'e to be the
same as To LP Sep Clone with a flow rate of4000 kglh. 8. Add a Minr and provide the following information: In this eIIll...
En......
Connection.
Name
MIX-i00
Inlet streams
To LP Ssp C10ns Water
Outlet stream
Feed
Param.....
Automatic Pressure Assignment
Set Outlet to Lowest Inlet
9
10
Modelling Real Separators in Aspen HYSYS
9.
Add a 3-phase Separator and specify it with the following infonnation: In this cell ...
Enter••.
Connections Name
V-101
Inlet stream
Feed
Vapour stream
Vapour
Light Liquid stream
LLiquid
Heavy Liquid stream
HLiquid
10. Open the separator unit operation and select the Worksheet tab. What is the vapour fraction and molarflow ofthe vapour product stream? Vapour fraction.
_
Light Liquidflow.
_
Heavy Liquid flow
Add Carryover Effects Let us say that we know (from a plant mass balance or as a design asswnption) that approximately 800 kglh of liquid is entrained in the vapour stream. How do we specify this in our model and ensure an accurate mass balance? 11. Select the Rating tab. Click the C.Over Setup page to bring up the carryover models, and choose Product Basis as the active model. 12. Enter the entrainment data. Select Specification By: Flow and choose Basis = Mass. Enter 800 kglh for Light liquid in gas. Figure 1 ~
Y-IOI @TPL2
Rating Sizing
Heat Loss
c ..,yQVeI M o d e , I - - - - - - - - - - - - - - - - - - - ,
r
Mane
Spedicatioo 8y
r
feed 8asis
r
Fraction
ee
Level Taps
Fk>w
BaSIS
F10w In Product IknJhl
Options
8000
Liahlliauidno4S Heavy liquid in ~s Gas in Iighlliquid Heavy liquid in ight liquid Gas in heavy liquid Light liquid n heavy 'quid
C. 0 ver Selup C.O",er Resub
I Ilola"
00000 OOCXXJ O(J)(J() O(JJ(J()
oOCXXJ
rUse 0.0 as ptoduct spec if phase feed now is zero
r
j;;a"y over 10 zero fI"", sllearns
r
Use PH flash 101 ploduct st,eams
=~~Rating Delete
10
I~~~~~~~~~~~•••••••• r
!gno
lIadIIlllng Real Separatars In Aapen HYSYS
11
13. Examine the product streams and the C.Over RelUltl page and compare to the ideal separation case. WI..., Is 1M WlJNlIUftwdioll oftlu wrpolU pnHllId 1INII1II7
_
Using the Carryover Correlations As an alterna1:ive to specifying the carryover, we can use correlations to predict the carryover: 1.
Return to the c.Over Setup page and change the model selection to Correlation Bued. For steps 2 - 4 select the appropriate radio button.
2.
Correlation Setup (radio button):
The setup and Results views will be different depending on which ccrreIetlon Is used. R.efer to page 8 for a detailed description of each ccrreIaiion and ilB required
a)
Select Overall Correlation and choose the ''ProSeparatcr'' correlation.
b)
Click. the View Correlation button to enter inlet and separation parameters.
In this case, the Inlet setup page can be left as is. The ProSeparator correlations will calculate the inlet dispmrion without the need for further information.
plI'IImetera.
Since we do not have an exit device, we need to set this for the ProSeparatar correlation: select the Vap. Edt Dmee page; select Mesh Pad; enter thic1mess =0.0.
Close the View Correlation window. 3.
Dimensions Setup (radio button): Enter the veue1 dimensions asleugth 8.0 m. diameter 3.0 In, light liquid levell.S In.
Figure 2
V_e1 dimensions can also be entered on the Sizing page d the R.etlng tab. Date on these two pages is linked.
~
I Y-1(11 @TPL2 ~'Y .o.ve,
Rating
r !:lone
Slmg
Model
r EroWct Baoit
r EeedBellt
(i'
tonelebon 8e.ed
r DP I NOZ2Ie Selup Correlation Seb4l r-Oinensions 5 e l u p - - - - - - - - - - - - - - - - ,
r
Heat loss
I..eveITaps 0_
VettelO,ientllCion Ve.tellen
C.Ov.. Setup C.Over Results
rv..-
8.001 3.001
barry over to zero ~ow streams
r
Ha.W..
I" Ha.80Ol
tOOl 2.667 '.500
I r
(." Horizollial
r
.use PH Rash fOf product s:trecms
=bi2!J~ Rating r;:-;::;::;:::;-T;:==-'F===========~ D.lolo
I
r
jgnQIed
11
12
Modelling Real Separators in Aspen 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 Figure 3 I Y-IUI @TPLZ
L.-
Car,yQve, M o d e , f - - - - - - - - - - - - - - - - - - - - - - - - ,
Rating
r
,Mane
Heat Loss
r
[OIIe!alion Setup
LevefTaps
PreSSUfe Dmp I Nozze Set
Sizing
r
r
Eeed84sis
r
(:' ~or,e~ton B~sed
,Emduct 8asis
Dimensions Setup Active
PreSSUfe DfOP
Options C. 0 Vel' 5 elup
Inlet device DP method IVapow exil DP method
COVet ResuJts
Nozzle Diameter I Loc~oo
I Feed
Nozzle
~metef
0.2833 5.667 0.0000
m
Nozzle hoiahl m) Nozzle Iocalion'(ml
r
.caff~ over to zero flow sheMls
r
I
I
r r
View Method
I
• Distance hom feed end Of side 01 vessel Vooou LLiouid HLOOid
0.2833 5.667 600:1
0.2833 5.667
0.2833 00000
JJse PH flash IOf ploduct sheams
-=~~Rating
Deletel::'~~~~~~~::~• ••••••••_
r
!\jIlOfed
Analyze the Results There are several pages where useful results are displayed: •
Open the Worksbeet tab.
What is the vapourfraction in the Vapour stream?
•
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:
Figure 4 I
Dispersion Basis
,-
,
.Dispersion in Gas Product
raIIlDmmi!ji.ii!eiilliiiiiiiiiiiiiii[iJ::J I
12
Light LQuid
Heavy Liquid
Modelling Real Separators in Aspen HYSYS
13
We need to eliminate all droplets larger tlum 50 microns (0.05 mm). Do we need an exit device to do secondary separation?
Open the Rating tab and select the C.Over Setup page. Click the View Correlation button and open the Results tab.
Adding a Secondary Separation Device 1.
Open the Rating tab and select the C.Over Setup page.
2.
Click the View Correlation burton and open the Setup tab.
3.
Select the Vap. Exit Device page; select Mesh Pad and enter a thickness of 150.0mm.
What effect does this have on the carryover?
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 dernister pad to remove the larger droplets.
4.
Increase the flow rate of the To LP Sep Clone stream by 25%.
5.
Select the C.Over Results page, and then click the View Dispersion Results button.
What is the Total Carryover with no mesh? With 150mm ofmesh?
What is the removal effICiency of50 micron droplets?
Based on this predicted dispersion, the engineer decides to install a thicker mesh pad. How would you suggest the engineer use Aspen HYSYS to determine the correct thickness? Perform the analysis yourself; how thick should the mesh pad be?
Now what is the vapourfraction ofthe Vapour product stream?
13
14
Modelling Real Separators in Aspen 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?
Carryover in Dynamic Models Please open sample case 'ADVll_Dynamic Real Separator.hsc'. This case is based on the one you have been working on, but dynamic specifications, controllers, and strip charts have been added as needed. Specifically, the following changes were made to the model: 1.
Valves were added to all boundary streams (for example, FeedO and VLV-lOO were connected to the Feed stream).
2.
Pressure-flow specifications were set on all boundary streams (you will find these specifications on the Dynamics tab of each boundary stream, for example, FeedO has a pressure specification of 30.05 kPa).
3.
Dynamic specifications were set on the separator. All dynamic specifications used in this example, or the separator, were already entered on the Rating tab.
4.
a)
Sizing and carry over data were left the same.
b)
Heat loss left at none
c)
Level taps and PV Work term options were not used
Strip charts were created for 2 sets of variables (open the Databook tabs titled Variables to see the list of variables and Stripcharts to view the strip chart configurations): The Vessel Conditions strip chart tracks vessel pressure, temperature, and liquid level. The Carry Over strip chart monitors liquid phase flow out ofthe vapour nozzle, as well as inlet flow rate to the vessel.
5.
14
Finally controllers were added to the alternate sample case called Controlled Dynamic Real Separator.hsc.
Modelling Real Separators in Aspen HYSYS
15
Demonstration 1.
Make sure the case'ADVll_Dynamic Real Separator.hsc' is open.
2.
Click 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 ofVLV-lOO to 25% open. Re-start the integrator. When the liquid carryover flow achieves a steady value stop the integrator.
6.
Change the position ofVLV-lOO 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 accountfor aU process conditions?
A thick pad creates more pressure drop; are there other mitigations to consider?
7.
Open 'ADVll_Dynamic Real Separator Controlled.hsc' and repeat the same exerCIse.
What effect does controUing the liquid level have?
15
16
16
Modelling Real Separators in Aspen HYSYS
Reactions
Reactions
© 2005 AspenTech -All Rights reserved. EA1000.04.07 12_Reactions.doc
1
2
2
Reactions
Reactions
3
Workshop In this module, you will simulate a Synthesis Gas Production facility. This will introduce you to the powerful reaction modelling capability of Aspen HYSYS. The production of synthesis gas is an important step in the production of ammonia. Synthesis gas is comprised of hydrogen and nitrogen at a molar ratio of3: 1. The main role ofthe synthesis gas plant is to convert natural gas, primarily methane, into hydrogen. 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: •
Simulate reactors and reactions in Aspen HYSYS
•
Use Set and Adjust Operations to modify an Aspen HYSYS simulation
Prerequisites Before beginning this module, you need to know how to: •
Navigate the PFD
•
Add Streams in the PFD or the Workbook
•
Add and connect Unit Operations
3
4
RMctlons
Reactions and Reactors There are five different react
ConvemOll - Given the stoichiometry of all the reactions occurring and the conversion ofthe base component, calculates the composition ofthe outlet
stream.
NatB that Kinetic, Kinetic (Rev Eqb), and LangmuirHlnshelwood reactions can be modeled in the CSTR. PFR and Separator.
•
Equilibrium - Determines the composition of the outlet stream given the stoichiometry of all reactions occurring and the value of the equilibriwn constant (or the temperature dependant param.etcI's that govern the equilibrimn constant) for each reaction.
•
Gibbs - Evaluates the equililrimn composition of the outlet stream by minimizing the total Gibbs :free energy of the efiluent mixture.
•
CSTR. -.Assumes that the reacur contents are completely mixed in computing the outlet stream conditions, given the stoichiometry for all the reactions that are occurring and the kinetic rate constant (or the tempc:ra1me dependence parameters for determining the kinetic constant) for each reaction.
•
PFR - Assumes that the reaction stream passes through the reactor in plug flow in computing the outlet stream composition, given the stoichiometry of all the reactions occmring and a kinetic rate constant for each reaction.
Note that the required input is different depending em. the type ofreactor that is chosen. The last two types (CSTR and PFR) must have kinetic rate constants (or the formula to determine the kinetic rate constant) as inputs, as well as the stoichiometry ofthe reactions. All of the reactor types, except for the Gibbs type, must have the reaction stoichiometry as inputs. The Tank, Separator, Three Phase Separator, and Column Unit Operations can also process reactions ifa reaction set is attached. The process for entering the reaction stoichiometry is discussed in this module, 8S is the process for adding reactor Unit Operations to an Aspen HYSYS simulation.
4
Process Overview
SynthesIs Gas Temper
ADJ-2 SPRDSHT-1
~
Temperature
Synthesis Gas Shifter
2 Feed SET-2 CombLlstor Shin Shifter 2
SET-1
Vessel Pressure Drop
SET-3 Combusto Feed
Reformer Steam
Gas
ADJ-1 Reformer Pressure Drop
CII
Combustor
00000
Spec % Conversion (Rxn-1)
4000
Spec % Conversion (Rxn-2)
3500
00000
kPa
Vessel Pressure Drop
% %
Spec % Conversion (Rxn-1)
3500
kPa
Spec % Conversion (Rxn-2)
6500
% %
Spec % Conversion (Rxn-3)
100,00
%
Building the Simulation The first step in simulating a synthesis gas plant is choosing an appropriate fluid package. We will be using the Peng Robinson (PR) BOS in 1his simulation. Add the following components to the simulation: Cf4 H2 O, CO, C
Adding the Reactions Reactions in Aspen HYSYS are added in a manner very similar to the method used to add components to the simulation: Click the Reactions tab in the Simulation Basis Manager view. Note that all of the Components are shown in the Rm Components list
1.
ROO EJ
• SImulalion BasIs Manager Rxn Componenls-
R~e~ac~ljo~n':===:;--
-:-;;;;;;;;;;::;l
Methane
Reaclion .s. el Global Rxn Sel
H20
CO C02 Oxygen Hydrogen Nitrogen
Copy Rx.!J. ..
Cop~
Sel. ..
Assoc. Fluid Pkgs Import Set ..
Export Set ..
III
8
Add ComQs...
A~d
10 FP
7
RaacHona
2.
Click the Add Rm button, and choose Converlion as the type from the displajed list. Enter the necessary information as shown:
Figure 2
Il!l!lOOI3
~ Convell.ion Reaction. RKn-1 Sloi chioro etfy In fu Comoonenl Methane H2O CO· Hydrogen HAdd Comp"
II MoleWeighl 16,043 I
~~' ~i
Stoich Coett
}f-.__.. _._-
2.016 I
-1,000 -lOOO 1000 3,000
I
I When entering the values for the Stolchlometer1c CosfficienlB, it is imporlant to remember that ·Products
I,n
8alance~rror
I
8lliance
-I
ReaCiion Heiif(25 CJl
0.00000 2'-'-10+05 kJ!k~mole
Stoichiometry Basis
are paaitive and ReactanIB are negaliw.·
Name !Rxn-1
Delele
3.
Move to the Basis tab and enter the information as shown:
Figure 3
I!!lIiII3
~ Conversion Reachon- RKn-1
Methane Overall
35.00 00000 00000 Conversion (%)
=
Co + C1"T + C2"r2
IT in Kelvin)
Delele
Harne !Rxn.1
7
•
R8acHons
4. Repeat Steps 2 and 3 for two more Conversion reactions. Use the following data:
Name
Ruction
CH. + 2H~
Rxn-2
~
CO:! +
Base Component
Co
Methene
65
Methane
100
4H z CH. + 20z ~ COa + 2HzO
Rxn-3
s.
Add an Equilibriwn reaction by selecting the reaction ~ as EquUibrium rather thAn Convenlon. Under the library tab, highlight the reaction with the form CO + H.20 ~ C~ + H.2. Click the Add library Rm button. This adds the reactim and all ofthe reaction'8 data to the simulation.
Adding the Reaction sets Once all four reactions are entered and defined, you can create reaction sets for each type ofreactor.
6. Still on the ReactiODl tab, click the Add Set button. Call the first set Reformer Rn Set, and add Rn-l and Rn-2. Reactions are added by highlighting the field in the Active Llat group and selecting the desired reactim from the drop-down list. The view should look like this after you are finished: Figura 4 ~OOI3
Reaction Sel. Reformel RKn Sel !Relormer Rxn Se~
tlame
Sellnlo Type
I:Sill
Only reactions cI the 8eme type cen be Included In 8 reaction set. For example, Equilibrium end Conversion reactions cannot be grouped into the same reaction eel:.
U
COnYer~
~
Active List Axn·1 Rxn-2
OK
.
~,-,
p:
~
r
Adv anced...
I
Bankin!1
(j neralions Altac~.ed.
Inactive Lisl
il 'I
Vie w Acti ve...
View Inaclive...
J
Make Inactive '2.
~; Make Active
I
7. Create two more reaction sets with the following in:furmati.m:
8
R8ac:llon Set Name
Active R. .c:llons
Combustor Rxn Set
Rxn-1, Rxn-2, Rxn-3
Shift Rxn Bel
Rxn-4
I I
Reactions
9
Attaching Reaction Sets to the Fluid Package After the three reaction sets have been created, they must be added to the current fluid package in order for Aspen HYSYS to use them. 1.
Highlight the desired Reaction Set and press Add to FP.
2.
Select the only available Fluid Package and press the Add Set to Fluid Package button.
3.
Repeat Steps I and 2 to add all three reaction sets (Reformer, Combustor, and Shift).
4.
If desired, you can save the Fluid Package with the attached reaction sets. This will allow you to use this Fluid Package in any number of Aspen HYSYS simulations.
Once all three reaction sets are added to the Fluid Package, you can enter the Simulation Environment and begin construction of the simulation.
Installing the Material Streams Create four new material streams with the following information: Name
Natural Gas
Reformer Steam
Air
Combustor Steam
Temp.,
370 (700)
250 (475)
16 (60)
250 (475)
Pressure, kPa (psia)
3500 (500)
Molar Flow, kgmolelhr (Ibmole/hr)
90 (200)
240 (520)
90 (200)
140 (300)
Molar Composition
100% - CH 4
100% - H2O
79% - N2 21% - O2
100% - H2O
°C (OF)
9
10
Ructions
Adding the Conversion Reactors Ccnwl'8ian ReackIr icon
The first reactor in the ~thesiB gas plant is the Reformer. This reactor will be modelled as a Conversion ReKtor.
1. From. the Object Palette. click Generl1 Reaetorl. Another palette appears with three reactoc types: Gtobll, Equilibrium, and Conversion. Select the Convenlon ReKtor. and enter it into the PFD. 2.
Name this reactor Reformer and attach Natural Gu and Reformer Steam 88 feeds. Name the vapour outlet Combustor Feed 8Dd the energy stream as Reformer Q. Even though the liquid product ftom this reactor will be zero, we still mUJtname the stream.. Name the liquid product stream as Reformer LP.
3.
On the PlII'8Dleten page, chOO8C the duty as BeatIDg.
4.
On the Details page of the ReactioDitab, select Reformer Rm Set as the reaction set This will automaticallyocmnect the proper reactions to this reactor.
General ReactDrB icon
5. Once the reaction set is attached, select the Conven1on.% radio button. Change the Co value for Rxn-l to be 40%, and fur Rxn-2 to 30%. 6.
On the Worlnbeet tab, enter a temperatore of 930 ·C (1700 .F) for the outlet stream Combustor Feed.
At this stage the reactor will not yet be fully solved.
The second reactor in a synthesiA gaA plant is the Combustor. The Combustor will be modelled as a Con'JCl'Sion :reactor and an Equilibrium reactor in series. This is because Conversion reactions and Equilibrium reactions C8IIIlot occur in reactors of the opposite type, that ill, conversion. reactions cannot be associated with equilibrium reactars, and vice versa.
10
R. .ctiona
7.
11
Add another Convenion Reutor with the fullowing data:
In Thia Cell...
Enter...
Nama
Combultor
FaedBlruma
Combustor Feed, Air. Combustor Steam
Vapour Praduct stream
MidCombuBt
Liquid PrDdud IItnIIm
Combu8tcr LP
Reaction 881
Combustor Rxn Set
Rxn-1 Convel1Jlon
35% (D8faun Value)
Rxn-2 Convel1Jlon
85% (Defaun Value)
Rxn-3 Convel1Jlon
100% (Default Value)
Adding the Set Operations Rec:a11 that we did not enter any prelJlUI'e8, except for the natural gas, when we added the material streams to the PFD. This is IK) that we could now add Set OpentiODI to the PFD to set the pre8lJUl'e8 of the remaining streams.
:N> Set Operation icon
1.
Select the Set OperaUon button from the Object Palette.
2.
Enter Reformer Steam Preuure as the Target Variable, and Natural Ga. 8S the Source Variable. This process links the Target Variable to the Source
Variable, so that iftbe Natural Gas Pressure were to change, the Reformer Steam Pressure pressure would match it. The completed view is shown here: Figure 5
I!lIiI El
• SET-1 Name
ISET.'
Targal Variabl~------------, Object [Reformer Sleam
Variable: IP,essLlIe
-=~-~======::;::::::::=====~)I Conneoclion*
Delete
r
[gnored
11
12
Ructions
On the PllI'8IDeten tab, set the Multiplier at 1 and the Offset at O. Far fbil operation we want a y=x (1:1) relationship. Amultiplicr of1 and an of&et of 0 will result in tbil t}'pe of relationship.
3.
Figure
e •
IIIi! Ei
SET -1
Pa!ameters--------------, 1.0000
Multiplier Ulfsel l
O.O[)[)OO kPa
Y = (1)"X. (OllkP ~I Y
Aspen HYSYS knows to uae the pr88sure YlIlue at
= Maleri..1Siream IReformer Steam]. Pre"ure
X - Malerid Stream (NaturJ Gas): Pressure
Natural Gas 88 the source
because 8 preasure \/lIlue W88
selected 81 the Target
VlI1abJe. Conned"",
!
Parameler~
r
Delete
[gnored
Repeat Steps 1, 2, and 3 with CombUJtor Steam Prenure, and Air Preuure 8S
4.
Target Variables, and Natural Gal as the Source Variable in both cases. The parameters will be 1 and 0 fur these Set operations, 8S well.
Adding the Shift Reactors AI. mentimed before, the Combustor i. to be modelled as a Convenion reactor followed by an Equilibrium reactor. The Shift Reactorl will also be modelled as Equilibrium Reacton. Therefore, a tol:II1 of three equililriwn react:anl must be added to the PFD. 1. Equilibrium Reactor icon
12
Add 811. Equilibrium Reactor with the following information:
In This Cell...
EnbIr...
Name
Combustor Shift
Feed 8tream
Mid Combust
Vapour Product stream
Shtft1 Feed
Liquid Product atream
Combustor Shin LP
~c:llon"
Shift Rxn Set
RaacHona
2.
Remember: Set temperature valuBB on the
Work Sheet page.
Enter another Equilibrium Reactor with the following information:
In This cell...
Enter...
Name
ShlftEl' 1
F_danam
Shift1 Feed
Vapour Product ......m
Shift2 Feed
Liquid Product a1re&m
ShlftEl' 1 LP
Energy stream
Shlft1 Q
Duty
Cooling
Shift2 Feed Temperatun
~C(8500F)
Reactlon8et
Shift Rxn Set
3.
13
Enter the third Equilibrium Reactor with the following information:
In This cell...
Enter...
Name
ShiftEl' 2
F_danam
Shift2 Feed
Vapour Product ......m
Synthesis Gas
Liquid Product a1re&m
ShlftEl' 2 LP
Energy stream
ShIft2Q
Duty
Cooling
Synthesis Gas Temperftif8
400"C (7500F)
Reactlon8et
Shift Rxn Set
Save your case! -------_ ......I
13
~cdon.
14
Adding the Adjust Operations In order to control the tanperature of the product stream leaving the Combustor (the second Conversion reactor), the flow mte of steam to this reactor is con1rolled. It is desired to have an outlet temperature :from the :first shift reactor of 930l>C (17001>F). The steam flow can be adjusted manually until the desired temperature is achieved; however, thi. takes a lot of time and will not be automatica1lyupdated ifsamething were to change. Aspen HYSYS contains an adjust fimction that instructs the solver to adjust one variable until the desired condition is met.
1.
Select the Adjust Operadon button from the Object Palette and add it to the
PFD. Enter the information as shown:
2.
Figun 7 •
1100 Ef
ADJ -1
Connections , Connections
Adjust !i3me
IADJ .,'
AdjudedVariable-------------=1
Note.
Select V~J.
SpecilieJ:! Target Value F30.0C
Del'le
14
SI§rl
r
jgnored
R..cdonl
16
3. On the Parameters tab, CIltcr the infurmatian 8S shown below. The step size in field units will be 44.092 IbmoleJh. Figuree .... 1iI£J
.. ADJ-' Solyin!) Paramelers---------------,
Paramelers
r
Parameters
Simull31eous Solution
Melhod Toleranee Slep Si2e Minimum [Optional] M",imum [Or>til>nal) Ma,imum Ilerations
Coe-onl
0.10000 C
20.000 kgmole/h 0.00000 kgmole/h
Sim b.dj fA anager
r "=" Connecli)ns n 4.
You don't hllV8 to be on the Monitor pege to start: the AdJUlt Opel'8llon, but It 8h~
Delete
Qplimi2er C"ntrolled
lliililiiiiiiiiiililiiiiiili
Parameters
_ r
jgnOled
Move to the Monitor tab and click the Start button. Aspen HYSYS will adjust the steam flow rate \mtil the desired condition iB met.
A second Adjust Operation will be used to control the Air Flow rate. The Air Flow rate determines the ratio ofH2 to N 2 in the synthesis gas product. We want this value to be Bet at 3.05.
you the values thBl:
Aspen HYSYS Is using In the celculatlons.
1.
Add a Spreadsbeet operaticm to the PFD. (The Spreadsheet is added in the manner aA other \mit operations).
2.
Import Syntbelll Gu Comp Molar Flow [Hydrogen) and Synthe..s Gal Comp Molar Flow [Nitrogen] into the Spreadsheet.
3.
Add a ratio furmula to 811 empty cell in the Spreadsheet, fur example, =AlIA2.
Spreadsheet Icon
lIlIDlf:
15
is
~cdon.
Add another Adjust operation. Select Air - Molar Flow as the Adjusted Variable, and SPRDSHT-l- B3 (where ''B3'' is the cell that contains the result ofthe ratio calculation) 8S the Target Variable, with a Specified Target Value of
4.
3.0S. Figure 9 •
1100 Ef
ADJ -2
Connections Connections
Adjust !i3me
IADJ -2 -
AdjudedVariable--------------=1 Seleci V~r",
Note.
.I
SpecilieJ:! Targel Value
D~I,I~
5.
SI§rl
r
jgnored
On the Parameten page, choose a tolerance of 0.001 and 8 step size ono
kgmolelhr (44.092lbmoleJhr). In this case the two Adjust operations may interfere with each other while they are solving. This is because changing either adjusted variable affects both target variables. To prevent this interference the Adjusts can be set to solve simultaneously. This uses a di:ffercnt solution algorithm, which makes the Adjusts solve cooperatively at the end of each flowsheet calculation step.
16
RaacHona
6.
17
On the Parameten tab ofthe ADJ-l operation, check. the Simultaneous Solution checkbox, 81 shown below.
Figure 10
Press the Sim Ad] Manager button to bring up the Simunaneous Adjust Manager. Here all the Simunaneou8 Adju8t1 can be controlled in one piece.
I!I~Ef
• ADJ-' Solvino P a r a m e l e r s - - - - - - - - - - - "
roDlfoDlmclcf.1 i
i Pa.amele.. Tolerance Sl~p Si,~
Minimurn (Optional) ~a"irnum.lQ:.t::pl~io::.:;nac=2II'_....L
0.10000 C 20.000 kgrnol~/h 0.00000 kgrnole/h ....;{c::;U~nb~o:.::.un:.:.::d::::"d~}
5.im Adj fA anager...
r Co nn"diom
Qplimi2er Conlrolled
Pa.amelers
r
Delele
jgnored
7.
Repeat ltep 6 for the IIeCODd Adjust operation.
8.
Start the simnltaneous Adjusts solving by using the Start button on the Adjust or in the Simultaneous Adjust Manager.
WlJtrtutMM/ubWAlr jlDwl'tlle,
_
Save your casel
17
18
18
Reactions
Rating Heat Exchangers
Rating Heat Exchangers
© 2005 AspenTech - All Rights reserved.
EA1000.04.07 13_RatingHeatExchangers.doc
1
2
2
Rating Heat Exchangers
Rating Heat Exchangers
3
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 sit inside a shell. There is no mixing oftluid between the shell and the tubes.
Learning Objectives In this workshop, you will learn how to: •
Use the Heat Exchanger Dynamic Rating Method in Aspen HYSYS for heat exchanger design
•
Determine if an existing heat exchanger will meet the process specifications
Prerequisites Before beginning this workshop, you need to: •
Know how to install and converge simple Heat Exchangers
•
Understand the principles of Heat Exchanger design
3
Process Overview
Water
RCY-1
LTS Vap
Chiller Q
HP
Sep
Gas to LTS
Vap
LTS MIX-100 Gas-Gas
Inlet Sep Gas
Inlet Sep
Gas to Chiller
Chiller
Sales
Vap
ADJ-1 HC Dewpoint
Inlet Sep
LTS Liq
Liq
Dewpt
Inlet Sep
H20
Rating Heat Exchangers
5
Modelling Heat Exchangers In this workshop we will examine a gas to gas heat exchanger from a Refrigerated Gas Plant. Heat exchangers are modelled in Aspen HYSYS using one of three configurations: •
Shell and Tube
•
CoolerlHeater
•
Liquefied Natural Gas (LNG) exchanger
The CoolerlHeater operations are single-sided unit operations where only one process stream passes through the operation. The LNG Exchanger allows for multiple (more than two) process streams. A shell and tube heat exchanger is a two-sided unit operation that permits two process streams to exchange heat.
In this module, a shell and tube exchanger of given dimensions will be rated to see if it will meet the requirements of the process.
Heat Exchanger Calculations The calculations performed by the Heat Exchanger are based on energy balances for the hot and cold fluids. The following general relation defines the heat balance of an exchanger.
where:
M
= Fluid mass flow rate
H
= Enthalpy
Qleak
= Heat Leak
Qloss
= Heat Loss
The Balance Error is a Heat Exchanger Specification, which, for most applications, will equal zero. The subscripts ''hot'' and "cold" designate the hot and cold fluids, while "in" and "out" refer to the inlet and outlet.
5
6
Rating Heat Exchangers
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:
where:
u
= Overall heat transfer coefficient
A
= Surface area available for heat transfer
LMTD = Log mean temperature difference Ft
= LMTD correction factor
Log Mean Temperature Difference (LMTD) The LMTD is calculated in terms of the temperature approaches (terminal temperature differences) in the exchanger using the following equation: (3)
where: IiTZ = Thot,in - Teold,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.
6
Rdng HMl: Exchang..
7
The following plot is a heat loss curve for a single-phase stream. It compares the temperatures ofthe process streams with the heat flow over the entire length ofthe exchanger. For lingle-phase streams, these plots are linear. Figure t
"'Il..-----..,...-----r-----,-----r--~--___,--____,
.".-...
() cJ) L..
:::::l
2IlIl ;--_-O;>--'-------'-T' T\.',--,8I='=__'_ -EJ- BI- 1181"
_+_--__+_--_+----+-------.~=~-__j ~
1~Il+---+_--_+_--__+_--_+--~""-----___t____.,..-=.----"'-----__j
~~v
lIlIli---+----+----+-:::::::>'"""'9---.....",j,-----t-----l
~~
+'"
!'is L.. cJ)
IlIl ..... ~---=_=+-----t-.....,.",..=:;-+----+---+----+-----j
a.
E cJ)
I-
~
~Il-r--__+_~------=:".-=---+-~------:;>iF-----+--+------l
~Il
-'[]Il~
~
~~
·1~Il4__--_+_--_I_---+---_+__--__+--__!--__I
=
Il Il
Il
'IlIIIJl Il
a:IDIJ Il
l!lIDJJIl
tlllDJJIl
j
=
Il
1'IlIIIJl Il
.H_.e.at8n~jkllb),
1-
......l
The following curve represents a superheated vapour being cooled and then condensed. Note that it is not linear because ofthe condensation that takes places inside the exchanger. Figure 2
-
T\. ,Ell"
-EJ-
'01" II8lC'
A
---
cJ) L..
:::::l
......
!'is L.. cJ)
a.
E cJ)
I-
,
-'H~~I~~!o=ltFjQw.JkJlb)'__
_"
7
8
Rating Heat Exchanlll"
If the LMTD is calculated using the hot fluid temperatures at points A and C, the rellU1t would be inCOlTeCt because the heat transfer is not constant over 1he length of the exchan.g«. To calculate the weighted LMTD:
1. Break the heat loss curve into regions at point B.
2.
Calculate the terminal LMTD for each region.
3.
Sum all ofthe LMTDs to find the overall LMTD.
Aspen HYSYS will do this automatically if the Heat Exchanger model is chosen as Weighted. Therefore, if condensation or vaporisation is expected to occur in the exchanger, it is important that Weighted is chosen lIB the model.
Heat Exchanger Specifications As with all other unit operations in Aspen HYSYS, the Heat Exchanger is assumed to adequately meet the process requirements. There are several choices for
specifications for the heat exchanger. The choices are given here:
TypIcal apecfficatlons for most heat mcchangers are Pressure Drops, and one of either, Temperature, ~nlmum Approach, Duty,
orUA.
•
Temperature - The temperature of any stream attached to the Heat Exchanger. The hot (X' cold inlet equilibrium temperature may also be defined. The temperature difference between the inlet and outlet between any two s1reams attached to the Heat Exchanger can also be specified.
•
Minimum Approach - The minimum temperature difference between the hot and cold stream at any point in the exchanger, that is, not necessarily at the inlet or outlet
•
UA - The overall UA can also be specified. This specification can be used to rate existing exchangers.
•
LMTD - The overall log mean tempera1me difference.
•
Prelmre Drops - The JX'CSsure drops on both the shell and tube sides on the exchanger are important spec:i.:ficatians that should not be ignored. Aspen HYSYS may be able to estimate the pressure drops if they lire not known.
Care must be taken when choosing specifications because it is possible to select
specifications that are either infea.sJ.'ble or impracti.cal. This may result in a Heat Exchanger that will not solve. Specifications are added on the Spees page of the Heat Exchanger Property view. Enough specifications must be added to ensure that the Degrees ofFreedom equals
O.
8
RatIng Hat Exchangers
•
Heat Exchanger Performance A summary of the Heat Exchanger's performance can be viewed on the Detail. page of the Performance tab:
PerfMmBl'lC:.
Typically, heat exchangers are solved uelng delta T
D Heal L.a.
Plett
Heat
Tables
Erre-Mtg
minimum approach and UA target values.
ovcroll Porfarrwru;.e
Delioi..
"-~"~
LoSf
UA
-
!-An ",","'00
[OO.'. '.'0_ FtFact.or
Uneorl~-cle(j LMTO
-'TIlfot
----I~OO8C
LMTD
Oil, C\lvIlU$ Err," Hot FTch To~ Cold PWlch T"'!!P
0.0000-01 kJA, aODIle-OJ lelA, 1.10e
~""~
24.0011 C
_
19.!!1Q..£ -::wn
j
"
.(.Nnpl.y>
Heat exchangers are sometimes compared on the basis ofUA values. For example, for a fixed surfilce area, what is the amount ofheat (duty) that can be exchanged?
4.
Open the Aspen HYSYS case Gu-Gu.bJc on the disk. that was supplied with this module.
5.
Double-click the Gu-Gu heat exchanger. and answer the following questions.
WIt. is IIu1llA willie IJfllu1 GA9-Gu ~1
_
WIt. I8I1u1 rctuItbJg IfIbdmIllll tIJ'lI'tHIdI ~1Ue UtM UA 18 jixetl til 15 (JIJ(J kJ/C-II (I(JIJ(J
BTlJ/F-Hr)1
_
WIt. tin tM ~ ofltretillU Gar III Chiller . .SlIla Gtts1 IIIUI
9
10
Rating Heat Exchangers
Heat Exchanger Rating The Rating option can be chosen by selecting Dynamic Rating from the Heat Exchanger Model drop-down menu on the Parameters page on the Design tab. Delete the Delta P on both the tube and shell side. This is because with this type of model the required information must be specified elsewhere.
Dynamic Rating Model The physical design specifications of an exchanger must be supplied on the Sizing page ofthe Rating tab. 1.
Firstly, specify the TEMA type to match the desired conditions. Figure 4
I!!!lIiI EJ
• Gas-Gos
Rating
Sizing Parameters
[Sizing Ddt. (i" .QveI~1
r
r
She!
Tu!ie
r
I Calcwted InlOlm3tio
Confguratio
Numbel of 5hel Passes
1
Number of Shels in Series Numbel of Shels in Palaiel
1 1 1
Tube Passes per Shcli EKCha~er Q,ientation Frsl Tube P~$S Flow D~ection
Honzonlal COU1leI
O.DOOO
Elevelion (S.,e) TElAe, Two
accept any input data
I
A
I
E
I
L
She' HT Coell I
I
1~7
1.1800:005
5.000
3500 60.32
01930 2272
~
~~:i.=~.="l~;ig•••••••••••••••••••
J.ipdale
Ir
!gnorod
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.
10
Rating Heat Exchangers
11
The radio buttons in the Sizing Data group include: •
Overall- Required infonnation about the entire exchanger. Most of the infonnation entered here is used only in dynamic simulations.
•
Shell- Required infonnation concerning the shell side of the exchanger.
•
Tube - Required information concerning the tube side ofthe exchanger.
The TEMA Type is selected as part of the Overall sizing data. There are three drop down lists that 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.
TEMA· Front End Stationary Head Types TEMAType
Description
A
Channel and Removable Cover
B
Bonnet (Integral Cover)
C
Channel Integral with TubeSheet and Removable Cover (removable tube bundle only)
N
Channel Integral with TubeSheet and Removable Cover
D
Special High Pressure Closure
TEMA - Shell Types TEMAType
Description
E
One Pass Shell
F
Two Pass Shell with Longitudinal Baffle
G
Split Flow
H
Double Split Flow
J
Divided Flow
K
Kettle Type Reboiler
X
Cross Flow
11
12
Rating Heat Exchangers
TEMA • Rear End Head Types TEMAType
Description
L
Fixed TubeSheet like 'A' Stationary Head
M
Fixed TubeSheet like 'B' Stationary Head
N
Fixed TubeSheet like 'N' Stationary Head
p
Outside Packed Floating Head
S
Floating Head with Backing Device
T
Pull Through Floating Head
U
U-Tube Bundle
W
Externally Sealed Floating TubeSheet
Rating Parameters Brief explanations are provided below for each Simple Rating parameter. The parameters are categorised 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.
Shell Side Required Information
12
•
Shell Diameter. Can be specified or calculated from inputted geometry.
•
Number of Tubes per Shell
•
Tube Pitch. The shortest centre to centre distance between 2 tubes.
•
Tube Layout Angle. A choice between four different configurations.
Rating Heat Exchangers
•
Shell Fouling. The fouling factor on the shell side.
•
Baffle Type. A choice of single, double, triple, NTIW or grid.
•
Baffle Orientation. A choice between horizontal and vertical.
•
Baffle Cut (% Area). The percent of the cross-sectional profile unobstructed by the baftle.
•
Baffle Spacing. The distance between adjacent baftles.
13
Tube Side Required Information •
Tube OD. The outside diameter of the tubes.
•
Tube ill. The inside diameter of the tubes.
•
Tube Thickness. Usually calculated from the two numbers inputted above.
•
Tube Length. The tube length per shell (one side for aU-tube).
•
Tube Fouling. The tube side fouling factor.
•
Tube Thermal Conductivity. The thermal conductivity of the tubes, used in determined the overall heat transfer coefficient, U.
•
Tube Wall Cp, and Tube Wall Density. Two physical properties of the tube material, used only in dynamics.
If you want Aspen 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 Aspen HYSYS to calculate the desired terms. The Rating model in Aspen HYSYS uses generalised correlations for heat transfer coefficients and pressure drop. These correlations are suitable for approximate results in most cases but may not be valid for every exchanger. For more accuracy, a rigorous model may be required. Please contact your AspenTech representative for a list of available third party heat exchanger packages that are compatible with Aspen HYSYS through OLE Extensibility.
13
14
Rating Heat Exchangers
Exploring with the Simulation You are asked to find a heat exchanger that will serve as the Gas-Gas exchanger. However, since you are on a very strict budget, you can only consider used equipment. A heat exchanger has been found in the surplus supply of a nearby plant. If the critical process parameter is to maintain a Sales Gas temperature of at least lOoC (50 OF), can this heat exchanger be used for the Gas-Gas service? The surplus exchanger has been thoroughly cleaned. The TEMA definition of this exchanger is A,E,L. The pressure drops on both sides of the exchanger should be deleted; this will allow Aspen HYSYS to calculate these parameters. The dimensions of the exchanger are given here: •
Tube Length = 1.5 m
•
Number of tubes = 300
•
Tube Pitch = 30 mm
•
Baffle Type = Double
•
Baffle Orientation = Vertical
•
Baffle Cut (% Area) = 15%
•
Baffle spacing = 100 mm
•
All other parameters are the Aspen HYSYS default values
Use the Dynamic Rating mode to determine if the exchanger is suitable; on the Rating tab, Parameters page, use the Detailed Model in Aspen HYSYS. What is the temperature ofthe Sales Gas using this exclumger?
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 wiD the temperature ofthe Sales Gas be after 6 months ofservice?
Will this exchanger be adequate after 6 months ofservice?
I -----------Save your case!
14
Rating Heat Exchangers
15
Challenge Why was the Recycle needed in this Flowsheet? For an interesting challenge, disconnect the recycle operation and stream 1. Connect the stream LTS Yap in place of stream 1. What one piece ofinformation is stopping the Exchanger from solving?
Apartfrom putting back the Recycle, how else could this be resolved?
15
16
16
Rating Heat Exchangers
Automation Introduction
Automation Introduction
© 2005 AspenTech -All Rights reserved. EA1000.04.07 14_Automationlntroduction.doc
1
2
2
Automation Introduction
Automation Introduction
3
Introduction Automation is the ability to programmatically interact with an application through objects exposed by that application. By using an Automation client like Microsoft Excel, or Visual Basic, the end user can write code to access these objects and interact with Aspen HYSYS. Code can also be written in Aspen HYSYS itself in the form ofUser Variables or Macro Language Editor (MLE) macros. The available objects are the same. The exposed objects make it possible to programmatically perform nearly any action that can be accomplished through the Aspen HYSYS graphical user interface.
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 User Variable will be created.
Learning Objectives In this module, you will gain an understanding of the possibilities that Automation access to Aspen HYSYS can bring. The examples given should give a starting point for any further learning. If you want to learn more about Automation programming with Aspen HYSYS, AspenTech offers another course that will meet your needs. Ask the instructor for more information.
3
4
Automation Introduction
Prerequisites No prior programming experience is asswned. However, before beginning this module, you should have a reasonable understanding of the Aspen HYSYS program.
Why Use Aspen HYSYS Automation? The main reason for using the Automation capabilities of Aspen HYSYS is to improve the efficiency of your work processes. By reducing the amount of time spent on repetitive, tedious tasks, and hence by reducing the amount ofhuman errors, more time is left for engineering tasks. The efficiency of your work processes can be increased by using Aspen HYSYS Automation for: •
Automating manual data entry tasks. For example, extract Aspen HYSYS data to an Excel spreadsheet for delivery to a vendor.
•
Creating hybrid solutions across applications. For example, allow for seamless data transfer between Aspen HYSYS and any other Automation enabled application.
•
Hide the complexity ofAspen HYSYS while taking advantage of its full capabilities. For example, build custom front ends for plant personnel.
•
Extend the functionality of Aspen HYSYS to meet particular needs. For example, use a User Variable to report custom stream properties.
The benefits that you will see from Aspen HYSYS Automation will depend entirely on what you use Aspen 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.
4
Automation IntroductlDn
!I
Excel Front-End to the Turbo Expander Plant A simple front end to 1he Tmbo Expander plant has been c::onstructed using Microsoft Excel. Rather 1han typing a large amount of code into the Excel Visual Basic Editor, in this Workshop you will review some prewritten code using VBA's debugging tools.
The instructor may chOOIle that the class does this individually, or as II. group.
Preparation 1. Open the Turbo Expander Aspen HYSYS calle. Den't worry if you haven't built the Turbo expander plant case.
The file "ADV5_Spreacls& C.estud SoIn.h8C"
contains the 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 MKroI. Figure 1
EI
Micloo&oU Excel Th e 'H or lebo ok you are opening con ta ins rna cros , 50 rne rna cros rna y (0 nt ain lIiruses that (0 uld be ha rmful to your com puter , If you are 5ure this IN orkb oak is from a trusted source, click 'Enable Macros', If you are not 5ure and want to prellent any mauos from running, dick 'Disable Macros'.
lell Me More
P" eJ way s ask before 0 peni ng IN orkb 0 oks IN ith m
~nable M
Do riot Open
In Excel 2000 onwards you may need to change 1he Security setting to Medium on 1he Tools I MlU:l'o I Security menu option, before you see this window on opening the tile. The Excel spreadsheet has already been set up with some labels and values.
5
6
Automation Introduction
Figure 2
_Iolxl
1#i;."m··tN,ffi.'.iflMiM' lEI
E.le
s.dt
D ~ !II
ta
B
~nsert
!\e'oll
~
6'
~ ~
~ ~..lIIiCl!!il
mm.
Fwmat
121
~
rook
,~""" ~,.
Q='J
~ndOOI
Q.!lta
to
tietp
J: • ~~
'l""R'rI,,,ihC"-';~
0
Type a quest 00 for h€!~
AcroQ.at »
100%
Mal
• 10
•
B
!!
I
;;;0;
(l), •
... _
fj
X
.o...
[,.tR........
r.
A1
A B C
~Advanced
D
H
G
E
K
L:;J
Process Modelling using HYSYS
Automation Introduction, HYSYS - h:cel Link Example Go to Tools ... Macros ... Visual Basic Editor to see the code
lOr press +
+ +
t Key Parametur5
+ +
1
E-100 Outlet Temperatures
+ +
·70 C
El(P.a.n~.,:! .o~,11.~!.£r_e.ss~..
29 bar
Unit Cost Power
LPG Value ...
~
5 OOE-D2 £ I kWh
··02 Ukg
+
Profit ClIlculation
Refrig Power
Ellport Camp Power Total POV/Sf
f t
Cost of Power
£/h
+
kgih
Value o!LPG
£/h
t
.LPG_l>1a~e
t
1 .11 HYSYS - Excel link
-
~
kW kW kW
Profit
£/h
J,I
+
i
~
--'.JrJ Nurt1
4.
6
~
Open the Visual Basic Macro Editor by going to Tools I Macro I Visual Basic Editor, or by pressing Alt Fll.
Automation Introduction
7
The code to link to Aspen HYSYS will now appear. Figure 3 g;d!M".':fffifW,fl@@Mttft¥i§MW, ole
~o:a
~'I
Ins~rt:
I!iI ~.!iiI l\ It> ijlfIjM-i.!uttl!M
o
~
f2l"ID&t
""
8--~ Ac:rob8tp1)FMak~t(PDFf'
14
~
Si' '§
~
ti~
B
In I, CoJ 1
_Ia'xl
:.:J IIDed~.Hon.)
:.:J
~
Require Explicit Variable declaration t--=°LP1"~1~O~n~E~x~p~1~1C~1~t I
@) Sheetl (H'f'5)'S • Exc
~ ~
6
•
lYlnclOW
1..-'..,,1,...-----------------=....:...--------------------'=_:..,11
Mcrosdt EJ:cel Objects !
II
_Iolx' &dd-It"t;
11Gcnc<.I)
B.t3 YBAProjed (Adv Autorni
8
•
lools
xl • . ftN.ffiMifu,M"filffl'fiMtffffli'M§i¥mu
§
Q
avo
[leOug
I
TIi:;\"lXldJook
~"
Note:
Hy9y~
PUbl ic 9ub
, .:t mo::lHysysCoOO
I
-
Type IJ..brary must be referenced undeI: Tool:!
HY3Y5Ej(c~lLinkCode
Descr1ptJ..on:
Re.ferenc:e9
()
HYSYS Advelnced Cour!!le,
-
Automation Intraduct10n
Illu.!!itrelte ba.:!lJ..c l!IIcceS!!l to HYSYS from Excel
I
L
ImodHy~[o{ M
Dec lare Var iab Ies -- ------------- -- -- ------------- -- ------------- -- -----------to Link to HYSYS obj~ct~ hyA.pp A.s HYSYS.Application hyCase Ag HygYS.SiroulationCase hySbFg A5 HY9Y9.Floll:3heet hy3tr::e8I(l As HY9Y9. Proce!ls3cr::eaw h'jlf:xpander A~ HY9Y3.ExpandOp h'jlCpt9 A.!! HY9Y9. Component.!! hyCpt As HYSYS. Component hyComp As HY9Y9. CompressOp hyCoo 1 A!"J HYSY9. COO l~rOp
'Variabl~~
amnm"Nliillllltfttl!!ttNx,
Dim Dim Dim Dim D1Ui D lUi D lUi D lUi D1m
o::J
ICMegorized I
I Ot.her Variabl~:5 Dim DblC~llValUl!: R.!! Daubl~ Dim 5trUnit A.:5 Strinq Dim IntCH1Idx A.s Int>2Q"er Dim VarHyArray As Ve.riant Din. IntCount As Integer
I
Prace dure
I
Setup an Error Handler
On Error GaTo I
1
H'lSYS Application Case F loysheet strl!€lrtl (can be energy or:: material) Expa.nd!'r Oper::Btlon Coll~ctlan ot compant!'nts In the tloilsh!'t!'t A partlcular compon.e..nt Comprl!S3or Cooler
I A 16 bit decimal nun>ber 'A t~xt ~tring that 1',Iill hold a unit I Position at Kethane in the cOlrlponent list t U!!led to retrieve data :troItl Hy9y9 arrays 'Gen\!ral pur::pose counter
_
Err:orHarLdl~r:
L ink to the current I y open
c~e
Making a Type Library reference The first step in accessing Aspen HYSYS via VBA is to make a Type library reference. 5.
In the VBA Editor go to the Tools I References menu option.
6.
Ensure the HYSYS 3.0 Type Library entry is checked.
7
•
AutomatlDn IntroductlDn
F1l1ure4 References - IIBAPro]ecl
=
Available Reference,;:
OK
~ Visu" I B"sic For lop Ii c"tio n, ~ MIcro 5 oft Excel 10, 0 0 blect Libr"ry
Cancel
~OLE Aut~matlo~ ~ Micro 5oft Office 10, 0 Ob Ie ct Library ~ MIcro 5 oft Form 5 2,0 Object lIbr art
I 1111,11111 I I o~UiimilimIMI!lll~ VBAP roje ct o VBAP role ct o lAS Helper COM :~mponent 1. 0 Type Library
Bro'i"lse, "
I III Priority
o lAS RADIUS Prooocoll ,0 Type Library
Help
0:-) Vldeo50ft V5FlexGrid 7,0 (light)
o ACOL HY5Y5 calculation interface
DCI'I't worry if the type library version number doesn't correspond to the Aspen HYSYS Y81'8lon being used.
Juet check th81: the
r;o
ACOL HYSY5 calculation interface COL620 1,0 Tyee Library
~
HYSYS 3,0 Type Litrary - - - - - - - - - - - - - - - - - - - - , Location: Language:
C:\Program Files\A,penTech\Aspen HYSYS 2004\hYIys,tlb Standard
Loc:8tIon Is fa the correc::t Aspen HYSYS Y81'8ion.
VBA Basics The intention ofthis section is to in1roduce the very basics of manipulating VBA code mther than to teach the details ofAspen HYSYS VBA programming. The techniques described here will be used later when examining the prewritten code.
Running Macros To nm a macro, place the cursor within the macro in the VBA Editor, and click the Run Sub I UlerForm toolbar button.
8
Automm:lon Introduction
8
Figure 5
Run Sub/UserForm I
Macros can also be run within the VBA Ediur, from the RJ.m menu or by pressing FS.
Additionally it is possible to trigger a macro by c1icking a button on the worksheet The example spreadsheet has a button to do this. (To set which macro is 1riggered, right-click the button and choose Assign Macro.)
Simple Debugging - Breakpoints In this module the example code will be run in Break. mode. This allows the code to be stepped through one line at a time. This helps to gain understanding ofwhat the code is doing, and is also useful when fixing bugs. Breakpoints cannd be
placed on comment linea or variable declaratlon Iinee. Ccmment lines ere those starling with' marks, which appear green in the VBA ednor. These are Ignored
To make VBA enter Break mode it is first necessary to add a breakpoint First select the position in the code at which to add a break point then either:
•
Select Toggle Breakpoint from the Debug menu in the main menu bar.
•
Press the F9 hot key.
•
Click in. the J!lCf colunm on the left side ofthe code window beside the desired breakpOint location.
•
Use the Toggle Breakpoint toolbar icon.
when the code rune.
Figure &
Toggle Breakpoint I
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.
9
10
AutolMtion Introduction
There are a number ofways to step through the code: •
Select Step Into from the Debug menu.
•
Press the F8 hot key. Use the Step Into toolbar icon.
•
Figure 7
Step Intol
Aspen HYSYS Automation Basics Each object within Aspen HYSYS (for example, a stream, the flowsheet, a case, or even the Aspen HYSYS applicatioo itself) has a corresponding Automation object. It is via these objects that Aspen HYSYS can be accessed and controlled through code.
This example illustrates access to some of the most commonly used Automation objects within Aspen HYSYS.
10
Automation Intracluction
11
Aspen HYSYS ObjectS are organised into a tree. the object hierarchy. The objects that will be accessed in this example are illustrated below: Figure.
81m ul atlonCase
Solver
E nergyStreams lCo~~liM)
ProcessStream
HeatFlow If'mpNty)
Tem perature
MaterialStream 5 lColiecliM)
If'rop " rty)
ProcessStream Pressure If'mpNty)
operations
operation
[Colle-clio,,)
("",coO"" Typ.,:s)
Flui dPackage
components I Colle e!k",)
Component
FICMlsheets lCoIle~liM)
The first stage oflinlring to Aspen HYSYS is to link in to an object at the top of the tree. In this example the line of code: Bet hyApp - GetObject(, "BYSYS.App11cat1on".
is used. This sets up the object variable hyApp to refer to the Aspen HYSYS application. The resulting object is of type Application.
11
12
Automation Introduction
To link to further objects within the 11'ee, dot notation il used. For example, the Turbo Expander Excel interface usel the line:
to refer to the currently active simulation. The resulting object is oftype Simulation Case. That is,
to refer an object on the next layer down in thelr8e a full stop is used.
Using the Object Browser The objects available within Aspen HYSYS, and the Aspen HYSYS object hierarchy can be viewed using a VBA tool called the Object Browser. To view the Object Browser either:
•
Select Object Browser from the View menu.
•
Press the n hot key.
•
Use the Object Browter tool'bar icon.
Figure ~
The object browser window willllppear. By default the object browser will list the objects available in all the type hbraries that are selected in the References lists (fools I References). In order to limit it to just Aspen HYSYS objects change the drop-down at the top left to Alpcn HYSYS.
12
Automation IntroductlDn
13
Figure 10
t1I MtiJi ti¥I·ifMj'BjJfIl'::'lit.j,8jmM"LD3Il!L@'.ii,i lig' J,;4 Ejll!l t dl y!MIt !MM: Fg.rlMt Qebug ~ [(10k ~~l'f ~p Ill: ~". m I1il f5J
':I
",,~ EJP~""I!IoIT~'IllI·1iil wrtF;,lf.!.~r·:<'·1
1...·Ut>o..-
..EI
:: =~:-~~:'
;::dUDflltelJ>
~¥.;1-:"-~:"-:"-:"-=-:"-:"
==-:m- ~
$ ~ Ml:rasctt E:.:ce Ob.~li. I
e:I
i
~·shMt.l("VSYS·h'cl!llliJkl
L.~T~warkI:u:Jk.
El ~ ~.3Ll ~
embers
~C:
.:r.;
VI
M-:d.J106
L-41'1'lOod~.,sco~
b III I
W~O""'Ct.
r
~ Ad,]ln~ ~ AdJu~lrnenlS ~
AdJuslOp
o1'o(~loDal$)o'
an~lIQu!
Ell
r
12]
GJ
aclnlJepend~nl
m i(:_NotU~€Id
~ Amin~Pto)OP"-9
12) AJ.ld~e_H2~o~
r!J
(lJ NloJtype_1'II'
Alltt)lnePrCPPkC
~~~~~~~j!!!!!!~£J~ ~-.!!.I
i:'JMplitatJon ~ AD~lic~lon
,l.ttll'8C€l1I AJ.,,~aChar1
IShed
~ ~::s\@
Z:::~~~Lr
0;]
I wcd':sUet ·1.1,....... lc"'~l ~)
fiJ Assayr.,ST1l D] B8](
~spCf.ri"a9'-""iIteil.sFa~ 1'\:Il:t:ALJ:oFlltO' FIlbi= float:llec:.:;b.lI,n::.n IHue
IO.xlU~.n:.ns
r&i""rne
~lAre.a
~d.c:nI~ ~d:le
~ .AA:irallt::f1rIlodeLG.e n elll l
~A8s:~ulkOntt ~ AS~Cl"IChromaIOll}ra(.,
~ Ad,,~od.U-hlll~ m AtIirIt'ptl4ode-UlllargLJlet
~..A!!~Cl'yOaB
H~S -[!cduW
r:4 AssQ\'OStLDt160
~."3
~ A!!~ayi:rv 1P MS~tlI'3POI;:rtlal'lh1
-1 - :dshoo'''loiibB
AcIi~awOI\bMl;'
ifJ AS'$ayS"'S:I~u~pulll
n.:lbll~t.,~=":"",,.,-· - - - - I 1? Ass;noC'JlO'eTYDe3rl ~tA:F9wotTd:I~ F.:I~ ~}l..S~a"IiO'16D
~t:I!~~n
~eWl"d"""
1:! .••• ..,..sno..DJea;
)hffi 1
I
ra~ Ion
~ M~a"IiOaBGot'MIr8m
ffJ :fjJ
.AS'i:~IQl'llEflljSC
ASst:M.lchlE'n~sCl:Jn
.:J A
Acrf,.ol~liI4Oll~LScatchatd
AttN~odeL'aI;:U1_a:lr
~ Addln~
0 AdI:;.b:.1lt_1;lI' G aem_1..30r,)nae @
G:l ae-mYrob'libilib'
~A8i.;wi:C'OI18t1)on
m !J_eeram~n
~ .A~savTBP
I2J AI _EdmlsU!r aJ ;.f _Lee_Kesler
'iF
AsS'EWT'J'~IU:lnum
ifJ Ass
C!J.AS'_Roblnson~9
~1
~IIUbrar1a:8·
'-
~
__l _
Clicking an object (or 'Clasl') in the left hand list then showl all the members (objectl or propertiel) that are associated with that object The Object Brawler also allows searching.
Using Watches to monitor Variables Variables are key to any programming language. They hold values that can be manipulated by the program as it runs. " is good prztice to declare all variables at the top of the procedure.
When accessing Aspen HYSYS via Automation, an Object Variable can be used in the code to link to an Aspen HYSYS object.
13
14
Automdon Introduction
By adding a Watch it is possible to see how the value of a variable changes as the code executes in Break Mode.
First the Watches window must be shown. Do this by choosing the Watch Window option in the View menu, or by using the Watch Window toolbar' icon. F1l1ure11
Watch Window I
The Watches window will then appear.
T e
Context
Application/Application
modHysysCode.HYSYSExcelllnkCode
SlmulatlonCaseJSlmulatlonCase
modHysysCode.HYSYSExcelllnkCode ~
Vanant/c:Unsupported object type::>
modHysysCode .HY SYSExcelllnkCode /:
Object/Application
modHysysCode.HYSYSExcelLinkCode
False
Boolean
modHysysCode.HYSYSExcelllnkCode
-32767
Long
modHysysCode .HY SYSExcelllnkCode
Nothing
~
..:J.
Secondly select the variable ofinterest in the code by clicking and dragging, then
either: •
Drag the selected variable onto the Watches window
•
Choose Add Wateh••• or Quick Watch••• from the Debug menu
•
Press the SIIIFI' F9 hot key.
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. The Watches window illustration above shows what happens if the hyApp object is added to the watch window and the code nut in break mode.
14
Automation Intracluction
15
Running the Code in Break Mode 1. First look at the top ofthe procedure. It is good practice to include a description ofwhllt the procedure does at the beginning. All the variables are then declared. Note that the variables that will be linked to Aspen HYSYS objects are declared as specific ~e8 depending on the kind ofobject they are linked to. Figure 13 Publl~
Sub
HYSYSEx~elLlnkCode()
'Description:
HYSY5
Advan~ed
Course, Automation Introduction
Illustrate basic access to HYSYS from Excel
'Declare Variables 'Variables to Link to HYSY5 objects Dim hy1pp As HY~YS.kpplicacion D~m hyCase As HYSYS,SlmulaClonCase Dllli hySbFS Ag HYSYS.Fl~~gh~e~ D~m
hyStrearn As HYSVS.ProcessScream
Dlm
hy~xpander
D~m
hvC~ts
As
I
Case Fl~~gh~~~
stream
Ag HY5YS.ExpandOp
I
(can be energy or material)
Expander operation Collection of components in the
HYSYS.Componen~s
Dlm hyCpt As HY5Y5.Gomponenc D~m hyComp AS HYSYS.CompressOp D~m
HYSVS Application
A
p~rticular
flowshee~
~omponent
Compressor Cooler
hVCool As HYSYS.CoolerOp
Ot her Var iab Ie:=:
Dim DblCellValue 13 Double D~m
StrUnlt As Strlng
D~m
IncCtl1Idx AS Incege.
Dlm VarHvArray As Varlant D~m
IntCount As Integer
'A 16 bit decimal number 'A text string that uill hold a unit Position ot H~thane in Che co~ponent lis~ 'Used to retrieve data from Hysys arrays I
I
General purpose
counte~
15
16
AutolMtion Introduction
After the variable declarations, there is a VB ins1ruction that sets what happens when an mor occurs. In this case, jump to the label ErrorHandler at the bottom ofthe code, and display an error message.
I!I[!J El
'. Ad. Alllomdllon - 50111hoo.HI. modtiysy'Codc (Code)
.:1
!IGenenl) 'P~ocedu~e
ISetup an
---------------------------------------------------------------------
Error
F.andle~
On Error GoTo ErrorHendler Re~t
ot Code
Goe~
in Here
ErJ:orHandlez::
ftSgBox "An Error occurred" & vbC~Lt & -TUt"D on E:t"l:ek OD All
nto
S@~
uh~r@
~h~
't~rlJl.t":1
@rror
i~",
on I:.h,= Tool::'! ••• OpcJ.on.:l ttind.ow J,n VlIA"
,
nUn~xp@et~d
J;
vbCt"Lf
J:
tr~or"
End Sub
2.
Add a breakpoint to the On Error line and start the code running. (If you need to,
you can refer back: to page , for details ofbreakpoints, and making the code run.) Make the Set hyApp ... line execute. Figure 15 'Procedure --------------------------------------------------------------------'~etup an Error Handler On Error GoTo ErrorHandler
'Link to the currently open case S"t hyApp ~ G"tObJ"c:t I, "HYSYS. App l~c:at ~on") S"t hyCas" ~ hyApp.Ac:tiv"Doc:wm"nt
, Onl y works
~f
Hysys
~s
op"
3. Add a Watch for thehyApp variable, click the '+' sign next to the variable to show the properties ofthis object; note that ActiveDocument is me of them, and that its type is SimulationCase.
18
AutolMtlon Introduction
17
4.
Execute the next line of code, add a Watch for hyCase and note that it shows the same infonnation as the ActiveDocument property oCthe hyApp object.
5.
Use the object browser to view the Aspen HYSYS Application object. Note again that the type oCthe ActiveDocument property is SimulationCase.
Hence when hyCase was declared, its type was SimulationCaAe. Figun 15
IIIi1 Ef
'. Object Browser jHYSYS
.
~"'.
'
....
Property ActiveDocument As SimulationCase read-only Member of HYSYS.Applica1ion
,
Act ive Doc urn ern
The next section of code checks if there was a case open in Aspen HYSYS using the VB 'Is Nothing' cons1ructian. Figure 17 'Check that a case ~as open II hyCB3e I3 Noth~ng Then 'Tell the U3er H3gBox ~Make 3ure the Turbo Expander CB3e 'Fini3h our procedure
13
open
~n
HYSYS·,
•
~Error·
EXlt Sub
End II
17
18
AutolMtion Introduction
Next some values are read in :from the Excel spreadsheet Figure 18 'Set an object re£erence £or the outlet stream o£ the cooler 'Re£erence an item in the collection of all Material streams 'in the main £lo~sheet Set hyStream - hyCase. F lo","sheet. Mater ialStreams. Item ("2 "I 'Note that because hyStream is an object variable the Set keyword must be used 'Each time a change is made in the HYSYS case via Automation, HYSYS resolves 'since multiple changes are going to be made, it makes SenSe to turn off the 'HYSYS solver, make all the changes and then turn it back on again, hyCaSE.501ver,Can50lve - False
There are a number ofways to refer to a particular cell in the spreadsheet: •
RangeQ with a cell name. For example, Range(''ClS'').Value
•
RangeQ with a named range. For example, Range("MyRange'').Value
•
CeUsQ with a row column reference. For example, Cells(lS,4).Value
WI... ia t1IB type Dftlm IHIriIIIJkl rn.oe in t1ul 0IJja::t ~ CDII14 t1Iia Dbjm type N folllUl?
18
Automation IntroductlDn
6.
Rnn the code down to the Set hyStream =
1.
.... line
Flgu... 19 'Read the required [-100 temperature value and unit from an Excel cell---------'Th~r~ ar~ a numb~r of ways to do this DblCellValue = Ac:cive5heet. Range C"C1S") . Value 'Cell naroe 5crUnic ~ ic:cive5heec.Cel13C1S, 1) .Value 'Row, Col Address 'Active5heet is an Excel object for the currently open Worksheet It is imp~icitlv used by ~xcel VBA anv~av so it's naG necessary GO have iC every Cime I
Here a particular stream within the flowsheet is placed into the hyStream object variable. 7. Note that It Is Importantto enclose the streem name
In ·quotatlon mertcs."
Look up SimulatiOllCase in the Object braWlIer and navigate through to the Materi.alS1reams property ofthe F10wsheet object.
This is a Collection. In programming terms Collections are objects that hold a group ofsub-objects - in this case all the material streams in the flowsheet. The Item property is used to refer to a specific stream. 8.
Add a Watch fur 1he hyS1ream object. Look at a1l the properties this has. Note that the Type of this variable is ProcessStream.
9.
Execute the hyCa.se.Solver.CanSolve = False line. In Aspen HYSYS the solver is now tmned off (Red Traffic light).
Now the temperature in the stream can be set using the two values that were retrieved from 1he Excel spreadsheet earlier. Figure 20 -Nom
~Et
it's temperature
h75tre~.Tew~erature.SetValueDblCellValue,
StrUnlt
'Use the 5etvalue method of the Temperature propercy of the Proce33Strearo object
'This takes tuo parameters: the value to set, and the unit to set it in
10. Execute this line - check that the w1ue in the Aspen 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.
19
20
AutolMtion Introduction
12. Look up RcalVariable in the object browser. Figure 21 EI
Oblect OlOwser
Classes Members~of='~R.;.~e,~~a;;.,;IV~a~ri~ab~le~'=~ dPReaci,ons-e,so,verM;f;l ~ -APpilcatlonrffJ ReacllonSeISolverMI;, ~ CalcBy rffJ Reacllon SelTraceLe>c .,...~ Ca Ic ula1e
_
I
li:l ',Fle;;jI\l~,~ia~,I~",,!; .;
~ "~,~,~,I,~,I,~:0!,~,r.i,~,~,I,~""",,,: . 'J ~
~ Des crip tion
Ca nMo diiY
~ Reboller
"f)
Erase
.
rffJ RebolierTypeEnum "'~ Getvalue rffJ Rebo II erTyp eEn um--:' A; ~ Isin co ns Istent ~ Recycle
!i:lI li:l I'~
I
~ ~
~
!i:lI rffJ
~ IsKnown ~ IsValid Refi ne ryAss ayCollec/ • P aren1 ResumeSequenceA, ' -l ':[~~[~eiY'~I~.~••••••• ::: :: RolaryFil1er: ~ State RTOEntry :.:J ~ UnllConversionType SchedulerSequence:, ' ~ Value Sch ed ule rSe que nc e',; ~ ScheduleSla1e_enurl:.] Re~neryA5say
d
,
::: :::::::::: ::: :: ::::::: ::::: ::
::::::::JJ
Sub SetVlllue(vaIA" Double, [uni~) Member oj HVS'iS.ReaIVariable Set value with unit conversion
RcalVariables are special Aspen HYSYS objects that hold nwnerica1 values, but also oontain other infunnation that is useful fur the programmer.
•
IsKnown - Whether the value is known or is
•
CanMocU:fy - Whether the value can be chanRed (that is, True = a Blue Aspen HYSYS number, False = B1aclc, calcuJited by something else)
'::..~
•
CakBy - Which Aspen HYSYS object calculated the value
Methocllcon In the Oblect
•
UnitConvenionType - What kind of unit the value has
Brcwaer
RcalVariables also have two useful methods; SetVatue and GetValue. These allow numbers to be put into, and retrieved :from Aspen HYSYS. In general. Methods are used to tell objects to do something.
20
Automation Intracluction
21
The SetValue method takes two parameters: Sub S_tValUlili (val As Daubl_, [unit])
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 Aspen HYSYS a!lSUDle8 the value is being supplied in its intemal units. ("'C in the case oftemperature.)
ILDok .....IhIe4 T................ W.... ""........... ~ ........ tIbovel ~
"'-·f...
13. Execute the code down to the line just above where the Aspen HYSYS solver is
turned back on. Figure 22 ·Similarly seC the pressure OI the expander outlet stream------------------------
'Reference the expander object -Like material stream5, there i5 a collection of all the operations in the main l:t:l.Qwshe.;;:'t Set hyExpander 'N~u
link
t~
hyCase.Flowsheet.Operation3.Item(~'K-iOO"1
=
it'~
5et hv5tream
~r~du~t
str~alli
hvExpander.Product5tream
DblCellValue Range (rrExpnctrOutprr) .Value StrUnlt - Range I "ExpndrOutP"1 .OffsetlO, 11.Value
'The Proce555tream '~~t
tn1~
1~
1n
tn~
obje~t
~~~
ICan also reference a named range lOr a given offset from another cell
ha5 another property called Pre55ure w~y ~~
t~rnp~.~t~.~
hy~tream.Pressure.SEtValue DblCellValue~ Strrrni~
'Turn the 50lver back on hyCase,50lver,Can50lve True IHYSYS will completely solve before moving on to the next command
This section of code is similar to the section above where II. tcmpetll.ture is set. However, instead of referring directly to a named stream. the product stream from a
given operation is used. The tlowsheet object has another collection called Operations that includes all the operations on the tlowsheet. 14. Add a Watch for the hyExpander object and look. at some of the properties it
has. 15. Reposition the VBA editor window and the Aspen HYSYS window so that both are visible.
16. Execute the line hyCase.Solver.CanSolve = True, and observe that Aspen HYSYS resolves the case.
21
22
Automation Introduction
The next parts of the code retrieve various information from the newly modified Aspen HYSYS case. Figure 23 'Retrieve Results Data froru the HYSYS case-------------------------------------'Link to the
compre~~or
energy stream on Che retrig loop
'Get an okject for the sub flowsheet Set hySbF:: - hyCase. F lo",sheet. F lo",sheets. Item ("TPL 1") 'Each Flovsheet object has a collection called Flowsheets 'all it's sub flowsheets
~ub
flow~heec
~hich
contains
'Now acceES the stream as before 'This time use the Energy5tre~s collectioll of the ruaill flo",sheet Set hyStream - hySbFS. Enel:gy5cl:e"lms. Icem ("Com]:) Duc y") 'Get the Leat flo", StrUnit - Range ("ProfJ.tResultsStart") . Offset (0, 1) 'All the Iroperties that have a .SetValue method also have , . GetValuE methods to get results out 'This takes only one par~eter - the required unit Range ("PrcficResulcsStal:C") - hyStl:eam. HeacFlo",. GecValue (ScrUnit)
Since the ''Comp-HP" stream is on a sub-flowsheet, it must be accessed from an object for the sub-:fIowsheet. Like the MaterialStreama collection, each :fIowsheet has a collection (called Flowsheeis) that contains objects :fur all its sub-:fI.owsheets. Hence the Item property is used on the FlOWBheetB collection of the main tlOW8heet, to refer to a particular sub-flowsheet within the collection.
Flowsheets are referred to by their Tag (not their Name). This can be found on the Connections tab.
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 :fIowsheet.
V..-Iables can be reused when they are finished. There is no need to declare a dllTerent variable fel' each stream or operation that Is accessed.
The ProcessStream object type can hold both Material and Energy stream objects, however, Energy streams have filr :fewer accessible properties. In this case the HeatFIow property is used. The GetValue method is then used. This is analogous to the SetValue method except that it takes only one parameter, the required unit. 17. Execute the Set hyStream =
...
line.
18. Look at the Watch :fur the hyStream variable now. Note that it now carries details ofthe energy stream.
.22
Automation Intracluction
23
I HInt: lhe Ik ob}ed 1mJwHI to look j", propmks ojt1t4 Prou.rI8tretlM o6)ect 6IIIrthIg with "iJ. 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 its properties. However, if1he same object is to be used more 1han once it makes sense to create an object variable for it Figure Z4 '~imilarly Ior the Export Gas Compressor 'It is not necessary to make an object Ior the stream every time Range ("ProI~tReaultaStarC") . OIfaet (1, 0) ~ hyCa.:::e. I' low::lheee. Energy:;)u:eam:::. Ieem ("QK-I02 ") . Heael' low. GeeVal ue (StrUni t) 'The operator alloWS the code to be written on multiple lines for clarity 'VBA treats the code as one line when it runs it
'Get the flQwrate DI the LPG product stream StrUni t ~ Range ("Prof ~ tResul taStart") . Offset (4, 1) Range ("ProI~-cResults5tart") . OIfse-c (4, 0) ~ hyCase. Flow::lheet. Mater lalStreams. Item (" 10") . Ma::lsF lou. GetVal ue (StrUni t)
19. Execute the code above.
The next section ofthe code retrieves some additional values :from some operations on the main flowsheet Figure 25 'Report some other Results ----------------------------------------------------'Get Compressor K-lOl Pressure Rise Sec hyComp - hyCaae.FloDsheec.Operaciona.Icem("K-10l") StrUn~
t
~
Range ("OtherReaul tS5tart") . Offaet (0, 1)
Range ("OcherResulcsSCarc") .Of:fsec(O, 0)
= hyComp.DelcaP.GecValue(ScrUnic)
'And E-I01 Temperature Drop Sec hyCool = hyCase.FloDsheec.Operaclons.Icem("E-101") ScrUni c - Range ("OcherResul caStarc") . Offsec (1, i)
Range ("OtherReaultsStart") .Offset(l, 0)
~
hVcool.DeltaT.GetValue(StrUnit)
20. Execute this section of the code. The final sections of the code deal with obtaining component specific properties.
23
204
AutolMtion Introduction
Filllure26 'Mole F~ac~ion of Methane in Expo~t Gas st~eam--------------------------------- 'First must determine the position of Methane in the component list
IntCWlIdx
~
-1
'Get an object for the collec~ion of components in the fluid package Set hyCpts ~ hyCase.Flo~sheet.FluidPackage.Components 'All collections have a Count property that says hON many items they have 'NON count through the components to find Methane For IntCount = 0 To hyCpts.Count - L 'Get a particular component Set hyCpt = hyCpts.ltem(IntCoun~) 'Check it's name
If hyCpt.NElllle IntCH4Idx 'Exit the Exit For End I f Next IntCount
"Methane" Then IntCount Fo~ ... To ... Nex~ loop ~ ~
21. Execute this section of the code.
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 IntCotmt variable is increased until it reaches the number of components minus one.
All the Aspen HYSYS collections are -Z8ra based." The first term Is at position
zero.
The result of this loop is that if Methane is present in the case then its position in the list of components will have been placed into the IntCH4Idx variable.
24
Automation IntroductlDn
25
Figure 27 II IntCH4[dx <> -1 Then 'NEthane is in the caSE
'GEt an array ot all the component mole tractions in ~he Export Gas stream VarHYArray = hyCase.flomsheet.MaterialStreams . Item ("EXPORT GAS") . ComponentMo larfract lOn. GetValues ("") 'Here the GetValues() method or a RealflexVariablei is used - this is hom 'HYSY5 deals mith arrays or values. 'Since in this case a mole rraction is being used the~e are no units 'RetrLeve the Methane value Ln this array - this is a~ index IntCHqldx Range ("OtherResultsStart") .Orrset(2, 0) .Value - VarHyArray(IntCHqldx) E13E Range ("OtherRe3ult3Start") .O:f:fset(2, 0) .Value
End I:f
All Aspen HYSYS valUf'B that contain arrays of data (for example, component mass :fractions. mole flows, or tray by tray data in a column) have a special object ~ called ReaIFIexVariable. 22. Look up the ComponentMolarFraction parameter ofthe ProcessStream object in the Object Browser and. confirm that it is oftype RealFIexVariable. ReaIFIexVariables have methods caI1ed SetValues and GetValues, which are analogous to those fur R.ealVariables except that the value pa8sed or retmned is a Variant This is a special kind ofVB variable that can contain any kind of data. In this case it contains an array of data. 23. Note that at the top ofthe procedure VarHyArray is defined as type Variant. 24. Run the code above, when the VarHyArray = VarHyArray.
...
line is reached, add a Watch for
Nate that the CanModify property of the
RealFlexvarlables aIeo returns a Variant erreyof Boolean (TrueiFalse) values.
.,
Vi'''·'
""tty"'.•
M[y - "'......"',,<1)'(0) -V_"'"",CI)
Var~I'itJl)Ci.tlIl!I(OI()9)
~"'>l
modH';t.\·t~Jf'v'"SYSE"X~t
t 52G9sesen89e:1f·02 lO;7S000sHl'll!E·oa
l'<>J,~
"",dH"Y'<'«le HY5'\'SO:
l'<>J,~
",,;H,~JtYSYS~(
[>u,~
I1lOdHys~«1e.JfYSYSfu~a::Il
-
V~""'t.bY(3l
D;9:34BI519-4771531 462BStl02U2G8E{E·02
ClJJt:l1e
rMdH.. W~JtYSYSExed.....WlCO'.ll
t S1S9'009&'131lf-03 4.41 58981 93;jD251E.05
[>u,~
tf)OdHYQy~jf'y'SYS~~1
-
V_"'''''I(4) V_.m.y(S)
"","",""tl'/(6)
1.647SI2331~607lf,..05
D
IMdH';S~1fYSYS~(
""'~
rflOdH.. ~~jf1SYSExoet..:u.Oxlt
V~.4rray(8)
t llll04:l91SSUee-os :1 S'97328951118:176E.07 1 7.J916224ro792E-DI3
.............,.(2)
-
"'_""",171 "_""*,,(9)
Dwb~
[>u,~
C
IKldHy.s:y!Ccde~Seo:eI....i'lkCcd/
rrodHysys.Ccd!!l.ffi"s.,-S~t
""'dH'<_JlYSYS~'3
Wlud is tire Wllru: in tIris""., III tile ptnitiDlI1I&l in the Ilf/CH41ix 'VIIIiIIbIe? Dt1e& tJUs IIJflW! MtIJ tile MetIuuw ..ole jivlctitllIl1itIplIIyI4 in Aapell HYSYS?
25
26
AutolMtion Introduction
Finally, all the component mass fractions in the Product LPG s1ream are to be reported. Figure 211 'Report Product LPG nass
Fractions---------------------------------------------
IGet a variant containing the cpt names
VarHyArray I
~
hyCpts,NaIDes
rrr itE thEm
for IntCount ~ 0 To hyCpts.Count - 1 Range ("CptData" I ,Off"et (IntCount, 0 I . Val ue N""t IntCount
VarHyArray(IntCountl
IGet a variant containing the mole fraction date
Var Hy Array
~
hyCase. f 1 ONS he et . Ha ter ial5 tre ams. Item ( "10") . Compane nt lias sF rac t
l
onVal ue
'Not" that thi" tim" th" .Compon"ntMEtssfrEtctionValu" prop"rty is U3"ct rath"r than 'usin~ th~
.Compon~ntllassFraction.G~tValu~sllm~thod
'All HYSYS properties also have .... Value or .... Values properties , leg Temperature and TemperatureValue and Pressure and PressureValuel 'In all cases ... Value or ... Values returns a number in HY5Y5 internal units I
IJr
it~
th~l'r'I
For IntCount = 0 To hyCpts.Count - 1 Range ("CptData." I . Offset (IntCount, 11. Val ue Next IntCount
VarHyArray(IntCountl
25. Execute this section of the code.
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. Note that instead ofusing ComponentMassFraction.GetValuesO as above, this time the ComponentMassF:ractianValue property of the ProcessStream object is used. 26. Examine the ProcessStream object in the Object Browser. Note that each of the properties also has a corresponding ...Value property. (For example, Temperature and TemperatureValue or Pressure and PressureValue) Wlild lITe tile types oftIu! ••• VII1l1epmperlia1
28
Automation Intracluction
'D
In eacl1 case the ...Value property simply returns a value oftype Double (in the case of single valued properties like temperature), or Variant (in the case ofcomponent properties), in the Aspen HYSYS internal calculation units. Rather than UH the ...Value properti.. of the ProceuStnlam object, it ia generally better practice to use the .Value(s) property 01 the ReaI(FIex)Variable. ReelVariables and ReelFlexv..-iabl81 aIIo have properties called Value and Values, which rebJm numbers In Aspen HYSYS internal units.
The final lines ofthe main code clear all the object variables and then instruct VBA to skip the error handler ifno error has occurred. Figure 30 'Clear Object Variables 'This is good p~og~arnming Set hyApp ~ Nothlng Set hyCase - Noching Set hy5bF5 - Nothlng Set hyStream ~ Nothing Set hyExpande~ = Nothing Set hyCpts - Nothlng Set hyCpt = Nothing Set hyComp Nothlng Set hyCool ~ Nothlng
p~actic~
'End or normal procedure Exit Sub
27
28
Automation Introduction
Aspen HYSYS User Variables Introduction User Variables can be used to add to the internal functionality ofAspen HYSYS objects, such as streams and unit operations, by attaching variables and code to those objects from within Aspen HYSYS itself. User Variables can be used like the variables built in to Aspen HYSYS objects; so can be added to spreadsheets, targeted by logic controllers, have their values specified by user input, etc. Typical uses for User Variables are: •
Calculation of Custom Properties: o
•
Automation of actions: o
•
Calculation of a dew point temperature. Automatically adding an energy stream each time a pump is added.
Adding extra intelligence to the Aspen HYSYS model: o
Relating the pressure drop through a heater to the flow rate.
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
Adding aUser Variable The location of the User Variable information within the Aspen HYSYS property win.dowIiI depends 00 the object they are being added to. Object
I Loatlon
Opend:IDn. (_pi Loglcala)
Dalgn tab... UHr Varlabl. . page
atr-ma
Workah... tab... U..... Varlabl. . page
logical O.-mIDn.
U_ Variables tab
Flowaheet
Flowa'-f: menu... FlowshMi IJsM' Variables option
Slmulld:IDn Cue
SlmulatlDn menu... SlmulatlDn Case U_ Variables option
When any ofthese locations il opened the view will be similar. (Below is the view for a stream.) Flgun31 1A
I!I~Ef
I I Ii I
Condilions
! P, ope, Ii e,
Composition
KValue U%er Va.iable% Notes
. Cost Pa, ~ meters
29
30
Automation Introduction
To add a new User Variable, click. the Create New UIeI' Variable icon. The Create New Uler Variable dialog box then appears. Create New User Variable
Figure 32 ~ Crcalc Hcw UscrVa"ablc
ICal
~1iI13
Dimensions 1,,1 nils
Yariabl
n
Prebecute[] Posthecute[]
Variable Changing
L
Variable Changed Y"riable Query Mac.os
r
r
I A~lribules I Fillers I Securily I Defaulls ~WI~
Pr oe:
r
I(d e "Ia.ati"... )
II
I ~ MI·
<;"~ C§ r;,~I~
El
[
The only User Variables that can run in Dynamics are the DynComp•.• and DynPras... Usef Variables for opefatlons.
These are called before each ccmpasiliOlllpr&lBUre flow spec respectively.
I
Cancel
I
Ok
This window is the lIllID.e far all types afuser variables. The only difference is the available macro types.
o.....tion
StrMm
-
-
PreExeG~lclJ
I
- , r
Po~IE~ule!LJ-C-
The only way to cl08elt1e INIndow and save any chenges made Is to click
FlowahHt
SimulMion Cue
.-=-=-=
__
Pt'~ITr-1
-o-nCOm~~7J' ~- I O~Pteuul6fb;Pr¥~; r
PreSolvelJ I PoslSolvelJ I
LI
r
~ I I
OnSay~1I1
0 0
OnOpenljl
0
Mainlll
1
I
This choice sets when the code gets called. For S1reams. Operations, and Flowsheets the choices are before and after the object does its calculations. Simulation Case user variables are only ever c::ocec:uted when the user clicks the button on the User Variable window.
the OK button.
Before the User Variable code window can be closed (by clicking OK), a name must be set far the User Variable.
30
Automation Introduction
!&~
ShowIHlde Verleble Details icon
Edit the Selected User Variable icon
31
The Show I Hide Variable Details icon (green triangle) in the top right comer ofthis window is used to toggle the display ofthe User Variable details tabs. In order to edit an existing User Variable, click the Edit the Selected Uler Variable
icon on the User Variable page ofthe Aspen HYSYS object, or doubll>clic.k the WICI' variable value cell.
Important User Variable Parameters Two ofthe most important parameters are: 1. User Variable Type
Cbanging the combobox values at the top-right allows the user to choose the type of User Variable. Flgur.33
IJpe
rRe~1
Dimensions
I Scalar
Units
!Index
---fJ
---
- Numerical (Real), Text, Code Only... - Single Velue (SCalar), or vectors, matrtces, or cubes - Unil8 cl any numeric values (Temperature. PrBBBUre...)
2. User Variable Activation Setting the Activation parameters on the Attributes tab tells Aspen HYSYS on which objectll to enable the User Variable. (Automatic = Enabled on all objects ofthe same type, User Enabled = Allow the user to pick on which objects the Uller Variable should be enabled.) Figure 34 Aclivalion--=========:' (' Automatic
Solve,.,...-----, r Trigger 50lve
31
32
Automation Introduction
If the User Variable does not appear on the User Variables page of an object on which it is to be enabled it may be necessary to ensure the Show I Hide Variable Enabling Checkboxel button (the green tick) is selected. Filiun 3& Detign
::Jil, G'l.
.II
Connecti-6ns
.,
\.>.
-
i
P ar,ar:n'eters
'''I~ _._-- 1--
Uter Variab les Notes
j -
Desiigh
Cormectiol1S Parameters
I
.1 All
1£lI1 G'l
')((1
estUV
-
~ l"'z+-§Ir·~
-
-
'''10'
II
User Variables' Noles
A more comprehensive description ofthe User Variable code window can be found in Section 5 ofthe Aspen HYSYS Custamization Guide.
Writing User Variable Code The Alpen HYSYS VB code editing window offera most ofthe same fimctionality ofthe VBA editor found in Microsoft Excel. Breakpoints can be added by clicking in the left margin or clicking the Toggle Break. toolbar icon. When running in break mode, Watches can be set on particular variables.
There is also a built in Object Browser. Since the code is executed :from Alpen HYSYS there is no need to make a reference to the Aspen 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 acceBBing Aspen HYSYS from Excel. The only difference is how to connect into the Aspen HYSYS object hierarchy, and how to interact with the displayed user variable value.
32
Automation Introduction
33
Accessing Top Level Objects Two built-in objects allow entry into the object hierarchy 1.
ActiveObject •
2.
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: o
Stream User Variable = Returns a ProcessStream type object for the stream containing the user variable.
o
Operation User Variable = Returns an object for the operation containing the user variable. (Type of object depends on the type of operation.)
o
Flowsheet User Variables = Flowsheet object for owner flowsheet.
o
Simulation Case User Variables = Not supported - use ActiveCase object instead.
ActiveCase - Always returns a SimulationCase object for the case containing the User Variable.
Interacting with the User Variable Value Using the code ActiveVariableWrapper. Variable will return an object for the User Variable. The type of object depends on the user variable type. User Variable... Type
... Dimensions
Object Type
Real
Scalar
RealVariable
Vector, Matrix, Cube
RealFlexVariable
Scalar
RealVariable
Enumeration
Text
Code Only
Vector
RealFlexVariable
Scalar
TextVariable
Vector
TextFlexVariable
No variable available
Hence the methods GetValueO or SetValueQ can then be used as in the ExcelAspen HYSYS example.
33
34
Automation Introduction
Importing/Exporting User Variables Yau may import and export User Variables between cases via the Import and E:qaort Uler Variables window. (Access this by going to the Simulation ... Import and E:qaort Uler Variables option.) User Variables are saved into files with .huv extensions.
~ ImpOil and [",pOlt User Vauables
EJ
r-Us:er Variables In
Ulol.,
rUser Variables In Etlporf File
fl-...•_lI.!QQ...\;~IP----l ~ E,po,I··) I.
<··lmpPlt
~
I I
".IM"
I
ell,.... E,po,1 Filt None
(. d.'lOI"'llIllIChing v.,_ ....,po,llil.]
C_et
1
Selecl File...
I
OK
I
II
Exporting a User Variable 1.
Open the Import and Export User Variables view.
A list of User Variables currently attached to the case is displayed in the User Variab1el in Cue group. The list box on the right displays a list of variables attached to the object (stream, operation, flowsheet, or simulation case) selected in the list box on the left. 2.
Select the User Variable to export then click the Export buttrm.
3.
On. the file dialogue that appears, set the tile name of the required. User Variable export :file (this will have a .huv extensicm).
Importing a User Variable
34
1.
Open the Import and Export User Variables view.
2.
Click the Sdeet FIle button and then navigate to the location of the .buv :file.
3.
Select the variable you wish to import and click the Import button.
Automation Introduction
35
Exercise - User Variables A simple User Variable that relates the pressure drop on a Cooler to the mass flow rate will be demonstrated.
Dal't worry If you haven't built the Turbo expand. plant case.
The file "ADV5_Spreecls& C.estud SoIn.hsc" contains the case.
Again, in this Workshop you will review the use of 8OID.e prewritten code rather than typing a large amount of code into the User Variable code window. 1.
Open the Turbo Expander Aspen HYSYS case.
2. Add a User Variable to Cooler &-101 (the Rccompressor after cooler). See page 29 for guidance on how to do this. 3.
Set the following User Variable plll'8Il1eters:
ParalMtllr
Value
Name
Pressure Drop Calc
(T1I8 will automldlcally b. 8et to the sem.)
Type
Real
Dimensions
Seal.
Units
Pressure Drop
Execution (Macro tab)
PreExecute()
Activation (Atirtbufaa tab)
UII8I' Enabled
Varlabl•... C8lculete Only (Security tab)
Checked
4.
Either type the code below into the code window, or paste it from the supplied text :file. ("Adv Automation - UV Code.txf')
35
36
AutolMtion Introduction
Filllure37
'Require Expllcit Varlable declaratlun Optlun Expll Clt Sub PreExecute() :De:scri pti on:
HYSYS Advance:d Course, Automation Introduction Illustrate a simple Use:r variable that links the: pre:ssure drop on a cooler, to the mass flow rate
'Declare Varlables ------------------------------------------------------------'Variable to llnk to the Heate Cuntainer operation Dim hyCooler A~ CuolerOp Dim hyFeedStrm A~ Proce~~Stream Dim DblFee:dFlo~ As Double Dim DblCalcPD As Double 'De:fine Constants -------------------------------------------------------------'It is conventlon to give constants names In ALL CAPITALS Const MINFLOW As Integer~O Const MAXFLOW As Long~100000 Con~t MINPD A~ Integer=O Con~t MAXPD A~ Integer=50 'MAXFLOW
l~
'Mln flowrate (kg/h) 'Max flowrate (kg/h) 'Mln pre~~ure drup (kPa) 'Max pre~~ure drup (kPa)
tou blg fur the Integer data type hence
u~e
Lung (Integer)
'Proce:dure: --------------------------------------------------------------------'Se:tup an Error Handler On Error GoTo ErrorHandler 'Clear any value that is currently In the User Variable ActlveVarlableWrapper.Variable.Erase 'Here Act,veVar,ableWrapper.Var,able glve~ a RealVarlable object for the 'Set up object variable~ for the Couler contalner op and Set hyCooler - ActiveOb]ect Se:t hyFee:dStrm - hyCoole:r.FeedStre:am
it'~
feed
~tream
'Is the mass flow rate known? If hyFeedStrm.MassFlow.IsKnown~TrueThen 'Here hyFeedstrm.MassFlow lS an InternalRealVarlable 'Flow lS known - get the value In kg/h uSlng the GetValue() method Db1 FeedFl uw = hyFeedStrm. Ma~5Fl uw. GetVa1ue (" kgjh") 'Interpolate between data puint~ tu determlne pre~5ure drop DblCalcPD=(MaxPD-MinPD)I(MaxFlow-MlnFluw)~DblFeedFlow 'Set this value into the Coole:r de:lta P hyCoo1er. PressureDrop. SetVa1 ue: Db 1Cal cPO, "kPa" 'and the User var1able value ActlVeVari ab 1 eWrapper. Var1 abl e. Se1:Val ue Dbleal cPD, "kPa" End If 'clear object variables - Good Practice Set hyCooler=Nothlng Set hy.eedStrm=Hothlng 'End of normal procedure EXl t Sub ErrorHandler: End Sub
38
U~er
Val'
Automation IntroductlDn
S.
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.
37
Note that the first time the code is called aftet the chBD.ge is made. the mass flow through the cooler is not known hence the code in the If hyFeedStrm.MassFlow.IsKnown=True Then ... End If section is not executed. It's beBt to trigger the User Vlriable for debugging by changing 8 value In the
f1DWBheal:, 8nd hence making Aspen HYSYS call the cocle. If th8 code is triggered by
clicking the StatlResume taoIbar button then any
This is because when the solver performs steady state calculations there are two solve passes which it performs; the forget pus and the calculate pass. When the value ofa wriable changes, the solver:first: does one solve pass with the value marked. as unknown. This is the forget pass. This allows Aspen HYSYS to correctly propagate the effects of any change.
7.
Export the User Variable and import it into another case. (You could try one of the Aspen HYSYS sample cases, or one of the solution cases for this course.)
ActIveObiect references will not point to the correct
object
Challenge Try using this code in a IIimilar Ulef 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. the density. or the composition of a particular component
37
38
38
Automation Introduction