• No results found

Aspen Examples

N/A
N/A
Protected

Academic year: 2021

Share "Aspen Examples"

Copied!
100
0
0

Loading.... (view fulltext now)

Full text

(1)

Reach Your True Potential

Reach Your True Potential

Aspen Custom Modeler

Aspen Custom Modeler

 10.2

 10.2

Examples 

Examples 

(2)

software and the application of the

software and the application of the results obtained.results obtained.

Although AspenTech has tested the software and reviewed the

Although AspenTech has tested the software and reviewed the documentatiodocumentation, the sole warranty for n, the sole warranty for the softwarethe software may be found in the

may be found in the applicable license agreement between AspenTech and the user.applicable license agreement between AspenTech and the user. ASPENTECH MAKES NOASPENTECH MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO WARRANTY OR REPRESENTATION, EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO THIS DOCUMENTATION, ITS QUALITY, PERFORMANCE, MERCHANTABILITY, OR FITNESS THIS DOCUMENTATION, ITS QUALITY, PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.

FOR A PARTICULAR PURPOSE.

Corporate Corporate

Aspen Technology, Inc. Aspen Technology, Inc. Ten Canal Park 

Ten Canal Park 

Cambridge, MA 02141-2201 Cambridge, MA 02141-2201 USA USA Pho Phone:ne: +1 +1 (61(617) 7) 949949-10-100000 Fax: Fax: +1 +1 (617) (617) 949-0130949-0130 UR

URL:L: hthttptp:/://w/wwwww.a.aspspenentetechch.c.comom

Division Division

Design, Simulation, and Optimization Design, Simulation, and Optimization AspenTech Ltd

AspenTech Ltd

Sheraton House, Castle Park  Sheraton House, Castle Park  Cambridge CB3 0AX Cambridge CB3 0AX UK UK Pho Phone:ne: +4+44 (4 (0)10)122223-33-31221222020 Fax: Fax: +44 +44 (0)1223-366(0)1223-366980980..

(3)

February 2000

February 2000

Copyright © 2000, Aspen Technology, Inc. All rights reserved. Copyright © 2000, Aspen Technology, Inc. All rights reserved. Aspen Custom Modeler

Aspen Custom Modeler™™

,,

 Aspen Dynamics Aspen Dynamics™™

,,

 Aspen Engineering Suite Aspen Engineering Suite™™, Aspen Plus, Aspen Plus®®, AspenTech, AspenTech®®,, Plantelligence

Plantelligence™™and the Plantelligence logo, Polymers Plusand the Plantelligence logo, Polymers Plus®®, Properties Plus, Properties Plus®®, and the aspen leaf logo are, and the aspen leaf logo are trademarks or registered trademarks of Aspen Technology, Inc., Cambridge, MA.

trademarks or registered trademarks of Aspen Technology, Inc., Cambridge, MA. All other brand and product names are trademarks or

All other brand and product names are trademarks or registered trademarks of their respective companies.registered trademarks of their respective companies. This manual is intended as a

This manual is intended as a guide to using AspenTech's software. This documentation contains AspenTechguide to using AspenTech's software. This documentation contains AspenTech proprietary and confidential informatio

proprietary and confidential information and may not be n and may not be disclosed, used, or copied without the prior consent of 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 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

software and the application of the results obtained.results obtained.

Although AspenTech has tested the software and reviewed the

Although AspenTech has tested the software and reviewed the documentatiodocumentation, the sole warranty for n, the sole warranty for the softwarethe software may be found in the

may be found in the applicable license agreement between AspenTech and the user.applicable license agreement between AspenTech and the user. ASPENTECH MAKES NOASPENTECH MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO WARRANTY OR REPRESENTATION, EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO THIS DOCUMENTATION, ITS QUALITY, PERFORMANCE, MERCHANTABILITY, OR FITNESS THIS DOCUMENTATION, ITS QUALITY, PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.

FOR A PARTICULAR PURPOSE.

Corporate Corporate

Aspen Technology, Inc. Aspen Technology, Inc. Ten Canal Park 

Ten Canal Park 

Cambridge, MA 02141-2201 Cambridge, MA 02141-2201 USA USA Pho Phone:ne: +1 +1 (61(617) 7) 949949-10-100000 Fax: Fax: +1 +1 (617) (617) 949-0130949-0130 UR

URL:L: hthttptp:/://w/wwwww.a.aspspenentetechch.c.comom

Division Division

Design, Simulation, and Optimization Design, Simulation, and Optimization AspenTech Ltd

AspenTech Ltd

Sheraton House, Castle Park  Sheraton House, Castle Park  Cambridge CB3 0AX Cambridge CB3 0AX UK UK Pho Phone:ne: +4+44 (4 (0)10)122223-33-31221222020 Fax: Fax: +44 +44 (0)1223-366(0)1223-366980980..

(4)

A

Assppeenn CC uusstt oomm MoModdeelleerr EE xxaa mmpplleess iiiiii

1

1 FiFive Tanks Exampleve Tanks Example

Run

Run ning the ning the Five Five TTaa nks nks ExaExa mple...mple... ... 1-1-22 A

Advadva nced Fnced F eateat ures ures in in Five Five TTaa nks nks ExaExa mplemple ... 1-1-33 U

U sing sing MicrosoMicrosoft ft Excel...Excel... ... ... ... 1-1-33 Run

Run ning ning from from MicrosoMicrosoft ft Visual Visual BB aa sicsic ... 1-1-44 T

Taa skssks ... ... ... ... ... ... 1-1-55

2

2 AbsorbeAbsorber Er E xamplexample

Models

Models UU sed sed in in thth e e AAbsorber bsorber ExaExa mplemple ... 2-2-22 Sett

Sett ing Uing U p Pp P roperoperties Prties P lus for tlus for t he Absohe Absorber Erber E xamplexample ... 2-2-33 Run

Run ning ning thth e e AAbsorber bsorber ExaExa mplemple ... ... 2-2-33 A

Adding Contdding Cont rollerollers to rs to thth e e AAbsorber bsorber ExaExa mplemple ... 2-2-44

3 Do

3 Double Effect Euble Effect Evapovaporator Optirator Optimization Emization Examxampleple

Running

Running the the Double Effect Double Effect EvaEva poporara tor tor ExaExa mple.mple... 3-3-22

4 Heated Metal Cube (PDE) Example 4 Heated Metal Cube (PDE) Example

Running

Running the the HeaHea ted ted Cube Cube ExaExa mple....mple... 4-4-22

5 Heated Metal Slab (PDE) Example 5 Heated Metal Slab (PDE) Example

Runn

Runn ing ing the the HeaHea ted ted SlaSla b b ExaExa mple...mple... 5-5-22 Vi

Viewing ewing a a PP lolot t of thof th e Ce C orner Torner Temperatuemperatu resres ... 5-5-33

6 Rea

6 Reactor Dynamic Ector Dynamic E ststimation Eimation E xamxampleple

