simulation of multiproduct batch chemical processes

13
199 The Chemical Engineering Journal, 8 (1974) 199-2 11 @ Elsevier Sequoia S.A., Lausanne. Printed in the Netherlands Simulation of Multiproduct Batch Chemical Processes WILLIAM M. FRUIT*, GINTARAS V. REKLAITIS and JOHN M. WOODS School of Chemical Engineering, Purdue University (USA) (Received November 19, 1973; in revised form July 23, 1974) Abstract Multiproduct chemical plants typically contain a collec- tion of units, some of which operate continuously and others which operate intermittently. Some material flows are continuous and others discrete. Such plants can not be modelled accurately by existing simulation programs. This paper reports the development of DIXON, a flexible simulation package for system of this type. Use of the program package is illustrated by a study to remove bottlenecks in a simplified but representative polymen’zation facility. 1. INTRODUCTION Recent years have seen considerable progress in the development and application of computer simulation program packages for the design and analysis of full scale engineering systems. The engineer currently undertaking a computer-aided systems study of en- gineering processes will find available for his use many different variants of essentially two types of simula- tion packages: the discrete type13* such as GASP, GPSS, and SIMSCRIPT or the continuous modular type3y4 such as DYNSYS, PACER, FLOWTRAN, and REMUS. The discrete event simulators are designed for stochastic systems which can be modelled as networks composed of functional nodes which generally impose time delays on the discrete items which advance through the system. This type of simulator has long been utilized by operations research analysts to in- vestigate the effects of scheduling rules on the capacity of queueing and inventory systems in applications such as: job shops, traffic systems, communications net- works, and various logistics systems. The main thrust of such studies is to determine how many items will pass through the system in a given period of time and hence how effectively the system components are * Current address: Shell Oil Company, Wood River, Illinois, USA. utilized as a function of the structure of the system (represented as a network) and the decision rules under which the system is operated.‘>* The continuous simulators, on the other hand, are designed for processes with fixed structures which involve continuous flows and in which the process units are described by differential and algebraic equa- tions. This type of simulator has been used extensively in studying the steady state and dynamic behavior of continuous chemical engineering process systems. Generally, the continuous simulators are organized in a modular fashion3. The design equations and material and energy balances which represent individual process units are gathered into separate subroutines which are executed in a specified sequence as the calculations step through the process flowsheet. It is significant to note that the calculation sequence is determined by the process flowsheet, or, more specifically, by the information flow which is fixed for each particular simulation. Multiproduct batch plants, which are representative of a considerable portion of the chemical industry, fall into neither of these categories. Rather, they in- volve the passage of discrete quantities of material through some units of the plant and a continuous flow of material through others. At present the engineer who wishes to study this class of processes must arti- fically describe his system by either a discrete model or a continuous model rather than a combination of the two. With the existing discrete simulators, the engineer must ignore the true physical nature of the process and limit his consideration to pure time delays. Even if variables other than time are included, the behavior of the system between the discrete events is ignored. With existing modular continuous simulators the identity of random discrete events is lost and the average system behavior is described by some deter- ministic model. If one resorts to the use of equation- oriented simulators such as MIMIC or CSMP5v6 some of the previous short-comings can be avoided at the expense of a greatly expanded programming require- ment and the need to provide a specific process net-

Upload: william-m-fruit

Post on 21-Jun-2016

220 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Simulation of multiproduct batch chemical processes

199 The Chemical Engineering Journal, 8 (1974) 199-2 11 @ Elsevier Sequoia S.A., Lausanne. Printed in the Netherlands

Simulation of Multiproduct Batch Chemical Processes

WILLIAM M. FRUIT*, GINTARAS V. REKLAITIS and JOHN M. WOODS

School of Chemical Engineering, Purdue University (USA)

(Received November 19, 1973; in revised form July 23, 1974)

Abstract

Multiproduct chemical plants typically contain a collec- tion of units, some of which operate continuously and others which operate intermittently. Some material flows are continuous and others discrete. Such plants can not be modelled accurately by existing simulation programs. This paper reports the development of DIXON, a flexible simulation package for system of this type. Use of the program package is illustrated by a study to remove bottlenecks in a simplified but representative polymen’zation facility.

1. INTRODUCTION

Recent years have seen considerable progress in the development and application of computer simulation program packages for the design and analysis of full scale engineering systems. The engineer currently undertaking a computer-aided systems study of en- gineering processes will find available for his use many different variants of essentially two types of simula- tion packages: the discrete type13* such as GASP, GPSS, and SIMSCRIPT or the continuous modular type3y4 such as DYNSYS, PACER, FLOWTRAN, and REMUS.

The discrete event simulators are designed for stochastic systems which can be modelled as networks composed of functional nodes which generally impose time delays on the discrete items which advance through the system. This type of simulator has long been utilized by operations research analysts to in- vestigate the effects of scheduling rules on the capacity of queueing and inventory systems in applications such as: job shops, traffic systems, communications net- works, and various logistics systems. The main thrust of such studies is to determine how many items will pass through the system in a given period of time and hence how effectively the system components are

* Current address: Shell Oil Company, Wood River, Illinois, USA.

utilized as a function of the structure of the system (represented as a network) and the decision rules under which the system is operated.‘>*

The continuous simulators, on the other hand, are designed for processes with fixed structures which involve continuous flows and in which the process units are described by differential and algebraic equa- tions. This type of simulator has been used extensively in studying the steady state and dynamic behavior of continuous chemical engineering process systems. Generally, the continuous simulators are organized in a modular fashion3. The design equations and material and energy balances which represent individual process units are gathered into separate subroutines which are executed in a specified sequence as the calculations step through the process flowsheet. It is significant to note that the calculation sequence is determined by the process flowsheet, or, more specifically, by the information flow which is fixed for each particular simulation.

