• No results found

BLOCK F1 IN=FEED OUT=VAP LIQ BLOCK F1 FLASH2

PARAM TEMP=120 PRES=13.23

CALL FLASH2

Block Results QCALC

F1 F2 . . . FC FTot T P h VF LF s ρ MV

f1and iterations are carried out until the specified value of f2is

obtained, as discussed in the next subsection. Note that for the heater or cooler model in most simulators, the vapor fraction can be specified for both streams and the heat duty computed.

Control Blocks—Design Specifications

Occasionally, the need arises to provide specifications for variables or parameters that are not permitted by a unit sub- routine (or block, or model). To accomplish this, all of the simulators provide a facility for iterative adjustment of the variables and parameters that are permitted to be specified so as to achieve the desired specifications. Guesses are made for the so-called manipulated variables. Then, the simulation calcu- lations are performed and a control subroutine compares the calculated values with the desired specifications, which may be called set points. When significant differences, or errors, are detected, the control subroutine prepares new guesses, using numerical methods, and transfers control to repeat the simu- lation calculations. Since the procedure is analogous to that performed by feedback controllers in a chemical plant (which are designed to reject disturbances during dynamic operation), it is common to refer to these convergence subroutines as feedback control subroutines (Henley and Rosen, 1969).

In the HYSYS simulator, this is accomplished by the Adjustoperation, in CHEMCAD by the CONT subroutine, and in PRO/II by the CONTROLLER subroutine. In ASPEN PLUS, the equivalent is accomplished with so-called design specifications. The latter terminology is intended to draw a distinction between simulation calculations, where the equip- ment parameters and feed stream variables are specified, and design calculations, where the desired properties of the product stream (e.g., temperature, composition, flow rate) are specified and the equipment parameters (area, reflux ratio, etc.) and feed stream variables are calculated. In HYSYS, the Adjustoperation is used to adjust the equipment parameters and some feed stream variables to meet the specifications of the stream variables. Furthermore, the Set object is used to adjust the value of an attribute of a stream in proportion to that of another stream. For assistance in the use of the Adjust and Set objects, the reader is referred to the multimedia module HYSYS ! Principles of Flowsheet Simulation! Getting Started in HYSYS! Convergence of Simulation. As was discussed in the subsection on bidirectional in- formation flow, for all of its subroutines, HYSYS provides a bidirectional information flow, that is, when product stream variables are specified, the subroutines calculate most of the unknown inlet-stream variables. In CHEMCAD, a control unit, with one inlet stream and one outlet stream (which may be identical to the inlet stream), is placed into the simulation flowsheet using the CONT subroutine. The parameters of the control unit are specified so as to achieve the desired value of a stream variable (or an expression involving stream variables) or an equipment parameter (or an expression involving equipment parameters)

by manipulating an equipment parameter or a stream variable. This is the feed-backward mode, which requires that the control unit be placed downstream of the units being simu- lated. The CONT subroutine also has a feed-forward mode.

As an example of using a feedback control subroutine in ASPEN PLUS, return to the benzene–toluene mixer in Example 5.2.

EXAMPLE 5.4 (Example 5.2 Revisited)

For an equimolar feed stream, S1, at 1,000 lbmol/hr and 100F, the flow rate of a toluene stream, S2, at 50F is adjusted to achieve a desired temperature of the mixer effluent (e.g., 85F), as shown in Figure 5.8a. Convergence units for feedback control (design spec- ifications) are shown on simulation flowsheets as dotted circles connected to streams and simulation units by dotted arcs. The arcs represent the information flow of stream variables to the control unit and information flow of adjusted equipment parameters to simu- lation units. Note that the control units of most simulators can adjust the flow rates of the streams. After the calculations by the MIXER subroutine are completed, the control subroutine samples the effluent temperature. It adjusts the flow rate of stream S2 when the specified temperature is not achieved and transfers to the MIXER subroutine to repeat the mixing calculations. This cycle is repeated until the convergence criteria are satisfied or the maximum number of iterations is exceeded.