Running

Running the the Reactor DReactor D ynayna mic Estimamic Estima tion Exation Exa mple...mple... 6-6-22

7 Ste

7 Steady-Staady-State Ete Estimation of stimation of a Methanol a Methanol RReactoeactorr

Running

Running the the MethaMetha nol Rnol R eactor eactor ExaExa mple...mple... 77--22 Cont

(5)

iv Aspen Cust om Modeler Exa mples

8 Catalytic Bed Regeneration Example

Running the Ca ta lytic B ed Exa mple... 8-3

9 Steady-State Methanol Reactor with Re-Cycle Example

Runn ing the Metha nol Exa mple... 9-2 Loa ding th e Exa mple... ... ... ... 9-2 B uilding th e Flows heet. ... ... 9-3 Conn ecting th e B locks ... ... ... 9-4 En tering the Input Da ta ... 9-5 Running the Simula tion a nd Reviewing Results ... 9-6 Cha nging the Simula tion ... 9-6 View ing Ch a nges ... ... ... .. 9-7 Sa ving New Specifica tions... ... ... 9-7 Homot opy... ... ... ... 9-8

Wha t is Homot opy?... ... ... 9-8 Running the Homotopy Exa mple ... 9-8 Runn ing the Optimizat ion Exa mple ... 9-9

10 SPEEDUP 5 Library With Flash Example

About SP EE DU P a nd the Aspen Cust om Modeler Libra ry ...10-2 P rocedures Required by the SP EE DU P 5 Librar y Models ...10-2 Models in the SU5Lib Library...10-4 SPEEDUP 5 Library Files...10-5 Fla sh Exa mple Files ... ... 10-5 Running the Flash Example...10-5

11 Water H ammer (PDE) Example

Running the Wat er Ha mmer Exa mple ...11-2

12 High Temperature Shift Reactor (PDE ) Example

Reactor Kinetics...12-2 Modeling St ra tegy ... ... ...12-4 In itia lizat ion St ra tegy ... ...12-5 St ead y-St a te Design ... ... 12-6 Dynamic Operability Study...12-6 Setting Up the Interface...12-7 Running the Example...12-7

13 Dynamic Optimization E xample

Running the Dynamic Optimization Example...13-2 Viewin g th e Dy na mic Optimiza tion In puts ...13-2 Viewin g th e Flows heet Const ra int s ... ...13-3 Creating a Task to Implement the Optimal Profiles...13-3

(6)

Aspen Cust om Modeler Exa mples v B uilding a nd U sing the Exa mple D LL ...17-2

18 Exporting an Aspen Custom Modeler Flowsheet

Export ing the Cy clohexa ne P roduction Flowsh eet ...18-2 Run ning th e Export ed Flow sheet in Aspen Plus ...18-5

19 Handli ng Events in a Vi sual Basic ActiveX DLL

Creating the ActiveX DLL for the Example...19-2 Addin g a Test Pr oject ... ... ...19-3

(7)
(8)

Aspen C ust om Modeler E xa mples vii

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. To run one of these examples:

Copy th e files in th e exa mple directory t o a convenient w orking folder, for

example:

C:\ P rogra m Files\ AspenTech\ Working Folder\ Aspen Cu stom Modeler 10.2 This manual contains step-by-step instructions on the examples supplied with Aspen Cust om Modeler™ including:

Five Tanks example

Absorber exa mple

Double effect evaporator optimization example

Hea ted meta l cube (P DE ) exa mple

Heat ed meta l sla b (P DE ) exam ple

Reactor dyna mic estimat ion example

Steady-state estimation of a methanol reactor

Catalytic bed regeneration example

St eady-sta te metha nol reactor wit h recycle example

S P E E D U P 5 li br a r y w i t h f la s h e xa m p le

Wa ter ha mmer (P DE ) exa mple

High tempera tur e rea ctor shift (P DE ) exa mple

Dy na mic optimizat ion example

CD I exa mple

Simu la tion Access eXtensions exam ple

G ar y B lau estima tion exa mple

Ext erna l nonlinear a lgebra ic equa tion solver example

Exporting a n Aspen Cust om Modeler flowsh eet a nd using it in Aspen P lus

(9)

viii Aspen C ust om Modeler E xa mples

About This Manual

For More Information

You can obta in informa tion on Aspen Modeler1

 products by:

Accessing t he comprehensive online H elp syst em

Reading t he printed man ua ls supplied w ith your product

P rinting t he P orta ble Document F orma t (PD F) files supplied on th e Documentation CD

Accessing Aspen Technology's w eb pa ge

If you need more deta iled a ssista nce tha n t ha t provided in th e online Help an d the P DF files, you can conta ct Technical S upport .

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 Dothis

Display a hierarchy of topics by category

Click the Contents tab

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

Help topics

Click the Find tab and then type the word or phrase you require

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.

Printing Online Help

To displa y informa tion on how t o print online H elp:

1. Open your Aspen Modeler product a nd fr om the H elp menu, click Help Topics. 2. On the Content s ta b, double-click Using H elp a nd th en double-click P rint

H elp Topics.

1

 Aspen Modeler products include Aspen Cust om Modeler™ , Aspen Dyn a mics™ , Aspen ADSIM™ , and Aspen Chromatography™ .

(10)

Aspen Cust om Modeler Exa mples ix

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 In 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).

Portable Document Format Files (PDFs)

In a ddition t o the printed ma nua ls supplied w ith your product, you ca n a lso print copies of all of th e man ua ls supplied a s P orta ble Document F orma t files (P DF s) on the D ocumenta tion CD . To do this, you must ha ve Adobe Acroba t Reader insta lled on your ma chine.

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.

(11)

x Aspen C ust om Modeler E xa mples

About This Manual

World Wide Web

For additional information about AspenTech products and services, check the AspenTech World Wide Web home pa ge on t he I nt ernet a t:

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.

AspenTech Technical Support on the Internet

AspenTech customers wit h a valid license and softw a re ma intena nce agreement can r egister t o access the Online Technical Support Center a t :

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.

The w eb support site a llow s you to:

Access current product document a tion

Sea rch for tech tips, solutions a nd frequently a sked questions (FAQs)

Sea rch for a nd download a pplica tion exa mples

Submit a nd tr a ck technical issues

Send suggestions

Report product defects

Review lists of know n d eficiencies an d defects

Registered u sers ca n a lso subscribe to our Technica l Su pport B ulletins. These e-B ulletins a re used to proa ctively a lert users to importa nt technica l support

informa tion such a s:

Technical advisories

P roduct updates a nd S ervice P a ck a nnouncements

The most up-to-da te cont a ct informa tion for your n ear est support office is a lso a va ilable on AspenTech's web pa ge.

(12)

Aspen C ust om Modeler E xa mples xi +1-888/996-7001 (toll free) South America (Argentina office) (Brazil office) +54-11/4393-5308 +55-11/5012-0321 +54-11/4394-8621 +55-11/5012-4442 [email protected] [email protected] Europe, Gulf Region, & Africa

