CHEMICAL ENGINEERINGTRANSACTIONS VOL. 70, 2018 A publication of The Italian Association of Chemical Engineering Online at www.aidic.it/cet Guest Editors:Timothy G. Walmsley, Petar S.Varbanov, RongxinSu, JiříJ.Klemeš Copyright © 2018, AIDIC ServiziS.r.l. ISBN978-88-95608-67-9; ISSN 2283-9216 Algorithmic Process Synthesis and Optimisation for Multiple Time Periods Including Waste Treatment: Latest Developments in P-graph Studio Software Botond Bertok*, Aniko Bartos University of Pannonia, Department of Computer Science and Systems Technology, Egyetem u. 10, H-8200 Veszprem Hungary bertok@p-graph.org Food, water and domestic energy demands changes seasonally as well as the availability of renewable energy sources. One of the challenging questions of utilizing renewable resources is its synchronization with the periodically varying demands. Only those methods can estimate the economic feasibility, which can explicitly take into account the pairing of demands with potential resources in multiple time horizons as well as the potential storage options. Moreover, waste treatment cannot be neglected in any long-term technology planning procedure. The P-graph framework provides appropriate formal and algorithmic basis for process synthesis, including structural modelling and model validation (Friedler et al., 1992), generation of alternative network structures (Friedler et al., 1995), determination of the optimal and N-best design alternatives (Friedler et al., 1996). By the help of the P-graph framework and its software implementation, i.e., the P-graph Studio developed at the University of Pannonia, process-network synthesis problems can be modelled and solved in general (Bertok et al., 2013), and optimization of multiperiod operation (Heckl et al., 2014), as well as multiperiod system design (Aviso et al., 2016) and waste treatment optimization (Friedler et al., 1994) in particular. Thanks to the built-in algorithm RCABB (Bartos et al., 2015) not just the best, but the list of N-best structurally different alternative network configurations can be generated utilizing the computational power of the computers executing. In the present work, recent additions to the software is to be introduced for multiperiod process- network synthesis including the design of waste treatment system, and computer aid for answering questions about the sensitivity of a configuration to the actual economic environment are to be shown. 1. Introduction In chemical and allied industries factories often produce harmful substances or by-products requiring further treatment. Government regulations can also force reducing the environmental burden. It is necessary to care about the pollutant at the supply chain level. Furthermore, most of these problems is not a one-off case, because they arise time to time or in other words from periods to periods. Thus, handling of the harmful substances needs to be planned in advance for each time period. The planning can be even more difficult if certain operations are periodically unavailable due to maintenance needs. This paper presents an algorithmic modelling and optimization method for multiperiod production planning regarding waste treatment with computer aid in all of its steps. Through an example it will be shown how the waste treatment can be guaranteed from period to period during process-network synthesis taking into account storage capacities and maintenance periods. At the last chapter a software implementation in P-graph Studio is presented. 2. Process Network Synthesis Process-network synthesis or PNS in short is a systematic procedure, where a complex network aiming at the production of desired product is constructed from a set of plausible building blocks, i.e., operating units. DOI: 10.3303/CET1870017 Please cite this article as: Bertok B., Bartos A., 2018, Algorithmic process synthesis and optimisation for multiple time periods including waste treatment: latest developments in p-graph studio software , Chemical Engineering Transactions, 70, 97-102 DOI:10.3303/CET1870017 97 Mathematical formulation and algorithmic solution for PNS have been established by professors Friedler and Fan in the early 90’s, known as the P-graph framework. 2.1 Combinatorial foundations for process-network synthesis In 1992 Friedler and Fan published the formal definition of and a graph-theoretic toolset for Process Network Synthesis (Friedler et al., 1992), which is appropriate for representing production processes and optimise them (Walmsley et al., 2017). Process graph or P-graph provides the structural representation which is a directed bipartite graph comprising two types of vertices or nodes. One type with circles as their symbols is of the M-type and represents materials, and the other with horizontal bars as their symbols is of the O-type representing operating units. Any PNS problem is symbolically expressed as synthesis problem (P, R, O) signifying that it is defined upon the specifications of the set of final products P, the set of raw materials R, and the set of all plausible candidate operating units O. P-graph is a solution-structure of synthesis problem (P, R, O) if it satisfies a set of five axioms formally defined by Friedler et al. (1993). The five axioms collectively act as a filter to eliminate all combinatorially infeasible or invalid networks or flowsheets. Each optimization algorithm rooted in the P-graph framework avoids combinatorially infeasible process structures on the bases of P-graph representation and the above axioms. In current examination both set of axioms and algorithms are to be extended to guarantee waste treatment even in a multiperiod process model. 2.2 Case study: vinyl chloride monomer production Vinyl chloride (C2H3Cl) is one of the most economically important chemicals from which various polymers, especially polyvinyl chloride, are manufactured (McPherson et al., 1979). Vinyl chloride (C2H3Cl) is currently produced by the so-called balanced process from ethylene (C2H4), chlorine (Cl2) and oxygen (O2) with three reacting units, each comprising one or possibly more corresponding reactors. One unit is for the direct chlorination of ethylene (C2H4); one, for the oxychlorination of ethylene (C2H4); and one, for the pyrolysis of ethylene dichloride (C2H4Cl2) (Lakshmanan and Biegler, 1997). Note that the hydrogen chloride (HCl) generated in the pyrolyzing unit is totally consumed in the oxychlorination unit to which it is recycled. Each of these reacting units yields some chlorinated hydrocarbons, carbon monoxide and carbon dioxide as by-products. Naturally, each reacting unit is accompanied by one or possibly more separating units for removing the by-product, recycling the hydrogen chloride (HCl) or purifying the final product (Cowfer and Magistro, 1983). Multiperiod P-graph model of vinyl chloride production is shown in Figure 1. Vinyl chloride is at the bottom as a product and Cl2, Capacity, C2H4, and O2 appear as raw materials at the top. M-type node “Capacity” specifies the available capacity of reactor O1 (direct chlorination). In this example the operating units has both operating and investment costs. Material denoted by red is HCl which requires special attention from waste treatment point of view, i.e., it cannot be disposed. By solving the model HCI does not remain in the structure in the best solution, and 36,288.0 kg/h C2H3Cl, i.e., the maximum flow of C2H3Cl is produced. However, in the second-best structure 21,192.0 kg/h HCl remains which is unacceptable from waste management point of view. In the third best and the last solution no operating unit is utilized, i.e., production stops. Furthermore, if direct chlorination unit O1 requires maintenance, represented by maximum of 0 availability for entity “Capacity” there is only one solution: when the whole process is stopped despite of that oxychlorination O2 and caustic wash O3 would be able to perform the same task from the perspective of the model. These shutdowns and waste management problems can be avoided by extending the circle of structures considered, as well as introducing periods and storages. 3. Proposed methodology Structural properties of process structures including not disposable intermediates are clarified first, and then considered during process synthesis and illustrated for the case study. 3.1 Extension of the axioms As mentioned in the previous chapter, to handle waste treatment, set of the axioms of combinatorially or structurally feasible process structures is extended for process synthesis problems with waste treatment. For this purpose, additional terms are to be introduced. Two classes of products are to be distinguished, i.e., so called required products with positive required gross production flow rate to be provided by the network, and potential products with zero required flow rate. Note that both required and potential products may have prices and upper bounds on their production. 98 An intermediate or by-product is considered to be undisposable if its gross production upper bound is set to be zero, i.e., cannot be more produced than consumed of it. In contrast, every disposable intermediate is considered as potential product. The set of axioms of structurally feasible process structures is modified and extended for process synthesis problems with waste treatment as follows: (S1) Every required final product is represented in the graph. ... (S4) Every vertex of the operating unit type has at least one path leading to a vertex of the material type representing a required or potential final product. ... (S6) Every produced undisposable intermediate material is consumed by at least one operating unit. This axiom (S6) states that there must exist at least one operating unit, which can handle or in other words eliminate the potential waste. In the vinyl chloride monomer production example, the new axiom is already satisfied, hence oxychlorination O2 consumes the HCl, but its maximum flow has not been limited. If its maximum flow rate is limited to zero, the best solution remains the same, but the second-best solution, where HCl remained unprocessed, disappear. After the capacity has been set to zero, the best solution will also disappear, since at the beginning there is not enough HCl to start the process. This can be avoided by installing a storage facility where sufficient amount of HCl can be stored before the maintenance period starts, so the process can be launched during the maintenance period as well. 3.2 Periods and storages After introducing periods, the models will not only be more realistic, but the solutions of the model will also be more accurate. The periods are not independent if they are interconnected through storages which can be of great service during the maintenance periods as well. The periods may be of different lengths, from modelling point of view only their ratio is really taken into account. The lengths of periods matter mainly if investment cost is to be considered during its payout period, and a separate operating unit is introduced to represent the investment providing the precondition for each operation in any time periods, and to represent the investment cost only once. Moreover, theoretically there can be materials and operating units which are not affected by the time periods, but such exceptions are not really typical. Storages are defined by the set of materials they can store and the set of time periods when they are available. In storage, however, amortization may occur, which is usually expressed by average percentage of material loss. If there is not yet an adequate container available, then investment costs will be associated with the storage as well. Moreover, any storage has its capacity and the initial level of inventory. 3.3 Multiperiod vinyl chloride production Let the basic structure be extended as follows. Let us have three time periods. The first period is 3,800 h, the second one is 200 h and the last one is 4,000 h and maintenance is scheduled for the second period. During the maintenance period, the upper bound for “Capacity” is set to be zero. As in the original version HCl is considered undisposable and has to be treated. For that purpose, a container is introduced which stores the HCl between the time periods. This container can store HCl without any amortization, but it has investment costs, because it needs to be built. The best process network computed for the multiperiod process-network synthesis problem is shown in Figure 1. Red colour represents HCl as in the original structure below and green denotes the utilization of storage between the time periods. Blue units are the physical embodiments of the operating units, while blacks are the operating units utilized. Relative lengths of the time periods are defined as weights of the edges connecting the investments and operations. Table 1 shows all the feasible networks. As shown in Figure 1 and Table 1 it makes sense to build the storage facility because the best structure contains it. Consequently, it is not necessary to shut down during the maintenance period because in the first period sufficient HCl was produced which can stored up to the maintenance period. In the first period oxychlorination O2 and caustic wash O3 are not involved in the production because they consume HCl. However, in the second period while O1 direct chlorination is being maintained these two operating units are able to take over their task by processing HCl remained from the first period. Since all operating units are available again in the third period there is no need to store HCl between the second and third time periods. In the second-best network there is a complete shutdown during the maintenance period, no operating unit is functioning, but storage is also utilized between the first and third time periods. 99 It is interesting to observe the sudden drop in profits between best and second best and between fifth and sixth best solutions. This is due to the fact that from the second-best solution there is one, and from the sixth best solution there are two whole periodical shutdowns. If there are no restrictions requiring HCl to be totally processed the best solution structure remains the same, but number of all possible solutions increases to eleven. The original six solutions are supplemented with another five where HCl remains at the end of the process. As illustrated above, process network synthesizes can answer to how to handle the waste, plan the maintenance period, and whether it is advisable to set up storage for this purpose or not. 3.4 P-graph Studio and its latest developments P-graph Studio is software for modelling and solving PNS problems (P-graph Studio). It has been developed at the Department of Computer Science and Systems Technology, University of Pannonia. Thanks to the drag and drop solution, the easily accessible object properties sidebar and several configuration options, it accelerates the modelling. In the case of a multi-period model, however, a lot of data has to be entered, and by increasing the number of periods the structure will become less clear and less manageable. Figure 1: Optimal network for vinyl chloride monomer production through three periods with storage modelled by P-graph To facilitate the multi-period modelling, P-graph Studio has been expanded with an additional option to quickly and easily adjust the properties of the periods. After constructing the base process structure, the periods can be set through the new software implementation. This is available by clicking on the calendar icon, see Figure 2. After the number of period is entered in the pop-up window, the length of the periods and the properties of the materials in the different periods can be set. It can be set at the extension checkbox whether to multiply or extend the base structure, e.g., the basic structure represents a year that should be split into months or it is one- month model which has to be multiplied. The exception tab gives opportunity to specify materials and operating units not affected by time periods as well. Moreover, a beta version of excel import is also available for even faster data entry. 100 Storages connecting the time periods can also be specified. This can be activated by clicking on a house icon next to the multiperiod button when time periods have already been entered, see Figure 2. In the popup window one can specify which materials can be stored between which time periods and with what percent of amortization. In addition to the usual settings of the operating units initial inventory can be set as well. When solving the problem, time periods and storages are generated, so the solution structures will be multi periodic. Table 1: All feasible networks computed for the multiperiod process optimization problem Solution Structure Investment Period #1 O1_inv O2_inv O3_inv O4_inv O5_inv O6_inv Container O1_P1 O2_P1 O3_P1 #1 4.04 2,000,000 2,000,000 36.78 36.78 36.78 1,000,000 1.92 #2 4.04 2,000,000 2,000,000 2.11 2.11 2.11 1,021,190 1.92 #3 4.04 2,000,000 2,000,000 2.11 2.11 2.11 1,021,190 1.92 #4 4.04 2,000,000 2,000,000 36.78 36.78 36.78 1,000,000 1.92 #5 2.11 2,000,000 2,000,000 2.11 2.11 2.11 1.00 1 1 #6 2.11 2,000,000 2,000,000 2.11 2.11 2.11 1.00 1 1 Table 1 (cont.) Period #1 Period #2 O4_P1 O5_P1 O6_P1 Container_use_P1 O1_P2 O2_P2 O3_P2 O4_P2 O5_P2 O6_P2 1 1 1 21,192 1.92 1.92 0.92 0.92 0.92 1 1 1 21,192 1 1 1 21,192 1 1 1 21,192 1.92 1.92 0.92 0.92 0.92 1 1 1 1 1 1 Table 1 (cont.) Period #3 Cost Container_use_P2 O1_P3 O2_P3 O3_P3 O4_P3 O5_P3 O6_P3 [USD/h] 1.00 1.00 1.00 1.00 1.00 1.00 -22,923,000 21,192 0.08 2.00 2.00 1.00 1.00 1.00 -16,493,300 21,192 1.92 1.92 0.92 0.92 0.92 -15,930,200 -15,921,500 1.00 1.00 1.00 1.00 1.00 1.00 -15,119,800 -8,118,340 The waste management option is located under the Preferences → Solver settings → Configuration tab, see right hand side of Figure 2. Figure 2: P-graph Studio extensions: Time periods, Storages, Waste treatment 101 4. Conclusions The above introduced methodology and software provides an effective tool by process network synthesis and its extensions to avoid waste production even during time periods when certain operating units are not available. Vinyl chloride monomer production served the example to illustrate how it the waste management restriction, time periods, the maintenance time, and the storages extend the computable potential capabilities of the original process structure. Acknowledgments This publication has been supported by the ÚNKP-17-3 (IV-PE-1) New National Excellence Program of the Ministry of Human Capacities of Hungary and Szechenyi 2020 under the EFOP-3.6.1-16-2016-00015. References Aviso K. B., Lee J.-Y., Tan R. R., 2016, A P-graph model for multi-period optimization of isolated energy systems, Chemical Engineering Transactions, 52, 865-870, DOI:10.3303/CET1652145. Bartos A., Bertok B., 2015, Synchronization and load distribution strategies for parallel implementations of P- graph optimizer, MACRo 2015- 5th International Conference on Recent Achievements in Mechatronics, Automation, Computer Science and Robotics, De Gruyter 1 (1), Târgu Mure, Romania, 303-313. Bertok B., Barany M., Friedler F., 2013, Generating and analyzing mathematical programming models of conceptual process design by P-graph software, Industrial & Engineering Chemistry Research, 52(1), 166- 171. Cowfer J.A., Magistro A.J., 1983, Vinyl Chloride and Poly (Vinyl Chloride), Kirk Othmer Encyclopedia, 23, 865- 885. Friedler F., Tarjan K., Huang Y.W., Fan L.T., 1992, Combinatorial algorithms for process synthesis, Computers & Chemical Engineering, 16, 313-320. Friedler F., Tarjan K., Huang Y.W., Fan L.T., 1993, Graph-theoretic approach to process synthesis: polynomial algorithm for maximal structure generation, Computers & Chemical Engineering, 17, 929-942. Friedler F., Varga, J.B., Fan, LT., 1995, Decision-mapping for design and synthesis of chemical processes: Applications to Reactor-Network Synthesis, AIChE Symposium Series 91 (304), 246-250. Friedler F., Varga J.B., Feher E., Fan LT., 1996, Combinatorially accelerated branch-and-bound method for solving the MIP model of process network synthesis, State of the Art in Global Optimization, 609-626. Friedler F., Varga J.B., Fan LT., 1994, Algorithmic approach to the integration of total flowsheet synthesis and waste minimization, AIChE Symposium Series, 90, 303, 86-97. Heckl I., Halasz L., Szlama A., Cabezas H., Friedler F., 2014, Modeling multi-period operations using the P- graph methodology, Computer Aided Chemical Engineering, 33, 979-984. Lakshmanan A., Biegler L.T., 1997, A case study for reactor network synthesis: The vinyl chloride process, Computers & Chemical Engineering, 21, 785-S790. McPherson R.W., Starks C.M., Fryar G.J., 1979, Vinyl Chloride Monomer… what you should know, Hydrocarbon Process, 75, 75-88. P-graph Studio, assessed 01.05.2018 Walmsley, T. G., Jia X., Philipp M., Nemet A., Liewd Y. P., Klemeš J.J., Varbanov P.S., 2018, Total site utility system structural design using P-graph, Chemical Engineering Transactions, 63, 31-36, DOI:10.3303/CET1863006. 102