*6.2. Graphical*

The ontology defines the base entities, and the equations describe the behaviour of these entities. For the physical systems, we have combinations of the time-scale behaviour, the distribution effects and the present tokens. By linking the mathematical behaviour description to graphical symbols, we generate a visual modelling language, to which the remaining paper shall be devoted. The graphical language uses a small number of visual symbols. For each discipline, a few capacity components and a few transport components remain to be defined. Appendix A shows a table of symbols for macroscopic physical systems and control.

The structure of the model, in terms of its composition of basic building blocks, is the main model-design issue, and not the equations. We can define the basic blocks' behaviour, except for the specific material models, which have to be injected at the initialisation stage. A very elegant solution has been suggested and realised by Bjørn-Tore Løvfall's PhD documented in his thesis [14]. He constructs one of the energy functions, usually Helmholtz, from two state equations, which serve as models of the specific material's behaviour. Legendre transformation provides the additional energy funtions. The properties then are defined by derivatives of the surface with respect to state-dependent variables. Automatic differentiation makes the sytem tick.

The graphical language is an excellent model design tool. We not only teach it in our modelling course, we also use it extensively in projects to discuss the model structure. We shall now discuss a few examples.

#### **7. Graphical Model-Design—Three Examples**

This section discusses three examples demonstrating the power of the graphical model design and their use in ProMo's model composer. An explanation for graphical symbols is in Appendix A.

#### *7.1. Stirred Jacketed Tank*

First, we look at a standard piece of equipment, the stirred tank reactor. Figure 7 shows a possible configuration.

**Figure 7.** The configuration of a jacket tank with an inflow, an overflow and a breathing pipe for pressure compensation.

The tank is connected to one liquid feed, has an overflow, and is "breathing" to the outside. The jacket controls the temperature of the contents. Figure 8 shows a relatively detailed model for energy flows but a relatively simple model for the reaction fluid.

**Figure 8.** A relatively complex model without condensation on the lid.

The overflow is of interest: an imaginary controller switches the overflow on when the level in the tank has reached the maximum. In the following examples, we use this approach of "control" to handle events that change the configuration of the model. The controller shown in Figure 8 is not real, but implements the event of reaching the fluid level in the tank when the overflow begins to become active. The graphical language also enables model reduction or model simplification. Different applications require different details, and rougher or finer granularity. We can apply a series of assumptions:


**Figure 9.** A simplified tank model. No heat loss through the outer shell, lid and gas phase; "breathing" is neglected, jet is event-dynamic.

This helps us to achieve a significant simplification, shown in Figure 9. Onecansimplifythemodelfurther byassuming:

 •Theoutershellhas anegligiblecapacity;

• The contents is ideally mixed—thus, mixing is very fast, resulting in uniform conditions;

•The fluid flow in the jacket is extremely fast—yielding uniform temperature in the jacket. This yields a much more simple model, as shown in (Figure 10).

**Figure 10.** An even more simplified tank model. The outer wall is neglected and jacket, and the contents are lumped.

#### *7.2. Melting Process*

This second example focuses on "model control". It shows the melting of a solid as shown in Figure 11. The process itself is rather straightforward: a solid is exposed to a heat source and heated up. Once the melting temperature at the hot surface has been reached, a liquid phase is generated. The model switches to describe two phases, assuming that the solid has no direct contact with the hot surface, and a liquid film is in between the solid

and the surface. The liquid's thermal distribution effect can be quite complex, and is not shown at this level of description.

**Figure 11.** A generic melting process demonstrating how the model switching is included in the model, leading to a surprisingly complicated overall model.

The topology indicates a connection to molecular modelling, which, as shown, implies close coupling, thus running the molecular modelling task at every point in time. Molecular codes are notoriously computationally intensive and slow. There is at least one unique method, COSMO [15], which works for some configurations well and is fast. Close coupling is not an option for the codes that minimise a vast number of molecules' overall energy. In these cases, the approach used replaces the molecular modelling module with a surrogate model that spans the variable space sufficiently and is of a simple structure. The molecular modelling task is replaced by an input/output function with the property function in a subspace of the fundamental variables, such as *p*, *T*, *n*.

