OO Concepts for Process Modelling and Simulation

OO Concepts for Process Modelling and Simulation — An object-oriented (OO) modelling approach which associates a detailed representation of the process structure and of the transformations that the material in the structure undergoes is presented through the illustrative example of a reactor. The structural decomposition of the process devices gives rise to the concepts of elementary devices and ports. The associated elementary model results from combining this structural decomposition with a material object and a set of hypotheses. The complete process model is then generated by aggregation of the available elementary models. By defining models on the level of technological components smaller than the classical unit operations, this modelling approach aims to meet the challenge of the model adaptability to process diversity and complexity. Implementation of this modelling is greatly facilitated by new computer technology and tools, and notably the methods and languages associated with object-oriented analysis and design.


INTRODUCTION
Steady-state and dynamic simulation is the essential complement to experimentation all along the process life cycle, from preliminary studies in the laboratory (i.e.kinetics, phase equilibria) to plant demolition with in between the two synthesis, design, startup and operation steps.Simulation is based on models, real tools of knowledge savings on physicochemical phenomena and unit operations levels.
Today, it clearly appears that the main hindrance to a larger use of simulation in the industrial community is the lack of models really suited to the user's specific needs.This is particularly true for chemical reactors.Reactor modules available in simulator libraries suffer from their generality and hypotheses.The end user, who demands a better representation of the physicochemical phenomena and a perfect match for his application field (refining, petrochemistry, fine chemistry, polymers, biotechnology, food industry, etc.) and for his specific technology, cannot include his know-how and the specificity of his process.
After an overview of existing modelling tools, an objectoriented (OO) modelling approach based on a hierarchical decomposition of the process is presented.Concepts of elementary device, port, material object and elementary model are defined and illustrated by a unit operation, a chemical reactor.

AN OVERVIEW OF EXISTING MODELLING TOOLS
On the conceptual level, and consequently on the numerical level, two approaches historically conflict in process modelling and simulation: the so-called module-oriented (MO) approach and the so-called equation-oriented (EO) approach.
The MO approach is used in the majority of commercial software, such as Aspen Plus TM , PRO/II TM , Hysys TM and ProSim TM .In this approach, the basic element in building the model of the process is the unit operation (UO) model, called module.This corresponds to the classical, and perhaps obsolete, view of a flowsheet.To model his process, the user selects the elementary standard modules from the simulator library, provides design and operating parameters and connects them by streams corresponding to material, energy and information flows circulating between units of the real process.The flowsheet is seen as a graph where the nodes are the modules and the arcs the streams.Modules have been developed by experts in modelling and the end user cannot really insert his own knowledge and the specificity of his process into them.The basic element for decomposing the process, the unit operation, corresponds to too large a scale and does not allow variety.These simulators suffer from their generality which, after having been their strong point, has proved to be ill-adapted to the present demand.
The EO approach is used in most dynamic simulators, such as gPROMS TM .These EO simulators appear above all as differential algebraic equation (DAE) numerical solvers in an environment offering an advanced modelling language.They are renowned for their numerical efficiency.Unfortunately, their UO model libraries are poor, and the user has to play the role of modeller.In the EO approach, the basic elements for building the process model are the equation and the variable, that is to say a numerical view of modelling.This numerical view limits access to these simulators to a small group of experts and not to process engineers.The enthusiasm that followed the advent of dynamic simulators in the early eighties therefore quickly disappeared.
In summary, it clearly appears that the existing modelling environments do not satisfy the appropriateness between available models and the diversity and complexity of physicochemical phenomena and technology.Moreover, they are incompatible with specific interfaces for integrating user models.This last point is the main motivation of the Global CAPE-OPEN project that is in the continuity of the European CAPE-OPEN project (Braunschweig et al., 1999).Standard interfaces have been defined for the four key software components of a modelling environment: unit operation module, physical properties (thermodynamics) package, numerical solver and simulation executive.The objective is to be able to define tailored simulators by assembling software components from various sources.Defining standard interfaces for the key components of existing simulators is major progress in responding to the diversity and complexity of the user's needs, but it is not sufficient.It appears necessary to adopt a new conceptual approach and especially to put aside the unit operation concept without going into a numerical and mathematical view of process modelling.The fundamental aspect for process modelling is the definition of the technological scale of the elementary components which, by aggregation, allow the creation of unit operation, process and plant models.This goes through a hierarchical decomposition of the process structure in which the building block moves from unit operation to technological elements of the devices.This process structure hierarchy is based on an object-oriented approach.

