17
Compurers &em. Engng, Vol. 15, No. 8, pp. 583-599, 1991 Printed in Great Britain. All rig&s reserved 009&1354/91 $3.00 + 0.00 Copyright0 1991 Pergamon Press plc AUTOMATIC GENERATION OF QUALITATIVE MODELS OF CHEMICAL PROCESS UNITS C. A. CATPJO, S. D. GRANTHAM and L. H. UNGAR~ Department of Chemical Engineering, University of Pennsylvania, Philadelphia, PA 19104, U.S.A. (Received 15 October 1990, final revision received 18 March 1991; received for publication I5 May 1991) Abstract-A library of general physical and chemical phenomena such as heat transfer and reaction has been developed in the qualitative process theory (QPT) representation of Forbus and used to build qualitative models of chemical process units. The QPT descriptions specify the conditions under which the phenomena become active and the constraints they contribute to the model, thus allowing the computer to automatically build and alter process unit models. In order to realistically model chemical plants, we introduce a Lagrangian approach to modelling the behavior of plug flow vessels and we present a set of techniques to focus the model building and solution mechanisms on specificaspects of unit behavior, reducing model complexity. These model generation and solution methods form a basis for developing flexible and robust expert systemsthat perform fault diagnosis, HAZOP studies and plant 1. INTRODUCTION Although computers are often used to solve detailed, numerical models or more abstract qualitative models (Venkatasubramanian and Rich, 1988; Finch et al., 1990), they have rarely been used to build or interpret models. The traditional engineering approach to modelling involves determining what is happening physically (e.g. a reaction is occurring due to the presence of catalyst), developing the set of equations describing this physics, putting these equations into a computer and solving them. The computer is only used to solve the model once it has been built; selecting the appropriate physics and chemistry has been left to the model builder. We present a method for automatically building qualitative models of chemical plants. In this ap- proach to modelling, the computer chooses the rel- evant physics and chemistry from a predefined library of general phenomena and builds the appropriate model for a given physical system. To intelligently describe the full range of behaviors of chemical process units, we use, not a library of standard pieces of equipment as is used in traditional modelling packages such as FLOWTRAN and DESIGN II, but a library of fundamental physical and chemical phenomena such as heat and mass transfer, chemical reaction and phase equilibrium which occur within chemical systems. The phenomenon descriptions in this library contrain both the conditions (e.g. tem- perature of source z- temperature of destination) re- quired for a particular process (e.g. heat transfer) to apply and the influences (e.g. heat of the colder body increases) contributed to the model by this process if tTo whom all correspondence should be addressed. it is applicable. This approach to modelling has been implemented using the qualitative process engine (QPE), a computer code based on Forbus’ qualitative process theory (QPT), which takes as input a pre- defined library of general phenomena such as heat transfer or reaction and a physical scenario describ- ing the substances and equipment present in a plant, their connectivity, assumptions about operating con- ditions and any focusing mechanisms desired. QPE identifies which phenomena are occurring and builds the corresponding model of the signed digraph con- sisting of the causal influences and relationships contributed by these active phenomena. Automatic model generation and qualitative mod- elling are both particularly useful in developing more flexible and robust expert systems that perform fault diagnosis, hazard and operability (HAZOP) studies, and design of chemical plants (Grantham and Ungar, 1990; Catino and Ungar, 1990; Grantham, 1990). In fault diagnosis, for example, engineers are interested in modelling situations in which the conditions of a process unit deviate from the design conditions. In these cases, the model that would be found in a library of standard process units is inappropriate, and a new model must be built. Because the assumptions underlying the construction of the models are explicit, models can be automatically updated when assump- tions change. Introduction of a fault into a system is synonymous with a change in assumptions. Qualitat- ive modelling has the distinct advantage of using a causal representation, revealing the effects variables have on other variables. This causality allows the engineer to ask questions such as “What could cause the outlet temperature to be high?” Such questions can be answered simply by examining the model links to find out what variables influence the outlet 583

Automatic generation of qualitative models of chemical process units

Embed Size (px)

Citation preview

Compurers &em. Engng, Vol. 15, No. 8, pp. 583-599, 1991 Printed in Great Britain. All rig&s reserved

009&1354/91 $3.00 + 0.00 Copyright 0 1991 Pergamon Press plc

AUTOMATIC GENERATION OF QUALITATIVE MODELS OF CHEMICAL PROCESS UNITS

C. A. CATPJO, S. D. GRANTHAM and L. H. UNGAR~

Department of Chemical Engineering, University of Pennsylvania, Philadelphia, PA 19104, U.S.A.

(Received 15 October 1990, final revision received 18 March 1991; received for publication I5 May 1991)

Abstract-A library of general physical and chemical phenomena such as heat transfer and reaction has been developed in the qualitative process theory (QPT) representation of Forbus and used to build qualitative models of chemical process units. The QPT descriptions specify the conditions under which the phenomena become active and the constraints they contribute to the model, thus allowing the computer to automatically build and alter process unit models. In order to realistically model chemical plants, we introduce a Lagrangian approach to modelling the behavior of plug flow vessels and we present a set of techniques to focus the model building and solution mechanisms on specific aspects of unit behavior, reducing model complexity. These model generation and solution methods form a basis for developing flexible and robust expert systems that perform fault diagnosis, HAZOP studies and plant

1. INTRODUCTION

Although computers are often used to solve detailed, numerical models or more abstract qualitative models (Venkatasubramanian and Rich, 1988; Finch et al., 1990), they have rarely been used to build or interpret models. The traditional engineering approach to modelling involves determining what is happening physically (e.g. a reaction is occurring due to the presence of catalyst), developing the set of equations describing this physics, putting these equations into a computer and solving them. The computer is only used to solve the model once it has been built; selecting the appropriate physics and chemistry has been left to the model builder.

We present a method for automatically building qualitative models of chemical plants. In this ap- proach to modelling, the computer chooses the rel- evant physics and chemistry from a predefined library of general phenomena and builds the appropriate model for a given physical system. To intelligently describe the full range of behaviors of chemical process units, we use, not a library of standard pieces of equipment as is used in traditional modelling packages such as FLOWTRAN and DESIGN II, but a library of fundamental physical and chemical phenomena such as heat and mass transfer, chemical reaction and phase equilibrium which occur within chemical systems. The phenomenon descriptions in this library contrain both the conditions (e.g. tem- perature of source z- temperature of destination) re- quired for a particular process (e.g. heat transfer) to apply and the influences (e.g. heat of the colder body increases) contributed to the model by this process if

tTo whom all correspondence should be addressed.

it is applicable. This approach to modelling has been implemented using the qualitative process engine (QPE), a computer code based on Forbus’ qualitative process theory (QPT), which takes as input a pre- defined library of general phenomena such as heat transfer or reaction and a physical scenario describ- ing the substances and equipment present in a plant, their connectivity, assumptions about operating con- ditions and any focusing mechanisms desired. QPE identifies which phenomena are occurring and builds the corresponding model of the signed digraph con- sisting of the causal influences and relationships contributed by these active phenomena.

Automatic model generation and qualitative mod- elling are both particularly useful in developing more flexible and robust expert systems that perform fault diagnosis, hazard and operability (HAZOP) studies, and design of chemical plants (Grantham and Ungar, 1990; Catino and Ungar, 1990; Grantham, 1990). In fault diagnosis, for example, engineers are interested in modelling situations in which the conditions of a process unit deviate from the design conditions. In these cases, the model that would be found in a library of standard process units is inappropriate, and a new model must be built. Because the assumptions underlying the construction of the models are explicit, models can be automatically updated when assump- tions change. Introduction of a fault into a system is synonymous with a change in assumptions. Qualitat- ive modelling has the distinct advantage of using a causal representation, revealing the effects variables have on other variables. This causality allows the engineer to ask questions such as “What could cause the outlet temperature to be high?” Such questions can be answered simply by examining the model links to find out what variables influence the outlet

583

584 C. A. CATINO et al.