Multiproduct batch plants, which are representative of a considerable portion of the chemical industry, fall into neither of these categories. Rather, they in- volve the passage of discrete quantities of material through some units of the plant and a continuous flow of material through others. At present the engineer who wishes to study this class of processes must arti- fically describe his system by either a discrete model or a continuous model rather than a combination of the two. With the existing discrete simulators, the engineer must ignore the true physical nature of the process and limit his consideration to pure time delays. Even if variables other than time are included, the behavior of the system between the discrete events is ignored. With existing modular continuous simulators the identity of random discrete events is lost and the average system behavior is described by some deter- ministic model. If one resorts to the use of equation- oriented simulators such as MIMIC or CSMP5v6 some of the previous short-comings can be avoided at the expense of a greatly expanded programming require- ment and the need to provide a specific process net-

Page 2: Simulation of multiproduct batch chemical processes

200 W. M. FRUIT et al.

work organization for each application. Thus, one is necessarily restricted to studying processes of a very limited size.

In recent months a number of revisions have been made to the GASP discrete event simulator7-9. These modifications permit the inclusion of continuous events, provide for the interaction between continuous and discrete events, and expand the data collection and reporting capabilities of the program. AS in GASP II the user must supply FORTRAN programs which describe his system completely. There is no provision for network organization or standard event modules. Rather, GASP IV is a general information handling system which is capable of accepting both continuous and discrete events but which leaves all coding of the model up to the user.

A simulation study of a multistage batchwise plant has been previously reported in the literaturelO. It in- volves a hypothetical process with a total of seventeen batch reactors distributed among four sequential reaction stages. The simulation was of the discrete type, for a single product, and the program was specific for this application. This paper reports on the develop- ment of a flexible package of computer program de- signed for the simulation of combined multiproduct batch and continuous processes. In the next section we describe a simplified but typical multiproduct batch plant, followed in Section 3 with a discussion of the general capabilities required to simulate this type of system. The remainder of the paper presents the general features of DISCON” (Discrete and con- tinuous process simulation package) and concludes with a discussion of an example simulation study.

2. A MULTIPRODUCT BATCH PLANT

Figure 1 represents an emulsion polymerization plant, a facility which is typical of many to be found in the chemical industry. A plant of this type will generally be operated to produce a large number of different latex formulations, each of which has its own charac- teristic recipe. Because of this, the plant must be operated on a batch basis and will normally ‘contain numerous reactors, evaporators, separators, feed prep- aration and product storage tanks. Some, but not all, of these units will be piped together to permit transfer of batches from unit to unit. Some of the units of a given type will be duplicated and thus will be inter- changeable; others may have features which make them especially suitable for particular product formulations.

Fig. 1. Polymerization plant process flowsheet.

In the figure, units 1, 2, and 3 are Batch Preparation units, units 4 through 7 are Batch Reactors, and units 8 and 9 Blowdown Tanks. Units 10 through 12 are Steam Strippers, units 13 and 14 Evaporators, and units 15 through 17 Product Storage Tanks. The lines connecting the units represent actual piping which is available for the transfer of material. In this process, a water emulsion of butadiene and styrene (about 85% water) is charged to a batch reactor and polymerized. The unreacted butadiene remaining in the reaction product is removed by flashing in a blowdown tank. The liquid product is then transferred to a steam stripper which removes much of the unreacted styrene. (Residual styrene causes an odor problem). Finally, the solids content of the product is adjusted to con- form to specifications by evaporating excess water.

A major difficulty in the operation of such a plant is the scheduling of the transfer of batches of the different types of latex products from unit to unit over a specified planning horizon so as to fulfill the required (possibly stochastic) customer demands, or, more directly, to maximize plant throughput at mini- mum cost. Although the sequence of production steps is fixed for each batch, the choice of particular units of equipment is not. Rather, the assignment of a batch to a particular unit in the next step of the process is made on the basis of,

(1) whether the unit is piped to the vessel con- taining the batch,

(2) the current availability of the unit (3) the suitability of the unit for this type of

charge, and (4) the relative priority of one product over

another.

Hence a complex branching or scheduling decision must be made at the completion of each production step for each batch being processed. Finally, after

Page 3: Simulation of multiproduct batch chemical processes

each use, a unit may be unavailable for a period of Next-event scheduling and queue management play time because of clean-up and preparation requirements. a role in discrete event simulation analogous to that This inactive time for each unit will depend upon the of integration in continuous simulation. The occurrence product type last processed and the type to be pro- of one event is used to trigger the occurrence of the cessed next, and may vary stochastically because of next one. Events may be either deterministic or ran- variability in operator servicing times. dom in character. Deterministic events may occur as

Clearly, since the system operates on discrete a result of one or more process variables attaining entities (batches) and since the flow of materials does some threshold value or of user-specified program not follow a fixed path because of the branching action such as intermediate data collection. An example decisions, the overall operation of the plant cannot be of randomly scheduled events is the arrival of an order modelled correctly with an existing continuous simu- for products. Although the expected distribution of lator. On the other hand, neither can the system be orders over time may be known from previous experi- modelled with a discrete event simulator because the ence, there is no advance knowledge regarding a speci- time which a given unit requires to service a batch is fic order. not a constant; rather, it depends on the dynamics of the individual unit. The unit dynamics in turn depend

(3) A logical control of branching.

upon the composition of the charge, the operating The program must be able to incorporate logical

conditions, the characteristics of the unit itself, as decision rules and processing priorities which are

well as any stochastic variation in these independent dependent upon product/unit combinations to select

variables. alternate production paths within the process network.

From all these considerations, it is clear that neither The program should, moreover, be able to switch

type of simulator alone will describe adequately the decision rules readily and in particular, to use different

multiproduct batch plant. A simulation program decision rules in different stages of the production

capable of accommodating all of the major features sequences. For example, a unit with a short residence