#### *7.3. Moving Boundary Problem*

Many processes are characterised by one part of the material growing at the cost of another. We take the example of a corrosion process: an iron-rod-reinforced concrete pillar in water. The problem is well known and of broad interest. Water, carbon dioxide, chlorine anions and oxygen mainly diffuse into the concrete and cause the iron to oxidise, resulting in a loss of strength over time. Since it is not the reaction that is of interest, Figure 12 shows a model representing the process with a simplistic abstract reaction. The main issue, in this case, is to demonstrate the approach used to model moving boundaries.

**Figure 12.** Rusting iron in concrete is an example of a moving boundary problem. The top row shows the species present in the respective capacities, while, in the lower row, the transfer constraints for the intrafaces and the reactions in the point capacity are shown.

The reaction is placed into an infinitely small reaction front, represented by an infinitely small volume where the reaction occurs, and the point capacity is combined with restrictive intrafaces to the left and right. The rust is transported to the left, while iron comes from the right. The species water, active component and rust do not transfer into the iron <sup>¬</sup>[*<sup>W</sup>*, *A*, *<sup>R</sup>*], and iron is not transferred to the rust <sup>¬</sup>[*I*]. Rust and concrete are not transferred between the rust and the concrete domain, and concrete is not transferred into the water.

The Figures 13 and 14 show two pictures taken from ProMo's model composer. Figure 13 shows the top layer, while Figure 14 shows the model of the pillar with the iron embedded in concrete and the reaction front receiving iron from the iron bar, converting it into rust, which is transported to the rust node, representing the rust capacity.

The ProMo software uses simple graphical objects limited to ellipses and rectangles for visual representation. Decorators are used to indicate the membership to networks— liquid and solid in the example—in the form of circles. The membership to specialised networks, like concrete, rust or iron, is indicated by coloured circles. ProMo provides an editor that allows the user to design the graphical object. Arcs are directional, with the tail as a small circle and the head a larger and darker circle. Intrafaces are the black squares.

**Figure 13.** Rusting iron in concrete, a view of the ProMo's graphical modeller showing the top of the hierarchy with the pillar in the seawater. The seawater is modelled as a reservoir system (large mauve circle) with two circular indicators attached, as seawater is a liquid. The black dot indicates mass, and the "W" and "A" stand for the species water and active component.

#### *7.4. Other Applications*

The reader may be interested to learn that we used this graphical approach for very many different processes. In process modelling lectures, we discuss tanks, mixing models, heat exchangers, distillation, chicken coop and greenhouses and wood drying and fruit transport, life-support systems, fermentation processes, biological cells, water treatment plants, solar reactor, mammal blood flow, moving bed reactor, decaffeination plant, a methanol plant, laboratory equipment like Soxhlet, mokka maker, crystaliser, bubble column, etc.

We used the same approach in European projects, including the modelling of polyurethane foams, production of high-precision ceramic products, biorefining processes, wastewater cleaning plants, transport of fruit and vegetables, life-support systems for space travelling, membrane processes, catalytic bed reactors, coating processes, etc.

**Figure 14.** Rusting iron in concrete, a view of the ProMo's graphical modeller showing the pillar model. The concrete and rust are modelled as distributed systems (ellipses). The reaction front is modelled as an infinitely small lumped system (black dot), decorated with the large red dot indicating the reaction front and the green dot indicating the solid. The iron is modelled as a lumped system. "R", "I" stand for the species rust and iron. The left strip elements show the parents, while the ones on the right are the siblings in the hierarchy.

### **8. Conclusions**

Motivated by reductionism, models are seen as directed "networks", where abstract "tokens" live in nodes and move about through arcs. The concept of "tokens" allows us to apply the network concept to different disciplines, thereby enabling the multi-disciplinary and multi-scale model building process. The nodes are then capacities for the tokens, and the arcs' transport tokens.