temperature, and what variables influence those variables, etc. In addition, processes may be added to the model which introduce new links to the outlet temperature. Methodical examination of all influ- ences (actual and potential) on outlet temperature reveals the possible faults leading to a high outlet temperature.

This paper presents a framework and methodology for automatic model construction. The model builder selects the desired equipment and its connectivity and decides the level of detail and a set of assumptions about operating conditions (e.g. temperature of inlet stream > dew point temperature of the mixture) in order to constrain the number and types of models built. The computer then constructs a causal qualitat- ive model of the plant. Selecting the right level of detail and the right set of assumptions is not trivial. If the model is not focused enough and/or too few assumptions have been made about par- ameter values, then numerous physical and chemical phenomena in the library will be applicable and all possible models will be built when perhaps only one model is truly applicable to the task at hand. This problem of producing too many solutions is inherent in all methods of qualitative reasoning due to the fact that multiple influences on a variable are often difficult to resolve using purely qualitative mathematics. We develop and apply a set of focus- ing techniques to limit the number of solutions produced.

Qualitative models do, of course, have limitations. When nonlinear systems consisting of multiple steady states and when systems containing feedback due to recycle or controllers are modelled qualitatively, nu- merous solutions result and actual numerical values are needed to prune the results. Although we have chosen to automatically build qualitative models of chemical process units, recent work in computer science offers the promise that techniques can be used to automatically build quantitative models of these units (Forbus and Falkenhainer, 1990; Berleant, 1989). Instead of haining the processes contribute qualitative constraints and influences (e.g. the heat of the colder body increases), the process could contrib- ute a differential and/or algebraic equation describing how precisely how the heat of the colder body changes. However, even when quantitative models are available, qualitative models showing the causal connections between design assumptions and plant behavior are crucial for automating diagnosis and design.

This paper addresses three capabilities needed to automatically build good, general models of chemical plants. We must be able to: (I) build and basic library of phenomena that occur in chemical systems which can be used to describe the behavior of many different types of plants; (2) model plug flow in pipe-like vessels; and (3) focus on particular aspects of behav- ior so that fewer solutions are produced and so that the model can be solved reasonably quickiy. Section

2 briefly describes several general methods for quali- tative reasoning and explains why we have chosen to use the QPT presentation of Forbus. Section 3 illus- trates some of the phenomena in our library of general phenomena and demonstrates how these pro- cesses can be used to automatically build a model of a chemical reactor. We provide a detailed look at some of the models used and the issues involved in their design and construction. In Section 4 a method of describing plug flow is introduced and applied to building a model of a condenser. Section 5 intro- duces a set of focusing techniques. Section 6 closes with a discussion of our qualitative modelling philos- ophy and the direction in which we see this work proceeding.

2. QUALITATIVE PROCESS THEORY (QPT)

Several general methods for qualitative reasoning have been developed (Weld and de Kleer, 1989), the most noted being qualitative simulation (QSIM) by Kuipers (1986) qualitative physics based on conflu- ences by de Kleer and Brown (1984) and qualitative process theory by Forbus (1984). QSIM, as its name implies, takes an input the qualitative analog of ordinary differential equations describing a particular scenario and an initial state and performs a qualitat- ive simulation predicting the possible behaviors that follow from the model. The device-centered represen- tation of de Kleer and Brown takes on more of the modelling burden than QSIM in that the qualitative equations are associated with particular devices. Given models for the individual process units and information about their connectivity, a model for a chemical plant can be created. However, this rep- resentation does not provide help in developing the individual unit models. A system can automatically create its own models only if it “understands” the laws of physics and chemistry and when they apply. Rather than basing his representation on devices, Forbus bases QPT on processes which capture this first principles physics.

More recently, QPC has been developed which compiles a QPT-type representation consisting of views, processes and influences into a QSIM represen- tation consisting of qualitative differential equations (QDEs) (Crawford et al., 1990). QPC builds QDEs for simulation by QSIM, which allows it to take advantage of many mathematical advances in quali- tative simulation incorporated in QSIM such as interval arithmetic and higher-order derivative con- straints.

QPT and the closely related QPC provide strong frameworks for building models of chemical plants because phenomenon definitions explicitly represent the conditions required for a process to occur, the relationships that exist between the system par- ameters as a result of the process occurring, and the influences that the active process has on the system parameters. This section briefly summarizes QPT,

Generation of qualitative models of chemical process units 585

which we use in the models presented below. For a more detailed account, see Forbus (1984).

In QPT, a process is defined by five parts: individ- uals, quantity conditions, preconditions, relations and influences. The iirst three parts are conditions which must be satisfied in order for the process to occur. These conditions include the objects which must exist, the relations between parameters of these objects (e.g. temperature is less than the boiling point) and the nonquantitative conditions (e.g. vessel1 and vessel2 are connected) which must hold. When all its conditions are satisfied, a process is said to be active. The last two parts of the process definition specify the causal relationships that exist between the parameters (e.g. temperature) as a result of the active process. The causal relationships of all active processes form the qualitative model. Causal relationships come in two forms: qualitative proportionalities (qprops), which relate changes in one variable to changes in another variable and influences, which specify how the process directly changes variable values.

Consider the process heat transfer shown in Fig. 1. Two containers, a source (?src) and a destination (?dst) must exist, and they must be “heat-connected.” The temperature of the source must be greater than the temperature of the destination. When these con- ditions hold, the specific process of heat transfer between the two containers is active. As a result, the quantity heat transfer rate exists, it is greater than zero and is qualitatively equal to the temperature difference between the two vessels. The heat of the

(defprocess (Heat-Transfer lsrc ?dst)

colder body increases at a rate equal to the heat transfer rate, and the heat of the hotter body de- creases at a rate equal to the heat transfer rate. Note that this process is very general. One might expect that in all situations the temperature of the colder body would increase, but this depends on its state. For example, a boiling liquid typically remains at its boiling point but partially vaporizes if heat is added. This physical scenario can only be captured by writing a process definition for vaporization and adding it to the library.

The QPT formalism is implemented in a computer package known as the qualitative process engine (QPE) (Forbus, 1988). A block diagram of QPE is shown in Fig. 2. The input consists of the scenario or physical system (the substances and equipment pre- sent, their connectivity and process conditions) and a library containing all phenomena that can occur in a domain. From these inputs, QPE identifies the phenomena whose conditions are satisfied, the changes the active processes cause, and how these changes are propagated through the system. QPE builds a good qualitative model, analogous to a signed directed graph [as used by Iri ef al. (1979) and many others] in which the nodes are the system parameters (temperature, pressure, . . . ) and the ar- rows connecting the parameters describe a particular causal relationship (qprop or influence) which comes from the set of active processes. Hence, the model can be thought of as specifying a series of causal paths linking variables and influences. This automatic

.. Two containers, a source (?src) and a &?stinadon (7&t) must exist. ;.I and they must be “henr-coNu?cted”

Individuals ((?src :type Container) (‘Kdst :type Container

:conditions (Heat-Connected ?src ?dst)))

.. Temperamre of source m.~ be greater than temperature of destination ,, QuantityConditions ((greater-than

(temperature ?src) (temperature ?dst)))

If the above conditions hold, the specific process of heat transfc between the ,, ;; two containers is active. I. As a resuk, the qumdty heat-war&r-rate mists, it is gmuer than zero. and it is :I. quaUztively equal to the temperanve d@erence between the hm containers.

Relations ((quantity heat-transfer-rate) ( reater-than heat-transfer-rate zero) td= heat-transfer-rate

(- (temperature ?src) (temperature ?dst))))

. The edzalpy of rhe colder tdy increases at a rote equal w the heat-transfer-rate. and 1.f the heat of the hotter body decreases at a rate equal m the heat-wa8&er-rate.

Influences ((I+ (enthalpy ?dst) heat-transfer-rate) (I- (enthalpy ?sre) heat-transfer-rate)))

Note: “I+” denotes a positive intluence, “I-” denotes a negative influence,“?” denotes a variable, “;;” denotes a comment.