Instructions to create a design specification using ASPEN PLUS for the mixing unit M1 are provided in the

multimedia module ASPEN! Principles of Flowsheet

Simulation! Control Blocks—Design Specifications. Based on the input specifications in this module, ASPEN PLUS generates the program in the module, and the simulator reports that

SEQUENCE USED WAS: $OLVER01 M1

(RETURN $OLVER01)

The iterative procedure used by $OLVER01 is initiated in the manner shown in Figure 5.9a. As indicated above, an initial guess for the manipulated variable (800 lbmol/hr), and the minimum and maximum values of the manipulated variable (0 and 2,000 lbmol/ hr), are provided. Then, $OLVER01 adjusts the manipulated variable, using one of several convergence algorithms, until the convergence tolerances are satisfied with F2¼ 402:3 lbmol/hr.

When the upper or lower bound is reached, a message is provided

M1 MIXER $OLVER01 TSP T S3 F S2 S1 (a)

Figure 5.8Feedback control—design specifications for the benzene–toluene mixer: (a) ASPEN PLUS blocks; (b) HYSYS icons. ww w .w ile y.com/colle g e / se id er ww w .w ile y.com/colle g e / se id er

Figure 5.8 (Continued) Range Desired Value Temperature of Stream S3 0 (min) 800 initial guess 2000 (max) Flow rate of Toluene in Stream S2

(Manipulated Variable) (a) 6 5 4 Iteration Number (b) 3 2 1 20,000 0 –40,000 –60,000 –80,000 Err/T ol

Convergence $OLVER01: Design Spec History

–20,000

Figure 5.9 Graphical solution of the mixer control problem: (a) specifications for the manipulated variable; (b) ASPEN PLUS iteration history using the secant method.

that convergence has not been achieved. For this example, the secant method was used to achieve convergence, with the iteration history displayed in Figure 5.9b.

For the benzene–toluene mixer, Figure 5.8b shows the HYSYS simulation flowsheet in which the Adjust operation manipulates the flow rate of stream S2 to achieve the desired temperature.

Calculation Order

In most process simulators, the units are computed (simu- lated) one at a time. The calculation order is automatically computed to be consistent with the flow of information in the simulation flowsheet, where the information flow depends on the specifications for the chemical process. Usually, the

variables of the process feed streams are specified and information flows parallel to the material flows. In other words, the calculations proceed from unit to unit, beginning with units for which all of the feed streams have been specified. For the flowsheet in Figure 5.4, the units are calculated in the order R1, D1, and D2, that is, starting from the feed end of the process. Before initiating the computations, ASPEN PLUS is provided with data for the variables of the feed stream, S1, and equipment parameters for the three units. The calculation orders for HYSYS, CHEMCAD, and PRO/II are the same. For HYSYS, the simulation flowsheet is shown in Figure 5.4c, using the Conversion Reactor, Column, and Column models, respectively. Similarly, the CHEMCAD simulation flow- sheet is shown in Figure 5.4d, using the REAC, TOWR, and TOWR subroutines. Finally, the PRO/II simulation flowsheet is shown in Figure 5.4e, using the REACTOR, COLUMN, and COLUMN subroutines.

After the subroutine (or model, or block) computations are completed, all of the stream variables and equipment parameters may be displayed or printed, as illustrated in the report files for ASPEN PLUS in the multimedia module ASPEN! Principles of Flowsheet Simulation! Interpretation of Input and Output: Program Output.

Recycle

Flowsheets are rarely acyclic, as in Figure 5.4. In process synthesis, most distributions of chemicals involve recycle streams as in Figure 5.1. For the simpler distributions, where the fractional conversions or the extents of reaction are known, the split fractions are specified, and no purge streams exist, as in the vinyl-chloride process (Figures 4.8 and 4.19), the flow rates of the species in the recycle streams can be calculated directly (without iteration).

