CHEMICAL ENGINEERING TRANSACTIONS VOL. 57, 2017 A publication of The Italian Association of Chemical Engineering Online at www.aidic.it/cet Guest Editors: Sauro Pierucci, Jiří Jaromír Klemeš, Laura Piazza, Serafim Bakalis Copyright © 2017, AIDIC Servizi S.r.l. ISBN 978-88-95608- 48-8; ISSN 2283-9216 Plant-Wide Simulation Model for Modified Claus Process Based on Simultaneous Data Reconciliation and Parameter Estimation Mohammad Hosein Eghbal Ahmadi*a, Amirhosein Radb aPetroleum Refining Technology Development division, Research Institute of Petroleum Industry (RIPI), P.O. Box: 14665- 137, Tehran, Iran. bDepartment of Chemical and Petroleum Engineering, Sharif University of Technology, P.O. Box 14155-4838, Azadi Avenue, Tehran, Iran. i.eghbalahmadi@gmail.com The modified Claus process is characterized by several problems, namely poor instrumentation and no precise kinetic model for predicting the behaviour of the reactors. Using operational data of an industrial plant, this paper proposes a general framework for development of a plant-wide simulation model for modified Claus process based on simultaneous data reconciliation and parameter estimation (DRPE) using Genetic algorithm (GA). HYSYS as a commercial process simulator that provides a high-level of accuracy as well as redundancy which all is favoured for DRPE has been utilized in this work. Building a communication framework between HYSYS and MATLAB, data pre-processing of raw measurement data, and then simultaneous data reconciliation and parameter estimation together with gross error detection were performed in the proposed algorithm. As a result, reconciled values of redundant data, inferred values of unmeasured observable data, as well as optimal estimated values of key parameters of the process were obtained. The key parameters of the modified Claus process have been considered as the kinetic parameters of the main reactions taking place in the reactors. Analysis of the results showed that the standard deviation of the reconciled data are reasonably reduced comparing with their raw measured values. Accordingly, measuring errors caused by various unfavourable problems in the plant such as instrumentation inaccuracy were reduced. Having developed simulation model with accurate values of process variables, the behavior of the plant was precisely monitored. Moreover, the developed simulation model can be used for process optimization and controlling purposes. 1. Introduction Straight through modified Claus process is the most significant desulfurizing process that recovers elementary sulfur from hydrogen sulfide (H2S) in natural gas processing or refinery plants. Reaction furnace (RF) reactor and catalytic converters are the foremost challenging parts of the process. Kinetic limitations inherent in the operation of these reactors (Hawboldt 1998) (Manenti et al., 2013) obligates us to utilize kinetic model rates rather than using equilibrium or heuristic relations to accurate modeling of these reactors. However, because of numerous known and unknown reactions taking place in both RF reactor and catalytic converters (Pierucci et al. 2004), it is a cumbersome task to propose a comprehensive kinetic model to accurately predict the behavior of reactions. In addition to the problems related to modeling the reactors, most of the modified Claus units suffer from poor instrumentation. Lack of information and incomplete set of measured data make it difficult for both the field and control-room operators to be exactly aware of the current condition of the plant (Signor et al. 2010). One solution to tackle the problem of poor instrumentation and difficulty of detailed modeling of such a process is implementing simultaneous data reconciliation and parameter estimation (DRPE) procedure on the whole plant. DRPE is a technique providing an optimal adjustment of measurement values of plant data and consistent estimation of observable unmeasured variables satisfying the model constraints. It also provides optimal estimation of inaccurate model parameters. Despite the many benefits obtained, the interest in applying DRPE procedure to industrial plants is not as much as those for developing DOI: 10.3303/CET1757167 Please cite this article as: Eghbal Ahmadi M.H., Rad A., 2017, Plant-wide simulation model for modified claus process based on simultaneous data reconciliation and parameter estimation, Chemical Engineering Transactions, 57, 997-1002 DOI: 10.3303/CET1757167 997 https://en.wikipedia.org/wiki/Desulfurisation mathematical and theoretical aspect due to inherent complexities (Lid & Skogestad 2008; Özyurt & Pike 2004; Farsang et al., 2015).Having applied simultaneous DRPE procedure, the aim of the present work is to develop a plant-wide simulation model of the modified Claus process that the key parameters of which are optimally estimated according to operating data belonging to a long time period of an industrial plant, the measured data are simultaneously reconciled and observable unmeasured data are inferred. As a result, the developed simulation model can accurately represent the modified Claus process across a wide range of operating conditions. The novelty of the present work lies in the fact that DRPE procedure is applied plant-widely to present simulation model for the overall process. To enhance the accuracy and reliability of the results as well as to manage the complexity regarding the implementation of the simultaneous DRPE procedure on a whole modified Claus process, the commercial simulator of HYSYS is employed to simulate the process. Furthermore, genetic algorithm (GA) is utilized to handle the optimization problem to guarantee achieving the global optima. 2. Proposed methodology The architecture of the proposed methodology (hereinafter called “DRPE_Claus”) is depicted in Figure 1. Figure 1. Architecture of the DRPE_Claus Methodology The DRPE_Claus consists of two subsequent blocks; a) pre-processing of raw measurement data, and b) simultaneous DRPE together with gross error detection aided by HYSYS. A set of raw measurement data were collected from DCS historical database of a modified Claus plant operating in Iran. Measurements belong to 360 subsequent steady state data sets of 3 months of operation time, capable of covering the behavior of the plant for a long time period. Measurements data of each steady state set include temperature of 6 streams (nT = 6), component molar fraction of 5 streams (nx = 5) and total volume flowrate of the 3 streams (nf =3) of the process. Note that there are some unmeasured process variables that are observable. Complete information is shown in Figure 2. Complete description of the subsequent blocks of the DRPE_Claus is presented in the next sections. Figure 2. Information related to measured and un-measured values of modified Claus unit 998 2.1 Block 1 - Data pre-processing The first block of the DRPE_Claus is data pre-processing. The proposed method (Buzzi-Ferraris & Manenti 2011) is applied to detect and remove the very large gross errors (if available) in the data. Note that, as it will be described in the next sections, since robust M-estimator is used to formulate simultaneous DRPE problem, if any gross error has not been detected via data pre-processing block of the DRPE_Claus, it can be tolerated or somehow accounted for in the subsequent block (Block-2). This approach is efficient especially in highly nonlinear models that modified Claus process is a typical example of which. 2.2 Block 2 – simultaneous DRPE together with gross error detection aided by simulator framework Simultaneous DRPE is mathematically expressed as a constrained minimization problem in which the reconciled values as close as possible to the measured data and simultaneously optimum estimates of inaccurate parameters are obtained. Model equations and any possible limitations on decision variables are equality or inequality constraints, to which the minimization problem is subject. In the block-2 of DRPE_Claus, simultaneous DRPE together with gross error detection procedure are performed. Two upper and lower stages are involved in this block that create a hybrid-programming environment using automation capability of HYSYS. The upper and lower stages are communicated with each other as follows. The set of measurements after being purified via block-1 are read by a function written in MATLAB. Then, the values of input vector including input process variables as well as key parameters which are produced by optimizer (GA) are transferred to HYSYS. With these inputs, HYSYS solves the whole process model. Afterward, the calculated process variables that construct the output vector are read by MATLAB. The calculated process variables are both the inferred values of observable unmeasured variables and reconciled values of measurements variables. This procedure is repeated until the optimum results are obtained. The objective function of simultaneous DRPE in this work is formulated as follows: obj. fun =y.p min ∑(∑Hε,Ti nT i=1 + ∑Hε,Fi nf i=1 + ∑Hε,xi nx i=1 ) T.I j=1 (1) where y is the vector of reconciled values of corresponding measurements and p is the vector of key parameters to be optimally estimated through DRPE. It should be noted that the key parameters of the process are kinetic parameters of the reactions because they predominantly determine the properties of the streams throughout the process. The term Hε in the equation (1) is the three-part redescending estimator of Hampel (H-estimator) (Arora & Biegler 2001) and Hε,Ti ,Hε,Fi and Hε,xi are corresponding H-estimator allocated to temperature, total volume flowrate and component molar fraction of measured streams, respectively. The H-estimator is formulated as follows. where yi,measured is the ith measured data, yi,reconciled is the reconciled value of ith measured data, ε is the measurement error that is proportional to difference between measured and reconciled data, and s is standard deviation of measurements acts as a weighted factor avoiding data with large values shading information conveyed by measurements represented with smaller numbers. a, b and c are the tuning constants that regarding the historical data and based on minimizing the Akaike Information Criterion (AIC) were set as 0.467, 0.935 and 1.871, respectively. The H-estimator is formulated so that can well tolerate the possible gross errors in data. In the other words, large errors in measurements have limited influence on the H- estimator, not letting to produce biased solution comparing with least squares function that traditionally is used in DRPE Simulation model. The complete description of H-estimator was described by (Arora & Biegler 2001). Hε = { ∑ 1 2 εi 2 i , (0 ≤ |εi| ≤ a) ∑(a|εi| − a2 2 i ) ,(a ≤ |εi| ≤ b) ∑(ab − a2 2 i + (c − b) a 2 (1 − ( c − |εi| c − b ) 2 ),(b ≤ |εi| ≤ c) ab − a2 2 + (c − b) a 2 ,(|εi| ≤ c) εi = yi,measured − yi,reconciled s (2) 999 2.3 Simulation model In this section, simulation model of modified Claus process is described, focusing on two main parts of the process: RF reactor and catalytic converters. RF reactor and catalytic converters are simulated as a plug flow reactors in the simulation model. Since one of the main goals of the present work is presenting a complete set of reactions in which the kinetic parameters are optimally re-estimated based on real plant data, the first step is to collect a complete package of reactions for both RF reactor and catalytic converters. These reactions were selected among many other reactions so that they could present the best possibly prediction of the behavior of RF reactor and catalytic converters validated by simulation among almost all kinetic models in the literature. The selected reactions for both RF reactor and catalytic converters are presented in Table 1. The hydrolysis reactions in catalytic converters are based on alumina-based industrial catalyst (Kaiser 201) and the kinetic rate parameters were defined per unit volume of the reaction phase. Table 1: Selected RF reactor and catalytic converters reactions and kinetic parameters Reactions Kinetic rates expressions Kinetic parameters values RF reactor 2H2S+ SO2 ⇌ 1.5S2 + 2H2O −rH2S = k1e − E1 RTPH2SPSO2 0.5 − k2e −E2/RTPH2OPS2 0.75 k1 = 489 k2 = 0.88 E1 = 2.088 × 10 5 E2 = 1.879 × 10 5 H2S ⇌ 0.5S2 + H2 −rH2S = k3e − E3 RTCH2SCS2 0.5 − k4e −E4/RTCH2CS2 k3 = 2.260 × 10 9 k4 = 3.460 × 10 6 E3 = 2.166 × 10 5 E4 = 1.313 × 10 5 CH4 + 2S2 → CS2 + 2H2S rCS2 = k5e −E5/RTCCH4CS2 k5 = 5.530 × 10 7 E5 = 1.606 × 10 5 2CO + S2 ⇌ 2COS rCOS = k6e − E6 RTCCOCS2 − 2k7e −E7/RTCCOSCt k6 = 318 k7 = 2.180 × 10 6 E6 = 5.570 × 10 4 E7 = 1.798 × 10 5 Catalytic converters 2H2S+ SO2 → 3 x Sx + 2H2O x = 6 or 8 −rH2S = k8e −E8/RTPH2SPSO2 0.5 − k9e −E9/RTPH2OPS6 0.25 (1 + Ka,1e −ΔHH2O,1/RTPH2O) 2 k8 = 138.3 k9 = 1.419 × 10 6 Ka,1 = 9.063 × 10 −13 E8 = 3.077 × 10 4 E9 = 7.691 × 10 4 ΔHH2O,1 = 1.335 × 10 4 CS2 + 2H2O → CO2 + 2H2S −rCS2 = k10e E10/RTPCS2PH2O 1 + Ka,2e −ΔHH2O,2/RTPH2O k10 = 1.198 × 10 −5 Ka,2 = 6.495 × 10 −12 E10 = 3.505 × 10 4 ΔHH2O,2 = 9.178 × 10 4 COS+ H2O → CO2 + H2S −rCOS = k11e E11/RTPCOSPH2O 1 + Ka,3e −ΔHH2O,3/RTPH2O k11 = 4.917 × 10 −2 Ka,3 = 2.057 × 10 −6 E11 = 2.558 × 10 4 ΔHH2O,3 = 6.736 × 10 4 Units: k1(mol.m−3.s−1.Pa−1.5), k2(mol.m−3.s−1.Pa−1.75), k3(m1.5.s−1.mol−0.5), k4(m3.s−1.mol−1), k5(m3.s−1.mol−1), k6(m 3.s−1.mol−1), k7(m 3.s−1.mol−1),k8(m 3.s−1.mol−1.kPa−1.5), k9(m 3.s−1.mol−1.kPa−1.25), k10(m 3.s−1.mol−1.kPa−2) k11(m 3.s−1.mol−1.kPa−2), Ei(J.mol −1, i = 1 to 11), Ka,i(kPa −1, i = 1 to 3), ΔHH2O,i(J.mol −1, i = 1 to 3) With regard to the selected reactions in Table 1, 28 kinetic parameters including pre-factor kinetic rate (ki), activation energy (Ei), adsorption constants (Ka,i) and heat of adsorption (ΔHH2O,i) will be optimally re- estimated via simultaneous DRPE procedure. 3. Merits of the proposed simultaneous DRPE methodology One of the important steps in DRPE procedure is determining redundant, observable and unobservable variables. Using HYSYS as a simulator, this step is handled by means of a simple procedure; all measured variables that belong to the set of output vector taken from HYSYS are definitely redundant, because they can be estimated by the model. By doing so, all complexities and inaccuracies of classical approaches can be handled (Kretsovalis & Mah 1988). The second merit of the proposed methodology is that, using model libraries proposed by the HYSYS process simulator, we make use of a comprehensive process model equations providing precise thermodynamic calculation and a high level of redundancy for simultaneous DRPE procedure. Moreover, when using HYSYS as a simulator, the constrained optimization problem of simultaneous DRPE is converted to unconstrained optimization problem, where the constraints are implicitly solved by means of the solver of the simulator. 1000 4. Results and discussion The proposed methodology has been tested off-line for the set of considered measurements data. Having implemented pre-processing (block-1) and simultaneous DRPE together with gross error detection (block-2) procedure on the measured data, a coherent set of reconciled measurements consistent with real plant data as well as optimally estimated key parameters can be obtained so that the performance of the whole process can be reliably evaluated. Moreover, observable unmeasured data can be inferred and those measurements suffering from gross errors can be detected that may be used to monitor faulty sensors. The trend of reconciled values vs the measured values of some of variables including RF reactor outlet temperature and first catalytic converter outlet temperature are reported in Figure 3. The results have been selected to show daily (over a period of a month). Figure 3 – Reconciled and measured values of RF reactor outlet temperature (a) and first converter outlet temperature (b) - (S.D. standard deviation, T: temperature) Analysis of data set shows that the standard deviation of reconciled data for RF reactor outlet temperature and first catalytic converter outlet temperature are 7.00 and 1.43, respectively that were reasonably reduced comparing with their raw measured values (which are 11.03 and 2.79, respectively). These values are accepted as inside the range of the measure errors, caused by various unfavourable problems in the plant such as instrumentation faults, process leaks, and so on. As is shown in Figure. 3 (b), the measurement in correspondence with the temperature acquired at third week shows a significant gap between the reconciled and measured value. Since H-estimator is employed to formulate the objective function of DRPE, the algorithm is able to tolerate and detect this gross error. Similar figures can be achieved for other measured variables of the process. 4.1 Optimum parameters The optimum kinetic parameters of RF reactor and catalytic converters that were re-estimated using plant data are presented in Table 2. Table 2: Optimum kinetic parameters of RF reactor and catalytic converters reactions parameters values parameters values parameters values parameters values k1 469 E1 2.155 × 105 k8 128 E8 3.190 × 104 k2 0.88 E2 1.680 × 105 k9 1.261 × 106 E9 7.064 × 104 k3 2.351 × 109 E3 2.319 × 105 Ka,1 9.438 × 10−13 ΔHH2O,1 1.336 × 10 3 k4 3.562 × 106 E4 1.220 × 105 k10 1.152 × 10−5 E10 3.501 × 104 k5 5.781 × 107 E5 1.556 × 105 Ka,2 6.590 × 10−12 ΔHH2O,2 9.169 × 10 4 k6 312 E6 5.098 × 104 k11 5.028 × 10−2 E11 2.608 × 104 k7 2.608 × 106 E7 1.921 × 105 Ka,3 2.087 × 10−6 ΔHH2O,3 6.406 × 10 4 4.2 Validation The developed simulation model was validated on some data which were not used in previous sections and are shown in Table 3. Furthermore, the inferred values of some observable unmeasured data are presented. 1001 Table 3: Measured and simulated values of validation data for two different test runs Variable Status Simulated value Measured value Residual Simulated value Measured value Residual Test run #1 Test run #2 RF reactor outlet temperature (°C) Measured 1019 1012 +0.7 % 1027 1020 +0.7 % H2S/SO2 at tail gas Measured 1.31 1.28 +2% 1.33 1.31 +1.6% S2 molar fraction at WHB outlet Unmeasured (observable) 0.57 - - 0.79 - - First converter outlet volume flow rate (Nm3/hr) Unmeasured (observable) 1210.33 - - 1109.87 - - H2S molar fraction in the second converter feed Unmeasured (observable) 0.05 - - 0.04 - - 5. Conclusions The modified Claus process is characterized by several problems, namely poor instrumentation and no precise kinetic model for the reactions occurring in the reactors. This paper aimed to propose a methodology to develop a plant-wide simulation model for modified Claus process based on simultaneous DRPE to represent the behavior of the whole process. Operational historical data which have been taken from an industrial plant (located in Iran) were used to develop the simulation model. Data pre-processing of raw measurement data, and then simultaneous data reconciliation and key parameters estimation together with gross error detection were performed in the proposed methodology. The key parameters of the modified Claus process are kinetic parameters of the main reactions taking place in the reactors. HYSYS as a commercial process simulator that provides a high-level of accuracy as well as redundancy which all is favored for data reconciliation and parameter estimation has been utilized in this work. H-estimator that large errors in measurements has limited influence on it has been selected to define the objective function of the simultaneous DRPE. Using the developed methodology, measure errors caused by various unfavorable problems in the plant such as instrumentation inaccuracy were reduced. In addition, accurate values of temperature, volume flow rate and component molar fraction of streams were obtained so that the behavior of the plant can be precisely monitored. In addition a set of optimized kinetic parameters for key reactions of the process were proposed which can be used for modelling, control and monitoring. The developed simulation model was validated on some measured and observable unmeasured data showing high accuracy of predicting the process variables. Reference Arora, N. & Biegler, L.T., 2001. Redescending estimators for data reconciliation and parameter estimation. Computers and Chemical Engineering, 25(11–12), 1585–1599. Buzzi-Ferraris, G. & Manenti, F., 2011. Outlier detection in large data sets. Computers & Chemical Engineering, 35(2), 388–390. Farsang, B., Balogh, I., Németh, S., Székvölgyi, Z., Abonyi, J., 2015. PCA based data reconciliation in soft sensor development - Application for melt flow index estimation. Chemical engineering transactions. 43, 1555–1560. Hawboldt, K., 1998. Kinetic modelling of key reactions in the modified Claus plant front end furnace. University of Calgary. Kretsovalis, A. & Mah, R.S.H., 1988. Observability and redundancy classification in generalized process networks-I. Theorems. Computers and Chemical Engineering, 12(7), 671–687. Lid, T. and Skogestad, S., 2008. Data reconciliation and optimal operation of a catalytic naphtha reformer. Journal of Process Control, 18(3), 320-331. Manenti, F., Papasidero, D. and Ranzi, E., 2013. Revised kinetic scheme for thermal furnace of sulfur recovery units. Chemical engineering transactions, 32, 1185-1290. Özyurt, D. & Pike, R.W., 2004. Theory and practice of simultaneous data reconciliation and gross error detection for chemical processes. Computers & Chemical Engineering, 28(3), 381–402. Pierucci, S., Ranzi, E. & Molinari, L., 2004. Modeling a claus process reaction furnace via a radical kinetic scheme. Computer Aided Chemical Engineering, 18(C), 463–468. Signor, S. et al., 2010. Sulfur recovery units: Adaptive simulation and model validation on an industrial plant. Industrial and Engineering Chemistry Research, 49(12), 5714–5724. 1002