of such a facility will certainly have to contain features time may be operated on a first-come first-served basis,

of both the continuous and the discrete. In the next while one with a long residence time may operate

section, we will summarize these specific major according to strict product priorities.

features. (4) Continuous/discrete interfaces In order to accommodate both batch and con-

tinuous subsystems within a simulation, interfacing

3. GENERAL FEATURES OF A COMBINED SIMULATOR “surge” units must be provided. In the case of the example emulsion polymerization process, these are

A simulation package for modelling a multiproduct the Batch Preparation and Product Storage Tanks. plant which, in general, may contain both batch and Two types of interface units will in general be required: continuous subsystems should contain the following a continuous input/batch output unit and a batch features: input/continuous output unit. This interface is neces-

(1) A modular unit description and a network sary because of the substantially different nature of

representation of the unit interconnections. the “stream” information which must be transferred

A modular description is important because it depending upon whether the unit is batch or

allows the same subroutine to be used to describe continuous.

several different process units of the same type oper- (5) Generation and analysis of simulation statistics

ating in a parallel or series fashion without duplicate The program should have the report generating and

coding. In addition, the modular structure allows the statistics gathering capabilities of any discrete simula- convenient use of a library of equipment subroutines tor. This should include periodic collection of “snap- which may be interchanged to model different systems. shots” of the entire plant as well as traces over time The network representation of the physical connec- of specific unit or plant variables (e.g. see Table). In tions between units, which is common for continuous addition, since some of the performance data arise simulators, permits a natural way of specifying the from random events, means and variances should be cal- numerous alternative ways in which batch as well as culated and utilization statistics, such as frequency continuous units are physically connected. counts, recorded. Finally, a capability should be pro-

(2) An event scheduling and queue management vided for the plotting of performance curves and histo- _ . capability. grams.

SIMULATION OF MULTIPRODUCT BATCH CHEMICAL PROCESSES 201

Page 4: Simulation of multiproduct batch chemical processes

TABLE1

Variable

trace

I

Uni

t I

Tim

e P

rod

A

in

2 3

4 5

6 7

8 9

10

I1

Uni

t U

nit

Uni

t U

nit

Uni

t U

nit

Uni

t U

nit

Uni

t U

nit

2 3

4 4

5 5

6 6

7 7

Pro

d B

in

Pro

d C

in

Rct

r 1

Rct

r I

Pr

Rct

r 2

Rct

r 2

Pr

Rct

r 3

Rct

r 3

Pr

Rct

r 4

Rct

r 4

Pr

2 76

0.00

94

500.

0000

72

500.

0000

94

500.

0000

21

8.07

66

1.0000

432.

4702

2.

0000

86

4.94

04

2.00

00

428.

6797

27

70.0

0 94

500.

0000

72

500.

0000

94

500.

0000

21

8.07

66

1.0000

432.

4702

2.

0000

86

4.94

04

2.00

00

428.

6797

27

80.0

0 94

500

.oO

Qo

7250

0.00

00

9450

0.00

00

218.

0766

1.

0000

43

2.47

02

2.00

00

864.

9404

2.

0000

42

8.67

97

2790

.00

9450

0.0O

c0

7250

0.00

00

945o

o.oo

oo

218.

0766

1.

0000

43

2.47

02

2.00

00

864.

9404

2.

0000

42

8.67

97

2800

.00

9450

0.00

00

7250

0.00

00

9450

0. oo

oo

218.

0766

L

OO

00

432.

4702

2.

0000

86

4.94

04

2.00

00

428.

6797

28

10.0

0 94

500.

0000

72

500.

0000

94

500.

0000

21

8.07

66

1.00

00

432.

4702

2.

0000

86

4.94

04

2.00

00

428.

6797

28

20.0

0 94

500.

0000

72

500.

0000

94

500.

0000

21

8.07

66

1.0000

432.

4702

2.

0000

86

4.94

04

2.00

00

428.

6797

28

30.0

0 94

500.

0000

72

500.

0000

94

500.

0000

21

8.07

66

1.0000

432.

4702

2.

0000

86

4.94

04

2.00

00

428.

6797

28

40.0

0 94

500.

0000

72

500.

0000

94

500.

0000

21

8.07

66

1.00

00

432.

4702

2.

0000

86

4.94

04

2.00

00

428.

6797

28

50.0

0 94

500.

0000

72

500.

0000

94

500.

0000

21

8.07

66

1.00

00

432.

4702

2.

0000

86

4.94

04

2.00

00

428.

6797

28

60.0

0 94

500.

0000

72

5OO

.OQ

OO

94

500.

0000

21

8.07

66

1.00

00

432.

4702

2.

0000

0.

0000

0.

0000

42

8.67

97

2870

.00

9450

0.00

00

7150

0.00

00

9450

0.00

00

218.

0766

1.0000

432.

4702

2.

0000

991.8949

2.00

00

428.

6797

28

80.0

0 94

500.

0000

71

500.

0000

94

500.

0000

21

8.07

66

1.0000

432.

4702

2.

0000

96

8.73

76

2.00

00

428.

6797

28

90.0

0 94

5oo.

oOQ

O

7150

0.00

00

9450

0.00

00

0.00

00

0.00

00

0.00

00

0.00

00

945.

5802

2.

0000

0.

0000

29

00.0

0 94

250.

0000

71

000.

0000

94

000.

0000

24

5.07

91

1.00

00

491.3160

2.00

00

922.

4229

2.

0000

46

5.26

40

2910

.00

9425

0.00

00

7200

0.00

00

9400

0.00

00

239.

2897

1.0000

479.7373

2.00

00

899.

2656

2.

0000

43

2.54

75

2920

.00

9425

0.00

00

7100

0.00

00

9400

0.00

00

233.

5004

1.0000

468.1587

2.00

00

877.

6823

2.

0000

42