When the reaction operations involve reversible reactions or competing reactions, the split fractions of the species leaving the separators are complex functions of the operating conditions (such as the temperatures, pressures, and reflux ratios), and purge streams exist, then iterative calculations are necessary. In these cases, the simulation flowsheets usually contain information recycle loops, that is, cycles for which too few stream variables are known to permit the equations for each unit to be solved independently. For these processes, a solution technique is needed to solve the equations for all of the units in an information recycle loop. One solution tech- nique is to tear one stream in the recycle loop, that is, to guess the variables of that stream (Henley and Rosen, 1969; Myers and Seider, 1976; Westerberg et al., 1979). Based on tear stream guesses, information is passed from unit to unit until new values of the variables of the tear stream are computed. These new values are used to repeat the calculations until the convergence tolerances are satisfied. The variables of the tear streams are often referred to as tear variables.

In process simulators, recycle convergence units are inserted into the tear stream. These units can be represented by dashed rectangles, as illustrated in Figures 5.2a and 5.10a. In so doing, an additional stream vector is created. Convergence units use convergence subroutines to compare the newly computed variables (in the feed stream to the convergence unit) with guessed values (in the product stream from the convergence unit) and to compute new guess values when the two streams are not identical to within convergence tolerances. In most process simulators, the convergence units are positioned automatically. Consider the flowsheet in Figure 5.10a. The process feed is stream S10, which the user would specify. Unit H1 could then be calculated. The set of units M1, R1, D1, and D2 constitutes a recycle loop. A conver- gence unit must be placed somewhere in this loop. In a recycle loop, calculations begin with the streams leaving the convergence unit. Each of the units in the loop is then computed, returning to the convergence unit,

S10 S11 S2 S3 S6 S6* S5 S1 S4 S7 S8 S9 H1 HEATER M1 MIXER R1 RSTOIC D1 DISTL D2 DISTL D3 DISTL $OLVER01 (a)

Figure 5.10 Process with recycle: (a) simulation flowsheet; (b) ASPEN PLUS simulation flowsheet. ww w .w ile y.com/colle g e / se id er

where convergence is checked. When convergence is not achieved, the simulator repeats the loop calculations. Upon satisfying the convergence criteria, control is transferred to the unit following the recycle loop in the calculation order. In Figure 5.10a, that unit is D3. ASPEN PLUS names the recycle convergence units $OLVER01, $OLVER02, . . . , in sequence. The names of the convergence units are reported in the calculation sequence output, which is illustrated below for the flowsheet in Figure 5.10a:

SEQUENCE USED WAS: H1

$ OLVER01 M1 R1 D1 D2 (RETURN $OLVER01)

D3

Note that Figure 5.10a shows the simulation flowsheet with the recycle convergence unit, $OLVER01, inserted in stream S6. Here, S6* denotes the vector of guesses for the stream variables of the tear stream, and S6 denotes the vector of stream variables after the units in the recycle loop have been simulated. Although the ASPEN PLUS simulation flowsheet in Figure 5.10b does not show $OLVER01 and S6*, the user should recognize that they are implemented. The user can supply guesses for S6*, or they are supplied by the simulator.

All of the recycle convergence subroutines in simulators implement the successive substitution (direct iteration) and the bounded Wegstein methods of convergence, as well as more sophisticated methods for highly nonlinear systems

where the successive substitution or Wegstein methods may fail or may be very inefficient. These other methods include the Newton–Raphson method, Broyden’s quasi-Newton method, and the dominant-eigenvalue method (Wegstein, 1958; Henley and Rosen, 1969; Myers and Seider, 1976; Westerberg et al., 1979). Each of these five methods deter- mines whether the relative difference between the guessed variables (e.g., for S6* in Figure 5.10a) and calculated variables (e.g., stream S6 in Figure 5.10a) are all less than a prespecified tolerance. If not, the convergence subroutine computes new guesses for its output stream variables and iterates until the loop is converged.