“Q=” denotes a qualitative cqwtlity: could also have been wrirten as two Pprops: (Qprop heat-uansfer-rafe (rempemtwc ?sE))

(Ooroc- heat-transfer-rate Cte~ ?dstN meaning that the tan*& of the source and &&tansf~-&a qualitatively

xxwortional such that an increase in the temuezatute of the souse causes an increase id the heat-transfer-rate. and similarly. thaithe 7 of the destination and

heat-nansfa-rate are invcrscly proporrional to each other such that an incrcasc in the temperature of the destination causes a decmase in the hea-Uansf~-rate.

?vlagnitudes (A’s) have been *moved from all phenomenon descriptions for clarity.

Fig. I. Process definition for heat transfer.

586 C. A. CATINO ef al.

Library of Descriptions zkenario Descliption:

I of Physical and

Chemical Phenomena and Process Conditio

Chemical Phenomena Consistent with

Fig. 2. Model building and solution using the qualitative process engine (QPE).

model building capability sets QPT apart from most other qualitative reasoning systems. The model is solved by determining the effect of process influences on variables and propagating these effects through the causal links (qprops) to other variables. QPE predicts and explains all possible sequences of behav- iors of a physical system over time. Therefore, QPE output consists of the qualitative model (set of qprops and influences), the qualitative values of all system parameters (temperature < boiling point), and the sign of the dk-ivatives of all system parameters

(temperature is increasing).

3. LIBRARY OF GENERAL PHENOMENA

One of the advantages of using QPT to model chemical plants is that a general-purpose library of physical and chemical phenomena can be developed which can be applied to a variety of plants. This library of phenomena can then be used as a basis for creating individual process unit models. A prototype library has been developed (Grantham, 1990) which contains definitions of uni- and b&component mass transfer, one- and two-phase flow, chemical reaction, liquid-vapor equilibrium and phase separation. The phenomenon descriptions can be broken down into

tOne n&&t have tried to model a two-comoonent liauid bv req&ing that the temperature of the vessel not kxceei the boiling point of the liquid, i.e. use this statement as a condition rather than as a consequence However, this model would fail because the boiling point is associated with the phase, so the boiling point does not exist until the phase itself exists. The system assumes that there is a liquid phase containing A and B whenever the con- ditions are satisfied and retracts this assumption if the temperature contradicts a process condition.

two distinct groups: individual views and processes. Individual views specify the existence and behavior of the basic entities of a chemical plant such as liquid and gas phases. Processes specify the driving forces which cause the properties of the basic entities to change. The more important features of these de- scriptions are discussed in the sections that follow.

3.1. Vessels and phases

The two most basic entities of our representation are vessels and phases contained in them. We classify vessels into three types: homogeneous, plug flow and stream-pair. This section discusses homogeneous or “well-mixed” vessels; Section 4 describes and defines the other types of vessels. Phases describe both the state (liquid or gas) and the number of homogeneous components contained in a vessel. In the prototype library, phases are currently limited to having either one or two components. While a vessel has an unconditional existence, phases may appear or disap- pear depending on the circumstances. In order to simplify the representation, all phases in a vessel are considered to be at thermal and mechanical equi- librium. Hence, enthalpy, temperature and pressure become properties of a vessel rather than properties of each phase in a vessel. This assumption reduces the number of parameters in the model.

Other properties such as mole fraction and boiling point are best attached to the contents of vessels (phases) rather than to the vessels themselves. The definition of the “Contained-Two-Component- Liquid” view shown in Fig. 3 provides an example of the modelling of a two-component liquid phase. Like processes, views contain a set of preconditions re- quired for activation and a set of causal relationships that result from the active phenomena. In order for this view to be activated, the following conditions must hold: a vessel and two miscible substances must exist and the amount of the two substances in the liquid phase must be greater than zero. In addition, because only a few of the many substances which may be present in a chemical plant typically appear in any given vessel, only substances which are expected to be in the vessel need to be considered. Also we require that the model builder explicitly state that phases should be considered. When all these conditions are satisfied, an objected called a two-component liquid phase exists in the vessel (2-c-l-p A B vessel). Once this view has been activated, the object (2-c-l-p A B vessel) has the following parameters: a boiling point which increases with pressure and with the mole fraction of the heavy component, an amount of each individual component in the phase, and mole frac- tions of the heavy and light components such that the mole fraction of the light component is inversely dependent on the mole fraction of heavy.7

The approach of using a special two-component phase definition is sufficient if the system being modelled have only one or two components. For larger, more complex systems it is preferable to use a

Generation of qualitative models of chemical process tits 587

(defview (Contalned-2-Component-Liquid (2-C-L-l’ Is1 782 ?c))

. In order fof this view to be activafed, la vessel und lWV ntisdbk stirances must exist, *, :; rhosr substances must be cqaectd in that vcssd. and the mock1 builda must consider :; phases in tk vessel.

Individuals (UC :type container :eenditionr (consider (phases 7~)))

(?sl :type Substance :conditioas (expect Is1 2~))

(?a2 :type substance :conditions (miscible 201 7~2)

(expect ?s2 ?c)))

;; ALSO, the amount of the hyo substcurccc in tk liquidphase musf be greater thm zero. QuantityConditions ((greater-than

(amount-of-in ?sl 782 liquid ?c) zero))

;; When these wnditions are sati&?d, an objeCt cu&d a two-component Iiqzddphase ;; aims in the vessel. This objCCt has thefolkwi

Relations ((there-is-unique (Z- 7 pcvamrrcrs: -L-P ?sl Is2 ?c))

;; a boiling point which in~n%~%?~ with pre~S4lV and with the mkfrMion of the hefty Component (quantity (Tboil (2-C-L-P ?sl ?s2 Tc)))

., m0lefmcti0n.s of the hemy and light compancnts such that the mole fraction of the light II c*mponenr is inversely depmdmt on the molefraction ofharvr

(quantity (ml ?sl (2-C-L-P ?sl Is2 ?c))) (quantity (ml Is2 (2-C-L-P ?sl ?s2 ?c)))

M amount of each individual component in the pharc ,, (quantity (amount-of ?sl (2-C-L-P tsl ?s2 ?c))) (quantity (amount-of ?s2 (2-C-L-P ?sl ?s2 ?c))) (greater-than (Tboil (2-C-L-P ?sl Is2 ?c)) zero) (not (less-than

(Tboil (2-C-L-P 751 752 2~)) (temperature ?c))) (greater-than (mf 2131 (2-C-L-P ?sl ?s2 Pc)) zero) (greater-than (mf 7~2 (2-C-L-P ?sl 7s2 ?c)) zero) (greater-than (amount-of Is1 (2-C-L-P ?sl 1.32 PC)) zero) ( eater-than (amount-of ?s2 (2-C-L-P 281 ?s2 ?c)) zero) &prop (Tboil (2-C-L-P Is1 ?s2 ?c))

(mf Is1 (2-C-L-P ?sl ?s2 ?c))) (Qprop (Tboil (2-C-L-P Is1 ?s2 ?c))

(pressure ?c)) (Qprop- (mf ?s2 (2-C-L-P ?sl ?s2 ?c))

(mf ?sl (2-C-L-P ?sl ?s2 ?c)))))

Note: “(-I-boil (2-C-I/P ?sl ?a ?C))’ llqnmalts the boiiing point of a Bent liqtid phase consisting of substances sl and s2 in container c.

Fig. 3. Individual view used in the modelling of a two-component liquid phase.

general multicomponent phase definition. In the sim- plest approach mole fractions and amounts of all substances are listed analogously to the labelling of components in each stream of a process flowsheet, with absent substances having zero mole fraction and amount. An increase in the amount of a substance causes an increase in its mole fraction, and mole fractions are constrained to sum to one. This rep- resentation is natural, but not without problems. For example, if a two-component mixture is removed from a vessel, then the amount of each component decreases, and consequently, the mole fraction of each component decreases. However, if the vessel is well-mixed, there should be no change in the mole fractions. Extra constraints can be added to take this possibility into account, and for a two-component mixture, the mole fraction of one substance can be easily related to the mole fraction of the other substance. When more components are present, the relationships between mole fractions and amounts are not as clear, and if the model builder is not careful, many solutions will result.

