CHEMICAL ENGINEERING TRANSACTIONS VOL. 81, 2020 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Qiuwang Wang, Min Zeng, Panos Seferlis, Ting Ma, Jiří J. Klemeš Copyright © 2020, AIDIC Servizi S.r.l. ISBN 978-88-95608-79-2; ISSN 2283-9216 Automated Synthesis of Process-Networks by the Integration of P-graph with Process Simulation Jean Pimentela, Ákos Oroszb, Raymond R. Tanc, Ferenc Friedlerd* aUniversidad Nacional de Colombia, Cra 45, Bogotá, Colombia bUniversity of Pannonia, Veszprém, Egyetem u. 10, 8200 Hungary cDe La Salle University, 2401 Taft Avenue, 0922 Manila, Philippines dSzéchenyi István University, H-9026 Győr, Egyetem tér 1, Hungary f.friedler@ga.sze.hu Chemical process simulation has become one of the most important tools for the analysis of process networks. The simulation software currently available are not capable of automatically generating the process structure, the designer must provide it as an input for the simulation. This limits the contribution of simulation to the latter stages of design after the structure has been clearly defined. Since the P-graph methodology was originally conceived to generate process structures systematically, it can be used to produce the topology of the problem automatically based on rigorous combinatorial axioms and algorithms. In this work, the properties of two P- graph algorithms are exploited to automatically generate alternative structures in a commercial simulator, conferring the latter an improved capacity to assist during the early stage of design. Initially, the maximal structure generation (MSG) algorithm is employed to identify a rigorous superstructure from the initial set of plausible operating units. The solution structure generation (SSG) algorithm is then used to enumerate all combinatorially feasible processes included in the superstructure. Each process structure is individually exported to Aspen Plus®, where rigorous models are used to simulate its performance. A set of alternative processes ranked by their economic performance can be generated. This integrated methodology is employed in a case study for producing methyl lactate from methanol and lactic acid. This work demonstrates that integration of P-graph with rigorous simulation constitutes an enhanced tool for process synthesis that automates the generation of process alternatives, providing useful information and additional insight of the synthesis problem. 1. Introduction The growth of computational power during last decades has resulted in the employment of computer aids in numerous disciplines including chemical engineering. One of the most employed tools in this field is the simulation of chemical and biochemical processes. Nowadays, there is a wide selection of simulation software available in the market, which include extensive built-in features such as thermodynamic models, component databases, equipment databases, etc. Foo et al. (2017) give a brief description of the key features of these software packages. In simulation software, the user needs to manually define and input the network topology to be simulated, i.e. the included operations and the connectivity between them; this task is usually based on experience and insight guided by engineering know-how and heuristics (Seider et al., 2003). Subsequently, simulation calculations can be performed within these predefined structures (Foo et al., 2017). This procedure entails trial and error, and can often lead to sub-optimal solutions due to “topological traps” with structural decisions severely limiting the performance of the resulting designs (Friedler et al., 2019). The current generation of commercial process simulation software can be enhanced significantly by adding the capability of automatically generating candidate flowsheets from a set of plausible operating units pre-defined by the designer based on rigorous principles. There have been attempts to address this gap. For example, computer-aided molecular design (CAMD) techniques have been adapted for synthesis of candidate networks for simulation and optimization. This approach determines process networks from process units following similar principles used for generating DOI: 10.3303/CET2081196 Paper Received: 30/04/2020; Revised: 22/06/2020; Accepted: 24/06/2020 Please cite this article as: Pimentel J., Orosz Á., Tan R.R., Friedler F., 2020, Automated Synthesis of Process-Networks by the Integration of P-graph with Process Simulation, Chemical Engineering Transactions, 81, 1171-1176 DOI:10.3303/CET2081196 1171 molecules from functional groups via CAMD (Tula et al., 2015). Relevant process flowsheet engineering characteristics such as energy consumption can also be estimated, based on empirical process group- contributions (D’Anterroches and Gani, 2005). As an alternative procedure for systematically generating feasible possible structures, Friedler et al. (1993) have introduced a hybrid synthesis methodology that consist of set of combinatorial algorithms and axioms, known as the P-graph framework. The P-graph framework is a graph theoretic framework for rigorous process network synthesis (PNS), the algorithms derived from its axioms have proven to be effective in the solution of problems with combinatorial nature, such as the synthesis of heat exchanger networks (Orosz et al., 2019) or the planning of evacuation routes (Garcia-Ojeda et al., 2012). Further information regarding applications of P-graph methodology can be found in the work of Lam (2013), and the contribution of Cabezas et al. (2018) that reviews some applications related to sustainability. The algorithms of P-graph framework have the capability to automatically generate a rigorous superstructure, and then enumerate all combinatorially feasible processes contained on it; and they can identify the n-best network structures in PNS problems (Friedler et al., 1992). Enumeration of n-best optimal and near-optimal solutions is a useful feature in engineering, since in practice near-optimal solutions may be comparable to the nominal optimum with advantageous features such as higher robustness (Tan et al., 2017). The P-graph framework can enhance simulation tools for process design, since from its formulation it intends to systematically generate an error-free superstructure (i.e., maximal structure) from the set of candidate operating units selected by the designer and identify different process configurations to be tested in the simulation environment; the set of axioms can reduce the computational effort derived from structural infeasibility that can emerge during optimization. In a recent prospective paper, Friedler et al. (2019) stated “the most important research challenge is to utilize the capability of P-graph to generate alternative configurations during process synthesis or flowsheeting.” This work addresses the aforementioned research gap by developing a procedure to use the maximal structure generation (MSG) and solution structure generation (SSG) algorithms of P-graph to generate candidate flowsheets for detailed simulation in commercial software. A prototype program developed in Visual Basic for Applications (VBA) is used to generate network structures which are logged in an Excel spreadsheet and exported into Aspen. The simulator is then used to evaluate a selected objective function. The simulation results are then re-imported into the spreadsheet for further analysis and decision-making 2. Methodology The maximal structure generation (MSG) algorithm systematically generates a rigorous superstructure that contains all possible structures from the set of specified process units. The solution structure generation (SSG) algorithm enumerates all combinatorially feasible structures, i.e., all feasible flowsheets comprised in the superstructure. This work links the MSG and SSG algorithms to a commercial flowsheeting software to automate the generation of candidate flowsheets. Aspen Plus® was selected as the simulation environment because of its wide employment in the industry, however, the method can be implemented for other simulators. Connection between Aspen and P-graph methodology was realised by combining the ActiveX automation feature of the simulator (Aspen Technology Inc., 2000). The ActiveX control enables an external software to modify the operations included in the simulation environment, and the connectivity between them. It is possible to create and calculate process structures in the simulation software without the direct intervention of the user. In this contribution, the external software that seizes the ActiveX feature for controlling the simulation environment is Visual Basic for Applications (VBA), employing it as the user interface for the introduction of the initial information of plausible operating units, and the extraction of performance criteria from the simulation results. Interaction between both software and the designer is depicted in Figure 1. Because of the hybrid nature of P-graph framework, automatic generation of structures in the simulator initiates with a judicious analysis of the synthesis problem to determine the set of candidate operating units, and the concomitant materials that are going to be included in the superstructure. Subsequently, each type of operation is assigned to one of the equipment models available in the simulator’s library (e.g., Distillation to RadFrac, or reaction to CSTR, etc.), so that all the units in the maximal structure can be represented by a model block in the simulator. Besides, an initial estimate of parameters for the operating units, such as conversion and recovery, should be provided depending on the conditions required by the simulator. A parametric optimization of these conditions can be performed after its generation in the simulation environment; however, since this contribution focuses on the generation of feasible process structures in the simulator, this will be addressed in future works. The set of plausible operating units and their materials are employed as the input information for the MSG and SSG algorithms; these algorithms are implemented in Excel and VBA. The SSG algorithm identifies and enumerates the set of combinatorially feasible structures that can be generated from the specified operating units, and then, each of these structures is exported to the simulator. The information regarding the process structure delivered by SSG is used to insert the block models related to each operating unit vertex included in 1172 the network. Information of material vertex is employed to automatically connect the corresponding units between them, creating a flowsheet in the simulation environment. Once the structure is completed, the simulation is initiated under the control of the VBA module. Output data from the simulations, such as energy consumption, columns vapor flow or catalyst weight, are then sent back and compiled in the Excel spreadsheet to evaluate the performance of the various alternatives. Figure 1 summarises this interaction between P-graph and the simulator. Figure 1: Flow of information between designer, VBA, and simulator during for the generation of structures The methodology described above was deployed for synthesizing a process that generates of methyl lactate from lactic acid and methanol, considering the profit generated by the process as the indicator of its performance. Methyl lactate (ML) is an ester usually present as an intermediate during lactic acid’s purification. Along with other lactates, it has attracted attention for its degradability properties, as well as its lower toxicity when compared with traditional solvents (Bowmer et al., 1998). It can be produced from the esterification reaction between lactic acid and methanol. Here, the methodology developed is used to synthesise the optimal, and a set of near-optimal flowsheets capable of generating methyl lactate with a minimum mass purity of 98 % from a mixture water(W)- lactic acid (LA) and methanol (M). Esterification is carried out at 80 °C in a packed-bed reactor (REACT) filled with ion- exchange resin. The reactor’s output is a mixture of ML, water, and non-reacted materials (R OUTPUT), which are separated to generate the final product, and to recover the non-reacted materials (M and LA) that can be recycled into the reaction step. The product selling price and raw material costs are estimated from market analysis. Table 1: Plausible operating units selected for the case study Operation Feed Distillate Bottoms Simulation block model D1 ROUTPUT M W, ML, LA DSTWU/RadFrac D2 ROUTPUT M,W,ML LA D3 W,ML,LA W ML,LA D4 W,ML,LA W,ML LA D5 M,W,ML M W,ML D6 M,W,ML M,W ML D7 ML,LA ML LA D8 W,ML W ML D9 M,W M W DD10 R OUTPUT M, W ML, LA REACT M, LA OUTPUT: R OUTPUT RPlug 1173 Distillation is selected as the main separation method because of the availability of binary interaction parameters for vapor-liquid equilibrium, the UNIQUAC-HOC model was deployed to model vapor-liquid equilibria with binary data from literature (Sanz et al., 2003). Consequently, a set of distillation towers were identified to separate the components according to their normal boiling points. Table 1 presents the plausible units selected for separation and reaction in the case study, and the model block used to represent them in the simulator; operating conditions of such units were defined by means of reduced models and literature review. The final set of plausible operations reactor REACT, the distillations D1 to DD10 and a pair of mixers termed as LA and MET, required for the recycle of unreacted materials for differentiating them from the fresh input of raw materials (termed as LARAW and METRAW in subsequent figures). The different types of operations considered for the synthesis problems are depicted in Figure 2. Profit was selected as the performance criterion for evaluating the structures. Total annualized cost (TAC) is calculated for each network based on estimated capital and operating costs. Figure 2: Conventional and P-graph representations of (a) distillation towers, (b) the reactor, and (c) recycle mixers The cost of catalyst for reaction was also included into the investment cost estimation for the reactor. Besides, a material factor was employed to estimate the additional investment cost required to construct the towers with a material suitable for handling lactic acid. All costs were calculated assuming 8,700 working hours per year and a pay-out period of 10 y. MSG can be used to generate the maximal structure which is shown in Figure 3. Figure 3: Maximal structure for the case study as (a) P-graph representation and (b) representation in simulation software The physical feasibility of a determined network is verified based on the final status of the simulation. If, after a user-defined maximum number of iterations is completed, the simulation fails to converge the search procedure continues with the next structure. The non-feasible solution is labeled, so it can be re-visited for further analysis of the failure to converge. 1174 3. Results The implementation of SSG identified 106 combinatorially feasible structures out from the maximal structure of Figure 3. All structures were automatically generated and simulated in Aspen Plus in a total time of 8 min in a computer with processor Intel Core i5, 8GB RAM, (i.e., with a computing time of about 10 s per structure). 38 of the combinatorially feasible structures resulted in feasible processes for generating methyl lactate, these structures were ranked based on profit. The results of the economic evaluation for the first 10 best structures are presented in Table 2. Table 2: Results of economic evaluation for the 10-best process structures synthesized for the case study Solution Profit (USD/y) Income (USD/y) TAC (USD/y) Annualized capital cost of units (USD/y) Operating cost of units (USD/y) Unit cost of product (USD/t) 1 14,673,845 30,908,841 16,234,996 117,508 384,853 1,313 2 13,787,387 30,084,672 16,297,285 137,950 426,701 1,354 3 13,660,147 30,247,042 16,586,895 205,985 648,275 1,371 4 13,620,787 30,084,674 16,463,887 220,454 510,798 1,368 5 13,600,413 30,165,955 16,565,542 227,059 605,848 1,373 6 13,552,189 30,084,615 16,532,426 237,281 562,510 1,374 7 13,498,999 29,738,334 16,239,335 169,266 337,434 1,365 8 13,396,473 29,897,463 16,500,990 237,139 531,217 1,380 9 13,390,213 29,478,067 16,087,854 138,648 216,571 1,364 10 13,337,523 29,811,842 16,474,320 257,951 483,734 1,382 The structure of the best solution is presented on Figure 4. In this solution, the four components are divided in groups of two, (M, W and ML, LA). Subsequently these 2 mixtures are separated by individual towers yielding the product, and an azeotropic mixture of water and ester. The remining reactants are recycled into the process. Figure 4: Representation of best structure for case study of methyl lactate generation (profit USD 14,673,845 /y) depicted as (a) P-graph representation and (b) conventional representation The structure shown in Figure 4 is a counterintuitive solution that does not correspond either to the direct or indirect distillation sequences. In this network, methanol and LA present enhance the separation ratio of the mixture, avoiding the binary azeotrope between the water and the ML, this improves the recovery ratio of the final product, and increases the process income while reduces the cost per unit of product. The automated structure generation capability can be a valuable aid to the design process by augmenting the designer’s knowledge by discovering alternatives that are not immediately apparent. Useful insights can be extracted from analyzing the sub-optimal processes. For instance, in structures 2 and 4, the contribution of the operating cost to the TAC is smaller than the corresponding value for the optimal structure. Since the operating costs consist of cooling and heating expenses, this result means that the new solution is more energy efficient than the optimal solution. The alternative solution is more robust in face of variations in the cost of energy. This is a significant result because energy price can vary widely during the operating life of 1175 a process plant. This case study demonstrates how P-graph can generate designs with superior features that may be revealed only via the comprehensive enumeration capability. 4. Conclusions In this work, a P-graph based methodology for automated network generation for process synthesis and simulation has been developed. The procedure was implemented via a prototype program to demonstrate the enhancement of commercial process simulation software Aspen Plus with automated process network generation capabilities via the MSG and SSG algorithms of the P-graph framework. This methodology was demonstrated on the synthesis of a process for producing methyl lactate from methanol and lactic acid feedstocks. The enumeration capacity of P-graph results a key feature for the identification and subsequent evaluation via simulation of all combinatorially feasible processes derived from the set of plausible operations initially defined by the designer. Multiple alternative flowsheets representing cost-optimal and near-optimal solutions were generated efficiently for the case study; this set of alternative processes confers to the designer the capability of elucidating unexpected networks, which may result superior performance because of properties of interest for process development, such as controllability, environmental impact or energetic efficiency. Future development will be addressed to the employment of the ABB algorithm along with reduced models to pre-select the best candidate flowsheets and reduce computational effort. It is also of practical interest to apply this methodology using other commercial simulation software. References Aspen Technology Inc., 2000, Aspen Plus®: Aspen Plus User Guide. Cambridge, MA: Author. Bowmer C.T., Hooftman R.N., Hanstveit A.O., Venderbosch P.W.M., Hoeven N. van der, 1998, The Ecotoxicity and the Biodegradability of Lactic Acid, Alkyl Lactate Esters and Lactate Salts, Chemosphere, 37 (7), 1317– 1333. Cabezas H., Argoti A., Friedler F., Mizsey P., Pimentel, J., 2018, Design and engineering of sustainable process systems and supply chains by the p-graph framework, Environmental Progress and Sustainable Energy, 37 (2), 624–636. D’Anterroches L., Gani R., 2005, Group contribution based process flowsheet synthesis, Design and Modelling, Fluid Phase Equilibria, 228–229, 141–146. Foo D.C.Y., Chemmangattuvalappil N., Ng D.K.S., Elyas R., Chen C.L., Elms R.D., Lee H.Y., Chien I.L., Chong S., Chong C.H., 2017, Chemical engineering process simulation. Amsterdam, Netherlands: Elsevier. Friedler F., Tarjan K., Huang Y.W., Fan L.T., 1992, Combinatorial algorithms for process synthesis, Computers & Chemical Engineering, 16 (May), Suppl. S313-S320. Friedler F., Aviso K.B., Bertok B., Foo D.C.Y., Tan R.R., 2019, Prospects and Challenges for Chemical Process Synthesis with P-Graph, Current Opinion in Chemical Engineering, 26, 58–64. Friedler F., Tarján K., Huang Y.W., Fan L.T., 1992, Graph-theoretic approach to process synthesis: axioms and theorems, Chemical Engineering Science, 47, 1973–1988. Garcia-Ojeda J.C., Bertok B., Friedler F., 2012, Planning evacuation routes with the p-graph framework, Chemical Engineering Transactions, 29, 1531–1536. Lam H.L., 2013, Extended P-Graph Applications in supply chain and process network synthesis, Current Opinion in Chemical Engineering, 2 (November), 475–86. Orosz Á., Pimentel J., Friedler F., 2019, Simultaneous synthesis of processes with its heat exchanger networks: p-graph approach, Chemical Engineering Transactions, 76, 1219–1224. Sanz M.T., Beltrán S., Calvo B., Cabezas J.L., Coca J., 2003, Vapor liquid equilibria of the mixtures involved in the esterification of lactic acid with methanol, Journal of Chemical and Engineering Data, 48 (6), 1446–1452. Seider W.D., Lewin D.R., Seader J., 2003, Product and process design principles : synthesis, analysis, and evaluation. Second Edi. New Jersey, USA: John Wiley & Sons. Tan R.R., Aviso K.B., Foo D.C.Y., 2017, P-Graph and Monte Carlo Simulation approach to planning carbon management networks, Computers & Chemical Engineering, 106, 872–882. Tula A.K., Eden M.R., Gani R., 2015, Process synthesis, design and analysis using a process-group contribution method, Computers and Chemical Engineering, 81, 245–259. 1176