OO MODELLING
As first proposed by Nilsson (1993), an OO modelling approach was adopted to define a general and open OO modelling and simulation environment for dynamic simulation of chemical processes.This environment is based on three main OO software components (Fig. 1), as follows: -ATOM: Applied Thermodynamic Object-Oriented Model, which defines a hierarchical structure of material for physicochemical properties and phase equilibria calculations (Jourda, 1996;Jourda et al., 1996); Figure 1 OO software components of the modelling and simulation environment.
-DISCo: object-oriented numerical kernel devoted to the dynamic simulation of hybrid dynamic systems.This kernel notably includes a DAE numerical solver (Sargousse, 1999); -Odysseo: Object-Oriented Dynamic Simulation Software Environment, which notably defines the process structure hierarchy based on a direct abstraction of the real world (Moyse et al., 1999).This paper focuses on process structure hierarchy and the associated concepts.
The Odysseo modelling approach aims to associate a detailed representation first of the process structure, and second of the transformations that the material in the structure undergoes.The proposed strategy for process modelling can be formalised by the following steps: -the structural decomposition of the process into building blocks in a hierarchy.This gives rise to the concepts of elementary devices and ports; -the creation of the elementary model associated with each triplet: elementary device, material system, set of hypotheses; -the aggregation of the elementary devices and consequently of the elementary models to generate the unit operation models and so on until the complete process model is established.

PROCESS STRUCTURE HIERARCHY
The abstraction of the process is created via a structural decomposition into meaningful physical components in a hierarchy.Uncoupling structure, or topology, material and phenomena is a basic concept.The structural decomposition of chemical processes is accomplished on two levels.The first is the process or flowsheet level and the second results in elementary devices.

Flowsheet Decomposition into Units
The structural description or topology of a chemical plant is commonly described in a flowsheet.Flowsheet describes the whole process with different subsections for reaction, separation, etc.It displays the unit operations, such as reactor, heat exchanger, control system, used in the chemical process and how these units are connected to each other.Thus, a flowsheet represents the first level of breaking chemical processes down into units which are the basic and classical predefined building blocks.

Unit Operation Decomposition into Elementary Devices
Depending on their complexity, the units can have an internal structure of units or subunits and so can be further decomposed.Classical examples of such complex units are distillation columns and reactors.This leads to a hierarchical decomposition and the definition of composite and elementary devices.An elementary device is defined as a simple unit or control volume which is not or cannot be further divided on a structural level.A composite device is defined as a recursive assembly of other composite or elementary devices.As an illustration, decomposing a batch or continuous jacketed stirred tank reactor (STR) composite device (Fig. 2a) is presented.The elementary devices identified are shown in Figure 2b.These are: vessel, agitator, wall and jacket.Just to give an idea of the combinatorial explosion due to technology, Figure 2c shows various types of agitators.The same applies for vessels and cooling systems.Technology has an impact on physicochemical phenomena and must be taken into account.Thus, a unit operation appears as a combination of elementary devices and means of communication with the surroundings.These media are technological elements, such as flange, interface, wire respectively used for material, heat and information transfer with other elementary devices (Fig. 2d).
By decomposing one unit operation into its technological elements, the internal details of the unit are abstracted and the structure becomes more comprehensible.Elementary devices

Figure 2b
Elementary devices of the jacketed STR.

Figure 2c
Various types of agitators.
of one unit can be reused as parts of other units.Elementary devices are the new key building blocks proposed for process modelling.They correspond to components smaller than the unit operations and aim to increase modelling power and thereby provide a solution to technological combinatory explosion.Elementary devices must be analysed under different aspects: -the structural aspect, with the topological description of the elementary device which notably defines the boundaries or control volume and communications with the outside world.This last point leads to the concept of ports; -the material aspect, with the description of the material system that the elementary device contains; -lastly, the phenomenological aspect, with a mathematical description of the physicochemical phenomena which take place.This phenomenological description depends on structure and material but also on the hypotheses made.