(Brussels office) (UK office) +32-2/724-0100 +44-1223/312220 +32-2/705-4034 +44-1223/366980 [email protected] Japan +81-3/3262-1743 +81-3/3262-1744 [email protected] Asia & Australia +65/295-83-30 +65/295-83-25 [email protected]

(13)

x

xiiii AAssppeenn CC uusstt oomm MMooddeelleerr EE xxaa mmpplleess

About This About This Manual Manual

(14)

A

Assppeenn CC uusstt oomm MMooddeelleerr EE xxaa mmpplleess 11--11

1

1

F

F iivve

e T

Taa n

n k

ks

s E

E x

xaa m

m p

pllee

T

This exahis exa mple modelmple models five os five open tapen ta nks in nks in series. Tseries. The key ahe key a ssumptssumpt ioions ans a re:re:

••

Flow out of each tank is proportional to the square root of the level of fluid inFlow out of each tank is proportional to the square root of the level of fluid in t h e

t h e t at a n kn k

••

FluiFluid ad a t cot constansta nt densitynt density

••

TTaa nk geomenk geometrtr y is a y is a regular regular sidesided vertd vert icicaa l cylil cylindernder

(15)

1-1-2 2 AAspen spen CuCu stst om om Modeler Modeler EE xaxa mplesmples

Five Tanks Five Tanks Example Example

R

Runni

unning

ng the

the F

Fiive

ve T

Tanks

anks E

Exam

xample

ple

Exa

Exa mple smple simulatimulat ioions ans a re incre included in your Aluded in your Aspespen Cn C ustom Modeustom Modeleler™ r™ instainsta llllaa tion.tion. If you ha

If you ha ve instave insta llelled in td in t he default loche default locaa tion, fition, fileles for this example will be s for this example will be in thin th ee folder:

folder: C:\

C:\ PP rogram rogram FileFiles\Asps\AspenTenTecech\h\ AAspespen n CustCust om Modeom Modeleler r 1010.2.2\E\E xamples\Fivetaxamples\Fiveta nknk T

To run to run t his exahis exa mple:mple:

Copy thCopy th e file files in thes in th e ee exaxa mple direcmple directory ttory t o a coo a convenient nvenient ww orking foldeorking folder, forr, for

example: example:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\FiveTank

10.2\FiveTank To run the simulation: To run the simulation: 1.

1. FrFr om om thth e e File File menu, cmenu, cliclick Opk Open.en. 2.

2. Open the FiveTOpen the FiveTaa nk folnk folder. If you hader. If you ha ve cve copiopied the fileed the files to s to thth e e examexam ple ple ww orkingorking fol

folder, tder, t his is:his is: C:\

C:\ PP rograrogra m Files\m Files\ AAspenTspenTecech\h\ WWorking Folder\orking Folder\ AAspen Cusspen Cus tom Modeletom Modeler 10.2r 10.2 3.

3. DD ouble-ouble-clicclick k tt he he filefile fivetank.acmffivetank.acmf.. Yo

You can run u can run the simulatthe simulat ioion dynan dyna micmicaa lly and chally and cha nge the fenge the feed fled floow rw r aa te to the firstte to the first ta

ta nk using ank using a n Aln AllVlVaa riaria blebles tas ta bleble. T. To do o do this:this:

In tIn t he Flohe Floww sheesheet wt w indow, doindow, doubleuble--clclicick the strk the str eam FeedSteam FeedSt ream tream t haha t enterst enters

T

Taa nk1. nk1. EnEn ter a ter a new vanew va lue lue fofor thr th e variae varia ble ble displdisplaa yed asyed as FlowFlow..

You can see the simulation respond to your step change by displaying a plot. To You can see the simulation respond to your step change by displaying a plot. To do this:

do this: 1.

1. In thIn th e e AAll ll ItIt ems pems paa ne one of the f the SimSim ulaula tion Explotion Explorer, crer, cliclick Flok Floww sheet.sheet. 2.

2. In thIn th e e ContCont ents panents pan e, e, double-double-clclick ick thth e e ploplott TankVolumesTankVolumes to disp to display lay it.it. 3.

3. Double-Double-cliclick ck thth e tae ta nk iconk icons on thns on th e fle flowsheet. Towsheet. This gives a more detahis gives a more deta ileiled plod plot oft of k e

k ey t an k d a t ay t a n k d a t a .. 4.

(16)

Aspen C ust om Modeler E xa mples 1-3

Tasks

Using Microsoft Excel

While Aspen Cust om Modeler™ is runn ing a simula tion, you ca n use Microsoft® E xcel to display a rea l-time profile plot of th e ta nk levels.

1. Fr om E xcel, open FiveTa nk.xls.

2. If prompted, select th e options to ena ble ma cros a nd to upda te linked information.

3. Select t he Ta nk Level Plot sheet, a nd click the Run butt on to run t he simulation.

Capturing Real Time Data using Excel

You can use Visua l B a sic wit hin E xcel to capture simulat ion results t o a ta ble. 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 change t he default va lues of th e fields.

By default, the volume of fluid in Tank5 is imported from the file

FiveTa nk.a cmf. The da ta is read into th e spreadsheet every t wo seconds of real time.

2. In th e Excel spreadsheet, click the Run butt on to sta rt t he simulat ion running an d to sta rt t he data reading into the sprea dsheet.

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.

(17)

1-4 Aspen Cu st om Modeler E xa mples

Five Tanks Example

Applying Step Changes at Specified Times Using Excel

You can use Visual B a sic in E xcel to apply a number of step changes in fixed variables at specific times. To do this, load the FiveTank.acmf file and the FiveTank.xls Excel file.

1. Ma ke sure you ha ve run th e FiveTa nk exa mple a s described in Running th e Five Ta nks E xa mple on pa ge 1-2.

2. In t he FiveTa nk.xls Excel file, click the w orksheet ca lled Schedule.

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.

You can a lter t he va lues of th e feed flow ra te a pplied a t specific times by editing the values in the columns. You can a lso a dd to the number of time / value pairs.

3. In t he Excel spreadsheet, click the Run Schedule butt on to run the simulat ion a nd a pply t he step cha nges at the specific times.

Running from Microsoft Visual Basic

You can cont rol the simulat ion from Microsoft® Visual B a sic® . This ena bles you to ea sily make cha nges to the key input da ta va lues a nd get results back into a single dia log box.

To loa d t he files int o Visua l B a sic:

D ouble-click Fiv eTa nk.v bp

To run th e cont rol a pplicat ion:

In Visual Ba sic, click the Sta rt but ton.

U se the spin box to alt er the feed flow ra te t o Ta nk1.

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.

(18)

Aspen C ust om Modeler E xa mples 1-5 2. In t he Content s pa ne, double-click the ta sk named TestTask to activate it. 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. To display the TankVolumes plot :