Consider the flowsheet in Figure 5.10. The variables for streams S1 and S10 are specified and the recycle stream (S6) has been selected as the tear stream. Let x* be the value of a particular variable (element) of stream vector S6*, the stream output of convergence unit $OLVER01, and let ffxg be the corresponding value for the corresponding calculated vari- able in stream S6, which enters $OLVER01, as determined by taking x* and calculating the units M1, R1, D1, and D2 in that order. The value of x to initiate the next iteration is determined by $OLVER01 using one of the five mentioned convergence methods. When the method of successive sub- stitutions is specified, the new guess for x is simply made equal to ffxg. A sequence of iterations may exhibit the behavior shown in Figure 5.11a. After a number of iterations, the locus of iterates intersects the 45 line, giving the

converged value of x in stream S6. When the slope of the locus of iterates ð f fxg; xÞ is close to unity (for processes with high recycle ratios), a large number of iterations may be required before convergence occurs.

Wegstein’s method can be employed to accelerate conver- gence when the method of successive substitutions requires a large number of iterations. As shown in Figure 5.11b, the previous two iterates of ffxg and x* are extrapolated linearly to obtain the next value of x as the point of intersection with the 45 line. The equation for this straight-line extrapolation is derived easily as x¼ s s 1   x 1 s 1  ffxg (5.9) where s is the slope of the extrapolated line. A more con- venient form of Eq. (5.9) uses a weighting function defined by q¼ s/ðs  1Þ, giving

x¼ qxþ ð1  qÞ f fxg (5.10) Thus, weights q and 1 q are applied, respectively, to x* and ffxg. Equation (5.10), with q defined by the slope, is usually employed when the slope is less than 1, such that q< 0. Typically, q is bounded between 20 and 0 to ensure stability and a reasonable rate of convergence. Wegstein’s method reduces to the method of successive substitutions, x¼ f fxg, when q ¼ 0.

When the tear stream is determined automatically by the process simulator, it is possible to override it. For example, ASPEN PLUS selects stream S2, but it can be replaced with stream S6. To do so, select Convergence from the Data pulldown menu. Then select Tear, which produces the Tear Streams Specifications form. Enter S6 as the tear stream. Other simulators permit the override in a similar manner.

Figure 5.12a shows a simulation flowsheet with two recycle loops for ASPEN PLUS. Flowsheets for CHEMCAD and PRO/II are identical except for the subroutine (or model) names for the units. Note that no recycle convergence units

are shown. This is typical of the simulation flowsheets displayed by most process simulators. The flowsheet for HYSYS is an exception because the recycle convergence unit(s) are positioned by the user and appear explicitly in the flowsheet. For ASPEN PLUS, CHEMCAD, and PRO/II, to complete the simulation flowsheet, either one or two convergence units are inserted, as described below. Note that a single convergence unit suffices because stream S6 Locus of Iterates 45° line f{ x *} f{ x *} 45° line Extrapolation x*0 x1* x*2 x*0 x*1 x*2 x* x* (a) (b)

Figure 5.11 Convergence of a recycle loop: (a) successive substitution method; (b) Wegstein’s method.

S8 S6 S7 S14 S1 S2 S3 S4 S11 S5 S12 S12 S9 S13 S10 M1 MIXER D DISTL G RSTOIC E FLASH2 F DISTL M2 MIXER A RSTOIC B RSTOIC C RSTOIC S8 S6 S6* S7 S14 S1 S2 S3 S4 S11 S5 S9 S13 S10 M1 MIXER $OLVER01 D DISTL G RSTOIC E FLASH2 F DISTL M2 MIXER A RSTOIC B RSTOIC C RSTOIC (a) (b)

SEQUENCE USED WAS:

$OLVER01 D G E F M2 A B C M1 (RETURN $OLVER01)

Figure 5.12 Nested recycle loops: (a) Incomplete simulation flowsheet; (b) simulation flowsheet with a single tear stream and a single recycle convergence unit; (c) simulation flowsheet with two tear streams and a single recycle convergence unit; (d) simulation flowsheet with two tear streams and two recycle convergence units.