3.2. Zones

Up to this point vessels have been described as containing phases that are homogeneously mixed.

But what happens when the phases do not mix and instead occupy specific areas of a vessel? This distinc- tion between homogeneous and inhomogeneous phases must be made in order to correctly reason about the separation of mixtures of phases as occurs in flashes and decanters. We have therefore defmed another type of modelling entity called a zone. Zones are geometrically distinct areas containing one or more phases separated by interfaces. Interfaces have the property of height, which specifies the geometry of the phases in the vessel and determines whether a particular zone can flow out of a vessel.

3.3. Creating individucd process tmit models

The library of general phenomena is used as a basis for creating individual process unit models. Given the library of phenomena and the scenario description of a physical system, OPE matches the conditions required to activate a process or view against the predicates provided in the scenario description in order to find all instances of active processes and views. A process unit model consists of the active processes and views and their effects on the system parameters. For example, suppose we want to develop a qualitative model for the uni-molecular (Organics + Alcohol), liquid phase,

588 C. A. CHINO et al_

exothetic reactor shown in Fig. 4. An engineer tion 4.1), strippers (Section 4.4), evaporators, phase might qualitatively describe the physics of this dia- separators, mixers, filters and compressors. gram in the following manner: due to a pressure Given this library of phenomena and this scenario gradient between the preheater and the reactor, or- description, QPE matches the source and destination ganics flow from the preheater into the reactor where for heat transfer with reactor and cooling-pipe re- they react with catalyst to form alcohol. Heat is spectively. Ekcause all required conditions and quan- produced from the reaction and heat transfer occurs tity conditions are satisfied, the specific instance of between the fluid in the reactor and the cooling water heat transfer (Heat-Transfer reactor cooling-pipe) is in the cooling coils. A mixture of alcohol and organ- activated. The system continues in this manner, its flows from the reactor into the product cooler. matching conditions required for activation of a

At the very least, a qualitative model of this reactor process or view against the predicates in the scenario should be able to predict that two instances of fluid description, and determines that the following views flow are occurring, one between the preheater and the and processes are active (only the more important reactor and one between the reactor and the product phenomena are listed): I

Views:

Processes:

(Contained-l-Component-Liquid (1-C-L-P organics preheater)) (Contained-l-Component-Liquid (1-C-L-P water cooling-pipe)) (Contained-2-Component-Liquid (2-C-L-P organics alcohol reactor)) (Contained-2-Component-Liquid (2-C-L-P organics alcohol product-cooler)) (Expert-Forward-Reaction of (R-P (2-C-L-P organics alcohol reactor)) (Reacting-Phase (R-P (2-C-L-P organics alcohol reactor))) (Heat-Transfer reactor cooling-pipe) (Reaction (R-P (2-C-L-P organics alcohol reactor))) ( 1 -Component-Flow

(1 -C-L-P organics preheater) (2-C-L-P organics alcohol reactor)) (2-Component-Flow

(2-C-L-P organics alcohol reactor) (2-C-L-P organics alcohol product-cooler))

cooler, in addition to predicting that relation is occurring within the reactor and that heat transfer is occurring between the reactor and cooling-pipe. Thus, the library must contain process definitions for 1-Componient-Liquid-Flow, 2-Compound-liquid- Flow, Heat-Transfer and Reaction, and individual view defkitions for Contained-l-Component-Liquid, Contained-2-Component-Liquid, Reacting-Phase and Expect-Forward-Reaction. Appendix A contains the major proceses and views needed to build a model of a reactor and the predicates that are used in the scenario description of this particular system. We have developed similar models for condensers (Sec-

-Ct-C!Oder

Fig. 4. Preheater/resctor/praduet-ler system.

The system also generates the corresponding quali- tative model shown in Fig. 5 consisting of the re- lationship (qprops and influences) contributed by each of the active processes and views. This model can be used to diagnose faults in the three-vessel system because the model contains potential causes for discrepancies which may be observed. For example, suppose the temperature sensor on the reactor reads higher than expected. From the model in Fig. 5, we know that the temperature of reactor is high if the enthalpy of the reactor is high. The enthalpy could be high because the reaction rate is high, because the heat transfer rate to the cooling- pipe is low (heat transfer could be low because the temperature of the cooling-pipe is high), or because there is heat transfer to the reactor from some hotter object. The scenario description can be altered for each of these cases and fault models can be automati- cally generated, simulated and compared to obser- vations. Similar reasoning is also useful in process design.

4. MODELLING THE BEHAVIOR OF PLUG FLOW VEssm

IModels similar to the chemical reactor model given above would be sufkient for describing the behavior of chemical plants if all we ever encountered were homogeneous phases. However, chemical plants of- ten contain nonhomogeneous vessels, i.e. pipe-like vessels such as plug flow reactors in which properties vary spatially and what we call “stream-pair” vessels

Generation of qualitative models of chemical process units 589

l-CohnaNFDrl-T-Fu3w PreheatsmR-

Note: AnowsfmmraresatbonomtopraMscsattoparrart~wn.

B denoteslnfluenccs. - dcnotcsqPnws

Fig. 5. Model of reactor showing only aspects associated with the vessel.

in which plug flow is occurring in two countercurrent streams (e.g. heat exchangers and strippers). This section addresses the problem of modelling plug flow vessels.

QPT and other qualitative simulation packages were created to model the interactions between a set of objects in a domain over time. Each object is described by a set of parameters which can take on one of several qualitative values. At any given time an object is fully-described by a single qualitative state, i.e. an assignment of a single qualitative value to each parameter. Thus, methodology assumes homo- geneous (lumped parameter) objects. This is ideal for modelling units which can be considered as a number of homogeneous phases contained in a vessel: the vessel and its contents can be completely described by a single state at any given instant. This approach has been formalized in the “contained-liquid” ontology of Hayes (1985) and extended by Forbus’ “contained- stuff” ontology (Forbus, 1984, 1985).

Unfortunately, this single state description does not necessarily apply when describing plug flow in pipe-like vessels where the parameters of a system may vary continuously throughout the length of the vessel and may even transition to a new qualitative state. In plug flow vessels changes and state tran- sitions occur along a spatial axis rather than a time axis. We require a methodology which, at the very least, notes the difference in parameter values be- tween the input and output of a plug flow vessel, and which ideally specifies how the properties of the

tThis is not quite true as the pressure of the elemental volume will automatically decrease as it moves down the vessel and would require an additional process. Altema- tively, if we assume the frictional resistance of the vessel is negligible, this extra process can be ignored.

system vary continuously throughout the vessel and identifies transitions to new states.

4.1. A Lagrangian approach

A solution to the problem is to take the standard engineering view for plug flow systems, the Lagran- gian view, which considers the changes in an elemen- tal mass as it moves with the flow through the pipe. The key to this problem is to note that the change in parameters of an elemental mass with distance along a pipe is completely analogous to the change in parameters of a homogeneous vessel with time: the qualitative simulations of heating water in a can over time and of heating water in a plug flow heiter over distance arc entirely analogous. Thus, not only can the existing model creation and solution mechanisms of QPE or other qualitative modelling packages be used to determine how an elemental mass changes with distance, but the library of processes and views developed for the contained-stuff ontology is equally applicable to an elemental mass as well.? Therefore, the approach to modelling chemical plants with plug flow systems is to first use the contained-stuff ap- proach to determine flow between homogeneous vessels as suggested in Collins and Forbus (1987), and then use the Lagrangian perspective to see how fluids change as they move through the pipe-like vessels.

For example, consider the plug flow condenser shown in Figs 6 and 7a. Once it has been specified that the direction of flow is from the stripper to the flash drum, the possible behaviors of the fluid as it passes through the condenser can be determined by running a simulation of the condenser as if it were a closed batch vessel and specifying the material leaving the stripper as the initial contents of the condenser. Suppose we specify that there is a

590 C. A. Cmmo et ul.

Fig. 6. Stripper/condenser/flash system.

two-component water-air mixture entering the tube- side of the condenser. The simulation determines that the behavior passes through two qualitative states, and therefore, two models of the condenser are built. In the first model, shown in Fig. 7b, the temperature of the gas is above its dew point tcrn- perature and is decreasing with increasing distance through the condenser. The following views and processes are active:

the vessel along as if it were a closed batch system. The contents leaving the vessel directly upstream from the vessel of interest are specified as the initial contents of the vessel of interest. For example, recall the reactor described in Section 3.3 in which the liquid phase, exothermic reaction organics + alcohol is occurring. The steady-state behavior of the reactor is viewed from the homogeneous perspective was described by the scenario given in Appendix A, and the model automatically created from this scenario was shown in Fig. 5. We have already determined that the direction of flow is from the preheater to the product-cooler and that we can expect both organics and catalyst in the reactor. Now the reactor/cooling- pipe system can be simulated as a batch system. The model automatically created for this batch system is shown in Fig. 8. This model represents how the properties of a volume of the fluid changes as it passes through the plug flow reactor. The solution to the model shows that as the organics/alcohol phase passes through the reactor, the amount of organics and the mole fraction of organics decrease while the amount of alcohol and the mole fraction of alcohol increase. The temperature of the reactor may in- crease, decrease, or remain the same &pending on the relative magnitudes of the reaction rate and the heat transfer rate.

(Contained-2-Component-Gas (2-C-G-P water air tube-side)) (Container-no-liquid-vapor-equilibrium-gas tube-side) (Heat-Transfer tube-side shell-side)

When the temperature of the gas becomes equal to 4.3. Describing behavior along a flow path

its dew point, the behavior transitions to a new qualitative state and a new model is applicable. In

A complete Lagrangian description of how a con-

the second model, constant temperature conden- trol volume behaves as it moves through the vessels

sation occurs, and a one-component liquid water of a plant can be generated for any path through a

phase exists along with the two-component gas phase chemical plant by patching together the Lagrangian

(see Fig. 7~). The following views and processes are behaviors of each individual vessel irrespective of

active: whether it is a homogeneous or plug flow vessel. For

(Contained-2-Component-Gas (2-C-G-P water air tube-side)) (Contained-l-Component-Liquid (1-C-L-P water tube-side)) (l-Component-Liquid-Vapor-Equilibrium (1-C-L-P water tube-side) (2-C-G-P water air tube-side)) (Heat-Transfer tube-side shell-side)

(1 -Component-Condensation (2-C-G-P water air tube-side))

4.2. Lugrangian description of homogeneous vessels

Although there is no spatial variation in the properties of vessels containing homogeneous phases, it is often desirable to describe how the properties of an elemental mass of fluid change as it passes through the vessel. This description can be produced by recreating and solving the model for the vessel but ignoring the effect of any fluid flow phenomena. The technique is the same as for plug flow vessels: simply specify the direction of flow and run a simulation of

example, recall the preheater/reactor/product-cooler system described in Section 3.3. The behavior of a volume of fluid as it passes through the reactor and product-cooler can be obtained by linking together the solution to the plug flow model for the reactor with that of the plug flow model for the product- cooler. The resulting sequence of state descriptions describes how the parameters change as each vessel of the flow path is traversed: for example, if a decreasing temperature profile is chosen for the reactor, the temperature of a volume of fluid decreases as it flows

Generation of qualitative models of chemical process units 591

(cl HEAT TRANSFER

0

Fig. 7. (a) Condenser. (a) Model of condenser before condensation. (c) Model of condenser after the start of condensation.

through both the reactor and product-cooler. The mole fraction of organics in a volume of fluid de- creases as it passes through the reactor and remains unchanged as it flows through the product-cooler.

4.4. Streams

There are many chemical plant units which have two distinct phases moving in countercurrent direc- tions within a single vessel. In order to model how

each phase changes as it moves through the vessel, it is necessary to define the counterc m-rent phases as contained in special objects, called streams, which are reasoned about as if they are individual plug flow vessels. Heat transfer and/or mass transfer can occur between the streams. Because the analogy between streams and plug flow vessels is not exact, the same phenomenon descriptions used for vessels cannot be used for streams.

REACTION HEATTRANSFER

1 0 1 0 McdeFracticm 0 TV

Ahwho in R- Of cooling-Pipe

RostiooRaoc RemlhmsfaRare

Note: Armw~favmntcrUbc#am*r proocucrutopmnotshown. I_) denominflualcu, - dcnomEqpropr

Fig. 8. Partial model of batch reactor.

592 C. A. CA= et al.

Consider the stripper shown in Fig. 9. The gas a result of that process occurring. The mini-descrip- stream consisting of air and water flows in a counter- tions provided by each set of rules are pieced together current direction to the liquid stream consisting of to give an overall history for the entire flow path. organics and water. Mass transfer occurs between the The MC approach suffers from two main draw- two streams: air “strips” the l&id stream of water backs: as it passes through the vessel. As a result of strip ping, the gas stream increases in water content and the liquid stream decreases in water content. Appen- dix B contains the major processes and views needed to build a model for a stripper and the scenario for the particular system consisting of air, water and organics. Figure 10 shows the model that is automati- cally generated in which the following views and processes are active:

1. It requires an explicit statement of rules describ- ing the input/output behaviors that a proozss could produce in pipe-like -vessel under all con- ceivable circumstances, i.e. all the modelling work is done a priori. Hand-coded models specified a priori are very much in contrast with the QPT philosophy which is to allow the computer to do the modelling.

(Contained-2-Component-Liquid (2-C-L-P organics water o/w-stream)) (Contained-2-Component-Gas (2-C-G-P water air air/w-stream)) (Liquid-Gas-Streams

(2-C-L-P organics water o/w-stream) (2-C-G-P water air air/w-stream)) (Stripping-Unit

(2-C-L-P organ& water o/w-stream) (2-C-G-P water air air/w-stream)) (Stripping

(2-C-L-P organics water o/w-stream) (2-C-G-P water air air/w-stream))

4.5. Comparison with the “molecular collection” on-

tology

Our approach to modelling chemical plants with plug flow vessels is to first use the contained-stuff ontology to set up flow paths through homogeneous vessels and then use the Lagrangian perspective to see how fluids change as they move through the plug flow vessels. This approach represents an alternative to the “molecular collection” (MC) ontology of Collins and Forbus (1987). The aim of the MC approach is to +scribe how a piece of fluid changes as it moves through a steady-state plant. The MC approach also uses the contained-stuff ontology to set up flow path through vessels, but for each path it creates a MC description of how a volume of fluid changes as it moves through the vessels- on the path. Rules, associ- ated with the continued-stuff processes, specify how the location and phase of the piece-of-stuff change as

Fig. 9. The stripper system.

2. These rules assume that as the MC moves through the pipe, it has a monotonic behavior. Thus, the rules cannot model situations in which there are transitions through several distinct types of behavior at different parts of a pipe. For example, heating a sub-cooled liquid to super-heated steam in a heat exchanger results in a sequence of three distinct states between input and output. The MC approach could do this by having rules attached to the process “heat transfer” which explicitly state this series of transitions as being possible if the input is a liquid phase, but again, this would necessitate the explicit, a priori modelling of every conceiv- able situation that could arise in the plant.

The Collins and Forbus approach, however, is more efficient because it requires only one simulation to produce a contained-stuff description, and then reasons about molecular collections with a simple set of rules. Our approach requires a separate simulation for each plug flow vessel. Thus, there is a trade-off in deciding between the speed of the MC approach and the greater flexibility and descriptive power of the Lagrangian approach.

5. FOCUSING ON RELEVANT ASPECTS OF BEHAVIOR

The mathematics of QPT suffers from the same weakness as all qualitative mathematics in that it is unable to resolve competing tendencies and hence produces multiple solutions. This weakness manifests itself in two ways: the inability to determine the sign of the derivative of a variable which is influenced by two or more counteracting phenomena and the inability to determine which of a number of possible

Generation of qualitative models of chemical process units 593

None: Amwaommeatbcammtopnrurmmpkmcshwm.

+ dulotnkflunreh - -qprops

Fig. 10. Partial model of stripper.

transitions will occur first. For example, in the reactor model described in Section 3.3, if steady state is not assumed (e.g. in order to describe behavior during start-up, shut-down or transients due to faults), nu- merous solutions are generated due to the competing influences on both the amount of organlcs in the reactor (generation of organics due to fluid flow and consumption of organics due to reaction) and the amount of alcohol in the reactor (generation of alcohol due to reaction and consumption of alcohol due to fluid flow). These types of ambiguity cause the number of solutions to increase exponentially with the number of variables in a model, requiring exces- sive computation and producing many solutions which are irrelevant to the task at hand. Some methodology for reducing the number of model solutions is necessary, even when analyzing the be- havior of a single unit, in order to produce useful results in a reasonable amount of time.

A set of focusing techniques has been developed to control the model creation and solution tasks so that only the more interesting solutions are produced. Using a focus mechanism provides the flexibility to consider all alternatives or a particular subset of possible behaviors. In addition, the focusing assump- tions are explicitly represented and hence can be retracted or manipulated during the performance of tasks such as troubleshooting and design.

Our focus system is based on the explicit represen- tation of modelling assumptions in a scenario de- scription. The focus system uses three types of assumptions: creation assumptions (Falkenhainer and Forbus, 1988) which reduce model complexity (i.e. the number of variables and links in the model) by specifying the level of analysis at which a model

is to be built, filter assumptions which filter out undesired details of the model before it is solved by ignoring the effects of certain variables and operating assumptions (Falkenhainer and Forbus, 1988) which reduced the number of solutions considered when solving a model. Creation assumptions are specified as “consider” statements in the individuals field of processes and views. If the consider statement associ- ated with a given phenomenon description does not match a statement in the scenario specification or an assertion from another active view or process, the phenomenon will not be included in the model. The appropriate specification of “consider” statements enables the system to focus on those phenomena associated with specific aspects of behavior and ignore the effects of the other phenomena when building a model. Filter assumptions are not explic- itly represented in the domain library. Instead, they trigger filtering algorithms which prune the model after it is created but before it is solved. These work by removing all model relations which affect variables that the system has been asked to ignore. Operating assumptions are specified as keywords (sometimes as “consider” statements), but unlike creation aaswnp- tions which are typically associated with specific processes or views, operating assumptions appear in global rules separate from phenomenon definitions.

5.1. Creation assumptions : kvels of mass balance Malysir

Creation assumptions are particularly important in building models that describe mass balances at the appropriate level of detail. There are several levels at which the mass balance of units can be analyxed. Sometimes we are only interested in the total mass of

594 C. A. CATINO et al.

material in a vessel; other times we may be concerned with the amount of individual substances in each phase or just the total amount of each phase. The mass balance of chemical process units has been analyzed at the levels of the:

-Total amount in a vessel -Amount of each zone in a vessel -Amount of each phase in a vessel -Amount of each substance in a phase -Amount of each substance in a vessel

In order to operate efficiently and flexibly, the reason- ing system must be able to analyze behavior at each level or combination of levels.

Through the use of creation assumptions, the modeller chooses to build models at the level of phases or zones. Each of the mass quantities listed above is associated with a phase-based model or with a zone-based model. For example, if the modeller chooses to use zones, mass balance analysis will be done at the level of amount of each zone in a vessel. Phase-based models, on the other hand, incorporate all other mass quantities. Using creation assumptions to build models at the levels of phases and zones means that all mass quantities do not exist each time a model is created, therefore, fewer parameters need be reasoned about.

5.2. Filter assumptions: focusing on the behavior of

specijic vessels

In many situations we want to know how phenom- ena affect the behavior of a specific vessel rather than the plant as a whole. In this case, it is necessary to consider the interaction between the vessel-of-focus and its peripheral vessels in order to determine the phenomena that are active and then analyze their effect only on the vessel-of-focus, ignoring the impact on other vessels. Filter assumptions can be used to remove all relations from the model which affect the variables of peripheral vessels. The system can then ignore the undesired variables when calculating de- rivative values but still keep these variables in the model if they influence parameters of interest. Some- times it is also desirable to ignore the behavior of certain variables (e.g. ignoring changes in the rates of processes or the changes in the pressure of a vessel) in order to reduce the complexity of behavior. Filter assumptions can be used in this case to remove all relationships that affect the specified variable.

5.3. Operating assumptions

Operating assumptions are specified as keywords that activate special rules which constrain the quali- tative solution of the model. There are of two types: those which constrain quantity ordering relationships (and hence reduce ambiguity by restricting certain transitions) and those which constrain parameter derivatives (and hence reduce ambiguity by restrict- ing the effects of competing phenomena). These con- straints can be general such as assuming steady state

by specifying that all system variables must have mro derivatives, or specific such as specifying that the derivative of the temperature of a vessel must be negative. Taken as a set, creation, filter and operating assumptions provide a powerful tool for controlling and focusing model building and solution.

5.4. Focus example

Recall the stripping unit shown in Fig. 9. Suppose that the model builder is only interested in finding out what happens to the organics-water liquid stream as it passes through the stripper. We can add a filter assumption to the scenario file that will focus the model on the organics-water stream. The resulting model is shown in Fig. 11. A comparison of Figs 10 and 11 shows that the focused model (Fig. 11) removes all links involving parameters of the air-water gas stream.

6. CONCLUSIONS

We have demonstrated how the QPT represen- tation of Forbus can be used to develop a library physical and chemical phenomena which, when com- bined with a description of a specific scenario, can automatically generate qualitative models of chemi- cal process units. General phenomena (e.g. heat transfer between a heat-source and a destination) are used to create specific models (e.g. heat transfer between the reactor and the cooling-pipe) such that the library can be used to describe the behavior of many different types of chemical plants. Our ap- proach is not limited to building the particular signed diagraph models generated by QPT. QPC, for example, takes the general approach of QPT in describing a plant in terms of the processes active in it, but builds qualitative differential equations for QSIM rather than QPT models. The approach is similar, and models analogous to those presented above would be equally useful for QPC.

In addition, several new modelling concepts were introduced: zones describe distinct phases within the same vessel. Streams are used to model units that have two distinct phases moving in countercurrent directions within a single vessel. The Lagrangian approach to modelling plug flow vessels considers changes in parameters of an elemental mass as it moves with the flow through the vessel. With these added tools, models can be built for three different types of vessels: homogeneous vessels which contain a number of spatially homogeneous entities (phases or zones), plug flow vessels which contain entities whose properties vary spatially and vessels which contain stream pairs. Our approach then to mod- elling an entire chemical plant is to break the flow- sheet down in small sections involving two to three process units. The output from one section becomes the input for the next section. Plug flow and stream pair vessels are simulated individually in order to determine spatial changes in parameter values.

Generation of qualitative models of chemical process units 595

Note: Anwl~ratcatboaomtoproasaattopi9notshown. 4 denotes itiucmzs. - denotes qpqn

Fig. 11. Focused stripper model.

Even with relatively small plants, however, the number of different behaviors predicted by qualitat- ive reasoning can become intractably large due to the exponential growth in the number of behaviors with the number of process units in the scenario. We limit this growth in solutions by using a set of focusing techniques: creation assumptions that constrain the phenomena considered when building a model, filter assumptions that reduce model size by pruning the model and operating assumptions that select certain model solutions. Although this set of focusing tech- niques is not the only way to avoid the problem of multiple solutions-quantitative information such as interval arithmetic can reduce ambiguity (Gripers and Berleant, 1988twe believe the focusing tech- niques must be a part of any large modelling system.

The use of these focusing techniques is not auto- matic; currently, the success of these techniques lies largely with the skill of the model builder. When a new process unit and/or set of processing conditions is modelled, QPE often predicts numerous qualitative behaviors, and the model builder is forced to apply focus mechanisms to reduce the number of behaviors produced in the simulation. Sometimes it is only after the first simulation is run that it becomes obvious exactly which focusing mechanisms and assumptions about operating conditions are needed.

While qualitative models of process units are useful in many circumstances, most chemical engineering tasks also require, at some stage, the quantitative analysis of a traditional mathematical model. The techniques used here to create qualitative models can also be applied to develop systems which can auto- matically create quantitative differential and alge- braic equation models of chemical units. We are

currently working on extending our methodology to the automatic generation of quantitative and semi- quantitative models using QPC and QSIM. Such systems will eventually combine symbolic and nu- merical analysis to give truly expert performance in problems such as fault diagnosis and design.

Acknowledgements-We thank Professor Ken Forbus of the Computer Science Department, Northwestern University, for the use of his OPE code. We also wish to acknowledne the financial suppoA of the Shell Foundation and of an NCF PYI Award CBT 86-57899.

REFERENCES

Berleant D., A unification of numerical and qualitative model simulation. Proc. Workshop on Model-Based Reasoning at ZJCAZ (1989).

Catino C. A. and L. H. Ungar, A qualitative physics approach to identifying potential hazards in chemical plants. Presented at the AZChE Spring Mtg. Orlando (1990).

Collins J. and K. Forbus, Reasoning about fluids via molecular collections. Proc. AAAZ (1987).

Crawford J., A. Farquhar and B. Kuipers, QPC: a compiler from physical models into qualitative differential equations. Proc. AAAZ (1990).

Falkenhainer B. and K. D. Forbus, getting up large-scale qualitative models. Proc. AAAZ (1988).

Finch F. E., 0. 0. Oyeleye and M. A. Kramer, A robust event-oriented methodology for diagnosis of dyuamic process systems. Computers them. J&gag 14 1379-1396 (1990%

Forbus K. D., Qualitative process theory. ArtiJ: Intell. 24, 85-168 (1984).

Forbus K. D., The problem of existence. Report No. UIUCDCS-R-85-1239 University of Illinois at Urbana- Champaign, Dept of Computer science (1985).

Forbus K. D., QPE: using assumption-based truth mainten- ancs in qualitative simulation. Inl. J. AZ Ekgng 3,20&2 15 (1988).

596 C. A. CA~NO et al.

Forbus K. D. and B. Falkenhainer. Self-explanatory simu- lations: an integration of qualitative and quantitative knowledge. Proc. AAAZ (1990).

Grantbam S. D. Automated reasoning about chemical plants from first principles: applications to troubleshoot- ine and de&n. Ph.D. Thesis. Chemical Ennineerine Department, ijniversity of Pen&ylvania (1990): _

Grantham S. D. and L. H. Ungar, A first principles approach to automated troubl&hooting of -che&al plants. Computers them. Engng 14, 783-798 (1990).

Hayes P., Naive physics 1: ontology for liquids. In Formal Theories of the Commonsense World. (Hobbs and Moore, Eds) Ablex, Norwood, NJ (1985).

Iri M., K. Aoki, E. O’Shima and H. Matsuyama. An algorithm for diagnosis of system failures in the

chemical process. Computers them. Bgng 3, 489-493 (1979).

de Kleer J. and J. S. Brown, A qualitative physics based on confluences. ArtiS. Inteli. Zq 7-83 (1984).

Kuipers B. J., Qualitative simulation. Arrif. IntelI. 29, 289-338 (19861.

Kuipers B. J. and D. Berleant, Using incomplete quantita- tive knowledge in qualitative reasoning. Proc. AAAZ (1988).

Venkatasubramanian V. and S. H. Rich, An object-oriented two-tier architecture for integrating compiled and deep- level knowledge of process diagnosis. Computers &em. Enpg 12, 903-921 (1988).

Weld D. S. and J. de Kleer, Reudings in Qualiturive Reasoning About Physical Systems. Morgan-Kauffman, Los Altos, CA (1989).

APPENDIX A

Major Views and Processes that are Active in the Reactor Model Pius the Scenario Description Used to Build Model

Note: Magnitudes (As) have been removed from all phenomenon descriptions for clarity. “Qprop” and “Qprop-” denote qualitative proportionalities, “Q = ” denotes a qualitative equality, negative influence,

“I+” denotes a positive influence, “I-” denotes a “?” denotes a variable.

Views

View describing a two-component liquid phase consisting of sl and s2 in vessel c. Associated with this phase are mole fractions of each component, amounts of each component, and a boiling point which is proportional to the mole fraction of the heavy component and the pressure of the vessel.

(deftiew (Contained-2-Component-Liquid (2-C-L-P ?sl ?s2 ?c)

Individuals ((?c :type Container :conditions (consider (phases c))

(?I :type Substance :conditions (except ?sI ?sc))

(?s2 :type Substance :conditions (miscible ?sl ?s2)

(except ?s2 7~))

Quantity Conditions ((greater-than (amount-of-in ?sl ?s2 liquid ?c) zero))

Relations ((there-is-unique (2-C-L-P ?s 1 ?s2 2~)) (quantity (Tboil (2-C-L-P ?s 1 ?s2 ?c))) (quantity (mf ?sl (2-C-L-P ?sl 992 7~))) (quantity (mf ?s2 (2-C-L-P Psi ?s2 ?c))) (quantity (amount-of ?sl (2-C-L-P ?sl 7~2 ?c))) (quantity (amount of ?s2 (2-C-L-P ?sl ?s2 7c))) (greater-than (Tboil (2-C-L-P ?sl?s2 ?c)) zero) (not (less-than (Tboil (2-C-L-P ?sl ?s2 7~)) (temperature ?c))) (greater-than (mf ?sl (2-C-L-P ?s 1792 ?c)) zero) (greater-than (mf ?sl (2-C-L-P ?sl ?s2 ?c)) zero) (greater-than (amount-of ?sl (2-C-L-P ?sl ?s2 ?c)) zero) (greater-than (amount-of ?sl (2-C-L-P ?sl 7s2 ?c)) zero) (Qprop (Tboil (2-C-L-P 7s 1 ?s2 ?c))

(mf?sl (2-C-L-P ?sl ?s2 Ic)) (Qprop (Tboil (2-C-L-P ?sl ?s2 7~))

(pressure ?c)) (Qprop (mf ?s2 O-C-L.-P ?s 1 ?s2 ?c))

(mf ?s 1 (2-C-L-P ?s I ?s2 7~)))))

View describing a reacting phase consisting of organics, alcohol and catalyst. Introduces the quantity reaction-eq-mf.

(deftiew (Reacting-Phase (R-P Xl))

Individuals ((?l 1 type Contained-2-Component-liquid form (2-C-L-P organ& alcohol?c) :conditions (consider (focus ?c))

(consider reactions) (contains 7c catalyst)))

Relations ((there-is-unique (R-P 711)) (quantity (reaction++mf organica 711)) (greater-than (reaction-eq-mf organic3 ?I 1) zero) @prop-(reaction-eq-mf organ& ?l 1)

(temperature Ic))))

Generation of qualitative models of chemical process tits 597

View describing a vessel containing all liquid such that no liquid-vapor equilibrium occurs. Asaresult,anincreascin enthalpy causes an increase in temperature.

(dcftiew (Container-No-LVE-Liq ?l)

Individuals ((?I :type Contained-Z-Component-Liquid :form (2-C-L-P ?1?2 ?c) :conditions (consider focus (‘7~))))

Quantity Conditions ((less-than (temperature ?c) (fboil ?l)))

Relations (@prop (temperature ?c) (enthalpy ?c))))

Processes

Process describing heat transfer between two vessels (src and dst). Heat transfer causes the enthalpy of the to increase and the enthalpy of the source to decrease both at rates equivalent to the heat-transfer rate.

(defprocess (Heat-Transfer ?src ?dst)

Individuals ((?src :type Container) (?dst :type Container

:conditions (heat-connected ?src ?dst)))

Quantity Conditions ((greater-than (temperature ?src) (temperature ?dst)))

Relations ((quantity heat-transfer-rate) (Q = heat-transfer-rate (-(temperature ?src) (temperature ?dst))) (greater-than heat-transfer-rate zero))

InfluenceS ((I + (enthalpy ?dst) heat-transfer-rate) (l - (enthalpy ?src) heat-transfer-rate)))

Process describing the flow of two components, pl and p2, from vessel c to vessel c2.

(deprocess (Z-Component-Plow ?src ?dst)

Individuals ((?src :type Contained-Z-Component-Liquid :form (2-C-L-P ?pl ?p2 k))

(?dst :type Contained-Z-Component-Liquid :form (2-C-L-P ?pl ?p2 ?c2) :conditions (fluid-connect ?c ?cZ)))

Quantity Conditions ((greater-than (pressure ?c) (pressure ?cZ)))

Relations ((quantity flow-rate) (greater-than flow-rate zero) (Q = flow-rate (-(pressure ?c) @ressure ?cZ)))

Influences ((I + (amount-of ?pl ?dst) flow-rate) (I + (amount-of ?p2 ?dst) flow-rate) (I - (amount-of ?pl ?src) flow-rate) (I- (amount-of ?pZ?src) flow-rate) (I- (amount-of-in ?pl ?p2 liquid ?c) flow-rate) (I + (amount-of-in ?pl ?p2 liquid ?c2) gow-rate) (I+ @amount ?c) flow-rate) (I+ @mount ?c2) flow-rate)))

Process describing reaction of organics and aloohol in vessel c.

(defprocess (Reaction ?1 1)

Individuals ((?l 1 :type Reacting-Phase :form (R-P (2-C-L-P organics alcohol ?c)) :conditions (consider (focus ?c))

(contains ?c catalyst)))

Quantity Conditions ((greater-than (mf organics (2-C-L-P organics alcohol ?c)) (reaction-eq-mf organics (2-C-L-P organ& alcohol 7~))))

Relations ((quantity reaction-rate) (greater-than reaction-rate zero) (Qprop reaction-rate

(mf organ& (2-C-L-P organ&s alcohol ?c))) (Qprog reaction-rate

(reaction-eq-mf organics (2-C-L-P organ& alcohol 7~))) (Qprop reaction-rate

(temperature ?c)))

C. A. cATIN et cd.

(mf organ& (2-C-L-P organics alcohol ?c)) reaction-rate) (enthalpy ?c) reaction-rate) (amount-of alcohol (2-C-L-P organics alcohol ?c)) reaction-rate

(amount-of organ& (2-C-L-P orgauics alcohol ?c)) reaction-rate)))

Inlluences ($T (I+

(I-

Predicates used in the reactor scenario

(container preheater) (container reactor) (container cooling-pipe) (container product-cooler)

(substance water) (substance alcohol) (substance organics) (immiscible alcohol water) (miscible organ& alcohol) (miscible organics water)

(contains reactor catalyst) (expect-f-reaction reactor)

(expect organics preheater) (expect organics reactor) (expect alcohol reactor) (expect water cooling-pipe) (expect organics productcooler) (expect alcohol product-cooler) (expect- l-camp-liquid organ& preheater) (expect-1-camp-liquid water cooling-pipe)

(heat-sinked cooling-pipe reactor) (heat-connected reactor cooling-pipe) (heat-connected cooling-pipe reactor)

(consider (mass-source preheater)) (consider (mass-sink product-cooler)) (fluid-connect preheater reactor) (fluid-connect reactor product-cooler)

(consider liquid-only) (consider (phases preheater)) (consider (phases reactor)) (consider (phases cooling-pipe)) (consider (phases product-cooler)) (consider steady-state) (consider (focus-reactor)) (consider reactions)

APPENDIX B

Partial Library of Phenomena for Stripper Model Plus the Scenario Description Used to Build ModeI

(Note: This library contains only active processes and views. Contained-2-Component-Liquid is gjven in Appendix A. Contained-2-Component-Gas is similar.)

Views

View describing liquid-gas streams consisting of a two-component liquid stream (made up of components sl and s2) and a two-component gas stream (made up of components s2 and ~3). Associated with this stream is the liquid-gas equilibrium mole fraction (I-g-quil-mf) of component s2 in the two-component liquid stream.

(defview (Liquid-Gas-Streams ?p 1 ?p2)

Individuals ((?pl :type Contained-2-Component-Liquid :form (2-C-L-P ?sl ?s2 ?st) :conditions (liquid-stream ?st)

(involatile ?s 1)) (?p2 :type Contained-2-Component-Gas

:form (2-C-G-P ?s2 ?s3 ?st2) :conditions (gas-stream ?st2)

(same-vessel ?st ?st2) (inert-gas ?s3)))

Relations ((quantity (I-g-equil-mf 192 7~1)) (not (less-than (1-g-equil-mf ?s2 ?pl) zero))))

View describes a stripping unit which must contain a liquid stream and a gas stream. In a stripping unit, the mole fraction of 92 in the liquid is greater than the liquid-gas-equilibrium mole fraction of 92 in the liquid.

(deftiew (Stripping-Unit ?pl ?p2)

Individuals ((?pl :type Contained-2-Component-Liquid :form (2-C-L-P ?s 1 ?s2 ?st) :conditions (liquid-stream ?st)

(involatile ?s 1)) :type Contained-2-Component-Gas :form (2-C-G-P ?s2 ?s3 Pst2) :conditions (gas-stream ?st2)

(same-vessel ?st ?st2) (consider (stripping-unit ?st ?st2)) (inert-gas 7~3)))

Relations ((quantity (I-g-equil-mf ?s2 ?pl)) (greater-than (mf?s2 ?pl) (1-g-equil-mf?s2 ?pl))))

Generation of qualitative models of chemical process units 599

Processes

Stripping requires that there be a liquid stream and a gas stream present in the same vessel and that the mole fraction of s2 in the liquid is greater than the liquid-gas-equilibrium mole fraction of 92 in the liquid. Stripping increasea both the amount and mole fraction of s2 in the gas, decreases the amount of s2 in the liquid, and increases the mole fraction of sl in the liquid.

Individuals ((‘?pl :type Contained-2-Component-Liquid :form (2-C-L-P ?sl ?s2 ?st) :conditions (liquid-stream ?st)

(involatile ?sl)) ((?p2 :type Contained-2-Component-Gas

:form (2-C-G-P ?s2 ?s3 ?st2) :conditions (gas-stream ?st2)

(same-vessel ?st ?st2) (inert-gas ?s3)))

Quantity Conditions ((greater-than (mf ?s2 ?pl) (1 -g-equil-mf?s2 ?pl)))

Relations ((quantity strip-transfer-rate) (greater-than strip-transfer-rate zero) (Q = strip-transfer-rate (-(mf ?s2 ?pl) (1-g-equil-mf?s2 ?pl))))

Influences ($’ (I, (I+

(amount-of ?62 ?p2) strip-transfer-rate) (amount-of ?s2 ?pl) strip-transfer-rate) (mf ?s2 ?p2) strip-transfer-rate) (mf ?sl ?pl) strip-transfer-rate) (amount-of-in ?sl ?s2 liquid ?st) strip-transfer-rate) (amount-of-in ?s2 ?s3 gas ?st2) strip-transfer-rate)))

Predicates used in the stripper scenario

(container o/w-stream) (container air/w-stream) (liquid-stream o/w-stream) (gas-stream_air/w-stream) (same-vessel o/w-stream air/w-stream)

(substance water) (substance air) (substance organics) (gas-miscible water air) (miscible organics water)

(expect water o/w-stream) (expect organics o/w-stream) (expect water air/w-stream) (expect air/w-stream) (inert-gas air) (involatile organics) (heavy water)

(consider (stripping-unit o/w stream air/w-stream)) (consider (phases o/w-stream)) (consider (phases air/w-stream))