1. In t he All It ems pa ne of the Sim ula tion Explorer, click Flow sheet. 2. In t he Cont ents pan e, double-click th e plot TankVolumes to display it. 3. Click Run and wa tch the simula tion respond to your step change. Ea ch tan k on the flowsh eet conta ins a plot na med Ta nkP lot.

(19)

1-6 Aspen Cu st om Modeler E xa mples

Five Tanks Example

(20)

Aspen C ust om Modeler E xa mples 2-1

2

Absor ber E xa m ple

This example is for users of Aspen Cust om Modeler™ w ith P roperties P lus. You therefore ha ve to have Aspen P lus® insta lled to use this exa mple.

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.

There is a pressure cont roller a nd a level cont roller on t he column. This example illustra tes t hese area s of Aspen C ustom Modeler™ :

How to use models within models, or hierarchy

How to use scripts to help initia lize models in stead y-sta te

How to write equations which are automatically normalized

How to use loca l or simplified physica l propert ies

Model polymorphism ba sed upon the st ructu re of the flow sheet

Model polymorphism based upon parameters

(21)

2-2 Aspen Cu st om Modeler E xa mples

Absorber Example

Models Used in the Absorber Example

There are several models in the simulation:

Model Name Used to

antoine_model Calculate coefficients for a simple ideal model for equilibrium k values based upon a simplified Antoine’s equation

column Model a complete absorption column

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 Model a single stage

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.

(22)

Aspen C ust om Modeler E xa mples 2-3 10.2\Absorber

2. Load th e file Absorber.bkp in to Aspen P lus an d run it.

Note This is a properties only input file, so you will not see a flowsh eet in Aspen Plus.

3. From the File menu, click Sa ve As an d save the simulation as a n Aspen P lus document (.a pw file), th en exit Aspen P lus.

Now you ca n run th e exam ple.

Running the Absorber Example

When you have set up Properties Plus, you can run the Absorber example. To do this:

1. In Aspen Cu stom Modeler, from the File menu, click Open.

2. Open the Absorber folder. If you copied the files to th e exa mple w orking folder, t his is

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\Absorber

3. Click th e example file Absorber.acmf then click Open.

4. In t he All It ems pane of the Simula tion Explorer, click Flow sheet to select it. 5. In t he Content s pane, double-click the ta sk nam ed FeedDisturba nce to

activat e it.

6. In t he Contents pan e, double-click the script Init ializeSimulation to run it. The InitializeSimulation script:

Fixes the feed compositions, flows, temperatures, and pressures in each of th e feed stream s. Notice a lso tha t w e use a strea m model.

Init ializes the tempera tur e, liquid a nd va por flows in t he absorber. The specabsorber script fixes the pressure and temperat ure in th e absorber, a nd frees the duty for each sta ge.

(23)

2-4 Aspen Cu st om Modeler E xa mples

Absorber Example

Runs th e simulat ion. A stea dy-sta te run a t t his point is at a fixed

temperat ure of 50° C. This simulat ion converges very q uickly, a nd shows the power of using simplified properties and initialization.

Sw itches the simulat ion to rigorous properties and a n a diaba tic duty for e a ch t r a y .

Runs a steady-sta te simulation again.

Switches the specifications of the absorber to dynamic specifications, wh ere tra y coefficients a re used to ca lculat e the pressure, and the va por a nd liquid product flows a re fixed.

Now you can a dd contr ollers.

Adding Controllers to the Absorber Example

When you have set up Properties Plus, and run the Absorber example, follow  these steps to add controllers:

1. Fr om th e Models folder of the Modeler libra ry , pla ce a P ID contr oller on the flow sheet. This will be a pressure controller to maint a in the vapor flow  based on the pressure in the top sta ge of the a bsorber.

2. U se the built-in stream C ontrolSigna l to connect these va ria bles:

Connectfrom To

B1.p(1) PIDvariablePV PID variable OP B1.vapor_out

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:

Connectfrom To

B1.Stage(6).Sieve.Liquid_Height PID variable PV PID variable OP B1.liquid_out

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.

(24)

Aspen C ust om Modeler E xa mples 2-5 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.

(25)

2-6 Aspen Cu st om Modeler E xa mples

Absorber Example

(26)

3 D ouble E ffect E va pora t or Opt imiza t ion E xa mple

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 Objective expression t o be ma ximized is defined in t he Flowsh eet Const ra int definition.

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  r a t e

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

(27)

3-2 3 D ou

Double Effect Evaporator

Running the Double Effect Evaporator Example

Exa mple simulat ions a re included in your Aspen Cust om Modeler™ insta llation. If you ha ve insta lled in t he default loca tion, files for this example will be in th e folder

C:\Program Files\AspenTech\Aspen Custom Modeler 10.2\Examples\EvaporatorOpt

To prepa re to run th is example:

Copy th e files in th e exa mple directory t o a convenient w orking folder, for

example:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\EvaporatorOpt

To run t his exa mple:

1. Open th e file DoubleEffectE va p. If you copied the files to th e example w orking folder, t hese files ar e locat ed in:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\EvaporatorOpt

2. Run the simulat ion in stea dy-sta te mode.

3. Cha nge the mode to Optimizat ion, a nd run the simulat ion aga in.

(28)

Aspen C ust om Modeler E xa mples 4-1

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.

A Microsoft® E xcel sprea dsheet file is provided, which shows t empera tu re cont ours a t four slices in the cube.

(29)

4-4-2 2 AAspen spen CuCu stst om om Modeler Modeler EE xaxa mplesmples

Heated Metal Heated Metal Cube Example Cube Example

Running the Heated Cube Example

Running the Heated Cube Example

Exa

Exa mple smple simulatimulat ioions ans a re incre included in your Aluded in your Aspespen Cn C ustom Modeustom Modeleler™ r™ instainsta llllaa tion.tion. If you ha

If you ha ve instave insta llelled in td in t he default loche default locaa tion, fition, fileles for this example will be s for this example will be in thin th ee folder

folder

C:\Program Files\AspenTech\Aspen Custom Modeler C:\Program Files\AspenTech\Aspen Custom Modeler 10.2\Examples\HeatedCube

10.2\Examples\HeatedCube T

To run to run t his exahis exa mple:mple:

Copy thCopy th e file files in thes in th e ee exaxa mple direcmple directory ttory t o a coo a convenient nvenient ww orking foldeorking folder, forr, for

example: example:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\HeatedCube

10.2\HeatedCube T

To run o run thth e example, folle example, follow tow t hese sthese st eps:eps: 1.

1. FrFr om the Fom the F ile menu, clile menu, clicick Open.k Open. 2.

2. Open Open thth e e HeaHea tedCtedC ube foube folder. If yolder. If you cu copopied ied thth e e filefiles to s to thth e e example workingexample working fol

folder, tder, t hese filehese files as a re locre locaa ted in:ted in:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\HeatedCube

10.2\HeatedCube 3.