8.67

97

2930

.00

9425

0.00

00

7100

0.00

00

9400

0.00

00

227.

7111

1.0000

456.5800

2.00

00

864.

9404

2.

0000

42

0.67

97

2940

.00

9425

0.00

00

7200

0.00

00

9400

0.00

00

221.

9217

1.0000

445.0013

2.00

00

864.

9404

2.

0000

42

0.67

97

2950

.00

9425

0.00

00

7100

0.00

00

9400

0.00

00

218.

0766

1.0000

435.8145

2.00

00

864.

9404

2.

0000

42

8.67

97

2960

.00

9425

0.00

00

7100

0.00

00

9400

0.00

00

218.

0766

1.0000

432.4702

2.00

00

864.

9404

2.

0000

42

8.67

97

2970

.00

9425

0.00

00

7100

0.00

00

9400

0.00

00

0.00

00

0.0000

432.4702

2.00

00

864.

9404

2.

0000

42

8.67

97

2980

.00

9400

0.00

00

7 10

00.0

000

9400

0.00

00

247.

6843

1.0000

432.4702

2.00

00

864.

9404

2.

0000

42

8.67

97

2990

.00

9400

0.00

00

7100

0.00

00

9400

0.00

00

241.

8949

1.0000

432.4702

2.00

00

864.

9404

2.

0000

42

8.67

97

3000

.00

9400

0.00

00

7100

0.00

00

9400

0.00

00

236.

1056

1.0000

432.4702

2.00

00

864.

9404

2.

0000

42

8.67

97

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

0.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

3.00

00

$ 3 z 2 m

2 ?

Page 5: Simulation of multiproduct batch chemical processes

SIMULATION OF MULTIPRODUCT BATCH CHEMICAL PROCESSES 203

(6) Equation solving The process modules may contain both algebraic

and differential equations. Thus, the program must be able to integrate all active process modules over time using some numerical integration scheme. Common storage is needed so that integration can be inter- rupted while a scheduled event occurs and then re- started with the saved results as initial values. The storage must be in some location external to the equip- ment subroutine since the same subroutine may be used to represent several operating units.

4. THE DISCON SIMULATION PACKAGE

4. I General description DIXON is a set of three FORTRAN computer pro- grams which together with a library of unit operations modules and utility subroutines, forms a compact simulation package which is designed to operate in a minimal amount of computer central memory. Although DISCON is intended primarily for the simu- lation of combinations of batch and continuous pro- cesses, the simulator executive is readily applicable to steady state simulation or to the dynamic simula- tion of completely continuous or completely discrete processes.

The three major programs which comprise the DISCON package are: an input preprocessing program, the simulator executive program, and the postprocessor program. This fragmentation into three separate pro- grams reduces central memory requirements and in- creases overall speed of execution. Thus, run priority and turn-around in a multi-programming environment are improved.

The preprocessor accepts data input in a form convenient for the user and generates a simulation data area. In order to minimize the central memory re- quirements, the simulation data area is allocated dynamically during execution of the preprocessor and is saved on a binary file for use by the simulator executive program in performing the process simula- tion. Any intermediate results generated by the simu- lation may be either saved on a binary file or listed as they are generated. The saved intermediate results are displayed as tables and plots by the postprocessor.

The large volume of data generated by a simulation involving batch units makes a complete display im- practical. It is then imperative that the user be able to select for display those portions of greatest interest to him. Typically he will wish a view of the system status at selected points in time as well as the sequences over time of certain variables of greatest interest.

The basic steps performed by the simulator execu- tive are illustrated in Fig. 2. First, the binary data file generated by the preprocessor is read by the executive and all initial parameter values set. Following the

Advonca Clock

Schedule Idle Units

Process Main Events

1 Check For Termination

Fig. 2. DISCON Executive structure.

initialization phase, the simulation clock is incremented. and the equipment subroutines for each active unit are called for the first integration step. The method of integration selected by the user will determine the number of passes through the active units of the process network for each integration time step. At the end of each integration time step, the equipment scheduling subroutine is called if the status of any unit has changed during the past time step. For example, a batch reactor may have achieved its required con- version during the time step and, hence, its operation will have been terminated. If a change in status has occurred such that material is to be transferred to a succeeding unit, this information is entered in a request queue. The equipment scheduler attempts to satisfy the request by assigning a unit which is acces-

Page 6: Simulation of multiproduct batch chemical processes

204 W. M. FRUIT et al.

sible and currently not in use. The manner of assign- ment is based upon user-specified priorities and decis- sion rules. When scheduling for the current time step is completed, a test is made to determine if inter- mediate results should be listed and/or saved. Next, any additional events scheduled for the current simu- lation time are processed. These may, for example, be controller actions on operating parameters, scheduled listings of simulation statistics, or snapshots of the current contents of the equipment request and event queues. If the simulator clock has not reached the termination time specified by the user, the clock is incremented and another loop through the executive started. If the termination time has been reached, final utilization statistics are listed and the simulation terminated.

4.2. Details of implementation In order to further elucidate the operation of the simulator, we shall consider more closely the imple- mentation details in the following four areas: Process description, Storage organization, Queue management, and Equipment allocation.

(1) Process description Whereas the simulation of a continuous plant requires only the description of the process topology and one set of operating conditions for each unit, the simula- tion of a multiproduct batch plant requires consider- ably more input data. Specifically, since the process information flow is generated dynamically during execution, all feasible paths and a basis for selection among them must be specified. Moreover, operating parameters are required for each feasible combination of process unit and product at each stage of the process. The major items of input information are summarized in Table 2.

TABLE 2

Process input data

Feasible process topologies Process equipment parameters for each unit/product combination

physical size operating condition model parameters delay time

Selection priorities and decision rules Order of computation of process units Initial stream values and unit contents Physical properties of materials

