12.08 the optimizer

Upload: fajri-julisyah

Post on 04-Apr-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 12.08 the Optimizer

    1/21

    The Optimizer 1

    1

    The Optimizer

    2000 AEA Technology plc - All Rights Reserved.Chem 8_5.pdf

  • 7/29/2019 12.08 the Optimizer

    2/21

    2 The Optimizer

    2

    WorkshopIn this example, a simple distillation column to separate

    Tetrahydrofuran (THF) from Toluene is simulated. The object of the

    exercise is to select the product specifications such that profit is

    maximized. A special tool in HYSYS, the Optimizer, will be used to find

    the optimum operating conditions.

    Learning ObjectivesOnce you have completed this section, you will be able to:

    Use the Optimizer tool in HYSYS to optimize flowsheets

    Use the Spreadsheet to perform calculations

    PrerequisitesBefore beginning this section you need to be able to:

    Add Streams and Operations

    Model columns in HYSYS

    Fast track to page 9.

  • 7/29/2019 12.08 the Optimizer

    3/21

    Process Overview

  • 7/29/2019 12.08 the Optimizer

    4/21

    Column Overview

  • 7/29/2019 12.08 the Optimizer

    5/21

    The Optimizer 5

    5

    Building the SimulationDefining the Simulation Basis

    For this case, you will be using the Wilson Activity Model. The

    components are: Tetrahydrofuran and Toluene.

    1. On the Binary Coeffs tab, check that the UNIFAC VLE estimationmethod is chosen, and press the Unknowns Onlybutton toestimate the missing Interaction Parameters.

    2. Enter the Simulation Environment.

    Adding the Feed Stream

    Add a material stream with the following values:

    Binary interaction parametersare used to correlate lab datawith a thermodynamic model.When lab data is notavailable, you can estimatethe parameters with HYSYSUNIFAC estimation method.

    In This Cell... Enter...

    Conditions

    Name Feed

    Temperature 10C (50F)

    Pressure 140 kPa (20 psia)

    Mass Flow 3700 kg/h (8160 lb/hr)

    Composition - Mass Fraction

    THF 0.44

    Toluene 0.56

  • 7/29/2019 12.08 the Optimizer

    6/21

    6 The Optimizer

    6

    Add the Distillation ColumnAdd a Distillation Column with the following values:

    Make the following specifications:

    In This Cell... Enter...

    Connections

    Column Name T-100

    No. of Stages 10

    Feed Feed, Stage 5

    Condenser Type Total

    Bottoms Liquid Toluene

    Ovhd Liquid THF

    Condenser Energy Stream Cond Q

    Reboiler Energy Stream Reb Q

    Pressure

    Delta P, Condenser and Reboiler 0 kPa

    Condenser 103 kPa (15 psia)

    Reboiler 107 kPa (15.5 psia)

    In This Cell... Enter...

    Specs

    Reflux Ratio 2 (Estimate)

    Distillate Rate 1500 kg/h (3305 lb/hr) (Estimate)

  • 7/29/2019 12.08 the Optimizer

    7/21

    The Optimizer 7

    7

    Create two newColumn Component Fraction specifications as shown

    below:

    These two specifications should beActive. The DOF for the column

    should now be 0.

    The column should now solve automatically. If it does not, press the

    Run button to start the solver.

    Save your case!

  • 7/29/2019 12.08 the Optimizer

    8/21

    8 The Optimizer

    8

    Changing the Column TolerancesIn order for the optimizer to work properly, we have to tighten the

    tolerances of the column solver. There are two tolerances that the

    column must meet before it can be considered as solved.

    The Equilibrium Error Tolerance

    The Heat/Spec Error Tolerance

    We want to set the value for both of these tolerances at 1e-6. Note that

    this will increase the solving time of the column, but this column solves

    very fast anyway, so the tighter tolerances are acceptable in this case.

    To change the tolerances, follow these steps:

    1. Access the Solver page of the Parameters tab.

    2. Enter 1e-6 for both the tolerance values. These cells are located inthe Solving Options group box.

    This completes the changing of the tolerances. We are now ready to

    begin to optimize the column.

  • 7/29/2019 12.08 the Optimizer

    9/21

    The Optimizer 9

    9

    Adding the OptimizerIn todays highly competitive market place, with stringent plant

    emissions controls and increased competition, a plants survivability is

    often determined by its ability to remain competitive. Optimization

    methods are now available that give the process engineer the necessary

    tools to perform on-going process improvement studies. Optimization

    studies lead directly to improved plant performance, efficient plant

    operation and finally to increased profitability. Typically, optimization

    studies involve an economic model composed of a Profit Function and

    operating constraints.

    HYSYS contains a multi-variable Steady State Optimizer. Once your

    Flowsheet has been built and a converged solution has been obtained,you can use the Optimizer to find the operating conditions which

    minimize or maximize an Objective Function. The Optimizer owns its

    own Spreadsheet for defining the Objective Functions as well as any

    constraint expressions to be used. This allows you to construct

    Objective Functions which maximize profit, minimize utilities or

    minimize exchanger UA.

    Primary Variables - these are flowsheet variables whosevalues are manipulated in order to minimize (or maximize) theobjective function. You set the upper and lower bounds for theprimary variables, which are used to set the search range.

    Objective Function - this is the function which is to beminimized or maximized. The function has to be defined within

    the Spreadsheet. This allows the user a great deal of flexibilityin defining the function.

    Constraint Functions - inequality and equality functions aredefined in the Spreadsheet. In solving the Objective Function,the Optimizer must also meet any constraints that are definedby the user.

    Open the caseOptOptimizer.hsc

    Onlyuser-specifiedprocessvariables can be used asPrimary Variables

    Restrictions on the Optimizer

    only available for Steady-State calculations

    it cannot be used inTemplates.

  • 7/29/2019 12.08 the Optimizer

    10/21

    10 The Optimizer

    10

    In our column example, the Profit Function/Cost Function (sometimes

    referred to as the Objective Function, Performance Criterion or

    Performance Index) requires calculating a net profit for the column.

    The Profit Function is a function of the revenue generated from desired

    products THF and Toluene, within the limit of product purity

    constraints. While increased profits is directly linked to increased

    production of the desired product, plant profitability is generally offset

    by operating costs. In our column, operating costs are associated with

    the column utility requirements for the reboiler and condenser. In

    general a profit function is given by:

    where:

    PF = Profit Function/time

    = Product Flows * Product Values

    = Feedstock Flows * Feedstock Costs

    OC = Operating Costs

    Profit = (THF Product + Toluene Product) Heating Cost Cooling Cost

    Feed Cost

    Typically, the economic model includes operating constraints (equality

    or inequality constraints or equations). The operating constraints

    comprise the model of the process or equipment. In this case, we haveno process constraints.

    To invoke the Optimizer, select Optimizer under Simulation in the

    Menu Bar, or press .

    Which variable can we change to affect theRevenue?________

    PF F

    p

    pMp FfMf f

    OC=

    FpMpFfMf

  • 7/29/2019 12.08 the Optimizer

    11/21

    The Optimizer 11

    11

    Variables tab

    When you invoke the Optimizer for the first time, you are placed on the

    Variables tab. On theVariables tab you define the Adjusted (Primary)

    Variables to be used in the optimization.

    In this case, our Primary Variables are the purity of our products, THF

    and Toluene.

    1. Press theAddbutton to add the first variable, T-100, Spec Value,THF Purity Spec.

    2. Set the Upper Bound at 0.9, and the Lower Bound at 0.90.

    3. Add the second variable, T-100, Spec Value, Toluene Purity Spec,

    with the same bounds as above.

  • 7/29/2019 12.08 the Optimizer

    12/21

    12 The Optimizer

    12

    Defining the SpreadsheetThe Optimizer has its own Spreadsheet for defining the Objective and

    Constraint functions. Primary Variables may be imported and

    functions defined within the Optimizer Spreadsheet, which possesses

    the same capabilities as the Main Flowsheet Spreadsheet

    1. Press the Spreadsheetbutton on the Optimizer view to open theSpreadsheet.

    2. Move to the Spreadsheet tab.

    Importing and Exporting Variables

    You may import virtually any variable in the simulation into theSpreadsheet and you can export a cells value to any specific field in

    your simulation.

    Object Inspection - object inspect (secondary mouse button)the cell which you want to Import into, or Export from. From theMenu that appears, select Import Variable or Export FormulaResult. Then, using the Variable Navigator, select the variableyou wish to import or export.

    Connections page tab - select the Add Importor Add Exportbutton. Then, using the Variable Navigator, select the variableyou wish to import or export.

    Drag n Drop - using the secondary mouse button, click thevariable value (from the WorkBook or Property View) you wish

    to import, and drag it to the desired location in theSpreadsheet. If you are exporting the variable, drag it from theSpreadsheet to the exported location.

    The Spreadsheet is anoperation and thus theSpreadsheet cells get updatedwhen Flowsheet variableschange

  • 7/29/2019 12.08 the Optimizer

    13/21

    The Optimizer 13

    13

    Adding Formulas

    Complex mathematical formulas can be created, using syntax that is

    similar to conventional Spreadsheets. Arithmetic, logarithmic and

    trigonometric functions can be performed in the Spreadsheet.

    All common functions must be preceded by a +symbol. Special

    Functions must be preceded by the @ symbol.

    Some of the functions available are:

    Addition (+): +A1+A2

    Subtraction (-): +A1-A2

    Multiplication (*): +A1*A2

    Division (/): +A1/A2

    Power (^): +A1^3

    Absolute Value (@ABS):@ABS(A1)

    Square Root (@SQRT):@SQRT(A1)

    Natural Log (@ln):@ln(A1)

    Exponential (@exp):@exp(A1)

    The following variables need to be imported into the Spreadsheet. Text

    entries are added to the spreadsheet by typing them in the appropriate

    cell.

    The quickest way of importing variables is to right-click on the desiredcell. Select Import Variable, and use the variable navigator to locate the

    desired variable.

    Use this method to import the variables above now.

    Press theFunction Helpbutton to view the AvailableSpreadsheet Functions andExpressions.

    Cell... Object... Variable...

    B1 Cond Q Heat Flow

    B2 Reb Q Heat Flow

    B3 THF Mass Flow

    B4 THF Comp Mass Frac THF

    B5 Toluene Mass Flow

    B6 Toluene Comp Mass Frac

    Toluene

    B7 Feed Mass Flow

  • 7/29/2019 12.08 the Optimizer

    14/21

    14 The Optimizer

    14

    Enter the following constants on the spreadsheet. The comments can

    be added, if desired.

    Enter the following product prices:

    Note: the prices of the products decrease as the impurities increase.

    The Objective Function is placed in Cell D8. The equation is:

    +(b3*d4+b5*d6)-b7*d7-(b1*d1+b2*d2)/3600

    Pay special attention to the units in this equation. If using field units,you may have to add an additional term to this equation to convert

    between hours and days.

    Cell Value (SI Units) Value (Field) Comment

    D1 0.471 ($/kWh) 138 ($/MMBtu) Cooling Cost

    D2 0.737 ($/kWh) 216 ($/MMBtu) Heating Cost

    D7 0.05 ($/kg) 0.024 ($/lb) Feed Cost

    Cell

    Equation

    (SI Units) Equation (Field) Description

    D4 +0.333*b4^3 ($/kg) +0.151*b4^3 ($/lb) THF Price (corrected

    for purity)

    D6 +0.163*b6^3 ($/kg) +0.074*b6^3 ($/lb) Toluene Price

    (corrected for purity)

    What is the value of cell D8, the Profit? __________

    You can change the VariableType to Unitlessfor dollarvalue variables.

  • 7/29/2019 12.08 the Optimizer

    15/21

    The Optimizer 15

    15

    Functions tab

    The Functions tab contains two groups, the Objective Function and the

    Constraint Functions. However, in this example we do not have

    constraint functions.

    1. In the Cell area of the Objective Function group, specify theSpreadsheet cell that defines the Objective Function. Use thedrop down menu in the Edit Bar to select the appropriate cell.The Current Value of the Objective Function will be provided.

    2. Select the Maximizeradio button.

  • 7/29/2019 12.08 the Optimizer

    16/21

    16 The Optimizer

    16

    Parameters tab

    The Parameters tab is used for selecting the Optimization Scheme.

    Box - Handles inequality constraints but not equalityconstraints. It generally requires a large number of iterations toconverge on the solution.

    SQP - Sequential Quadratic Programming, handles inequalityand equality constraints. Considered by many to be the mostefficient method for minimization.

    Mixed - Handles inequality constraints only. It is a combinationof the Box and SQP methods. It starts the minimization with theBox method using a very loose convergence tolerance. Afterconvergence, the SQP method is used to locate the finalsolution.

    Fletcher Reeves - Does not handle constraints. Efficientmethod for general minimization.

    Quasi-Newton - Does not handle constraints. Similar methodto Fletcher Reeves.

    1. Select the Mixed method as the Scheme.

    2. Use the defaults for Tolerance and Number of Iterations.

    Monitor tab

    The Monitor tab displays the values of the Objective Function and

    Primary Variables during the Optimizer calculations.

    1. Move to the Monitor tab and press the Startbutton to begin theoptimization.

    For more information on theOptimization Schemes, referto the manual section 17.2 or

    the on-line Help.

    Save your case!

  • 7/29/2019 12.08 the Optimizer

    17/21

    The Optimizer 17

    17

    Analysing the ResultsOnce the Optimization is complete, examine the results and fill in the

    following table:

    Base Case Optimized Case

    THF mass flow 1650.8 kg/h

    (3639.4 lb/hr)

    THF purity 0.95

    Toluene mass flow 2049.2 kg/h

    (4517.7 lb/hr)

    Toluene purity 0.95

    Cond duty 9.926e5 kJ/h

    (9.408e5 Btu/hr)

    Reb duty 1.5980e6 kJ/h

    (1.5146e6 Btu/hr)

    Profit 106.3 $/hr

  • 7/29/2019 12.08 the Optimizer

    18/21

    18 The Optimizer

    18

    Exercise 1We are going to introduce a constraint on the liquid volume flow of the

    stream THF and examine how it affects the results, profit and products

    purities.

    First, the case must be set back to its state before the optimization.

    1. Go to the column subflowsheet.

    2. On the Design tab, Monitor page, enter the initial value of0.95 forthe THF and Toluene purity specifications.

    3. Re-run the column.

    The constraint on the liquid flow is that it must not exceed 1.85 m3/h

    (65.5 ft3/hr).

    The THF Liquid Flow must first be imported into the spreadsheet (use

    an empty cell), and the constraint value must be written in the

    spreadsheet. Remember to write the comments next to the values so

    that they can be understood.

    1. On the Functions tab of the Optimizer press theAddbutton.

    2. Type in the reference of the cell where the variable constraint islocated.

    3. In the Cond column, use the scroll down arrow to find the lessthan sign. Type in the reference of the cell where the value of theconstraint is written.

    4. Go to the Monitor tab and start the Optimizer.

    The constraint values arepositive if inequalityconstraints are satisfied andnegative if inequalityconstraints are not satisfied.

  • 7/29/2019 12.08 the Optimizer

    19/21

    The Optimizer 19

    19

    What differences, if any, does the constraint make to the first optimized

    solution? Fill in the following table:

    Base CaseOptimizedCase

    OptimizedCase 2

    THF Mass Flow 1650.8 kg/h

    THF Purity 0.95

    Toluene Mass

    Flow

    2049.2 kg/h

    Toluene Purity 0.95

    Cond Duty 9.926e5 kJ/h

    Reb Duty 1.5980e6 kJ/h

    Profit 106.3 $

  • 7/29/2019 12.08 the Optimizer

    20/21

    20 The Optimizer

    20

    Exercise 2Here, we are going to model the reboiler with a steam-heated shell and

    tube heat exchanger. The heat exchanger will be modelled with 115 psia

    steam and the maximum flow of steam available to the reboiler is

    limited to 840 kg/h (1850 lb/hr). (Note that there are a few approaches

    that can be taken with the heat exchanger modelling so two of the

    possibilities are listed). The cost of the 115 psia steam is 0.682 $/kWh

    ($200/MMBtu).

    1. AddWater as a component. This must be done in the BasisEnvironment.

    2. Open the Columns Property viewer; on the Monitor page, resetthe THF and Toluene purity specifications to 0.95.

    3. Add a new internal stream (on the Flowsheet tab), ToReb with thefollowing attributes:

    4. Run the column.

    5. Return to the Main Environment (notice that the "To Reb" streamis now shown on the PFD. Add a heat exchanger. The streamToReb is the shell side feed and steam is on the tube side.

    6. Set the Shell and Tube side pressure drops to 0.

    7. Specify the Steam inlet conditions atVf = 1.0; P = 790 kPa (115psia); Flow = 770 kg/h (1700 lb/hr). The outlet steam is at itsbubble point (Vf = 0.0).

    8. Add a Duty Spec to the Heat Exchanger but do not specify a value(pass is Overall).

    Use the Mixed optimizationscheme for this exercise.

    In This Cell... Enter...

    Type Liquid

    Net/Total Total

    Stage 10

    Export Yes

    What is the Heat Exchanger Duty? __________

  • 7/29/2019 12.08 the Optimizer

    21/21

    The Optimizer 21

    21

    9. Add anAdjust operation. The Adjusted Variable is the Steam flowrate and the Target Variable is the Spec Calc Value (Duty Spec).

    10. Export the RebQ Heat Flowvalue (you will have to make thisExportablefirst) from the Optimizer spreadsheet into the Targetvalue for theAdjust operation. A cell on the spreadsheet can notbe simultaneously imported and exported. Copy the value of cellB2 to another empty cell by entering the formula "+B2". Thevalue in this new cell can then be exported to the Target Value ofthe Adjust operation.

    11. Change the Heating Cost value to 0.682 $/kWh ($200/MMBtu)(Cell D2 on the spreadsheet) and Start the Adjust.

    12. Add the Steam Mass Flow (must be less than 840 kg/h (1850 lb/hr)) constraint to the Optimizer.

    13. Start the Optimizer.

    What is the Exchanger Duty and what is the Steam massflow rate? __________ & __________