3. Double-click the example fileDouble-click the example file HeatedCube.acmfHeatedCube.acmf.. 4.

4. In the All Items pane of the Simulation Explorer, click Flowsheet.In the All Items pane of the Simulation Explorer, click Flowsheet. 5.

5. In the Contents pane, In the Contents pane, you you can activacan activa te a cte a combiombinana tion tion of of thth e e tata skssks W

Waa rmErmE dge1dge1, 2, , 2, aa nd 3, annd 3, an d Wd Waa rmSrmS urfaurfa cece1, 21, 2, an, an d 3. Yd 3. Yoou mau ma y wy w ish to editish to edit these

these tata sks to sks to alter the staalter the sta rt trt t imeimes, so s, so thatha t tt t he hehe heatat ing eing effeffeccts stats sta rt art a tt diffe

different rent times.times.

Note

Note AAfter yofter you have eu have edited dited a taa ta sk, sk, you you must comust compilmpile e aa nd then activatnd then activat e e it.it. To do this, click the task with the right mouse button and then click Compile. To do this, click the task with the right mouse button and then click Compile. A

After cofter compilmpiling a ing a tata sk, activask, activa te it by te it by clclicicking it wking it w ith tith t he right he right mouse mouse buttbutt onon and then clicking Activate.

and then clicking Activate. 6.

6. OpeOpen thn th e Mie Microcrososoft® ft® ExceExcel spl spreadshreadsh eeeet file t file HeaHea tedCube.xltedCube.xls to diss to display tplay t hehe temperat

temperat ures iures inside nside the cubethe cube. . If a diaIf a dia lolog bog box appex appeaa rs ars a sking isking if yof you wau wa nt tnt t oo update your workbook, or your macros, click YES.

update your workbook, or your macros, click YES.

Note

Note YoYou need u need EE xcxcel el 7.0 7.0 or lor laa ter tter t o o use this filuse this file.e. 7.

7. In AspIn Aspen Custom Moen Custom Modeldeler, cer, cliclick Run to stark Run to star t tt t he dynahe dyna mic mic run trun t hen in Exchen in Excelel,, wa

wa tch the ptch the plolots change as the surfats change as the surfa ce ce temperattemperat ures iures increase. ncrease. YoYou may needu may need to pause th

to pause th e simule simulaa tion to allow Etion to allow E xcxcel time to upel time to updada te thte th e surface ple surface ploot.t.

       

(30)

A

Assppeenn CC uusstt oomm MMooddeelleerr EE xxaa mmpplleess 55--11

5

5

H

H eeaa tt eed

d M

Meett aa l

l S

S llaa b

b

((P

P D

D E

E )

) E

E x

xaa mp

mpllee

This simulation models a slab of a material heated and cooled on opposite sides. This simulation models a slab of a material heated and cooled on opposite sides. For example

For example, this simula, this simula tion ction coulould represed represent nt the heathe hea t flow tt flow t hrough through t he wahe wa ll oll of af a vessel, heated or cooled with a jacket.

vessel, heated or cooled with a jacket. T

The heat he heat flux through tflux through t he mahe ma teriateria l slab is modell slab is modeled in twed in tw o dio dimensiomensions. Tns. The heathe heat flux

flux equaequa tion ition is a secos a second order, pnd order, paa rtiartia l del derivatrivat iveive. P. P aa rtrt ial derivatial derivat iveives as a re used ire used inn tw

tw o spo spaa tiatia l dimel dimensionsions to modens to model the slab of matl the slab of mat erial.erial. T

Two two t aa sks asks a re used to model trare used to model tra nsient effensient effects during cts during dynadyna mic simic simulamula tion. Ttion. Thehe tasks model a pulse of warm fluid passing over two of the edges of the slab. These tasks model a pulse of warm fluid passing over two of the edges of the slab. These pulse

pulses stas sta rt rt aa t t the sathe sa me time, but me time, but the periothe period is differed is different, nt, so the pulseso the pulses becs become oome outut of phase as the simulation proceeds.

of phase as the simulation proceeds. A

A MicroMicrosoft® soft® EE xcxcel spreadshel spreadsh eet file ieet file is provided to give a sus provided to give a su rfarfa ce ce ploplot of tt of t hehe temperat

(31)

5-5-2 2 AAspen spen CuCu stst om om Modeler Modeler EE xaxa mplesmples

Heated Metal Heated Metal Slab Example Slab Example

Running the Heated Slab Example

Running the Heated Slab Example

Exa

Exa mple smple simulatimulat ioions ans a re incre included in your Aluded in your Aspespen Cn C ustom Modeustom Modeleler™ r™ instainsta llllaa tion.tion. If y

If y ou haou ha ve instave insta llelled in td in t he default he default lolocation, the filecation, the files for ths for th is exis exaa mple will be mple will be inin th

th e fole folderder

C:\Program Files\AspenTech\Aspen Custom Modeler C:\Program Files\AspenTech\Aspen Custom Modeler 10.2\Examples\HeatedSlab

10.2\Examples\HeatedSlab T

To run to run t his exahis exa mple:mple:

Copy thCopy th e file files in thes in th e ee exaxa mple direcmple directory ttory t o a coo a convenient nvenient ww orking foldeorking folder, forr, for

example: example:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\HeatedSlab

10.2\HeatedSlab T

To run to run t he examhe exam ple:ple: 1.

1. FrFr om the Fom the F ile menu, clile menu, clicick Open.k Open. 2.

2. Open Open thth e e HeaHea tedStedS lala b fob folder. If yolder. If you cu copopied ied thth e e filefiles to s to thth e e example workingexample working fol

folder, tder, t hese filehese files as a re locre locaa ted in:ted in:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\HeatedSlab

10.2\HeatedSlab 3.

3. DD ouble-ouble-clicclick tk t he fhe f ileile HeatedSlab.acmfHeatedSlab.acmf.. 4.

4. In the All Items pane of the Simulation Explorer, click Flowsheet.In the All Items pane of the Simulation Explorer, click Flowsheet. 5.

5. In tIn t he Contents panhe Contents pan e, e, clclicick Flok Floww sheesheet at a nd and a ctivatctivat e the tae the ta sk Side2sk Side2.. 6.

6. In tIn t he mode he mode bobox ox on tn t he Run Che Run C ontrol toontrol tooolbar, chalbar, cha nge the run nge the run mode mode toto Dynamic.

Dynamic. 7.

7. BB efoefore re runrun ning the simulatning the simulat ioion, on, open pen thth e e MicroMicrosoft® Esoft® E xcexcel l spreasprea dsheet fildsheet filee Hea

Hea tedStedS lab.xls lab.xls to dito display the tempesplay the temperara turtur es es inside inside the slab. the slab. If a diaIf a dia lolog bog boxx aa ppeppeaa rs ars a sking if yosking if you wu w aa nt nt to updatto updat e yoe your wur w oorkboorkbook, ok, or your mar your ma crocros, cs, cliclickk Y E S .