is common to both loops, as illustrated in Figure 5.12b. Stream S6 is torn into two streams, S6 and S6*, with guesses provided for the variables in S6*. Since no units are outside of the loops, all units are involved in the iterative loop calcu- lations. The calculation sequence is

$OLVER01 D G E F M2 A B C M1 $OLVER01

In ASPEN PLUS, the calculation sequence output is SEQUENCE USED WAS:

$OLVER01 D G E F M2 A B C M1 (RETURN $OLVER01)

Note that this is the calculation sequence prepared by ASPEN PLUS. Alternatively, when the user prefers to provide guesses for the two recycle streams, S5 and S10, the simu- lation flowsheet in Figure 5.12c is utilized. To accomplish this in ASPEN PLUS, select Convergence from the Data pulldown menu. Then, select Tear, which produces the Tear Streams Specifications form. Enter S5 and S10 as the tear streams. Then the calculation sequence output becomes

SEQUENCE USED WAS:

$OLVER01 M1 D G E F M2 A B C (RETURN $OLVER01)

In this case, a single convergence unit, $OLVER01, checks for convergence and adjusts the guess values for streams S5 and S10 simultaneously.

Yet another sequence, shown in Figure 5.12d, can be programmed for ASPEN PLUS, with instructions for completing the ASPEN PLUS forms provided in the multimedia module ASPEN! Principles of Flowsheet Sim- ulation! Recycle ! Multiple Recycle Loops. This results in the calculation sequence output

SEQUENCE USED WAS: C2

C1 M1 D G E (RETURN C1) F M2 A B C

(RETURN C2)

In this sequence, the internal loop, C1, is converged during every iteration of the external loop, C2 (which includes C1). This may be efficient when the units outside C1 require extensive computations.

A more complex flowsheet, which contains three recycle loops, is shown in Figure 5.13a. Two calculation sequences are illustrated in Figure 5.13b and 5.13c. These involve the minimum number of tear streams, S5 and S8, and result in the following output from ASPEN PLUS:

Option 1

SEQUENCE USED WAS: CONV2 F G CONV1 D A B C (RETURN CONV1) E (RETURN CONV2) S8 S6 S7 S14 S1 S2 S3 S4 S11 S5 S5* S10* S12 S9 S13 S10 M1 MIXER D DISTL G RSTOIC E FLASH2 F DISTL M2 MIXER A RSTOIC B RSTOIC C RSTOIC S8 S6 S7 S14 S1 S2 S3 S4 S11 S5* S5 S12 S9 S13 S10 S10* M1 MIXER D DISTL G RSTOIC E FLASH2 F DISTL M2 MIXER A RSTOIC B RSTOIC C RSTOIC (c) (d)

SEQUENCE USED WAS: C2 C1 M1 D G E (RETURN C1) F M2 A B C (RETURN C2) $OLVER01 C2 C1

SEQUENCE USED WAS:

$OLVER01 M1 D G E F M2 A B C (RETURN $OLVER01) Figure 5.12 (Continued ) ww w .w ile y.com/colle g e / se id er

Option 2

SEQUENCE USED WAS: CONV3 F G D A B C E (RETURN CONV3)

In both options, guesses are provided for the variables in streams S5 and S8. In option 1, the internal loop, CONV1, is converged during every iteration of the external loop, CONV2. In option 2, both loops are converged simultane- ously. Note that the minimum number of tear streams may not provide for the most rapid convergence. An alternative solution procedure for this flowsheet involves three tear streams, for example, S7, S9, and S11, with one convergence unit.

When using ASPEN PLUS, the details of the convergence forms and the CONVERGENCE para- graph generated can be found under Help! Using Aspen Plus! Convergence. See also the multimedia modules in ASPEN! Principles of Flowsheet Simulation! Recycle: For HYSYS, the user can consult the modules under HYSYS!

Principles of Flowsheet Simulation! Getting Started in HYSYS! Convergence of Simulation ! Recycle and for CHEMCAD and PRO/II, their user manuals.