For physics, the tokens are first the conserved quantities that form the basis of the Hamiltonian's and the contact geometry's configuration space. Since we also model reactive systems, the tokens are extended to refining mass with species, consequently augmenting the representation with balances. This approach thus captures the physical system on all levels, including electronic and atomic, and particulate and macroscopic systems. For some particulate processes, the behaviour description is augmented with population balances. For financial systems, the tokens are monetary values. The node represents an account, with the monetary value being the state, and interest plays the role of a production term similar to the role that reactions take in component mass balances.

Reductionism is applied recursively, resulting in a hierarchical representation of the modelled process. The subdivision is continued until a basic level is reached, where "basic" implies that it can be considered a basic building block. The definition of "basic" is the smallest granules in the decomposition process, such that the resulting model serves the intended purpose.

ProMo implements an ontology, which captures the knowledge of a user-defined application domain, which, in turn, reflects the hierarchy of disciplines considered for the application domain. For each discipline, the ontology defines the infrastructure for the definition of the model structure and the behaviour description, with the latter being a multi-bipartite graph of variables and their defining relations. This bipartite graph captures the behaviour of each basic building block for all involved disciplines. The variable/expression set is lower triangular in the sense that one begins by defining the state that reflects the relevant tokens in a node. We allow for multiple definitions of the variables, thereby supporting the use of principle definition equations as well as more practical versions, which ultimately enables the substitution of a complex with a simple model, also termed the "surrogate".

The ProMo suite resolves a number of issues in process modelling:

**Incompleteness and consistancy:** The systematic approach of constructing the variable/expression system guarantees the completeness of the model equations. The fundamental base used to describe the entity's behaviour models is tiny, namely, the thermodynamic and mechanical system's configuration space. Physical units and dimensionality is defined only for the fundamental quantities. They automatically propagate when defining new variables.

**Code generation:** is automated and does not require manual intervention. The entity behaviour code is centralised and not distributed over unit models, as this is commonly the case in chemical engineering software.

**Documentation:** The expressions defining a variable are compiled as part of the definition process. Consequently, the documentation is complete and available during definition time.

**Closure:** Defining the fundamental behaviour equations as the conservation equations has two main advantages: (i) the equations are not substituted, and (ii) the closure of the balances can be guaranteed for the defined accuracy.

**The graphical model-design language:** enables us to capture the structure of the modelled process and generate alternatives quickly. The simplicity makes it an efficient discussion tool for exploring functionality, required detail, involved disciplines, and complexity to generate alternatives.

**Funding:** ProMo research was funded in part by: (i) Bio4Fuels Research Council of Norway (RCN) project 257622 (ii) MARKETPLACE H2020-NMBP-25-2017 project 760173. (iii) VIPCOAT H2020- NMBP-TO-IND-2020 project 952903T (iv) MODENA FP7-NMP- Specific Programme "cooperation": Nanosciences, Nanotechnologies, materials and new Product Technologies Grant agreemen<sup>t</sup> ID: 604271.

**Acknowledgments:** I gratefully acknowledge the contributions of the doctoral students who worked on this project over the years: Tae-Yeong Lee (TAMU), Mathieu Westerweele (TUE), Sigve Karolius (NTNU), Arne Tobias Elve (NTNU), and Robert Pujan (NTNU, DBFZ) and several master students and PostDoc Niloufar Abtahi.

**Conflicts of Interest:** The author declare no conflict of interest.

#### **Appendix A. Graphical Symbols**

The number of graphical items required to discuss controlled, physical processes is small. The following set was sufficient in the cases where we applied the method to applications including basic units: tanks, mixing models, heat exchangers, distillation, chicken coop and greenhouses and wood drying and fruit transport, life-support systems, fermentation processes, biological cells, water treatment plants, solar reactor, mammal blood flow, moving bed reactor, decaffeination plant, methanol plant, laboratory equipment like Soxhlet, mokka maker, crystaliser, bubble column, polyurethane foam, pressure distributions in plants, molecular modelling of polymer/ceramic powder mix, melting processes, and more.

**Figure A1.** A starter set of graphical symbol defining the graphical modelling language.