Y E S .

Note

Note YoYou neeu need Exced Excel l 95 95 or or lala ter to ter to use use thth is is spreasprea dsheet filedsheet file.. 8.

8. StSt arar t the dynamt the dynam ic ic run anrun an d wad wa tch the tch the ExcExcel el surface surface plploot change as thet change as the temperat

temperat ures change on twures change on tw o oo oppopposite edgesite edges of the slab. You may s of the slab. You may need toneed to pause th

(32)

Aspen C ust om Modeler E xa mples 5-3

(33)

5-4 Aspen Cu st om Modeler E xa mples

Heated Metal Slab Example

(34)

Aspen C ust om Modeler E xa mples 6-1

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.

The components are represented by A, Q, and S. The rea ctions a re :

K3 S  A

(1) K1 K2 S  Q  A

(2)

Where both reactions a re ra te-ba sed.

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.

(35)

6-2 Aspen Cu st om Modeler E xa mples

Reactor Dynamic Estimation Example

Running the Reactor Dynamic Estimation 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:\Program Files\AspenTech\Aspen Custom Modeler 10.2\Examples\ReactorDynEst

To run t his exa mple:

Copy th e files in th e exa mple directory t o a convenient w orking folder, for

example:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\ReactorDynEst

There are th ree wa ys to run t he estimat ion example:

U sing the Estima tion dia log box

U sing the supplied Microsoft® Visua l B asic® script

From external Microsoft® Visual B a sic® in t he supplied Microsoft® Excel® spreadsheet

Using the Estimation Dialog Box

To run t he example using the E stima tion dialog box: 1. Fr om th e File menu, click Open.

2. Open th e fileReactorDynamicEstSetupComplete.acmf . If y ou copied th e files to t he exam ple working folder, t his file is loca ted in:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\ReactorDynEst

3. To inspect t he setup of th e estim a tion experiment s, from the Tools menu, click Estimation.

4. Click the Estima ted Var iables tab a nd note tha t it shows those varia bles wh ich a re to be estima ted.

5. On the Dyna mic Experiments ta b select the dyna mic experiment listed on it a nd click th e Edit but ton to view its deta ils.

(36)

Aspen C ust om Modeler E xa mples 6-3 a re no initia l var iables in this exa mple.

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.

From a Microsoft Visual Basic Script

To run t he exa mple from a Visual B a sic® script: 1. Fr om th e File menu, click Open.

2. Open th e Rea ctorDy nE st folder. If you copied th e files to the exa mple w orking folder, t hese files a re loca ted in::

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\ReactorDynEst

3. Open th e file ReactorDyn a micEst .acmf 4. P erform a n initializat ion run.

5. In t he All It ems pane of the Simula tion Explorer, click Flow sheet to select it. 6. In th e Cont ents pan e, double-click the script ca lled est_dyn_cat.

The estima tion simula tion sta rt s.

(37)

6-4 Aspen Cu st om Modeler E xa mples

Reactor Dynamic Estimation Example

From External Visual Basic in an Excel Spreadsheet

To run t he example from externa l Microsoft® Visual B a sic® in a Microsoft® Excel® spreadsheet:

1. Fr om the F ile menu, click Open.

2. Open th e folder ReactorD yn Es t. If you copied th e files to the exa mple w orking folder, t hese files a re loca ted in:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\ReactorDynEst

3. Open th e fileReactorDynamicEst.acmf. 4. P erform a n initializat ion run.

5. If you ha ve E xcel 97 or la ter, open the sprea dsheet ReactorDynamicEst.xls. – or –

If you have Excel 7.0, open the spreadsheet ReactorDynamicEst95.xls. This is in Exa mples\Off95ExcelSheets.

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. The E xcel spread sheet ha s some additional fea tur es:

Youcan Todothis

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 the sensitivities of the estimated variables to the measured variable

Select the Sensitivity worksheet.

Check and alter the Estimation Solver Options

Select the Estimation Solver Options worksheet.

Click Get to read in the current values of the estimation solver options. Click Put to apply values.

(38)

Aspen C ust om Modeler E xa mples 7-1

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

Seven experiments a re run, va rying t he feed flow ra tes to a reactor. The measur ed values a re the outlet concent ra tions of th e components A an d B . 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

(39)

7-2 Aspen Cu st om Modeler E xa mples

Methanol Reactor Estimation Example

Running the Methanol Reactor Example

Exa mple simulat ions a re included in your Aspen C ustom Modeler™ insta lla tion. 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:\Program Files\AspenTech\Aspen Custom Modeler 10.2\Examples\MethReactorSSEst

To run t his exa mple:

Copy th e files in th e exa mple directory t o a convenient w orking folder, for

example:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\MethReactorSSEst

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.

Using the Estimation Dialog Box

To run t he example using the E stima tion dialog box: 1. Fr om th e File menu, click Open.

2. Open th e fileMethReactorSSEstSetupComplete.acmf . If y ou copied th e files to t he exam ple working folder, t his file is loca ted in:

 C:\ P rogra m Files\ AspenTech\ Working Folder\Aspen Cust om Modeler 10.2\MethReactorSSEst

3. To inspect t he setup of th e estim a tion experiment s, from the Tools menu, click Estimation.

4. Click the Estima ted Var iables tab a nd note tha t it shows those varia bles wh ich a re to be estima ted.

5. On the St eady St a te Experiments ta b, seven experiments ar e listed. Select a n experiment a nd click th e Edit but ton to view it s deta ils.

6. In th e dialog box, note th e follow ing two ta bs:

Measured Variables tab. Lists va ria bles for w hich t here is observed dat a, a s well as enabling you to edit the da ta . It a lso displays results w hen the estimat ion r un is complete.

Fixed Variables tab. Lists va ria bles w hich ha ve prescribed values in the experiment a nd ena bles you t o edit of th ose va lues.

7. Run t he simula tion. The results can be inspected on th e Mea sured Va ria bles ta b for each experiment.

(40)

Aspen C ust om Modeler E xa mples 7-3 3. D ouble-click th e file MethanolReacSSEst.acmf.

4. In t he All It ems pa ne of the Sim ula tion Explorer, click Flow sheet. 5. In t he Contents pane, double-click the script ca lled SS Est imat ion.

The results of the Estima tion run a re shown in the Simula tion Messages window.

Running with an E xcel Spreadsheet

To run t his exa mple with a n E xcel spreadsh eet: 1. Fr om th e File menu, click Open.

2. Open the MethReactorSS Est folder. If you ha ve insta lled Aspen Cust om Modeler in the default location, this is:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\MethReactorSSEst

3. D ouble-click t he file MethanolReacSSEst.acmf.

4. If you ha ve E xcel 97 or la ter , open the sprea dsheet ReactorSSEst.xls.

– or –

If you have Excel 7.0, open the spreadsheet ReactorSSEst95.xls. This is in

Exa mples\Off95ExcelSheets. If a dia log box a ppea rs asking if you w a nt t o enable ma cros, click " En a ble Macros".

