using calc levels

Upload: syed-muzamil-ahmed

Post on 12-Oct-2015

48 views

Category:

Documents


5 download

DESCRIPTION

Using Calc Levels

TRANSCRIPT

  • 5/21/2018 Using Calc Levels

    1/16

    Using Calc Levels 1

    1

    Using Calc Levels

    1999 AEA Technology plc - All Rights Reserved.

    ADV 10.pdf

  • 5/21/2018 Using Calc Levels

    2/16

    2 Using Calc Levels

    2

    IntroductionCalc levels are used to determine the order in which streams and unit

    operations are solved in HYSYS. Normally, it is not necessary for the

    average user to work with these numbers as HYSYS automatically sets

    calc levels that are appropriate for most applications.

    However, there are certain situations where the calculation time can be

    reduced by specifying the order in which you want HYSYS to solve the

    flowsheet.

    Before anyone can understand how calc levels function in HYSYS, they

    must understand how HYSYS solves a flowsheet. For this reason, this

    module will deal with both calc levels and the HYSYS solver; in reality,

    these two topics are inseparable.

    Learning ObjectivesIn this module, you will learn how to adjust the calc levels in a

    simulation, and you will learn how HYSYS solves a flowsheet. You will

    also discover when it makes sense to adjust these values and when itdoes not.

    PrerequisitesBefore beginning this module, you should have a solid understanding

    of the HYSYS program, and its interface.

  • 5/21/2018 Using Calc Levels

    3/16

    Using Calc Levels 3

    3

    The HYSYS SolverThe HYSYS solver is responsible for all of the calculations that are

    performed in a Steady State simulation. The most important thing to

    know about the HYSYS solver is that it is a non-sequentialsolver.

    HYSYS is one of the few simulation packages available with this type of

    solver.

    This means that calculations do not have to be performed in flowsheet

    order. As most users are aware, it is possible to have a solved stream as a

    product of an unsolved operation. This is only possible with a

    non-sequential solver.

    Using a non-sequential solver means that information flows both ways

    through the flowsheet; upstream operations can be used in the solving

    of preceding streams. Because HYSYS is able to move information

    forwards and backwards through a simulation less information has to

    be specified before the simulation is able to solve.

    HYSYS uses a degrees of freedom analysis to trigger the solving of a unit

    operation or stream. Users familiar with the column operations in

    HYSYS will be able to relate to the degrees of freedom analysis used by

    the steady state solver.

    When a column is entered into the flowsheet, the degrees of freedom

    are shown, only when the degrees of freedom = 0 is the column able to

    solve. While the column operations are the only operations in HYSYS

    that show the degrees of freedom, HYSYS is automatically keeping track

    of the DOF for each operation and stream in the simulation. Once the

    DOF = 0 for any operation or stream the solver is activated.

    As operations and streams are added to the simulation, HYSYS tracks

    all specified values and all calculated values. All values are "filed"

    according to their source; every number in HYSYS knows where it came

    from. What the user sees as simply a value, HYSYS sees as a value and a

    source. The values source can be either a stream, an operation, or user

    specified.

    If a change is made to a specified value, HYSYS will examine its list of

    calculated values and will "forget" any calculated values that can be

    traced back to the specified value that has changed. This is known as

    the "forget" pass. If the solver is not in Hold mode, the solver will begin

    calculations immediately after the "forget" pass is complete, but not

    before. Note that HYSYS will only forget those value that are somehow

    The steady state Solver and thedynamic Integrator arecompletely separate anddistinct parts of the HYSYSprogram.

    The results of the "forget" passcan be seen by putting thesolver in Hold mode. The"forget" pass will stillfunction, but the solver willnot solve.

  • 5/21/2018 Using Calc Levels

    4/16

    4 Using Calc Levels

    4

    related to the value that was changed. It is often difficult for users to seethis relationship.

    Once the solver is activated, there are several phases to its operation.

    First, it ranks all streams and operations according to their respective

    calc levels. The streams/operations with the lowest calc levels are

    ranked first. Secondly, it checks the DOF for the first item on the list. If a

    solution is possible, it will be solved and the solver will move unto the

    next item. If it can not be solved, the solver will remove that item from

    the current list and move onto the next item.

    The solver will continue through the list until all items are solved or

    removed from the list.

    If, after an item has been removed from the list, a change has occurred

    in that item, it is returned to the list and the solver will again attempt to

    solve the operation or stream.

    A flowsheet that illustrates the process that occurs after the "forget"

    pass and the ranking of the individual items is given here.

  • 5/21/2018 Using Calc Levels

    5/16

    Using Calc Levels 5

    5

    Calc Levels and SubflowsheetsIn older versions of HYSYS (2.0 and older) the function of calc levels in

    subflowsheets was quite different from their role in the newer versions.

    In older versions, calc levels were treated as "global." That means that it

    did not matter if a unit operation was in a subflowsheet or in the main

    PFD, it would be solved with the main solver.

    In newer versions of HYSYS (2.1 and up) the calc levels are considered

    "local." Therefore, each subflowsheet has its ownsolver that is

    responsible for solving allstreams and operations on that sheet.

    The default calc level for subflowsheets is 2500, that means that they

    will solve after all solvable streams and ordinary unit operations havebeen solved in the flowsheet. Note that simultaneous adjusts and

    recycles are still moved to the simultaneous solver and solved only after

    all other operations (in all flowsheets) have been solved.

    Calc levels can now be used in subflowsheets in exactly the same

    manner as they are used in the main flowsheet.

    The Simultaneous Solver

    The simultaneous solver is another, separate part of the main HYSYS

    solver. It is responsible for calculation of all Recycle and Adjust

    operations that are designated as simultaneous. This solver will onlyrun after the main solver has successfully calculated all flowsheets.

    When a Recycle or Adjust operation is set to calculate simultaneously, it

    is removed from the calculation list that the main solver uses, and is

    placed on the list for the simultaneous solver. Once a Recycle or Adjust

    operation is placed on the simultaneous solvers list, its calc level

    becomes insignificant. It will always be calculated after the main

    flowsheet has been solved, and at the same time as the other Recycles

    or Adjusts.

    When Recycles are set as nested, they are calculated by the main solver

    as was discussed previously. Setting the Recycles to calculate

    simultaneously helps to speed up convergence if there are interactionsbetween the multiple recycle operations.

  • 5/21/2018 Using Calc Levels

    6/16

    6 Using Calc Levels

    6

    The Default Calc LevelsAs mentioned previously, HYSYS automatically sets the calc levels for

    operations and streams based on preset defaults. These default values

    will be given here.

    As you can see, the default calc levels for logical operations will mean

    that these will calculate last.

    Item Default Calc Level

    Material Streams 500

    Energy Streams 500

    Ordinary Unit Operations -

    Pumps, Heaters, Coolers, Valves, Heat

    Exchangers, Separators, LNG Exchangers,Reactors, Spreadsheets, Mixers, Tees, etc.

    500

    Column Operations and Subflowsheets -

    Distillation Columns, Liquid-Liquid

    Extractors, Refluxed Absorbers, Reboiled

    Absorbers, etc.

    2500

    Logical Operations -

    Adjusts, Recycles, Sets

    3500

    For calc level purposes, theComponent Splitter and theShortcut Distillation columnare considered ordinary unitoperations and have a calclevel of 500.

  • 5/21/2018 Using Calc Levels

    7/16

    Using Calc Levels 7

    7

    Information SummaryThe information presented here is not new; rather this section will

    serve as a brief summary of the information presented in this module.

    The HYSYS Solver:

    Is responsible for all steady state calculations in the HYSYSprogram.

    Is a non-sequential solver, information can flow forward andbackward through the flowsheet.

    Uses a Degrees of Freedom analysis to trigger solving of unitoperations and streams.

    Tracks all numerical values in HYSYS according to theirsource.

    Runs after the "forget" pass that erases any numerical valuethat can be traced back to the changed value.

    Ranks all streams and unit operations according to their calclevel. The items with the lowest calc level will be solved first, ifpossible.

    Calc Levels and Subflowsheets

    The operation of calc levels in subflowsheets has changed inthe newest versions of HYSYS (2.1 and up). They are now

    considered local and operate in a manner identical to theiroperation in the main flowsheet.

    The default calc level for subflowsheets is 2500.

    The Simultaneous Solver

    The Simultaneous Solver is a separate and distinct part of themain HYSYS solver. It is responsible for solving all Recyclesand Adjusts that are specified as simultaneous.

    The Simultaneous Solver will only solve after allother streams,operations, and subflowsheets have been solved.

    The calc levels of simultaneous recycles and adjusts are notconsidered by the simultaneous solver. They are all solved

    simultaneously.

  • 5/21/2018 Using Calc Levels

    8/16

    8 Using Calc Levels

    8

    Exercise

    In the flowsheet shown above, all of the user specified information is

    shown in the tables. The Adjust is used to set the mass flow rate of

    stream 2, so that the mass flow rate of stream 6 is 1 kg/hr (2 lb/hr).

    Answer the following questions based on the material presented in this

    module.

    Which item will be ranked last in the solvers list; i.e. whichitem has the highest default calc level? ___________

    If this entire simulation is unsolved, which item will besolved first? Hints: Only one item has DOF = 0. This itemmust be solved before any other stream or operation cansolve. ______________

    If the solver is in Hold mode, and the pressure drop acrossthe valve is changed, what six items will be affected?_______________, _______________, __________________,_______________, _______________, and ______________.

    What will happen if the Adjust operation is assigned a calclevel of 400? ______________________________________

    ________________________________________________.Would there be any advantage to setting the calc level forstream 7 at a level greater than 3500, yes or no ? __________

    If yes, what is the advantage? ___________

  • 5/21/2018 Using Calc Levels

    9/16

    Using Calc Levels 9

    9

    Additional Exercise

    Main PFD

  • 5/21/2018 Using Calc Levels

    10/16

    10 Using Calc Levels

    10

    Subflowsheet #1

    Subflowsheet #2

    Subflowsheet #3

  • 5/21/2018 Using Calc Levels

    11/16

    Using Calc Levels 11

    11

    Examine the flowsheets on the previous two pages and answer thefollowing questions.

    If the recycles are set to simultaneous, how many separateand distinct solvers will this simulation have? ___________

    Assuming that the flowsheets will solve from left to right,will the ADJ-1 in Subflowsheet #3 (calc level = 3500, non-simultaneous) solve before stream 71 in Subflowsheet #2(calc level = 500), yes or no? ___________Why? ______________________________________________

    What if the ADJ-1 was set to simultaneous? ____________

    Why? ______________________________________________

    The two recycles in the main flowsheet are set to calculatesimultaneously. Will the column (T-100) be solved beforethe recycles will start their calculation? ___________

    If the two recycles were set to Nested rather thansimultaneous, would the ADJ-1 in the third subflowsheetbe solved before the recycles began calculation? __________

    Is there any way that the calc levels can be manipulated inorder to speed up the solving of the simulation, yes or no?_________ How? ____________________________________

    Can you foresee any difficulties in solving if a non-simultaneous adjust operation was added to manipulatethe feed flowrate in order to produce a certain liquidvolume flowrate in stream 20, yes or no? ____________

    What will happen? __________________________________

  • 5/21/2018 Using Calc Levels

    12/16

    12 Using Calc Levels

    12

    Optional Exercise

    Open the HYSYS caseADV Flowsheet.hscfound on the course disk. Try

    to decrease convergence time by manipulating the calc levels for

    various streams and operations.

    With both recycle operations set to simultaneous, add a non-

    simultaneous adjust operation to manipulate the molar flowrate of the

    Feedstream to result in a Liq. Vol. Flow of 150m3/h(22,500 bbl/day) in

    the columns liquid product stream( #20). Attempt to solve theflowsheet.

    Can you decrease convergence time by manipulating thecalc levels? ______________

    What happens when this flowsheet tries to solve? _________

    What can be done to prevent and correct this behaviour?________________

  • 5/21/2018 Using Calc Levels

    13/16

    Using Calc Levels 13

    13

  • 5/21/2018 Using Calc Levels

    14/16

    14 Using Calc Levels

    14

    Answer Key

    First Exercise, Page 8

    Which item will be ranked last in the solvers list; i.e. which item has the

    highest default calc level? ___________

    The Adjust operation (ADJ-1) has the highest default calc level(3500), and will be ranked last in the solvers list.

    If this entire simulation is unsolved, which item will be solved first?

    Hints: Only one item has DOF = 0. This item must be solved before anyother stream or operation can solve. ______________

    The only item with enough user specified information to solve isthe Stream #1. All other streams or operations requireinformation from another source before they are able to solve.

    If the solver is in Hold mode, and the pressure drop across the valve is

    changed, what six items will be affected? _______________,

    _______________, __________________, _______________,

    _______________, and ______________.

    The six affected items are: VLV-100, Stream 5, V-100, Stream6, Stream 7, and the Adjust (ADJ-1).

    What will happen if the Adjust operation is assigned a calc level of 400?

    ____________________________________________________.

    Essentially nothing, it will be ranked first, instead of last, in thesolvers list, but it cannot solve until stream 6 has been solved.Therefore, nothing will happen to the solving order.

    Would there be any advantage to setting the calc level for stream 7 at a

    level greater than 3500, yes or no ? __________

    If yes, what is the advantage? ___________

    Yes, though in this case the advantage is so small it can not be

    seen. Setting the calc level for stream 7 at 4000 means that itwill solve after all other operations and streams. This meansthat the adjust will have completed its calculations. If thisstream were connected to a large column, then the columnwould only have to solve once rather than several times. If thiswere the case, the advantage would be much greater.

  • 5/21/2018 Using Calc Levels

    15/16

    Using Calc Levels 15

    15

    Additional Exercise, page 11If the recycles are set to simultaneous, how many separate and distinct

    solvers will this simulation have? ___________

    This simulation will use six (6) separate and distinct solvers,one for the main flowsheet, one for each subflowsheet (4) (donot forget that the column is a separate subflowsheet), and thesimultaneous solver.

    Assuming that the flowsheets will solve from left to right, will the ADJ-1

    in Subflowsheet #3 (calc level = 3500, non-simultaneous) solve before

    stream 71 in Subflowsheet #2 (calc level = 500), yes or no? ___________

    Why? ______________________________________________

    Yes; once the solver has entered a subflowsheet, it must besolved to the highest possible level before exiting.

    What if the ADJ-1 was set to simultaneous? ____________ Why?

    ______________________________________________

    If the Adjust were set to simultaneous, then the answer abovewill change. All Simultaneous adjusts and recycles must besolved after all operations and streams in all other solvers havebeen solved.

    The two recycles in the main flowsheet are set to calculate

    simultaneously. Will the column (T-100) be solved before the recycles

    will start their calculation? ___________

    Yes; according to the answer above, all operations andstreams in all other solvers must be solved before thesimultaneous solver will begin its calculations.

    If the two recycles were set to Nested rather than simultaneous, would

    the ADJ-1 in the third subflowsheet be solved before the recycles began

    calculation? __________

    Lets look at the calc levels for these operations, the recyclescalc level is 3500 and the sub flowsheets calc level is 2500.Therefore, the solver for the subflowsheet will be activatedbefore the recycles will start calculating. In fact, if possible, all

    streams and operations in subflowsheets will be solved beforethe solver will move onto the next level. Therefore, yes; theADJ-1 operation in the third subflowsheet will be solved beforethe recycles will start calculating.

  • 5/21/2018 Using Calc Levels

    16/16

    16 Using Calc Levels

    16

    Is there any way that the calc levels can be manipulated in order tospeed up the solving of the simulation, yes or no? _________

    How? ____________________________________

    No; changing the calc levels will have little, or no, effect on thespeed of the solver.

    Can you foresee any difficulties in solving if a non-simultaneous adjust

    operation was added to manipulate the feed flowrate in order to

    produce a certain liquid volume flowrate in stream 20, yes or no?

    __________What will happen? __________________________________

    Adding a non-simultaneous adjust operation to the flowsheetwill cause a severe error in the simulation. The adjust will

    change the flowrate of the feed stream, but since the Recycleoperation is not solving yet, the flowrate of stream Rec 2 Outwill not change. If this stream does not change, it is impossiblefor the flowrate of stream 20 to change; so the adjust operationwill again change the flowrate of feed, but again the flowrate ofstream 20 will not change. This problem can be correctedeither by setting the adjust to simultaneous, or removing thesimultaneous setting from the recycle operation.