The process topology specifies all physical con- nections between the units in the process. Connections for batch units are specified by listing for each unit the equipment numbers of the units to which it is physically connected. Connections for purely con- tinuous units are specified by listing for each unit the continuous streams which are its inputs and out- puts. Those for mixed units, batch in/continuous flow out or continuous flow in/batch out, are specified by listing both types of connections.

The process topology can thus be viewed as a directed network of feasible paths. The direction defines the sequence in which the required operations are to be performed; the individual paths followed will correspond to the specific units which are em- ployed to perform these operations. In this formula- tion if for some products certain operations can be skipped, then a suitable by-passing connection (arc) must be specified and the production priorities of the by-passed unit for those products set to zero.

The order in which each unit is called for integra- tion is specified by the user. This sequencing can be arbitrary for the batch units and is significant only for the continuous sections of the plant. For the con- tinuous units the order should be selected so that all input streams to a unit have always been updated to the end of the previous time step before calculating the unit.

The rather large amount of data required to de- scribe the process, control the program execution, and display the simulation results demands that the input of these data be made as convenient as possible for the user in order to reduce common input errors. In addition, the preprocessor itself checks the con- sistency of the input data and provides detailed diagnostics to aid in locating errors.

Input data are divided into eleven blocks of informa- tion each with its section heading. These sections may appear in any order and, within a section, title cards, and a uniform format are used throughout. A brief description of each section follows:

(a) PROCESS dimension parameters: the number of items of equipment, the number of continuous streams, the number of chemical species, and the number of products.

(b) CONTROL parameters for the simulator: the type of integration method, the maximum allowed number of queue entries, simulator termination time, the time intervals between printing of traced variables and between saving of results, and the initial estimate of the data area length.

(c) TOPOLOGY of the process: a code identifying

Page 7: Simulation of multiproduct batch chemical processes

the type of unit, indices indicating the predecessor and successor equipment units for each equipment item, indices for the input and output streams for each unit involving continuous streams.

(d) UNITDATA equipment parameters: a vector of equipment parameters for each unit/product combi- nation. The dimension and content of this vector will depend upon the equipment type. For example, for a reactor it may include rate constants, conversion, volume of reactor, etc.

(e) SCHEDULER input data: a code to indicate the type of decision rule to be used for each unit and a priority vector to indicate the priorities of each unit for the production of each product.

(f) ORDER of equipment calls for calculation: a vector of indices representing the order in which the various units are called during an integration step.

(g) STREAM initial values: the initial values of continuous streams or initial contents of production units. The stream vector consists of flow rate (or volume), temperature, pressure, enthalpy, product number, composition.

(h) EVENTS scheduled by the user: a list of user scheduled main events including time of each event, event code, and event attributes. For example, a user scheduled main event may store a snapshot of the plant at some specified time.

(i) TRACE: identification of variables which are to be followed and printed as the simulation proceeds.

(j) SAVE: identification of variables which are to be displayed by the post processor.

(k) PROPERTIES: vector of physical property in- formation for each chemical species. These include molecular weight, latent heat, activity coefficient, Antoine vapor pressure coefficients, temperature coefficients for densities and heat capacities.

(2) Storage organization Most of the process simulation programs currently in use employ fixed size arrays for the storage of process topology, equipment parameters, and stream information. Since all equipment parameter and stream vectors usually do not contain the same number of elements, these arrays must be dimensioned to accommodate the one with the largest number of elements. Typically this results in considerable portions of the storage arrays being unused. In view of the large amount of information which is required in the simulation of a multiproduct plant (for example, each unit/product combination will in general require different values of the equipment operating para-

SILiULATION OF MULTIPRODUa BATCH CHEMICAL PROCESSES 205

meters) such inefficient utilization of storage cannot be tolerated. Consequently DISCON has been written with a modest fixed length array which contains various pointers and simulator constants, and a much longer array of variable length which accommodates all other simulation information. Storage of information in the latter array is contiguous and the length of this array is the minimum required by the problem being run. The various subvectors of information which need to be retrieved are located by means of pointers which are used to locate the first element of the desired vector within this array. The pointers are all set by the data preprocessor while it packs the input data into the data area. The run-time dimen- sioning of the data area was accomplished by a smail assembly language program. All other programs are written in FORTRAN.

(3) Queue management During a process simulation DISCON maintains two queues which are stored in a section of the data area. Both queues are maintained as doubly-linked lists. Queue number one, the main event queue, contains all events scheduled by the user initially or by the program during execution. Entries are ordered in this queue in ascending event time. Queue number two, the equipment request queue, contains all requests for subsequent equipment made by units of equipment which have terminated processing and are waiting to dump their charges. The order of entries in this queue is that in which requests occur. Requests are honored according to calculated priorities and user-selected decision rules.

The information associated with each event con- tains a pointer to the initial location of its predecessor in the list and a pointer to the initial location of its successor. If an entry has no predecessor and/or successor, special flags are used to indicate this fact. Since there are many more events than the simultaneous contents of a queue the storage is dynamic and many different events may be stored in the same location over the course of the simulation. When an event takes place it is removed from the queue and its space becomes available for other entries. The structure of the queues as well as the subroutines which manage the queues are based upon the queue management provisions of the discrete simulator GASP 11’.

(4) Equipment requests When a batch unit finishes processing its charge, the processed batch must be discharged to a following unit for further treatment, when one is available. In

Page 8: Simulation of multiproduct batch chemical processes

206 W. M. FRUIT et al.