5. Check the dat a on the Input Da ta page.

6. On the Results worksheet, run t he estima tion by clicking the Calculat e butt on a nd w hen the estima tion simulation is complete, view the results.

7. For direct a ccess to th e estima tion algorithm options, select the Est imat ion Solver Options w orksheet. Click G et to read va lues a nd P ut t o a pply va lues. 8. You ca n an a lyze th e results of the estima tion simulat ion to compa re the

estimat ed solution wit h th e mea sured dat a . After a n Est imat ion run, select the Analyze w orksheet a nd click Ca lculat e.

9. You ca n check the sensitivities of the estima ted var iables to the measur ed var iables. Select t he Sensitivity Analysis worksheet a nd click Ca lculat e.

(41)

7-4 Aspen Cu st om Modeler E xa mples

Methanol Reactor Estimation Example

Controlling NL2SOL Options

You can r ead a nd cha nge the va lues of the estima tion routine NL2SOL solver options in th e following wa ys:

U se the E stima tion Solver Options worksheet in t he Excel file ReactorSS Est .xls or ReactorSS Est 95.xls

Use the supplied Visual Basic form NL2SOLOpt.vbp. You need either Visual B a sic 5.0 Pr ofessional or Ent erprise Edit ion, or the C ontr ol Crea tion Edition.

On th e Setup ta b of the Estima tion dialog box, click th e Options button t o open the Solver Options dialog box with the E stima tion ta b a ctive.

(42)

Aspen C ust om Modeler E xa mples 8-1

8

C a t a lyt 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 .

(43)

8-2 Aspen Cu st om Modeler E xa mples

Catalytic Bed Regen-eration Example