Ports
As mentioned earlier, elementary devices have different means of communicating with the surroundings such as a flange for material flow, a wall for heat transfer, a driving shaft for mechanical energy and wires for measurements from sensors or actions from control systems.All these technological components allow an elementary device to exchange information with one or possibly several other elementary devices.
On the conceptual level, a port is defined as an abstraction of a location on a physical device, where material, energy, or information enters or exits.All connections between different unit operations, composite devices or elementary devices are accomplished with ports.Ports can be described along two axes.The first is modelling causality (inlet or outlet), and the other is the functionality of the connection: a port can be a communication port where the exchange of typed data is similar to a digital connection, or a transport port, where the exchange is qualified by a flux and a potential.Thus, there are four kinds of generic ports that can be clearly typed for specific content.
The connection between an input port and an output port is made by sharing content reference.Only the output port hosts the shared object.Communication ports (Fig. 3a) share a variable or a more complex object.An output communication port can be connected to several input communication ports: they all share the same references.There is no concept of flux, and thus their content can be broadcast to many inlet ports.On the other hand, transport ports (Fig. 3b) share a flux and a variable or a more complex object such as material or energy.The flux is defined as a M T Interface (heat) Flanges (material) Wire (state variables) Driving shaft (mechanical energy)

Figure 2d
Communication means of the jacketed STR.
function of the difference of potential variables (outputinput) of the two interconnected transport ports.The potential of a transport port is a weight that determines towards which ports a real flux can be considered.The difference in potential is the driving force for the flux.This flux is defined by convention to be positive when it goes from an output port to an input port.The connection between an input transport port and an output transport port gives visibility to both in and out potentials (Fig. 3c).
Six kinds of ports are defined: -material input and output ports: these ports allow material transfer.They contain an ATOM phase object.By including the phase object in the material port, not only the set of independent variables defining the intensive state of a material system (i.e. for normal fluids: composition, temperature and pressure) are accessible but also all the methods for calculating thermodynamic properties.The flux is a material flow and the potential is the pressure in the device at the port.Material ports transfer only a single phase (solid, liquid or vapour); -energy input and output ports: in this case, the flux is a power variable and the potential, in the case of thermal energy, is the temperature of the device at the port.Note that the attribute output denotes that the heat flux is determined by the associated elementary device and an input energy port receives the heat flux from an output energy port; -communication input and output ports: these ports exchange any variable or more complex object.This can be temperature, pressure, operating parameters or any other distinctive object from a device.They are useful for some specific devices such as controllers and transmitters for example.Communication ports can be specialised to exchange specific types of objects.Communication ports.

Shared object Out potential
In potential Flux

Figure 3c
Input and output transport ports connected.

Material System
An elementary device has to be associated with a material system.Figure 4 shows the simplified unified modelling language (UML) diagram giving the hierarchical structure of material as proposed by Jourda et al. (1996) in ATOM.Note that the UML class diagrams represent the software architecture and are used as a tool for OO analysis and design.A material system contains all the information concerning the description of matter.These are the state variables (for normal fluids: composition, temperature and pressure) and the different phases existing in the material system.The material system is associated with different thermodynamic models that can calculate the phase physicochemical properties, such as density, enthalpy, and phase equilibria.An extension of the ATOM phase system that supports chemical reactions has been suggested by Moyse et al. (1999) and a specialisation for polymerisation reactions by Skowrowski (2000).

Elementary Model
The elementary device is associated with an elementary mathematical model to describe the physical behaviour of the process.Elementary devices are control volumes on which balances are defined.Global and partial material balances are generated in accordance with the physical state and the causality and number of its material ports.An energy balance is generated in accordance with the causality and number of material and energy ports.All balance equations are automatically generated for any elementary device.The formulation of this mathematical model, including the overall and partial mass, energy and possibly momentum balances, must be as general and flexible as possible.The model contains additional algebraic equations associated with kinetic, transfer, holdup and thermodynamic terms.Generally, one algebraic equation links one physicochemical property to the independent variables (i.e.temperature, pressure, composition) defining the material system via a model.More specialised equations can also be introduced for specific devices.The complete elementary model is built on the triplet basis: elementary device (control volume and ports), material system, set of hypotheses.
As an illustration, the elementary model associated with the vessel elementary device of the jacketed STR is shown in Figure 5.The material object corresponds to one liquid phase and the vessel is assumed to be perfectly stirred.The vessel has one input and one output material port as well as one energy output port.