general, several of the following units can accomplish the next processing step. Conversely there may be several batch units waiting to discharge their batches to a given following unit. The assignment of a specific unit to process the output from a particular unit must be made on the basis of a calculated priority number and some appropriate decision rule. In DISCON, the user specifies for each unit the product priorities for that unit. If a given product has a zero priority for a particular unit, then it will not be processed by that unit. The unit finishing a batch calculates an equip- ment request priority for each following unit by forming the product of the priorities of the two units in question between which a transfer of material may occur. If the request priority for a given follow- ing unit is non-zero, a request is entered into the equipment request queue. The requesting unit is then put into a waiting status and will not be called during subsequent integrations. One of the concerns in per- forming a. simulation is to determine preferred paths as batches of different products move through the system. The choice of a particular link in a path must depend upon priorities associated with each end of the link, not just one end. The product of these priorities was chosen as a combining rule in order to obtain a link priority of maximum sensitivity.

At the end of the current integration step, the equipment scheduling subroutine will be called since a unit, namely the one finishing, has changed status. The scheduler checks to see if any unit is on available status. If there is one available, the scheduler will search the equipment request queue for requests for this unit. If there are requests for this unit, a selection is made among the requests based on the decision rule specified for this module by the user. Five types of decision rules are currently coded into DISCON: highest priority, lowest priority, first-in-first-out, last- in-first-out, and first-request-found (no priority). Once a request has been honored all other requests from the requesting unit are removed from the request queue. If the requested unit has a time delay assigned to it, it

will be put on a delayed state for the specified time, after which it will be returned to available status. Finally, the status of the requested unit is changed to active so that it will be called during subsequent integration passes.

Since the capabilities of various units will usually not be the same (for example, a stripper may accept several reactor batches before being started up), several simplifying rules have been imposed to regulate batch size. If a requested unit is not empty, then only re- quests of the same product type as that of the con-

tents already in the unit are considered. Moreover, the entire contents of the requesting unit must fit into available space in the non-empty requested unit. This is required so as to avoid splitting of batches. On the other hand, if the requested unit is empty, then the batch size becomes the smaller of either the contents of the requesting unit or the capacity of the requested unit.

5. EXAMPLE SIMULATION

A simulation of a chemical plant can be used both to guide the design of new plants as well as to study the operation of an existing plant. In either case, simula- tion allows experimentation with plant variables and operating procedures without the need for running the real system. This approach permits information to be obtained at a considerable saving in both time and money. The motivation for simulating an existing plant is to,

(1) investigate the effects of scheduling rules on plant operation

(2) identify and eliminate plant bottlenecks (3) determine the most efficient strategy for plant

expansion

The simulation study described in this section illustrates the use of DISCON to devise an efficient strategy for increasing total plant throughput by the addition of appropriate parallel units. The example used is that of the emulsion polymerization plant of Fig. 1.

The cumulative results of the simulation are con- tained in a comprehensive report of equipment utiliza- tion statistics which can be scheduled at any time during a run and at its conclusion. Table 3 illustrates one page of such a report. For each unit of equipment, the report tabulates how often and for what total, average, minimum and maximum time the unit was on active, ready, and wait status. An “active” status signifies that a unit is processing material. A “ready” status signifies that it is empty and waiting to accept the contents of another unit. A “wait” status signifies that it has completed processing and is waiting to discharge its contents into a following unit. The active statistics are further subdivided into a separate tabula- tion for each product type. The last column gives a count of how many batches were transferred from a preceding unit to the unit in question (positive index) and from the present unit to a succeeding one (negative index).

Page 9: Simulation of multiproduct batch chemical processes

TA

BL

E

3

Equ

ipm

ent

stat

istic

s

Tim

e of

T

ype

of

Obs

er-

Equ

ip.

last

cha

nge

stat

us

vati

ons

Tot

al t

ime

Avg

. ti

me

Std.

de

v.

Max

imum

M

inim

um

Pro

duct

B

ranc

h-co

unt

9 28

80.7

50

Act

ive

0 0.

000

0.00

0 0.

000

0.00

0 0.

000

1

a/

0

71

0 -ll/

0

-12/

0

21

5.250

.250

0.000

,250

.250

2

6/

21

7/

0

-ll/

12

-121

9

10

2.500

.250

0.000

.250

.250

3

61

1

7/

9

-ll/

3

-12f

6

Ready

3

72.500

24.167

8.520

33.000

16.000

w8it

30

2800.500

93.350

75.759

287.250

.250

10

2980

.250

A

ctiv

e 13

1283.750

98.750

0.000

98.750

98.750

1

al

13

-13/

12

3

192.750

64.250

0.000

64.250

64.250

2

af

3

-131

0

0.000

0.000

0.000

0.000

0.000

3

a/

,'

-13

0

Rea

dy

16

69.000

4.313

14.456

58.500

.5OO

Wait

15

1284.750

85.650

86.459

229.250

.250

11

2975.000

Active

3

296.250

98.750

0.000

98.750

98.750

1

af

3

91

0

-131

3

-141

0

> -

2

_ --

n

. .

_

,.”

.” _

._

__

_ _

.- -.

- .-

-I .Y

,

_ _

“,

_

_

_

,”

- .,

-

._,

--

.”

Page 10: Simulation of multiproduct batch chemical processes

208 W. M. FRUIT et al.

The simulation of the emulsion polymerization plant was run for 18,000 simulated minutes of process operation, and required about 300 set CPU time on a CDC 6500. A summary of the main utilization stat- istics is presented in Tables 4 and 5. Table 4 indicates

TABLE 4

Distribution of unit utilization time among products (Basis: 18,000 min)

Product type 1 2 3

Reactors 1 2 3 4

Strippers 1 2 3

Evaporators 1 2

1 .oo 0.0 0.0 0.112 0.888 0.0 0.0 0.952 0.048

0.0 0.0 1.0

0.929 0.071 0.121 0.671 0.0 0.074

0.283 0.717 0.0 0.0 0.526 0.474

::;OS 0.926

TABLE 5

Distribution of total available time (basis 18,000 min)

Active* Fraction of time

Ready* Wait*

Reactors 1 2 3 4

Strippers 1 2 3

Evaporators 1 2