The temperature profile in the bed between the gas and solid in the bed is described by the following equations.

) (  _  ) (  _  s  g  s  s  g  g  g  T  T  const  S  t  T  T  T  const  G  z  T  v  t  T 

=

=

ε  Where: g  T  = G a s t emper a tur e s  T  = S olid t em per a tu re= Time= S tea m velocit y ε  = B ed voida ge G_const  and

S_const  = H ea t t ra n sfer con st a nt s z  = B ed len gt h

The part ial derivat ive for t empera tur e in t erms of length is approximat ed by the finite difference equation:

z  T  T  z 

1 Where:

(44)

Aspen C ust om Modeler E xa mples 8-3

Copy th e files in th e exa mple directory t o a convenient w orking folder, for

example:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\Regen

You can ru n th is example in several w a ys:

Loading t he text input file a nd use Aspen Cust om Modeler ta bles, run-time plots a nd profile plots to ma ke input disturba nces a nd view key r esults

U sing a Visua l Ba sic cont rol panel to run the simulat ion w ithout intera cting wit h th e Aspen C ustom Modeler U ser Int erface

To run th is example from Aspen C ust om Modeler, complete th ese steps: 1. Fr om th e File menu, click Open.

2. Open the Regen folder. If you copied the files to the example working folder, these files are located in:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\Regen

3. D ouble-click t he file Regen.acmf. 4. S t a r t a d y na m i c r u n .

5. View th e effect of th e cha nge in feed tempera tu re in the plot SolidTempP lot in th e block B ed1. To view th is plot, click t he block B ed1 with th e right mouse button then point to Forms and click SolidTempPlot.

6. You ca n run a predefined ta sk to simulat e changes in the temperat ure of the stea m entering the bed:

In the Simulation Explorer, under Flowsheet, double-click the

RegenerateCatalyst task icon to activate the task. This task simulates one cycle of cat a lyst regenera tion.

(45)

8-4 Aspen Cu st om Modeler E xa mples

Catalytic Bed Regen-eration Example

Running the Catalytic Bed Example from Visual Basic

You can use Visua l B a sic to sta rt a n Aspen Cust om Modeler session a nd run th e simulat ion w ithout intera cting with the Aspen C ustom Modeler U ser Int erface. 1. Run th e executa ble RegenDemo.exe.

2. Click the St ar t Regen Demo button. Ensure tha t the pathna me displa yed in the box a t t he bott om of the cont rol pa nel show s the directory w here you ha ve installed the example files.

3. Wa it for confirma tion tha t the simula tion is ready t o run.

4. If you wa nt t o see a n E xcel real-time tempera tur e profile, click the La unch Excel but ton.

If a dialog box appears a sking if your w a nt to updat e your w orkbook, or your macros, click Yes.

5. Click the Run butt on an d cha nge the feed vapor temperat ure with th e slider. 6. To close the simula tion, in the cont rol pa nel, from th e File menu, click Exit .

You a re a sked if you w a nt to close the Aspen Cust om Modeler session a t the same time.

The Visual B a sic source code is included in t he files RegenDemo.vbp an d

RegenD emo.frm. These files a re compat ible wit h Visual B a sic 5 a nd Visual B a sic 6.

(46)

Aspen C ust om Modeler E xa mples 9-1

9

S t ea dy-S t a t e Met h a n ol

Rea 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 To run t his exa mple:

Copy th e files in th e exa mple directory t o a convenient w orking folder, for

example:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\SSMeth

The Meth a nol Reactor models a meth a nol production process including a recycle loop.

A feed st ream of H ydrogen, Ca rbon Monoxide, Car bon D ioxide, Metha ne a nd Wa ter is mixed w ith t he recycle strea m a nd fed to a rea ctor operat ing at 533 Celsius and 120 bar.

Two reactions are modeled in the reactor:

The metha na tion reaction betw een C a rbon Monoxide and H ydrogen

C O + 2 H 2 - > C H 3 O H  

A side rea ction betw een H ydrogen an d C a rbon Dioxide.

H 2 + C O 2 -> C O + H 2 O  

Metha nol a nd Wa ter a re extr a cted as a product st ream . To prevent t he build up of impurities a proportion of the recycle stream is purged to waste.

(47)

9-2 Aspen Cu st om Modeler E xa mples Version 10.2

Methanol Reactor with Recycle

Running the Methanol Example

To run the Meth a nol exa mple, S SMeth Demo.acmf, you need to complete t he follow ing s teps:

Loading th e exam ple

B uilding t he flowsh eet

Connecting t he blocks

Tidying th e flow sheet

Ent ering the input dat a

Running th e simulat ion a nd reviewing results

Cha nging the simula tion

Viewing changes

Sa ving new specifications

Note There is a lso a Metha nol exa mple w ith the flow sheet a lready built, SS Meth.a cmf. If you choose to load t his file, go stra ight t o Running the Simula tion a nd Reviewing Results on page 9-6.

Loading the Example

To loa d t he exa mple:

1. Fr om th e File menu, click Open.

2. G o to the SS meth folder. If you copied th e files to the exa mple w orking folder, these files are located in:

C:\Program Files\AspenTech\Working Folder\Aspen Custom Modeler 10.2\SSMeth

3. D ouble-click one of t he follow ing:

File Name Description

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.

(48)

Aspen C ust om Modeler E xa mples 9-3 3. From the Content s pa ne, dra g and drop the FeedIcon ont o the flowsh eet.

4. Double-click th e specificat ion indicat or on t he sta tu s ba r. (The specifica tion indica tor is either a gr een squa re or a r ed arr ow.) Keep the St a tus w indow  open. You will see th e degrees of freedom cha nge a s you pla ce the blocks. 5. Cont inue building th e flow sheet:

Block Model B1 FEEDER B2 MAKEUP B3 REACTOR B4 SEPARATOR B5 SPLITTER

(49)

9-4 Aspen Cu st om Modeler E xa mples Version 10.2

Methanol Reactor with Recycle

Connecting the Blocks

If you a re using the S SME thD emo.acmf file, a fter you ha ve pla ced a ll the blocks on th e flow sheet, y ou need to connect t hem. To connect th e blocks:

1. In t he All It ems pane of the Simula tion Explorer, click St rea m Types. From the C ontent s pan e, drag t he Connection icon onto the flow sheet. B lue arr ow s a ppea r on the icons where port s a re ava ilable.

2. Dr op the Connection on a port an d connect to a nother port a s shown in th e flowsheet diagram. Repeat to complete the flowsheet. The finished flowsheet should look like this:

Tidying the Flowsheet

You ma y n eed to reposition blocks on t he flowsheet. To do this:

1. Click th e right m ouse but ton on the flow sheet an d then click Zoom Full to ensure the flowsheet is a s la rge a s possible.

2. To select all the blocks, hold dow n th e mouse butt on a nd dra g the cursor to round th em to form a box.

3. Fr om th e Flowsh eet menu, click Align Blocks. 4. From the Flowsheet menu, click Reroute St ream s.

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

(50)

Aspen C ust om Modeler E xa mples 9-5 Click the required block to select it, then click with the right mouse button a nd point to Forms. From t he displa yed list, click th e required form.

Entering Data from the AllVariables Table

En ter t he da ta for t he Feeder block from th e AllVa riables ta ble. To do this:

In th e Flowsheet w indow, d ouble-click the block B 1.

An AllVa ria bles ta ble tha t conta ins a ll the varia bles in the block appea rs.

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.

Entering Data from the User Defined Forms

Complete t he da ta entry by using t he customized forms. A user-defined form is a Microsoft® ActiveX® contr ol form, designed to display da ta for a par ticula r

model. You ca n design y our own forms for your ow n models. To access t he form: 1. Ma ke sure B3 (th e Rea ctor block) is selected, th en click it wit h th e right

mouse button, point to Forms and click ReactorSpec.

A user-defined form a ppea rs. This form ena bles you to ent er th e correct da ta easily. To cha nge da ta in t his form, ma ke sure you click outside each box a fter entering a n umber, otherw ise the va lue is not reta ined.

(51)

9-6 Aspen Cu st om Modeler E xa mples Version 10.2

Methanol Reactor with Recycle

Running the Simulation and Reviewing Results

To run t he simulat ion a nd r eview results:

1. After a ll the da ta ha s been entered, you can show th e user defined form for the Sepa ra tor B4.

The numbers chan ge when a result is calculat ed.

2. Ma ke sure the run mode box on the Run Control toolbar shows St eady S ta te a nd click th e Run butt on.

3. U se th e user-defined forms t o look a t th e result s over the wh ole flow sheet. 4. En ter different va lues in the user-defined forms a nd run t he simulat ion to get

different results.

5. You ca n perform furt her run s, cha nging t he value of the feed flow t ota l a nd/or th e component mole fra ctions in t he AllVa ria bles ta ble for block B 1.

Changing the Simulation

You can now t ry a ltering the structur e of the simulat ion.

1. Open the St a tus w indow , if it is not current ly displayed, by doing one of the following:

Double-click th e green sq ua re on the sta tus ba r.

From t he View m enu, click S ta tus Window. 2. Click the Fixed Cha nges ta b.

3. In t he Flowsheet w indow, double-click th e feed block, B 1. 4. In t he AllVa ria bles ta ble, click th e Spec column cell for Tota l. 5. Ch a nge th e spec from Fixed to Fr ee.

The simulation is now underspecified by one. On the tab for Fixed Changes, the va ria ble th a t you just cha nged appears on the unFixed list.

6. Open the AllVa ria bles ta ble for B 4, the sepa ra tor.

7. Cha nge the spec for th e varia ble meprod from Free to Fixed. The simulation is squar e aga in.

8. Now r un th e simula tion aga in to ca lculat e the required feed for th e specified metha nol production ra te.

(52)

Aspen C ust om Modeler E xa mples 9-7 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.

Saving New Specifications

You can save the new specification values by creating scripts. To do this:

1. If th e Sta tus w indow is not a lready open, open it. To do this, from th e View  menu, click St a tus Window then click the Genera l ta b.

2. Click the Script butt on, supply a n a me for th e new script an d click OK. 3. In t he All It ems pa ne of the Sim ula tion Explorer, click Flow sheet.

The script a ppea rs in t he Contents pan e.

4. To edit th e script, click wit h th e right mouse button on the script icon th en click E dit.

The changes ma de from the defa ult specification va lues are r ecorded in t he script.

5. To apply th e cha nges ma de in th e script, double-click the script icon to invoke it .

6. To revert t o th e defa ult specifica tion provided in the models, in th e St a tu s window, on th e Fixed Ch a nges ta b, click th e Reset butt on.

Now you ca n easily sw itch between the default spec and t he new spec between runs.

7. You ca n use a Microsoft® Visua l Ba sic® a pplica tion to switch between a

design a nd ra ting case. You can fix th e total feed flow ra te to the flowsh eet, or switch to fixing the total methanol produced. The front end provides you with the values of the key data .

If you are running the file Use this Visual Basic form from the SSMeth folder ssmeth.acmf MethanolLoop.vbp

(53)

9-8 Aspen Cu st om Modeler E xa mples Version 10.2 Methanol Reactor with Recycle

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.

Running the Homotopy Example

You can run the H omotopy exa mple from the input file SSMeth .acmf. To run t he H omotopy exa mple:

1. In t he All It ems pane of the Simula tion Explorer, click Flowsh eet. In the Cont ents pa ne, double-click the script ca lled RunH omotopy.

This script initializes the homotopy ta rget va ria bles a nd ena bles homotopy. 2. To see the result s of runnin g th is script, from the Tools menu, click Homotopy.

In t he Homotopy dialog box, you can cha nge the initial a nd t a rget va lues of the va riables by double-clicking th e var iable na mes in t he list.

3. To sta rt t he solution, click th e Run but ton.

The simula tion solution is moved from th e curr ent solution point to th e solution a t t he ta rget va lues of thr ee fixed va ria bles:

Feed Flowra te

Reactor Tempera tur e

Reactor Pressure

References

Related documents