COMPOSITE DEVICES AND AGGREGATION
Composite devices, such as unit operations, result from the aggregation of elementary devices or other composite devices.Aggregation is the connection of ports of elementary devices to generate a new building block, the composite device.The visibility of composite devices is limited to their defined boundaries, and communication with other devices is achieved by means of ports.The composite device ports are only references to the inner nonconnected ports of the elementary devices.The composite device receives all the    Jacketed STR composite device.information needed from its elementary devices.The composite device model results from the aggregation of its elementary device models and some specific model equations can be added on the composite device level.The jacketed STR composite device model is presented in Figure 6.It results from the aggregation of the three elementary models associated with the vessel, the wall and the jacket, respectively.The wall elementary model has one input and one output energy port connected to the output energy port of the vessel elementary model and to the input energy port of the jacket elementary model, respectively.Consequently, the wall receives the heat flux from the vessel and transmits it to the jacket.The jacket elementary model has one input energy port, one input and one output material port.The material associated with the jacket elementary device corresponds to the thermal fluid while the one associated with the vessel corresponds to the process fluid.

TUBULAR REACTOR OO MODELLING
A tubular reactor is taken as an example to illustrate the potential of the proposed OO modelling approach.It is shown that elementary devices, defined from a jacketed STR, can be directly used to generate the tubular reactor model.
To allow the dynamic simulation of a tubular reactor, it is generally discretised in space in the axial direction.Note that the axial discretisation is of mathematical nature rather than structural.Tubular reactor discretisation in the axial direction leads to reactor slices along the z-axis.When one reactor slice is examined in the radial direction different structural entities can be determined: an inner tube slice, a wall slice and an outside shell slice.This structural decomposition represents a second-level decomposition of the tubular reactor: first the discretisation into reactor slices and second the structural decomposition into tube, inner wall and shell slice.
Under some hypotheses (such as perfect mixing), the elementary models associated with tube, wall and tube elementary devices are equivalent to those associated with vessel, wall and jacket already defined for the jacketed STR.Thus, the complete tubular reactor is easily generated by aggregation as shown in Figure 7.At the lowest level, the elementary vessel, wall and jacket devices are aggregated to form a slice of the reactor.The reactor slice is a composite device.The inner ports of the original elementary devices are used in two different ways.Heat exchange occurs in the radial direction.Therefore, the inner energy ports are connected to each other to make up the reactor slice.The material ports in the axial direction are not yet connected.The reactor slice makes the inner material ports of the elementary devices available on the composite device level.This means that the ports of the reactor slice are references to the inner ports of the elementary devices.In parallel to the aggregation of the elementary devices, the related models are aggregated to make up a composite device model.
In a second-level aggregation, the material ports of the reactor slices are connected to give a new composite device, the tubular reactor.Depending on the order in which this connection is made, either a countercurrent or a cocurrent tubular reactor is defined.The reactor slice models are again aggregated to make up the reactor model.Tubular reactor composite device.

CONCLUSION
In this paper, a hierarchy of chemical process structure has been presented through an illustrative example, a chemical reactor.The basic element, the elementary device, has been characterised by its ports, its phase system, its hypotheses and its associated elementary mathematical model.Once the elementary devices are specified, decomposition is reversed by aggregating the elementary devices to make up composite devices, unit operations and finally the chemical process.
By defining models on a level of technological components smaller than the classical unit operations, this OO modelling approach aims to meet the challenge of model adaptability to process diversity and complexity.The elementary device model library is progressively becoming richer.This should considerably shorten the development time for new unit operation and process models.Implementation of this type of modelling is greatly facilitated by new computer technology and tools, and particularly the methods and languages associated with object-oriented analysis and design.
The proposed approach increases model reusability and extendability and thus allows construction of tailored simulation packages, perfectly adapted to the user's needs.

Figure 4
Figure 4Hierarchical structure of material (simplified UML class diagram).

Figure 5
Figure 5Elementary model associated with the vessel elementary device.