0.498 0.0073 0.495 0.503 0.0083 0.489 0.575 0.0083 0.417 0.255 0.007 1 0.738

0.734 0.0116 0.254 0.868 0.0113 0.121 0.913 0.0097 0.0773

0.732 0.268 0 0.754 0.246 0

product/unit priorities and the decision rules used for scheduling. Table 5 shows the fraction of time that each unit spends in active, ready, and wait status. This distribution is dependent primarily upon the process topology as well as the capacity and number of units. For the purpose of a plant expansion study, it is the “ready” and “wait” times that are most pertinent in locating bottlenecks and potential needs for additional capacity.

From Table 5, it is quite apparent that the reactors are spending a large portion of the time in wait status and that thus additional reactor capacity is not required. The bottleneck is also unaffected by the blowdown tanks, because of their short residence times (see data for unit 9 in Table 3). On the other hand, the strippers have both very low ready times, indicating that the limits of stripper capacity are being approached, and comparatively high wait times, indicating that evaporator capacity may be limiting. It thus seems that either an additional evaporator or an additional stripper or both may need to be installed to increase process throughput. In order to determine which alternative is preferable and whether the resul- tant change in process throughput would justify the expenditure, a simulation run was undertaken for each of the above three cases.

The modification required in each data section to incorporate the additional unit, for instance the evaporator, are:

(1) Increase the unit count in the CONTROL section

(2) Add the process connections for the evaporator in the TOPOLOGY section

(3) Add the equipment parameters for each pro- duct processed by the evaporator (UNITDATA section)

(4) Add the Scheduling rule and product priorities for the unit (SCHEDULER section)

(5) Include the additional unit in the ORDER section

6. RESULTS AND DISCUSSION

* Active time = Processing time plus set up time * Ready time = Time unit is empty and idle * Wait time = Time unit is waiting to transfer its charge to a

following unit

the fraction of the total processing time which each unit devotes to each of the several products. This distribution is most directly influenced by the assigned

The results of the three additional simulation runs are summarized in Table 6 and Fig. 3. Case 1 is the original plant, listed for comparison; Case 2 has an added multipurpose evaporator which can be accessed by all three strippers; Case 3 is the original plant with an additional multipurpose stripper connected to both evaporators and both blowdown tanks; Case 4 contains both the additional stripper and the additional evapor-

Page 11: Simulation of multiproduct batch chemical processes

SIMULATION OF MULTIPRODUCT BATCH CHEMICAL PROCESSES 209

ator. From the reactor wait times listed in Table 6, it is clear that throughput increases monotonically from Case 1 through Case 4. This trend is confirmed by Fig. 3, which shows a monotonic increase in the average production rate. These average production rates for the four cases in units of mol/minute x 1 O3 are (1) 1.766 (0.43) (2) 1.949 (0.1054), (3) 2.091 (0.091), (4) 2.272 (0.055). The numbers in paren- thesis are the standard deviations of the mean rates.

TABLE 6

Average distribution of total available time (Basis: 18,000 min)

Unit Time fraction in given status Case status Reactors Strippers Evaporators

1 Ready 7.76 x 1O-3 1.087 x IO-’ 0.257 Wait 0.547 0.1508 0.0

2 Ready 8.58 x 10-a 1.168 x 10-a 0.443 Wait 0.494 7.56 x 1O-3 0.0

3 Ready 9.71 x 10-s 1.150 x 1O-2 0.1362 Wait 0.443 0.210 0.0

4 Ready 1.138 x 1O-2 1.062 x 1O-2 0.405 Wait 0.366 3.10 x 10-2 0.0

2.6 - 0 - Cm4 I : Oriqinal Plant

0 - Cnn 2 : Evapomtor Added

h V - Can 3: Stripper Added

A - Con4 : Eva~orotor and

Stripper Added

1.4,’ ” ” ’ ’ ’ ’ 1’ ’ ’ ” ” ’ ’ ’ 0 5 IO 15 20

TIME, min x IOms

Fig. 3. Variation of smoother total production rate with time.

The mean production rates for the four cases are given for the plant operation period between 6000 minutes and 18000 minutes simulated time. Performance data during the first 6000 minutes are ignored in order to remove the effect of the initial conditions. Given this improvement in the production rate and the costs, fixed and variable, incurred by the addition of the units, an economic comparison can be made among the three alternatives. In view of the complexity of the interactions between units, such a comparison could not be undertaken without simulation.

In this illustration the simulator is used to evaluate alternatives for plant expansion. However, its use need not be confined to the addition of units. Once constructed, the simulator can also be used to investi- gate the effects of changes in operating conditions, in labor requirements (as increased or decreased set-up times), in scheduling heuristics, in the numbers of products, as well as in the distribution of products. In all of these instances, the effect of each change can only be correctly assessed if viewed within the total process environment. The simulator provides this capability with only small changes in the input data.

Figure 3 merits further elaboration because it points out several characteristics of discrete event simulation. Initially, while the plant is empty, the production rate grows dramatically and then continues to oscillate about a mean value. The oscillatory behavior is of course caused by the discrete nature of the material flow and would be somewhat damped out if the process contained more parallel lines. The irregularities in the oscillations are introduced to some extent by the fact that batches are readied in the preparation units at a frequency chosen from a distribution with specified mean and variance. The oscillation is characteristic of the process, and will not die out as the simulation time is increased. In order to avoid excessive computation times, it becomes important to devise tests for terminating the run when a “steady state” has been achieved. In this example study, the length of the simulation run was chosen by trial comparisons of sequential sample average. A more sophisticated test could be made and further work on this question is in progress. In addition, since the variance of the mean will remain at a substantial non- zero value, regardless of the length of the run, any comparisons of results obtained by alternate runs must take these variances into account.

One approach to the comparison of runs which takes these variances into account is to assume that upon reaching a steady state, the production rates are normally distributed and that all runs will have the

