Aspen Examples
Aspen Examples
Examples
February 2000
Copyright © 2000, Aspen Technology, Inc. All rights reserved.
™ ™ ™
Aspen Custom Modeler , Aspen Dynamics , Aspen Engineering Suite , Aspen Plus®, AspenTech®,
™
Plantelligence and the Plantelligence logo, Polymers Plus ®, Properties Plus ®, and the aspen leaf logo are
trademarks or registered trademarks of Aspen Technology, Inc., Cambridge, MA.
All other brand and product names are trademarks or registered trademarks of their respective companies.
This manual is intended as a guide to using AspenTech's software. This documentation contains AspenTech
proprietary and confidential information
information and may not be disclosed, used, or copied without the prior consent of
AspenTech or as set forth in the applicable license agreement. Users are solely responsible for the proper use of the
software and the application of the results obtained.
Although AspenTech has tested the software and reviewed the documentation,
documentation, the sole warranty for the software
may be found in the applicable license agreement between AspenTech and the user. ASPENTECH MAKES NO
WARRANTY OR REPRESENTATION, EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO
THIS DOCUMENTATION, ITS QUALITY, PERFORMANCE, MERCHANTABILITY, OR FITNESS
FOR A PARTICULAR PURPOSE.
Corporate
Aspen Technology, Inc.
Ten Canal Park
Cambridge, MA 02141-2201
USA
Phone:
Phone: +1 (617)
(617) 949-10
949-1000
00
Fax: +1 (617) 949-0130
URL:
URL: http
http:/
://w
/www
ww.a
.asp
spen
ente
tech
ch.c
.com
om
Division
Design, Simulation, and Optimization
AspenTech Ltd
Sheraton House, Castle Park
Cambridge CB3 0AX
UK
Phone:
Phone: +44
+44 (0)1
(0)122
223-3
3-3122
12220
20
Fax: (0)1223-366980 .
+44 (0)1223-366980
February 2000
Copyright © 2000, Aspen Technology, Inc. All rights reserved.
™ ™ ™
Aspen Custom Modeler , Aspen Dynamics , Aspen Engineering Suite , Aspen Plus®, AspenTech®,
™
Plantelligence and the Plantelligence logo, Polymers Plus ®, Properties Plus ®, and the aspen leaf logo are
trademarks or registered trademarks of Aspen Technology, Inc., Cambridge, MA.
All other brand and product names are trademarks or registered trademarks of their respective companies.
This manual is intended as a guide to using AspenTech's software. This documentation contains AspenTech
proprietary and confidential information
information and may not be disclosed, used, or copied without the prior consent of
AspenTech or as set forth in the applicable license agreement. Users are solely responsible for the proper use of the
software and the application of the results obtained.
Although AspenTech has tested the software and reviewed the documentation,
documentation, the sole warranty for the software
may be found in the applicable license agreement between AspenTech and the user. ASPENTECH MAKES NO
WARRANTY OR REPRESENTATION, EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO
THIS DOCUMENTATION, ITS QUALITY, PERFORMANCE, MERCHANTABILITY, OR FITNESS
FOR A PARTICULAR PURPOSE.
Corporate
Aspen Technology, Inc.
Ten Canal Park
Cambridge, MA 02141-2201
USA
Phone:
Phone: +1 (617)
(617) 949-10
949-1000
00
Fax: +1 (617) 949-0130
URL:
URL: http
http:/
://w
/www
ww.a
.asp
spen
ente
tech
ch.c
.com
om
Division
Design, Simulation, and Optimization
AspenTech Ltd
Sheraton House, Castle Park
Cambridge CB3 0AX
UK
Phone:
Phone: +44
+44 (0)1
(0)122
223-3
3-3122
12220
20
Fax: (0)1223-366980 .
+44 (0)1223-366980
Contents
Introduction
For More In forma tion......... ................................... ................................... ...................... viii
Online Help............ ................................... ................................... ............................... viii
P rinted Man ua ls ...............
......................
..............
..............
...............
...............
..............
..............
..............
...............
...............
..............
..............
.............
...... ix
P ortable Document
Document Forma t Files (PD Fs)...............
Fs).....................
.............
.............
............
............
............
............
............
...........
..... ix
World Wide
Wide Web
Web ................................. ................................... ................................... ......x
Technical Support...........................................................................................................x
1 Five
Fi ve Tanks Example
Run ning the Five Ta nks Exa mple....................................................................... ....... 1-2 1-2
Adva nced F eat ures in Five Ta nks Exa mple ............. ...................
.............
..............
.............
.............
..............
.............
.............
....... 1-3
1-3
U sing Microsoft
Microsoft Excel............ ................................... .................................... .............. 1-3 1-3
Run ning from Microsoft
Microsoft Visual B a sic ........................................................................ 1-4 1-4
Ta sks ..................... ......................... ........................ ......................... ......................... ... 1-5
1-5
2 Absorber
Absorber E xample
Models U sed in th e Absorber Exa mple ...................................................................... 2-2 2-2
Sett ing U p P roperties
roperties P lus for t he Absorber
Absorber E xample ...........
.................
...........
...........
............
............
...........
....... 2-3
2-3
Run ning th e Absorber Exa mple ............................................................... .................. 2-32-3
Adding Cont rollers
rollers to th e Absorber Exa mple ............................................................ 2-4 2-4
3 Double
Double Effect Evapo
E vaporator
rator Optimization
Opti mization Exam
E xample
ple
Running the Double Effect Eva pora
pora tor Exa mple.......
mple.............
............
............
.............
.............
............
............
...........
..... 3-2
3-2
6 Reactor
Reactor Dynamic E stimation
stimation E xample
xample
Running the Reactor D yna mic Estima tion Exa mple..............
mple....................
............
...........
...........
............
...........
....... 6-2
6-2
7 Steady-Sta
Steady-State
te Estimation
E stimation of a Methanol R eactor
eactor
Running the Metha nol R eactor Exa mple.............
mple...................
.............
..............
.............
.............
..............
.............
.............
......... 7-2
Cont rolling NL2SOL Options ......................................................... ............................ 7-47-4
As p e n C u s t om M od e l e r E x a m p l e s iii
Version 10.2
8 Catalytic Bed Regeneration Example
Running the Ca ta lytic B ed Exa mple.......................................................................... 8-3
Introduction
Exa mple simulat ions a re included in your Aspen Cust om Modeler™ insta llation.
If y ou ha ve insta lled in t he default location, these will be in the folder
C:\Program Files\AspenTech\Aspen Custom Modeler 10.2\Examples.
C:\ P rogra m Files\ AspenTech\ Working Folder\ Aspen Cu stom Modeler 10.2
This section explains how t o use the online help, print P DF files, find Aspen
Technology on t he w eb, an d cont a ct Technica l Support .
Online Help
To a ccess onlin e H elp:
Fr om th e Help menu, click H elp Topics an d t hen do one of the follow ing:
To Do this
Display an index of all Help topics Click the Index tab and then type the word you require
Search for words or phrases within t he Click the Find tab and then type the word or phrase you require
Help topics
Tip To display H elp on but tons, fields, menu comma nds, an d oth er screen
element s, click th e Wha t's This but ton: or , at the top of the window, a nd
th en click the element.
1
Aspen Modeler products include Aspen Cust om Modeler™ , Aspen Dyn a mics™ , Aspen
ADSIM™ , and Aspen Ch romatography™ .
Improving Help
We value your comments, suggestions, and criticisms. If you could not find the
informa tion you wa nt ed, needed more assista nce, or ha ve any suggestions for
improvements to our online informa tion, we wa nt to know.
Printed Manuals
The following printed manual is supplied with your product:
• A sp en C u s t om M od el e r a n d A sp en D yn a m i c s I n st a l l a t i on M a n u a l
This guide pr ovides inst ructions on inst a lling th e product(s).
Tip If you do not ha ve the Adobe Acrobat Reader, you ca n download a fr ee copy
from the Adobe web site a t http://www.adobe.com.
http://www.aspentech.com/
Technical Support
You can get help from AspenTech's technical support resources on the World Wide
Web, or by contacting an AspenTech office.
http://support.aspentech.com/
Approximat ely t hree da ys a fter r egistering, you w ill receive a confirma tion e-ma il
a nd y ou w ill then be able to access this informa tion.
AspenTech Hotline
If you need help from an AspenTech Customer Support engineer, contact the
Hotline at a ny of these locations:
South America
(Argentina office) +54-11/4393-5308 +54-11/4394-8621 [email protected]
(Brazil office) +55-11/5012-0321 +55-11/5012-4442 [email protected]
x ii As p e n C u s t om M od e l e r E x a m p l e s
Version 10.2
Chapter 1
1 F i v e Ta n k s E x a m p l e
This exa mple models
models five open
open ta nks in series. The
The key a ssumpt ions
ions a re:
• Flow out of each tank is proportional to the square root of the level of fluid in
the ta nk
• Fluid
Fluid a t consta
consta nt density
• Ta nk geometr
geometr y is a regular sided
sided vert ica
ica l cylinder
cylinder
• No overflow condition
As p e n C u s t om M od e l e r E x a m p l e s 1- 1
Version 10.2
Five Tanks
Example
R unning
unning the Five Tanks E xample
xample
Exa mple simulat
simulat ions
ions a re included
included in your Aspe
Aspen n C ustom Modele
Modeler™
r™ insta lla
lla tion.
If you ha ve insta lled
lled in t he default loca
loca tion, file
filess for this example will be in th e
folder:
C:\ P rogram Files\Asp
Files\AspenTenTecech\
h\ Aspen
spen Cust om Modele
Modelerr 10.2
10.2\E
\E xamples\Fiveta nk
3. D ouble-clic
ouble-click
k t he file fivetank.acmf .
You
You can run the simulat ion ion dyna mica
mica lly and cha nge the feed
feed flo
flow r a te to the first
ta nk using a n AllV
AllVaa ria bles
bles ta ble.
ble. To
To do this:
In t he Flow
Flow sheet
sheet w indow, double
double--clic
click
k the str eam FeedSt ream t ha t enters
Ta nk1. En ter a new va lue for
for th e varia ble displa
displa yed as Flow.
You can see the simulation respond to your step change by displaying a plot. To
do this:
1. In th e All It ems pa
pa ne of
of the Sim ula tion Explorer,
Explorer, clic
click
k Flow
Flow sheet.
2. In th e Cont ents pan e, double-cl
double-click
ick th e plot
plot TankVolumes to display
display it.
3. Double-cli
Double-click ck th e ta nk icons
icons on th e flowsheet.
flowsheet. This
This gives a more deta iled
iled plot
plot of
k ey
ey t a n k d a t a .
4. Click
Click Run and w a tch the simula
simula tion respond
respond to your step change.
1-2
1-2 Aspen Cu st om Modeler E xa mples
Version 10.2
Chapter 1
To run t he exam ple, load t he FiveTa nk.a cmf file a nd t he FiveTa nk.xls E xcel file.
1. In t he FiveTa nk.xls E xcel file, click th e w orksheet ca lled Im port D a ta .
You can see time /value pairs a ppea ring in a column in t he spreadsheet.
3. When you have enough da ta , click the P a use butt on.
You can n ow use the time /value dat a to define a plot, or to use in further
spreadsheet calculat ions.
The w orksheet S chedule conta ins a number of t ime /va lue pairs r epresenting
the desired va lue of feed flowra te a t a specific time.
Ta nk volumes a re reported in th e cont rol pan el. The color of t he t ext la bels for
the ta nk volume indicate low a lar m a nd high a larm conditions.
Tasks
You can r un a ta sk tha t is supplied with the example. This ta sk covers the ma in
ta sk fea tur es a va ilable in Aspen Cust om Modeler™ .
Now wh en you run a dyna mic simulat ion, the instructions in the ta sk ar e ca rried
out. These instr uctions show a number of different distur ban ces you ca n ma ke to
a dyna mic run.
You can look at the results of the simulation through predefined plots.
Ea ch tan k on the flowsh eet conta ins a plot na med Ta nkP lot.
Note If you are using a Simulat ion Engine insta llation from a client ma chine,
ma ke sure tha t y ou run Aspen P lus using the sa me server and the sam e working
folder a s you ha ve configur ed for Aspen Cu stom Modeler.
This exam ple simula tion is from Equi li bri um -Stage Separat ion Oper ati ons in
Chemi cal Engi neeri ng , by Ernest J . Henley a nd J .D. Seader, Exa mple 12.8, page
466. A simple, 6-sta ge-a bsorber is used to r emove heavy components from a light
ga s strea m w ith a high-molecular weight oil.
antoine_model Calculate coefficients for a simple ideal model for equilibrium k values based upon a
simplified Antoine’s equation
enthalpy_model Calculate coefficients for a simple component enthalpy model for the vapor and liquid
phases
props Calculate physical properties based upon the simplified equations or rigorous physical
property calls from PROPERTIES PLUS
tray_hydraulics Calculate the holdup and flow rates for the vapor and liquid phases for each tray
The tra y model is the hear t of the simula tion, and includes ma teria l and energy
bala nce equa tions for a n equilibrium sta ge model. The equat ions a re writ ten so
tha t th ey a re self-norma lized by the flows in t he column. This helps speed t he
solution of the problem. The column model orga nizes ea ch of the m odels int o the
a bsorber simulat ion.
Note the str ucture of ea ch of th e models. For exa mple, th e tra y model and column
model include IF st ructures a round logica l IS CONNE CTED for ea ch of th e ports.
This illustr a tes how t he model ca n convert it s equa tions to new equa tions
depending upon th e flow sheet connectivit y, an d is a n example of model
polymorphism. In a ddition, a para meter called proptype is used to switch the
models between rigorous and simple property models, and is another example of
polymorphism.
Connect from To
3. P lace a nother P ID controller on the flowsh eet. This will be a level controller
to ma nipulate t he liquid flow ba sed on t he bott om st a ge liquid level. Use
ControlSigna l to connect t he new P ID contr oller:
Connect from To
4. Double-click each cont roller t o access the cont roller fa ce-plat e, an d th en click
the C onfigure butt on . For each contr oller, click the In itialize Va lues but ton t o
set up defa ult va lues for t he contr oller.
6. When you ha ve a dded the controllers, run the simulat ion in steady-sta te
mode.
7. Cha nge the run mode to Dyna mic and sta rt the run.
8. View cha nges in th e column tempera tu re profile using th e Flowsh eet plot
TempP rofile.
3 D ouble E ffect
E va pora t or Opt imiza t ion
Example
This example models a tw o-sta ge evaporat or system.
A glycol/w a ter solut ion ent ers th e first vessel an d is hea ted by stea m. The glycol
is concentr a ted a nd t he vapor offta ke from t he first vessel is used to heat the
second eva pora tion sta ge running a t a lower pressure.
The decision va ria bles a re given a specifica tion Vary . For t his simulat ion, t he
decision va riables a re:
• Outlet P ressure for th e Va por str eam
• Valve position for t he process feed st rea m, effectively th e process feed flow
rate
• Va lve position for t he stea m feed strea m, effectively t he stea m feed flow ra te
The following constraints are applied to the simulation in the Flowsheet
Constra ints definition:
• Minimum concentr a tion in E va porat or 2 is 0.12 kg/kg
• Minimum pressure in Eva pora tor 2 is 30.0 bar
• Ma ximum temperat ure in both evaporat ors is 100.0 Celsius
3- 2 3 D ou
Version 10.2
Chapter 4
4 H ea t ed Met a l C ube
(P D E ) E xa mple
This simulat ion models a cube of a ma teria l heat ed across three surfa ces.
The heat flux through t he ma teria l slab is m odeled in t hree dimensions. The heat
flux equa tion is a second order, pa rtia l derivat ive. P a rt ial derivat ives a re used in
thr ee spa tia l dimensions t o model the cube of ma terial.
Ta sks ar e provided th a t simula te ra ising the temperat ure of thr ee of the surfa ces
of the cube an d ra ising the tempera tur e of th ree of th e edges of the cube. You can
combine these heating effects t o experiment w ith different dyn a mic temperat ure
profiles in t he cube.
7. In Aspen
Aspen Custom Model
Modeler,
er, clic
click
k Run to star t t he dyna mic run t hen in Excel
Excel,,
wa tch the plo
plots
ts change as the surfa ce temperat ures increase.
increase. You
You may need
to pause th e simula
simula tion to allow E xcel
xcel time to upda
upda te th e surface plo
plot.
4-2
4-2 Aspen Cu st om Modeler E xa mples
Version 10.2
Chapter 5
5 H ea t ed M et a l S l a b
(P D E ) E x a mpl
mp l e
This simulation models a slab of a material heated and cooled on opposite sides.
For example,
example, this simula tion coul
couldd represent
represent the hea t flow t hrough t he wa ll of
of a
vessel, heated or cooled with a jacket.
A Microsoft®
Microsoft® E xcel
xcel spreadsh eet file is is provided to give a su rfa ce plot
plot of t he
temperat ure in th e tw o spa
spa tia l directions
directions modele
modeled.
d.
As p e n C u s t om M od e l e r E x a m p l e s 5- 1
Version 10.2
Heated Metal
Slab Example
3. D ouble-clic
ouble-click
k t he f ile HeatedSlab.acmf .
4. In the All Items pane of the Simulation Explorer, click Flowsheet.
5. In t he Contents pan e, clic
click
k Flow
Flow sheet
sheet a nd a ctivat e the ta sk Side2.
Side2.
6. In t he mode box
box on
on t he Run C ontrol too
toolbar, cha nge the run mode to
Dynamic.
7. B efore
efore run ning the simulat ion,
ion, open
open th e Microsoft®
Microsoft® E xcel
xcel sprea dsheet file
file
Hea tedS lab.xls to display
display the tempera
tempera tur es inside the slab. If a dia log
log box
box
a ppea
ppea rs a sking if you
you w a nt to updat e your
your w orkbook,
rkbook, or
or your ma cros,
cros, clic
click
k
YES.
Note You You need
need Excel
Excel 95 or la ter to use th is sprea dsheet file.
file.
8. St ar t the dynam ic run an d wa tch the Excel
Excel surface plo
plot change as the
temperat ures change on tw o oppo
opposite
site edges
edges of the slab. You may need to
pause th e simulation to allow E xcel
xcel time to upda
upda te th e surfa ce plot.
plot.
5-2
5-2 Aspen Cu st om Modeler E xa mples
Version 10.2
Chapter 5
6 Rea ct or D y n a m ic
E stima t ion E xa mple
This exam ple models a simple rea ctor. There a re th ree component s in th e syst em
an d tw o main reactions.
K3
A → S (1)
K1 K2
A → Q → S (2)
The estima tion simulat ion calculat ed estimat ed values of K1, K2, a nd K 3 from
experimenta l measurements of the concentr a tions of A a nd Q.
7. Cha nge th e run mode to Est imat ion and run th e simulat ion. Wa it for the
solution to complete.
8. To observe th e result s on the Est ima ted Var ia bles ta b, from th e Tools menu,
click Estimation.
9. To check the accura cy of th e plot, on th e Mea sured Var ia bles ta b of the
Est imat ion d ialog box, double-click t he mea sured va ria bles t o edit them, a nd
observe the deviations. You may also plot these results here.
– or –
Note If a dia log box a ppea rs asking if you wa nt t o enable macros, click
Enable Macros.
6. On the Results sheet, click the button Run Estima tion on the sprea dsheet.
After t he simulat ion completes, th e results a re put int o the E xcel spreadsh eet.
Analyze the results of the Estimation run Select the Analysis worksheet.
You can check the results of the dynamic simulation with the estimated
values against the original experimental results.
Check and alter the Estimation Solver Select the Estimation Solver Options worksheet.
Options Click Get to read in the current values of the estimation solver options.
Click Put to apply values.
7 S t ea dy -S t a t e E st im a t ion
of a Met ha nol Rea ct or
The rea ctor models th ese thr ee component s:
Component Represents
A H2O
B CH4
A2B CH3OH
The results of these experiments are coded in three ways for this example:
• U sing the Estima tion dia log box
• Visual B a sic Script a t t he flowsh eet level in th e simula tion
• Excel spreads heet (Excel 7.0 or lat er)
You can run the meth a nol reactor exam ple from the E stima tion dialog box, or
wit h a Visual B a sic script, or from a n E xcel spreadsheet.
7. Run t he simula tion. The results can be inspected on th e Mea sured Va ria bles
ta b for each experiment.
The results of the Estima tion run a re shown in the Simula tion Messages
window.
8 C a t a ly t ic B ed
Regenera t ion E xa mple
The ca ta lyst in a packed bed rea ctor needs to be regenera ted by pa ssing
superheated st eam t hrough th e bed. The ca ta lyst a t a ll point s along the bed
needs to be held at 700°C for a period of time to ensure a ll the cata lyst if fully
regenera ted. The process strea m is a t 600°C .
The temperature profile in the bed between the gas and solid in the bed is
described by the following equations.
∂T g v ∂T g
=− − G _ const (T g − T s )
∂t ε ∂z
∂T s
= S _ const (T g − T s )
∂t
Where:
T g = G a s t emper a tur e
The part ial derivat ive for t empera tur e in t erms of length is approximat ed by the
finite difference equation:
∂z ∆z
Where:
i = E lement number
9 S t ea dy -S t a t e Met h a n ol
R ea ct or w it h R e-C y cle
Example
Exa mple simulat ions a re included in your Aspen Cust om Modeler™ insta llation.
If y ou ha ve insta lled in t he default location, the files for th is exa mple will be in
th e folder
C:\ P rogram Files\AspenTech\ Aspen Cust om Modeler 10.2\E xamples\S SMeth
The Meth a nol Reactor models a meth a nol production process including a recycle
loop.
SSMethDemo.acmf Contains text descriptions of the models required for the example, as well as variable
type definitions. You need to build the flowsheet yourself.
SSMeth.acmf Contains the models and flowsheet. Because this example is ready to run, go directly to
Running the Simulation and Reviewing Results.
Block Model
B1 FEEDER
B2 MAKEUP
B3 REACTOR
B4 SEPARATOR
B5 SPLITTER
When y ou ha ve placed th e blocks, the flowsh eet should look like this:
Note If you wa nt to use the Flow sheet a s Wa llpa per option, ma ke sure the
Flow sheet w indow is a ctive, a nd t hen from the Window menu click Flowsheet a s
Wa llpa per. This ma ximizes the flowsheet w indow so tha t it becomes th e
background for your simulat ion.
Tip To chan ge w hich columns a re show n, click the right mouse but ton on
the t a ble a nd t hen click P roperties. Va lue and S pec are usua lly the most
useful column s.
Fr om this t a ble, you can a lter t he TOTAL flow out of th e feeder block. Values to
run the simula tion successfully a re a lready defined. Close the AllVa riables ta ble.
Viewing Changes
To view th e cha nges you ha ve ma de, edit th e Feeder model. To do th is:
1. In t he Simulat ion Explorer, expand Cust om Modeling an d expan d the Models
folder.
2. In the Contents pane, click FEE DE R with the right mouse button and then
click E dit.
The text equa tions for t he model appear in a Text Edit or w indow. Tow a rds
th e end of th e model description, th e specificat ion va lue for some var iables a re
set t o Free or F ixed. These ar e the defa ult specificat ions for th e model.
3. To view th e cha nges from the defa ult specifica tion, double-click th e
specification indicator to open the specification Status window, if it is not
already displayed.
If you are running the file Use this Visual Basic form from the SSMeth folder
ssmeth.acmf MethanolLoop.vbp
ssmethdemo.acmf MethanolLoopDemo.vbp
Homotopy
You can run a Homotopy example using t he input file SS Meth.a cmf.
What is Homotopy?
Homotopy enables you to move from one stea dy st a te solution to a nother st eady
sta te solution in sma ll increments. I n some circumsta nces, the simula tion ma y
not converge for t he ta rget stea dy-sta te solution from the current stea dy-sta te
solution. H omotopy allows you to approach th e ta rget st eady-sta te solution in
sta ges, thereby improving the cha nces tha t t he ta rget stea dy-sta te solution is
reached.
This example uses a Visua l B a sic script t o initia lize a solution t owa rds a set of
ta rget va lues for fixed va ria bles.
When Flow sheet is selected in t he All Items pa ne, th e Homotopy script is sh own
in th e Contents pa ne (this a pplies to SS Meth only, not SS MethD emo). You can
edit this script to cha nge the ta rget va lues of the fixed va ria bles, and a lter the
number of steps ta ken to reach th e tar get stead y-sta te solution.
The optim iza tion ma ximizes the profit ma de by t he rea ctor a nd r ecycle loop. The
profit is calculat ed from the a mount of metha nol produced minus th e amount of
effluent pur ged from th e recycle.
To open t he Opt imiza tion d ia log box, on t he Tools menu , click Opt imiza tion. The
Decision Varia bles ta b shows th e varia bles wh ich w ill be varied to achieve the
optimum, a nd t he Objective Va ria bles ta b shows th e value of the va ria bles wh ich
a re being optimized. Run t he optimizat ion by cha nging th e run mode to
Optimizat ion a nd clicking the Run but ton.
10 S P E E D U P 5 L ibr a r y
Wit h F la sh E xa mple
The SPEEDUP 5 steady-state example simulation models a two-stage separation
process wit h nin e chemical components. I t consists of a feed unit , compressor, a nd
tw o flash units.
To use th is exa mple, you need to ha ve Aspen P lus® inst a lled, a s well as Aspen
Custom Modeler™ .
Notes
• Ma ke sure the Aspen P lus Simulat ion E ngine is on your pat h. If you ha ve
insta lled Aspen P lus in the defa ult loca tion, the simulat ion engine ca n be
found in C:\Program Files\AspenTech\Aspen Plus 10.2\engine\xeq. This
enables you to use the command which creates the properties file.
• If you a re using a S imulat ion En gine insta llation from a client ma chine, you
must ma ke sure tha t you run Aspen P lus using the sa me server and t he same
w orking folder a s you ha ve configured for Aspen Cus tom Modeler.
The librar y conta ins SP EE DU P 5 va ria bles, stream s, models, procedures, and
ma cros covering the a reas of heat excha nge an d pressure cha nge; distillat ion a nd
reactors; mixers a nd splitters; a nd feed and contr ol.
The dyn a mically linked libra ry for th ese procedur es is Su5lib.dll. This cont a ins
SP EE DU P 5 Fort ra n procedure code modified for Aspen Cust om Modeler™ .
If you installed Aspen Custom Modeler in the default location, Su5lib.dll can be
found in:
Su5lib.acmf Text input file for the SPEEDUP 5 library using metric units of measurement
Su5libu.acmf Text input file for the SPEEDUP 5 library using US units of measurement
Su5lib.dll Dynamic Link Library containing compiled SPEEDUP 5 Fortran procedure code.
If you have installed in the default directory, this dll will be in
C:\Program Files\AspenTech\AMSystem 10.2\bin
Gpu.dll Dynamic Link Library containing compiled Fortran code for the physical property routines using U.S.
units of measurement. This dll is only used by Su5libu.
If you have installed in the default directory, this dll will be in
C:\Program Files\AspenTech\AMSystem 10.2\bin
Filename Description
Complete the following steps to run t he fla sh exa mple using the SP EE DU P 5
library with metric units:
1. Set up the interfa ce for Aspen Cust om Modeler™ a nd Aspen P lus® . To do
this, open a Comma nd P rompt window a nd in it, move to the directory w here
you have installed the Su5lib flash example files. If you copied the files to the
example working folder, th ese files ar e locat ed in:
Note The Cr eat e Libra ry comma nd consolidat es the content s of the S u5lib
libra ry int o a binar y S u5lib.acml librar y file.
7. In Aspen Cu stom Modeler, from the File menu, click Open.
8. Open the Su 5lib folder a nd double-click th e exa mple file flash.acmf .
9. Click Run to run the simulat ion in steady sta te.
11 Wa t er H a m m er (P D E )
Example
This example simula tion consists of a pipeline termina ted by a va lve. If t he va lve
is slammed shut , a pressure wa ve tra vels ba ck up the pipe. The pipe expands d ue
to th e increased pressure. When t he pressure wa ve reaches the pipe inlet, th e
pressure is relieved by back flow. The pressure wave oscillates back and forth
a long t he pipe. The pressures decrea se as ener gy is a bsorbed by friction.
Depending on t he severity of the va lve closure, either the flow is ha lted w ithout
a ny problems, or else th e pressure in some or a ll sections of th e pipe fa lls below
the va por pressure of wa ter. The model does not simula te cavit a tion, but if y ou
see the pressure falling too fa r below one bar , you can estima te th a t cavit a tion
can occur, and you need to close the valve more gently.
With the current simulation configuration, closing the valve Cv to 100 causes no
cavitation in the pipe following closure, whereas a closure to a Cv value of 10
causes extensive cavita tion. The ta sk used t o close the va lve uses a n S RAMP
function. You ma y w a nt to tr y increasing th e period over w hich t he va lve closes.
Note If you are using a Simulat ion Engine insta llation from a client ma chine,
you must make sure tha t you run Aspen P lus using th e same server a nd t he
sa me working folder a s you ha ve configured for Aspen Cus tom Modeler.
This example models a high t empera tur e shift rea ctor, w hich is importa nt for
ma ny indust ria l plan ts, including ammonia plan ts. The high temperat ure shift
reactor example illustra tes:
• Complex reaction kinet ics
• G enera lized solution of par tia l differentia l equat ions
• A flowsh eet initializat ion st ra tegy w hich includes generalized ca lls to
initialization scripts, and homotopy scripts of each model
• A dynam ic opera bility study of the rea ctor
Reactor Kinetics
The reactor uses a solid cat a lyst t o complete the gas pha se wa ter shift r eaction:
CO + H 2O ←
→ CO2 + H 2
The reaction is exothermic, with the heat effects determined from enthalpies
wh ich include heat s of forma tion. The rea ctor is considered ad iaba tic beca use th e
thr oughputs a re high an d the a rea (which is insulat ed) a va ilable for hea t loss is
small.
pH 2 * pCO2
k * pCO * pH 2 O −
K 1
r =
2
( DEN )
Where:
The reaction ra te consta nt, k , is a function of temperat ure, activa tion energy, a nd
frequency factor, in the classic Arrhenius form:
Litera tur e dat a indica te th e activat ion energy in the a bsence of diffusion effects
a s 121.8 kJ /kmol. The frequency fa ctor w a s determined fr om litera tur e a nd plant
data.
i = CO , H 2, CO 2, H 2 O
The rea ction equilibrium consta nt is a function of temperat ure. The w a ter ga s
shift rea ction equilibrium consta nt is a function of tempera tur e.
Ki = f ( T )
Diffusional Effects
The reactor kinetics discussed a re intrinsic kinetics tha t a re va lid in the a bsence
of diffusional or heat t ra nsfer resista nces. B ulk phase concentr a tions (par tia l
pressures) a nd temperat ures ar e not present at the a ctive sites within th e
cata lyst pellets, since the pore structure can offer significa nt resistan ce to
diffusion, a nd mild resista nce to heat t ra nsfer exists between the bulk pha se and
the pellet sur face. Litt le resista nce to heat tr a nsfer exists w ithin t he pellets.
The diffusiona l effects a re a ccounted for usin g th e clas sic effectiveness fa ctor.
Eva luat ing the num erat or of this expression requires simulta neous integra tion of
the rate and diffusion relationships. Simplification of the effectiveness factor
calculation can be applied for conditions which cause the diffusional resistance to
be la rge. The simplifica tion is:
3 K(De)
η=
rp k(K + 1)ρp
The relat ionship a mong a ctual r eaction r a te, intr insic ra te, effectiveness factor,
an d ca ta lyst activity is:
ri ,observed = η i × α × ri ,intrinsic
Where:
η = Effectiveness factor
α = Relative catalyst activity (accounting for aging, sintering, pore closure)
ri, intrinsic = Rate calculated with bulk fluid conditions
The ca ta lyst a ctivity is calculat ed as a para meter, updated from opera ting da ta .
Modeling Strategy
Although the rea ctor can be treat ed as a simple equilibrium reactor, a kinetic
model is necessa ry t o reproduce dyna mic beha vior. The ma in rea ctor model uses
the Aspen C ustom Modeler™ domain a nd distribut ion models, thus a llowing t he
par tia l differential equa tions for t he reactor a nd t he solid ca ta lyst t o be solved
easily. Severa l methods can be selected for t he solution of the r eactor equa tions,
such a s orth ogona l collocat ion of finite elements a nd finit e differences.
Representa tion includes a par tia l differentia l equa tion for the convective reaction
equa tion, convective gas energy equa tion, an d conductive solid energy equa tion.
N Number of finite difference The location of the FD points is determined by the array z(*) and the
points parameter SPAC.
NE Number of finite elements to The spacing is determined by the array z(*) and the parameter SPAC.
be used by OCFE
The part ial differentia l equa tions are wr itten using multi-dimensiona l arr a ys,
an d the D EL an d LAP LACE sub-models. DE L calculates the first spatia l
derivat ive, wh ile LAP LACE calculat es the second spa tia l deriva tive.
A simple example model, DI FFU SI ON is also included to show how a par tia l
differentia l equa tion ca n be represented in Aspen C ustom Modeler™ . Notice tha t
the boundary conditions are simple, explicit equations. The form of the partial
differentia l equa tion is for diffusion-convection. The hea rt of the meth od is the
par a meterizat ion of th e distr ibution equa tions by the set, PD ES ET. Notice how it
is used to write the part ial differentia l equa tion with multi-dimensional ar ra ys.
The user need only be a ble to wr ite the par tia l differential equa tion an d use
either P DE SE T or P DE SE T2 ( one less bounda ry point for diffusion only
problems).
Initialization Strategy
The equa tions of th e reactor a re highly non-linea r, a nd w ill require a
comprehensive str a tegy to converge in steady st a te. Fortuna tely, Visual B a sic®
scripts in Aspen Cu stom Modeler w ill a llow ea sy convergence of th e simulat ion.
Several feat ures of the rea ctor w hich are modeled ar e:
• The chosen state variable is concentration for the convective equation
• The reactor is adia ba tic
• Axial conduction is considered down t he length of the rea ctor in th e solid
catalyst
The most difficult of th ese feat ures is th a t the r eactor is a diaba tic. The
temperat ure profile of the rea ctor is not known a nd must be ca lculat ed.
U nfortuna tely, the reaction equa tions are highly dependent on the tempera tur e,
a nd w ill not converge if the temperat ure is freely calculat ed. However, if th e
temperat ure is fixed, th e kinetic equa tions ar e well behaved. In a ddition, th e
density of the ga s is ea sily estima ted by the ideal gas law (high temperat ure
ga ses ar e mostly ideal, regar dless of the pressure).
Thus, the sta te concentra tions ca n be estima ted from the ideal ga s law a nd th e
entering molefractions. In a ddition, I nitia l specifica tions for t he solid a nd ga s
temperat ure can be used. These specifications w ill a llow a n initia l run to
converge ea sily. The In itia l script w ill prompt for t he pressure dr op (0.3 ba r) an d
the t empera tur e rise (60° C).
In a series of homotopy-type runs, you can change the specifications and perform
stea dy-sta te runs. I f you switch the specifica tions for solid an d ga s temperat ure to
fixed conditions, an d free th e duty , a stea dy-sta te ru n converges easily. Then you
can retur n th e ga s tempera tur e specifications back to Init ial, an d fix the duty t o
adiabatic conditions, thus an adiabatic condition. In the last steady-state run, you
can fix the solid temperat ure slack to 0, an d retur n t he solid tempera tur e to
specifications to Initial.
Steady-State Design
The rea ctor opera tes a t over 380° C a nd 35 bar , a nd u ses an iron oxide/chromium
oxide cat a lyst . The rea ction is exoth ermic, but th e rea ctor is not cooled. The feed
composition to the reactor is mostly water and hydrogen (35%each), 15%
nit rogen, 8%ca rbon monoxide, a nd 5%ca rbon dioxide. The rea ctor product is
enriched with hydrogen, and much of the carbon monoxide is consumed. Thermal
stress is a significa nt d egrading fa ctor for the ca ta lyst. The reactor ha s a 3.5-
meter bed of cylindr ical pellets, a nd t he a vera ge velocity is a bout 0.5 m/s. There
is a t empera tur e profile and composition from a n operat ing reactor, an d th e
estimat ion capa bilities of Aspen C ustom Modeler™ ha ve been used to adjust t he
kinetics to plan t da ta .
After you ha ve set up t he interfa ce, you ca n run th e Wa ter S hift Rea ctor example.
To do this:
1. Fr om th e File menu, click Open.
2. Open th e Wa ter Sh iftRea ctor folder. If you copied th e files to the exam ple
w orking folder, t hese files ar e locat ed in:
P roduct, represented by va ria ble Holdup_C in the simulat ion, is the quan tity t ha t
we w a nt t o ma ximize at t he end of th e process, a t fina l time 60 hours by var ying
the feed ra te.
Constr a ints on the optimizat ion a re a fina l tempera tur e at 60 hours of betw een
295 and 300 °C a nd a path constra int on the temperatur e throughout t he whole
process to confine it to less th a n 520 °C. To achieve these const ra int s t he cooling
ra te will also be varied.
7. Click the Contr ol Va riables tab in the Optimization dia log box.
8. Note tha t CoolingRat e a nd FeedRa te have been selected.
9. With t he right mouse butt on, click CoolingRat e and select Edit I nitia l Control
Element Values to see the initial estimates for the optimal control profile.
For the pat h constr a int, you ca n see th a t t he integral of th e viola tion squa red
of t he temperat ure a bove 520 is posed a s a constr a int t o the optimizer. Notice
in the flowsh eet t here is a va ria ble violat ion mea suring th e total violat ion
squared.
The path constr a int is posed as a " soft" constr a int. You can a llow a larger
degree of violat ion by increasing t he value of the number on the right h a nd
side of the constr a int equa tion.
3. P erform the optimiza tion run.
Observe how t he fina l tempera tur e constr a int is sat isfied. Note tha t th e pa th
constr a int is not completely sa tisfied, as it w a s posed as a soft constr a int.
14 C D I E xa m ple
A CD I exa mple is supplied w ith Aspen Cust om Modeler™ . This exam ple is a
model of a column a nd side str ipper for the separ a tion of a mixture of benzene,
toluene, an d xylene. B enzene and xylene a re th e main column's top an d bottom
products respectively, a nd t oluene is the product fr om the sidestr ipper. This
example includes scripts to:
• Specify the CD I input an d output var iables
• G enerat e mat rices which you can t hen exa mine to determine the suita bility of
the input var iables to contr ol the specified output va riables
LINEARISE.MatricesRequired "A"
15 pH C on t r oller E xa mple
us ing S im ula t ion Access
eXtensions
This exam ple models a pH cont rol system. An a cid effluent is fed into a stir red
ta nk a nd neutr a lized using a lkali. The flow of a lkali is contr olled by a P ID
contr oller t ha t m easures th e pH of the ta nk content s. A step cha nge in the a cid
flow from 0.025 to 0.03 is int roduced a t t ime 5.0 to test t he cont roller r esponse.
This exa mple includes a simple exa mple of using th e Simu la tion Access
eXtensions (SAX) int erfa ce. The int erfa ce code is supplied a nd can be used a s a
sta rt ing point in the development of your own S AX interface.
Using SAX
You can run this exam ple using SAX to int roduce a disturba nce in th e acid feed
flow ra te a t 5 hours. To do this:
1. Modify th e ma kefile a nd crea te the dll a s described in Modifying th e Ma kefile
a nd B uilding t he DLL on page 15-6.
2. If you have already run th e simulat ion resta rt it and ensure tha t the task
AcidFlowStep is not active.
3. Fr om the Tools menu, click Simula tion Access eXtensions. The Simu lat ion
Access E xtensions dia log box is display ed.
4. Ma ke sure the Output Varia bles ta b is on top by clicking it. Note tha t th e
var iable CS T.Acid.flow ha s been a dded to t his list of var iables for
tra nsmission t o the S AX function.
Tip An easy wa y to add va riables to this list is to dra g and drop them from a
table.
5. Click the P rocedure ta b and note th a t the following da ta h a s been entered:
F un ct ion n a m e: S AXF un ct ion
L i br a r y n a m e : C : \ P r o gr a m F i le s\ A sp en Te ch \ Wo rk in g F ol de r \ As p en C u s t om Mo de le r
10.2\SAX\phconsax.dll
(or location of your inst a llation: chan ge the library n am e if necessa ry)
6. En sure tha t th e After Dyn a mic St ep check box is selected, so tha t t he function
is ca lled aft er each st ep. Also select th e Ena ble Simula tion Access eXtensions
check box to ena ble SAX a nd t hen close the S AX wind ow.
7. In t he Explorer, click Flowsh eet an d th en double-click AcidFlowP lot t o open it.
8. Run th e simulat ion. You will see a st ep change in the acid flow ra te at 5
hours, and the resulting change in pH in the ta nk w ith time.
The ma in fun ction is ca lled SAXFun ction. This corr esponds t o the na me given to
the function in th e SAX dia log box. It ha s a fixed argu ment list, so tha t it ca n be
found w hen the D LL is loa ded.
The body of the code is a la rge switch st a tement, w ith a case for each of the
possible types of event. In this ca se, only t hree events a re of int erest: those at th e
beginning and end of a simulation, and the event after a dynamic step.
At t he sta rt of a simula tion, which is wh enever a new simulat ion is loa ded, or a
structural change is made to a loaded simulation, a number of ar ra ys a re
allocated. These need to be allocated for both lists of variables being passed to
SAX. For each, a list of nam e pointers a nd a list of type specifiers a re a llocated,
wit h one entry for each varia ble in the list, a nd th ree sma ller a rra ys for rea l
values, integer values, and string va lues. Note tha t a dditiona l arra ys may ha ve
to be a llocated if we wished to ma nipulat e varia ble bounds or oth er var iable
a tt ributes. These allocations a re performed in the function
GenerateProblemData().
After a dyna mic step, we need to check th e simula tion time an d th e value of
CS T.ACI D.FL OW, wh ich in t his case is the only va ria ble passed in, a nd cha nge it
a s a ppropria te. This is done by t he following code:
case SAX_AFTER_DYN_STEP: /* after a dynamic step */
{
DiagPrint("\nSAXFunction, after dyn step:");
LoadVector(nOut, OutList, OutTypes, OutReals, OutInts,
OutStrings);
/** PHCON SPECIFIC **/
{
/*
* Since there is only one variable, it must be in
* position [0] of our data arrays
*/
int changed=0;
if (Time>= 20.00)
{
if (OutReals[0]!=0.03)
{
OutReals[0] = 0.03;
changed++;
}
}
else
{
if (OutReals[0]!=0.025)
{
OutReals[0] = 0.025;
changed++;
}
}
if (changed)
{
ACM_Print(0,
"SAX: Modified value of %s to %g at time %g",
OutNames[0],&OutReals[0],&Time);
UnloadVector(nOut, OutList, OutTypes, OutReals,
OutInts, OutStrings);
}
}
/** END PHCON SPECIFIC **/
}
break;
This code loa ds t he current va ria ble data for t he var iables passed into your SAX
function by ca lling LoadVector (this fun ction is cont a ined in t he source file), th en
checks th e time, and the va lue of CS T.ACI D.FL OW. If t his va lue needs t o be
changed, it modifies it, an d causes a message to be sent to the S imulat ion
Messages window of the client, using ACM_P rint(), to say t ha t it ha s done so.
The changed value is then loaded back into the server by a call to UnloadVector().
This code is designed to be generic. It ca n be used a s th e sta rt ing point for your
SAX applica tions.
1. The makefile is supplied in the exa mples directory a s MakeP hconS a x. If you
have not installed in the default location or have copied the examples files you
w ill need t o modify t he follow ing definitions.
Cha nge th e following definitions to correspond wit h y our insta llation location:
ACMSAXSOURCEPATH \Program Files\Common Files\AspenTech Shared\AMSystem 10.2\Procedures
ACMSAXINCLUDEPATH \Program Files\Common Files\AspenTech Shared\AMSystem 10.2\Procedures
Ch a nge the follow ing definitions to corr espond w ith t he locat ion of your
example directory.
SOURCEDIR \Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\SAX\
DLLDIR \Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\SAX\
2. If you ha ve not alrea dy done so, creat e the directory specified by DLLD IR,
otherw ise the make w ill fail.
3. Na vigat e to th e directory conta ining th e file Ma kePhconSa x a nd then build
the DL L by entering the following comma nd in a D OS w indow:
nmake –f MakePhconSax
16 G a r y B la u E st im a t ion
Example
This exa mple is based on the 1986 paper " Nonlinear P a ra meter Est imat ion: a
Ca se St udy Compa rison" by L.T.Biegler, J .J .Da miano and G .E.B lau in the
AIC hE J ourna l, Volume 32, Num ber 1, pa ges 29 to 45. The paper compar es the
solutions from several a uth ors to a difficult estimat ion problem formulat ed by
Dow.
The problem is th e estima tion of nine par a meters fr om a complex kinetics model
of a batch reactor.
6. Cha nge the run mode to Est imat ion and run th e simulat ion. Wa it for the
solution to complete. This ma y t a ke some minut es.
7. To observe the results on the Est ima ted Var iab les ta b, from th e Tools menu
click Estimation.
8. To check the accura cy of th e plot, on th e Mea sured Var ia bles ta b of the
Est imat ion dia log box, double-click th e measur ed var iables to edit th em a nd
observe the deviations. You may also plot these results here.
Tip Covar ian ce a nd Correlat ion ma trices a re norma lly a va ilable from the
Estima tion dia log’s S ta tus t ab by clicking the ma trices butt on. Note that the
correlat ion ma tr ix is computed from th e cova ria nce mat rix; when t he lea ding
diagona l of the cova ria nce ma trix conta ins negat ive values, it is not possible
to compute a correlat ion ma tr ix.
17 E xt er n a l Non lin ea r
Algebra ic S olver
Example
This exa mple shows how to write a nd use a DL L cont a ining an externa l
Nonlinear Algebra ic solver. The exam ple implements a n extern a l solver called
NLEQ1S a vailable in:
http://www.zib.de/SciSoft/CodeLib/frame_nonlin.en.html
Note The exam ple is given und er th e a ssumpt ion th a t you ha ve MS -Developer's
St udio insta lled on your ma chine.
a nd double click it. Aspen Cust om Modeler w ill sta rt w ith t his file loa ded a nd
the external solver DLL loaded. This simulation contains nonlinear blocks in
both the initialization and dynamic decompositions. The external solver
NLEQ1S will be used to solve any of these nonlinear blocks.
it mean s you are using the dumm y NLE Q1S Fortra n code provided. You ha ve
probably forgotten to put the correct NLEQ1S.f file in position.
Alterna tively, you can sear ch for your D LL using the search butt on at t he
right of t he box.
5. Click the Apply butt on (this w ill loa d the D LL into ACM) and list the
ava ilable par ameters.
6. You ca n modify the par a meters by clicking on th em. A dia log box will open,
a llow ing you to set a new va lue.
7. Click OK
From now, w henever ACM needs to solve a nonlinea r a lgebra ic system, it w ill use
the n onlinear solver provided in t he DL L.
18 E xpor t in g a n Aspen
C us t om Modeler
Flowsheet
Cyclohexane can be produced by the hydrogenation of benzene in the following
reaction:
C6 H 6 + 3H 2 = C6 H 12
Benzene Hydrogen Cyclohexane
The benzene and hydrogen feeds are combined with recycle hydrogen and
cyclohexane a nd preheat ed before entering a fixed bed ca ta lytic reactor.
The reactor effluent is cooled and the light gases separated from the product
str eam. P a rt of the light ga s strea m is fed back to the rea ctor a s recycled
hydrogen.
The liquid product str eam from the separa tor is fed to a distilla tion column t o
furth er remove an y dissolved light gases a nd t o sta bilize the end product. A
proport ion of th e cyclohexa ne product is recycled to th e react or to a id in
temperat ure contr ol.
The port variables to be exported and therefore to be used in the Aspen Plus
flowsh eet a re defined by th e port na med MoleFra ctionP ort_SI found in t he
Modeler library.
Note All model types, port types, va ria ble types, para meter t ypes etc.
referenced in t his exam ple exist in th e delivered Modeler or D yna mics
libraries.
2. Run the simulat ion in stea dy stat e run mode.
3. Review the key results from the ReactorResults ta ble in the
Simu la tion/Flowsh eet content s folder.
Note The first t ime th is file is specified, you w ill be a sked if you wa nt t o
creat e one, since the file does not yet exist.
4. In t he Input s Ta ble box, select Rea ctorIn put s from th e list. This is th e form
that defines the variables that Aspen Plus will display as inputs.
5. In t he Results Ta ble box, select Rea ctorResults from th e list. This is the form
that defines the variables that Aspen Plus will display as results.
Note In I NP U T mode, the Va ria bles ta b form displays t he var iables defined
in Aspen Custom Modeler ReactorInputs form.
19 H a ndling E vent s in a
Visua l B a sic Act iveX
D LL
To run t his exa mple, you need to:
• Create the DLL
• Add a test project t o test the D LL
Note If you have insta lled Aspen Custom Modeler™ in the default location, the
Microsoft® Visua l B a sic® s ource code for both t he projects in t his exam ple is
a v a i la b l e a t :
For more information about Application Object events, see the Automation
Reference.
This completes the information needed to handle ACM events. You must now add
instru ctions t o make th e DLL work. To do this:
1. Add the follow ing function:
Public Sub Go()
if not (ACMApp is Nothing) then
ACMApp.OpenDocument App.Path & "\fivetank.acmf"
Dim Sim As AspenModelerSimulation
Set Sim = ACMApp.Simulation
Sim.Step (True)
Set Sim = Nothing
ACMApp.CloseDocument False
end if
End Sub
3. Sa ve th e project.