Page 12: Simulation of multiproduct batch chemical processes

210 W. M. FRUIT ef al.

same variance. Under these conditions Student’s t distribution can be used to test the significance of the hypothesis that there is no difference in the mean production rates of the two runs being compared against the alternative that there is an increase12. If we use only the last seven points for each run shown in Fig. 3, the t-test with degree of freedom of twelve shows significant differences between all pairs of runs. Specifically, the means are different at a 98.5% level for runs 1 and 2, the 88% level for runs 2 and 3, and the 93% level for runs 3 and 4. Hence, the monotonic increase in mean production rate from Case 1 through Case 4 is confirmed. Of course, this analysis is based upon the assumption of constant variance which may be questionable since the estimates of the variance will contain both a cyclic and a random component. Of these, the cyclic component is dependent upon process configuration. A more precise statistical test should take this into account and is the subject of further investigation.

I. SUMMARY

In this paper the problem of simulating systems which involve continuous processes and discrete events has been raised. The characteristics required of a program designed for this purpose were discussed and the development of a general combined simulation reported. The utility of the package was demonstrated by a plant expansion study applied to a multiproduct batch emulsion polymerization facility.

8. ACKNOWLEDGEMENT

The use of the t-test was suggested by R. H. Beresford.

APPENDIX

The modules, BATCH, BLOWDN, BSTORE, EVAPR, POLYR, STRIPR model the process elements for the example application. These are supported by other subroutines for computing vapor pressure, vapor- liquid equilibria, the interconversion of enthalpy and temperature, and equilibrium flash separation.

BATCH provides for a continuous input and discrete removal of output. The continuous input is integrated over time and scheduled withdrawals are made from the accumulated inventory. Differential balances are written to include flow, composition, and heat.

BSTORE provides for discrete addition to an inventory from which an output flow is withdrawn continuously. The continuous output is integrated over time to provide the accumulated withdrawal from the inventory built up by scheduled addition of batches of material. Differential balances are written to include flow, composition, and heat.

POLYR is a simplified model of a batch emulsion polymerization reactor. The monomer ratio, the polymer average molecular weight, and the ratio in which the two monomer fragments add to the polymer chain are assumed to remain constant over time. A differential balance is written for the conversion of monomer to polymer at a fixed temperature. The reaction rate is treated as zero order up to seventy percent conversion and first order for conversions above this. After the reactor is charged, the derivative of conversion is integrated over time until the specified limit is reached. The contents are then flagged as available for transfer after an appropriate time delay.

BLOWDN is a simplified model for removal of volatile unreacted monomer from the polymer latex by equilibrium flash vaporization accompanying a sudden reduction in pressure. The latex contains a second monomer with a lower volatility. The process is essentially instantaneous and no integration is in- volved. Because of the large excess of water it was necessary to compute the monomer/polymer compo- sition on dry basis, flash isothermally, and mix the remaining liquid with water originally present,

STRIPR is a simplified model of the continuous addition of superheated steam to a batch of latex to remove residual monomer of low volatility. The liquid in the stripper is assumed to have a uniform compo- sition. Monomer is transferred into the steam by convective desorption. The monomer content of the steam is assumed to be small enough to permit the rate of transfer from the liquid to the vapor to be proportional to the arithmetic average difference between the steam composition and the equilibrium composition for the liquid in the stripper. The deriva- tive of the monomer content of the liquid is integrated over time to determine the total removal of monomer.

EVAPR is a simplified model of an evaporator to concentrate the stripped latex at a fixed temperature. Heat is added at a constant rate. The temperature of the liquid contents rises from an initial value until the specified operating temperature is reached. After that, all heat addition goes to vaporize water. Because of the small magnitude of the derivative, simple Euler integration is used to compute the change in the water content with time.

Page 13: Simulation of multiproduct batch chemical processes

SIMULATION OF MULTIPRODUCT BATCH CHEMICAL PROCESSES 211

REFERENCES Manual, International Business Machines Corporation, 1968.

H. M. Markowitz, SIMSCRIPT: A Simulation Program- ming Language, Prentice-Hall, Englewood Cliffs, N. J., 1963. A. A. B. Pritsker and P. S. Kiviat. Simulation with GASP II, Prentice-Hall, Englewood Cliffs, N. J., 1969. C. M. Crowe, A. E. Hamielec, T. W. Hoffman, A. I. Johnson and D. R. Woods, Chemical Plant Simulation, Prentice- Hall, Englewood Cliffs, N.J., 1971. J. R. Flower and B. D. Whitehead. Computer aided design: A survey of flowsheeting programs parts I and II; Chemical Engineer, No. 272, 208, April 1973; No. 273, 271, May 1973. F. J. Sansom and H. E. Peterson, MIMIC-A digital simula- tion program, SESCA internalMemo 65-12, Wright- Patterson AFB, Dayton, Ohio, May, 1965. System 360, Continuous System Modeling Program User’s

7 N. R. Hurst, GASP IV: A combined continuous/Discrete FORTRAN based simulation language, Ph.D. Thesis. Purdue University, May 1973.

8 N. R. Hurst and A. A. B. Pritsker, GASP IV: A combined continuous/discrete FORTRAN based simulation language, Proc. Winter Simulation Cant, San Francisco, I9 73.

9 A. A. B. Pritsker, The GASP IV Simulation Language, Wiley-Interscience, 1974.

10 P. V. Youle, Simulation of full-scale multi-stage batchwise chemical plant, Camp. J., 3, (1960) 150-157.

11 W. M. Fruit, Simulation of combined discrete and con- tinuous processes, M.S. Thesis in Chemical Engineering, Purdue University, Dec. 1972.

12 P. G. Hoel, Introduction to Mathematical Statistics, John Wiley & Sons, 1962, Section 11.5.2.