Two-Stage Stochastic Optimization of a hydrogen network

Two-Stage Stochastic Optimization of a hydrogen network

Proceedings, 10th of IFAC International Symposium on on Advanced Control Chemical Processes Proceedings, 10th IFAC International Symposium Proceedings...

566KB Sizes 1 Downloads 28 Views

Proceedings, 10th of IFAC International Symposium on on Advanced Control Chemical Processes Proceedings, 10th IFAC International Symposium Proceedings, 10th of IFAC International Symposium on Advanced Control Control of Chemical Processes Shenyang, Liaoning, China, JulyProcesses 25-27, 2018 Advanced Chemical Available online at www.sciencedirect.com Advanced Control of Chemical Processes Shenyang, Liaoning, China, July 25-27, 2018 Shenyang, Liaoning, China, July 25-27, 2018 Proceedings, 10th IFAC International Symposium on Shenyang, Liaoning, China, July 25-27, 2018 Advanced Control of Chemical Processes Shenyang, Liaoning, China, July 25-27, 2018

ScienceDirect

IFAC PapersOnLine 51-18 (2018) 263–268 Two-Stage Two-Stage Stochastic Stochastic Optimization Optimization of of aaa hydrogen hydrogen network network Two-Stage Stochastic Optimization of hydrogen Two-Stage Stochastic Optimization of a hydrogen network network Gloria Gutierrez*, Anibal Galan*, Daniel Sarabia**, Cesar de Prada* Gloria Gutierrez*, Gutierrez*, Anibal Galan*, Daniel Daniel of Sarabia**, Cesar de denetwork Prada* Two-Stage Stochastic Optimization a hydrogen Gloria Anibal Galan*, Sarabia**, Cesar Prada*

Gloria Gutierrez*, Anibal Galan*, Daniel Sarabia**, Cesar de Prada*

Gloria Gutierrez*, Anibal Galan*, Daniel Sarabia**, Cesar de Prada* * Department of Systems Engineering and Automatic Control, University of Valladolid * Department of Systems Engineering and Automatic Control, University of Valladolid Valladolid * Department of de Systems Engineering and Automatic Control, University of c/ Real Burgos s/n. Sede Mergelina EII, 47011, Valladolid, Spain * Department of de Systems Engineering and Automatic Control, UniversitySpain of Valladolid c/ Real Burgos s/n. Sede Mergelina EII, 47011, Valladolid, Real de Burgos s/n. Sede Mergelina EII, 47011, Valladolid, Spain (e-mails:c/ [email protected], [email protected], [email protected]) c/ Real de Burgos s/n. Sede Mergelina EII, 47011, Valladolid, Spain (e-mails: [email protected], [email protected], [email protected]) *(e-mails: Department of Systems Engineering and Automatic Control, University of Valladolid [email protected], [email protected], [email protected]) **Department of Electromecanic Engineering, Escuela Politécnica Superior,Universidad de Burgos, (e-mails: [email protected], [email protected], [email protected]) **Department of Electromecanic Engineering, Escuela Politécnica Superior,Universidad de Burgos, Burgos, Real de Burgos s/n. Sede Mergelina EII, 47011, Valladolid, Spain **Department ofc/Electromecanic Engineering, Escuela Politécnica Superior,Universidad de Avda. Cantabria s/n, Burgos, 09006,( [email protected]) **Department of Electromecanic Engineering, Escuela Politécnica Superior,Universidad de Avda. Cantabria s/n, Burgos, 09006,( [email protected]) (e-mails: [email protected], [email protected], [email protected])Burgos, Avda. Cantabria s/n, Burgos, 09006,( [email protected]) Avda. Cantabria s/n, Burgos, 09006,( [email protected]) **Department of Electromecanic Engineering, Escuela Politécnica Superior,Universidad de Burgos, Avda. Cantabria s/n,explicitly Burgos, with 09006,( [email protected]) Abstract: This paper discusses how to deal uncertainty in the optimal management of the Abstract: This This paper paper discusses discusses how how to to deal deal explicitly explicitly with with uncertainty uncertainty in in the the optimal optimal management management of of the the Abstract: hydrogen network of a petroleum refinery. The current system is based a RTO/MPC system Abstract: network This paper discusses howrefinery. to deal explicitly with system uncertainty in theon optimal management of for the hydrogen of a petroleum The current is based on a RTO/MPC system for hydrogen network of a petroleum refinery. The current system based on a RTO/MPC for supervision and on-line optimization that includes a robust data is reconciliation to estimate system consistent hydrogen network of a petroleum refinery. The current system is based on a RTO/MPC system for supervision and on-line optimization that includes a robust data reconciliation to estimate consistent Abstract: This paper discusses howupdate to that dealthe explicitly with uncertainty the optimal management of the supervision and on-line optimization includes robust dataItreconciliation to estimate values of the process variables and modelaaparameters. hasinbeen extended with a consistent two-stage supervision and on-line optimization that includes robust data reconciliation to estimate consistent values of the process variables and update the model parameters. It has been extended with a two-stage hydrogen network of variables atopetroleum refinery. system in is operation based onextended RTO/MPC for values of the process and of update theThe model parameters. It has been with asystem two-stage stochastic optimization take care the effect of current crude changes ofa the network. paper values of the process variables and of update the model Itreconciliation has been extended with a The two-stage stochastic optimization tooptimization take care care the effect of crude crude changes in operation of the the network. The paper supervision and on-line that includes a parameters. robust datain to and estimate consistent stochastic optimization to take of the effect of changes operation of network. The paper analyses how to formulate the problem in order to obtain implementable solutions presents results stochastic optimization to take of theineffect oftocrude changes in operation of the and network. paper analyses how to formulate formulate the care problem order obtain implementable solutions presents results values of how the process variables and update model parameters. It has been extended a The two-stage analyses to the problem in the order to obtain solutions andwith presents results that compare the deterministic and stochastic solutions usingimplementable real plant data. analyses how to formulate the problem in order to obtain implementable solutions and presents results that compare compare the deterministic deterministic and stochastic solutions using real plant plant data. of the network. The paper stochastic optimization to take and carestochastic of the effect of crude changes in operation that the solutions using real data. that2018, compare the deterministic and stochastic solutions usingoptimization; real plant © IFAC (International Federation of in Automatic Hosting by data. Elsevier Ltd. All reserved. Keywords: Two-step stochastic optimization; Real-time Model predictive control; Oil analyses how to formulate the problem order toControl) obtain implementable solutions andrights presents results Keywords: Two-step Two-step stochastic stochastic optimization; optimization; Real-time Real-time optimization; optimization; Model Model predictive predictive control; control; Oil Oil Keywords: refineries; Hydrogen networks. that compare the deterministic and stochastic solutions using real plant data. Keywords:Hydrogen Two-stepnetworks. stochastic optimization; Real-time optimization; Model predictive control; Oil refineries; refineries; Hydrogen networks. refineries; Hydrogen Keywords: Two-stepnetworks. stochastic optimization; Real-time optimization; Model predictive control; Oil feed changes. In the end, these unknowns affect negatively refineries;1.Hydrogen networks. INTRODUCTION feed changes. changes. In In the the end, end, these these unknowns unknowns affect affect negatively negatively feed the operation profitability the plants and negatively hydrogen 1. INTRODUCTION feed changes. and In the end, theseof unknowns affect 1. INTRODUCTION the operation and profitability of the plants and hydrogen the operation and profitability of the plants and hydrogen 1. INTRODUCTION network. In order to limit these consequences, the uncertainty Hydrogen has become one the main utilities in oil refineries the operation andthe of the plants anduncertainty hydrogen network. In order order toprofitability limit these consequences, the Hydrogen has become one the main utilities in oil refineries feed changes. In end, these unknowns affect negatively network. In to limit these consequences, the uncertainty the properties oftothe new hydrocarbons, such asuncertainty hydrogen Hydrogen become one the main utilities in oil refineries due to the has combined of removing sulphur from petrol in 1.needs INTRODUCTION network. In order limit these consequences, the in the properties of the new hydrocarbons, such as hydrogen Hydrogen has become one the main utilities in oil refineries due to to the the combined combined needs needs of of removing removing sulphur sulphur from from petrol petrol demand operation andof profitability thelight plants and in the properties the weight new hydrocarbons, such asshould hydrogen or molecular ofofthe ends, be due products andcombined converting heavy hydrocarbons into lighter ones the in the properties of the new hydrocarbons, such asuncertainty hydrogen demand or molecular weight of the light ends, should be due to the needs of removing sulphur from petrol products and converting heavy hydrocarbons into lighter ones network. In order to limit these consequences, the demand or molecular weight of the light ends, should be Hydrogen has become one the hydrocarbons main utilities in oil refineries incorporated explicitly in the optimization formulation. products and converting heavy into lighter ones as a result of the new environmental legislation and the aim demand or molecular weight of the light ends, should be incorporated explicitly in the optimization formulation. products and converting heavy hydrocarbons into lighter ones as aa to result of the the new newneeds environmental legislation and the aim incorporated in the properties of theinnew such as hydrogen explicitly the hydrocarbons, optimization formulation. due the combined sulphur and fromthe petrol as result of environmental legislation aim of increasing profitability of of theremoving refinery business. incorporated explicitly in the optimization formulation. as a result of the new environmental legislation and the aim data orreconciliation moduleofabove mentioned is able be to of increasing increasing profitabilityheavy of the thehydrocarbons refinery business. business. demand molecular weight the light ends, should products and converting into lighter ones The of profitability of refinery The data data reconciliation reconciliation module module above above mentioned mentioned is is able able to to The of increasing profitability of the refinery with parametric uncertainty, but onlymentioned provides indication incorporated explicitly inmodule the optimization formulation. Hydrogen in different reactors in business. order to and accomplish as a result isofused the new environmental legislation the aim deal The data reconciliation above is able to deal with parametric uncertainty, but only provides indication Hydrogen is is used used in in different different reactors reactors in in order order to to accomplish accomplish of dealthe with parametric only provides changes onceuncertainty, they havebut revealed in theindication process. Hydrogen these tasks, being supplied through a complex distribution of increasing profitability of the refinery business. deal with parametric uncertainty, but only provides indication of the the changes once they they haveabove revealed in the theisprocess. process. Hydrogen used insupplied differentthrough reactorsaincomplex order to distribution accomplish Ideally, these tasks,is being being datachanges reconciliation module mentioned ablethe to of once have revealed in one should make before onethe knows these tasks, suppliedplants through network to the different thataa complex perform distribution the hydro- The of the changes once theydecisions havebutrevealed in process. Ideally, one should make decisions before one knows the these tasks, being supplied through complex distribution network to the different plants that perform the hydrodeal with parametric uncertainty, only provides indication Ideally,andone should effects make of decisions before one the Hydrogentois used in reactors order to accomplish possible the uncertainty, andknows not only network the different plants thatinoperations. perform theDue hydrodesulphurization anddifferent hydro-treating to value Ideally, one should make decisions before in one knows the value and possible effects ofhave the uncertainty, uncertainty, and not only network to being the different plants thata complex perform distribution the Due hydrodesulphurization and hydro-treating operations. to reacting of theand changes once theyof revealed the process. value possible effects the and not only these tasks, supplied through to the consequences of a choice, which leads to the desulphurization and hydro-treating operations. Due to technical reasons, hydrogen has to be used in excess in the value and possible effects of the uncertainty, and not only reacting to the consequences of a choice, which leads to the desulphurization and hydro-treating operations. Due to technical to reasons, hydrogenplants has to tothat be used used in excess excess in the the use Ideally, make decisions before oneinstead knows reacting tostochastic theshould consequences of a choice, which leads to the network the perform the or hydroof one optimization methods of technical reasons, hydrogen has be in in reactors, with the different unreacted hydrogen being recycled sent reacting to the consequences of a choice, which leads to the use of stochastic optimization methods instead of technical reasons, hydrogen has to be used in excess in the reactors, with with the the unreacted unreacted hydrogen being being recycledDue or sent sent value and stochastic possible effects of the uncertainty, and not only use of optimization methods instead of desulphurization and hydro-treating operations. to deterministic ones. Additionally, other methods such as reactors, hydrogen recycled or to the fuel-gas network. As hydrogen is an expensive utility, use of stochastic optimization methods instead of deterministic ones. Additionally, other methods such as reactors, with the unreacted hydrogen being recycled or sent to the the fuel-gas fuel-gas network. As hydrogen hydrogen isused an expensive expensive utility, reacting to theones. consequences a choice, leads to the deterministic Additionally, other methods such as reasons, hydrogen has to beimplies in excess utility, in the the Modifier Adaptation, are moreoffocused on which the process-model to network. As is an atechnical good management of the network minimizing deterministic ones. Additionally, other methods such as Modifier Adaptation, are more focused on the process-model to the fuel-gas network. As hydrogen is an expensive utility, good management management of the the network network implies implies minimizing the mismatch use of Adaptation, stochastic optimization methods instead and of Modifier more focused on the reactors, with the unreacted hydrogen beingofrecycled orfuelsent instead of are the decision making in process-model unknown aa good of minimizing the production of fresh hydrogen or conversely losses to Modifier Adaptation, are focused on methods the mismatch instead of Additionally, the more decision making in process-model unknown and aproduction good management of the network implies the mismatch of fresh fresh hydrogen or conversely conversely ofminimizing losses to to fueldeterministic ones. other such as instead of the decision making in unknown and to the fuel-gas network. As hydrogen is an expensive utility, changing scenarios and are limited in the size of problems production of hydrogen or of losses fuelgas. Nevertheless, theoravailable hydrogen mismatch instead ofand theare decision making in process-model unknown and changing Adaptation, scenarios limited in on thethe size of problems problems production of freshreducing hydrogen conversely ofminimizing lossescan to limit fuelgas. Nevertheless, reducing the available available hydrogen can limit Modifier are more focused changing scenarios and are limited in the size of agas. good management of thevaluable network implies the they can sensibly deal with. Considering these aspects, the Nevertheless, reducing the hydrogen can limit the processing of the more hydrocarbons, so that an changing scenarios and are limited in the size of problems they can can sensibly sensibly dealthewith. with. Considering these aspects, and the gas. Nevertheless, reducing the available hydrogen can limit the processing processing of the the more valuable valuable hydrocarbons, so that an two-stage mismatch instead of decision makingseem in unknown they deal Considering these aspects, the production of fresh hydrogen or conversely of losses to fuelstochastic optimization methods to be a good the of more hydrocarbons, so that an optimum balance has to be valuable reached between maximizing the they can sensibly deal with. Considering these aspects, the two-stage stochastic optimization methods seem to be a good the processing of the more hydrocarbons, so that an optimum balance has to be reached between maximizing the changing scenarios and are limited in the size of problems two-stage stochastic optimization methods seem to be a good gas. Nevertheless, reducing the available hydrogen can limit to the problem of incorporating the uncertainty of optimum balance has to beminimizing reached between maximizing the approach flow of hydrocarbons and the required hydrogen, two-stage stochastic optimization methods seem to be a good approach to the problem of incorporating the uncertainty of optimum balance has more to beminimizing reached hydrocarbons, between maximizing flowprocessing of hydrocarbons hydrocarbons and the required required hydrogen, theyhydrocarbon can sensibly deal with. Considering these aspects, the approach to the problem of incorporating the uncertainty of the ofthe the valuable so that the an the properties into the RTO system, as they flow of and minimizing the hydrogen, while satisfying operation constraints, using the hydrogen approach to the problem of incorporating the uncertainty of the hydrocarbon properties into the RTO system, as they flow of hydrocarbons and minimizing the required hydrogen, while satisfying satisfying the operation constraints, using the hydrogen hydrogen two-stage stochastic optimization beas a good the hydrocarbon properties into the RTOseem system, they optimum balance has to be in reached between maximizing the offer the required flexibility in themethods description oftouncertainty while the operation constraints, using the generation and distribution the network, membranes, and the hydrocarbon properties into the RTO system, as they offer the required flexibility in the description of uncertainty while satisfying the operation constraints, using the hydrogen generation and distribution distribution in the the network, network, membranes, and as approach to the problem of in incorporating the uncertainty of offer the required flexibility the description of practice uncertainty flow of hydrocarbons and minimizing the required hydrogen, different scenarios, and reflect the current of generation and in membranes, and other process elements as degrees freedom. offer the required flexibility thethe description of practice uncertainty as different scenarios, and in reflect the current of generation and distribution inconstraints, theof network, membranes, and the other process elements as degrees of freedom. hydrocarbon properties into RTO system, as they as different scenarios, and reflect the current practice of while satisfying the operation using the hydrogen decision making and a-posteriori correction. other process elements as degrees of freedom. as different scenarios, and reflect the current practice of decision making and a-posteriori correction. other process elements as degrees of freedom. the making requiredand flexibility in the description of uncertainty decision a-posteriori correction. In the oil refinery of Petronor, in network, Northern membranes, Spain, a system generation and distribution in the and offer decision making and a-posteriori correction. In the the oil oil refinery refinery of of Petronor, Petronor, in in Northern Northern Spain, Spain, aa system system This paper scenarios, discusses and the reflect formulation of the optimal In different the current practice of driven by these aims operation, Sarabia Spain, et al. (2012). It as other elements asindegrees freedom. This paper paper discusses discusses the the formulation formulation of of the the optimal optimal In theprocess oil refinery ofis inofNorthern a system driven by these these aims isPetronor, in operation, operation, Sarabia et et al. al. (2012). (2012). It management This of a hydrogen network in an oil refinery as a driven by aims is in Sarabia It decision making and a-posteriori correction. is composed by aims a RTO working in supervisory mode and It a This paper of discusses the network formulation the optimal management a hydrogen hydrogen in an an of oil refinery refinery as aa driven by refinery these is in operation, SarabiaSpain, et al. (2012). is composed composed by aa RTO RTO working inNorthern supervisory mode and aa two-stage management of a network in oil as In the oil of Petronor, in a system stochastic optimization problem and presents is by working in supervisory mode and LP/MPC controller that implements optimal policies on-a management of a hydrogen network problem in an of oil and refinery as a two-stage stochastic optimization presents is composed by aims a RTO working in the supervisory mode and LP/MPC controller that implements the optimal policies onThis paper discusses the the presents optimal two-stage stochastic optimization and driven bycontroller these isdata in operation, Sarabia et al. (2012). It results obtained with real data.formulation The problem main contributions are LP/MPC that implements the optimal policies online. Additionally, a reconciliation module provides two-stage stochastic optimization problem and presents results obtained with real data. The main contributions are LP/MPC controller that implements the optimal policies online. Additionally, a data data reconciliation module provides management of proposal awith hydrogen network in an contributions oil and refinery asare a results obtained real of data. The main is composed by a RTO working invariables supervisory mode andthe a linked to the an architecture problem line. Additionally, aof reconciliation module provides consistent estimates the process and updates results obtained with real data. The main contributions are linked to the proposal of an architecture and problem line. Additionally, a data reconciliation module provides consistent estimates of the process variables and updates the two-stage stochastic optimization problem and presents linked to the proposal of an architecture problem LP/MPC controller that implements the optimal policies onthatproposal allows using thisarchitecture advanced tool a large consistent estimatesfor of the the process variables and works updateswell, the specification model parameters The system linked obtained to the of andin specification thatwith allows using this advanced tool inproblem large consistent estimatesfor the RTO. process variables and works updates the scale modelAdditionally, parameters the RTO. The system system well, results realusing data.annetwork, Theadvanced main contributions are specification that allows this tool in aa large line. aof data reconciliation module provides system as the hydrogen which involves the model parameters for the RTO. The works well, nevertheless, as the refinery processes crudes of different specification that allows using this advanced tool in a large scale system as the hydrogen network, which involves the model parameters for the RTO. The system works well, nevertheless, as the refinery processes crudes of different linked to the proposal of an architecture and problem scale system as the hydrogen network, which involves the consistent estimates of the process variables and updates the joint operation of eighteen process plants. nevertheless, as the refinery processes crudes of are different origins and properties whose detailed compositions rarely scale system as the hydrogen network, which involves the joint operation of eighteen process plants. nevertheless, as the refinery processes crudes of different origins parameters and properties properties whose detailedThe compositions are rarely rarely allows using thisplants. advanced tool in a large joint operationthat of eighteen process model for the RTO. system works well, specification origins and whose detailed compositions are known beforehand, periodic disturbances take place during joint operation of eighteen process plants. origins properties whose detailed compositions rarely scale system as the hydrogen network, which involves the known and beforehand, periodic disturbances take place place during nevertheless, as the periodic refinery processes crudes of are different known beforehand, disturbances take during known beforehand, periodic disturbances take place during origins and properties whose detailed compositions are rarely joint operation of eighteen process plants.

Copyright © 2018 IFAC 257 Copyright © 2018, 2018 IFAC IFAC 257Hosting by Elsevier Ltd. All rights reserved. known beforehand, disturbances place during 2405-8963 © IFACperiodic (International Federationtake of Automatic Control) Copyright © 2018 257 Copyright 2018 responsibility IFAC 257Control. Peer review©under of International Federation of Automatic 10.1016/j.ifacol.2018.09.310 Copyright © 2018 IFAC 257

2018 IFAC ADCHEM 264 Gloria Gutierrez et al. / IFAC PapersOnLine 51-18 (2018) 263–268 Shenyang, Liaoning, China, July 25-27, 2018

The paper is organized as follows: After the introduction, section 2 describes the hydrogen network and its operation. In section 3, the current RTO and MPC control system is presented, followed by the core section 4 which deals with the two-stage stochastic optimization and the way it is adapted and formulated for optimization of the network operation. Then, section 5 gives results of the stochastic optimization and compares them with the deterministic case. The paper ends with some conclusions and references.

being processed. Excess hydrogen from these plants is partially collected in the low purity header (LPH) and recycled back to the consumer plants, while the rest goes to the fuel gas network, where it is mainly burnt in furnaces.

2. PROCESS DESCRIPTION 2.1 Hydrogen network In the refinery of reference, high purity hydrogen is produced in steam-reforming furnaces in two plants, named H3 and H4. Additionally, two platformer plants (P1 and P2) generate lower purity hydrogen as a by-product of the catalytic reforming process so that their flows can be considered as non-controllable disturbances to the network. From these four plants, hydrogen is distributed to the consumer ones using several interconnected networks at different purities and pressures, as can be seen in the schematic of Fig.1. The network interconnects a total of eighteen plants, four producers and fourteen consumers, mainly hydrodesulphurization (HDS) plants.

Fig 2. Schematic of producer and consumer plants with the main hydrogen distribution headers and fuel gas network. 2.1 Network operation Both, plants and networks, are operated from control rooms equipped with Distributed Control Systems (DCS) implementing basic controls (flow, pressure, …) and several MPCs (DMC) in charge of more complex multivariable tasks, such as sulphur removal in the plants. The main network operation aims are: •

Distribute the available fresh hydrogen and the recycled hydrogen (including internal plant recycles) so that the requirements of hydrogen at the reactors’ inputs in all plants are satisfied. • Maximize the hydrocarbon loads to the plants, approaching the production targets established by the refinery planning system. • Balance the hydrogen that is produced and the hydrogen that is consumed so that the hydrogen losses to fuel gas are minimized. The main decision variables are the fresh hydrogen production of H3 and H4 plants, the hydrocarbon feed to the consumer plants and the hydrogen distribution and reuse in the network, including the use of membranes where available. The overall operation is framed by the specific production targets given by the planning system of the refinery that change according to the market conditions and crudes available, and it is constrained by the physical and operational limitations imposed by the equipment.

Fig 1. Schematic of the hydrogen network of the Petronor refinery. Dark grey boxes represent producer plants, while light grey ones refer to hydrogen consumer units A typical HDS receives hydrogen from different sources, and after mixing it with the hydrocarbon load, the mixture is processed in bed reactors where the hydrogen must be in excess to prevent shortening of the life-cycle of the expensive catalyst. The excess hydrogen is partly recycled internally (in some cases using membranes to increase its purity), partly purged to the fuel-gas network or recycled to a low purity header (LPH) to be used in other plants. The global operation of the network can be explained using Fig. 2, which is a simplified representation where only a small number of producer and consumer plants are represented. The generated hydrogen is distributed to the consumer plants through the corresponding high purity headers. The hydrogen demand of each plant depends on the quantity and composition of the hydrocarbons being treated, which may experience strong changes every two or three days according to the crude that is

3. RTO AND MPC 3.1 Data reconciliation The operation of the system is difficult not only due to its complexity and the presence of significant disturbances that affect the process, but because the information available 258

2018 IFAC ADCHEM Shenyang, Liaoning, China, July 25-27, 2018 Gloria Gutierrez et al. / IFAC PapersOnLine 51-18 (2018) 263–268

about many key variables is limited and unreliable. In particular, molecular weights of the impurities are unknown, which stops the computation of sensible mass balances. To avoid this problem, a data reconciliation (DR) system was developed with the aim of estimating consistent values of all plant variables from available on-line measurements based on a process model.

265

capacity, recycle purity in the consumer plants, ratio hydrogen/hydrocarbon at the reactors’ input, operating range of membranes, producer plants’ capacity, reciprocating and centrifugal compressors’ capacity, etc. Important parameters, such as the specific hydrogen consumption or equilibrium constants are fixed in the model according to the DR estimation. Again, the problem is a NLP one and is solved in the GAMS environment, involving nearly 2000 variables and more than 1800 equality and inequality constraints, with the IPOPT algorithm in less than one minute. CPU time, running every two hours, and its results are available in an Excel HMI and through the refinery Osisoft PI system.

A first principles model of the network and associated plants was developed to provide support in process optimization Gomez (2016). It is based on mass balances of hydrogen and light ends (considered as a single pseudo-component) in the pipes and units. In addition, it incorporates other equations for compressors, membranes, separation units (including a solubility model), etc., some of which are reduced order models fitted to experimental data or with some adjustable parameters. Taking into account the much faster dynamics of the hydrogen flows compared to the dynamics of the reactors, the hydrogen distribution model is static, having flows, purities, molecular weights of hydrogen and light ends of all streams and hydrogen consumption in the reactors as its main variables.

3.3 On-line implementation with DMC One of the main problems related to the implementation of the RTO solutions is the fact that, being a static optimization executed at low frequency, it is not able to cope with disturbances and changes that must be taken into account and corrected at a higher frequency, Darby et al. (2011). At the same time, when operating the RTO, is possible to identify a set of patterns in the optimal solutions that can be implemented as partial targets and that define the global network optimization: For instance, maintaining the purge from the LPH at minimum, or keeping the purity of the recycles at a certain low value. These partial targets have been implemented in the LP layer of a commercial DMC controller, providing set points to the MPC controller below similar to the ones of the RTO, but computed on-line at the frequency of the controller, De Prada et al. (2017). The global architecture is summarized in Fig.3. The LP/DMC only acts on the six more important plants of the network. The RTO operates in supervisory mode, with its solutions being computed for the whole network and providing a reference framework for the on-line operation of the DMC.

Data reconciliation requires redundancy in measurements, and takes advantage of the fact that the core of the model, being based on mass balances, does not present structural errors. The DR problem is solved as a large NLP one in GAMS using IPOPT and incorporating robust estimators as the Fair function to compensate gross errors, Nicholson et al. (2014). The implementation involves more than 4400 variables and 4700 equality and inequality constraints. It provides consistent, estimations of the measured and unmeasured variables while, at the same time, enables the update of certain unknown model parameters. 3.2 Deterministic Real Time Optimization Once reliable information of the network and a model are available, it is possible to formulate the following optimization problem, that translates the aims described in section 2.1, and is executed at regular time intervals: min

2

14

14

i =1

i =1

i =1

∑ p H 2i FH 2i − ∑ p HCi HCi + ∑ p Ri Ri

(1)

s.t. Process model Process constraints Refinery planning specifications where HC i refers to the hydrocarbon loads to consumer plants, F H2i denotes the fresh hydrogen generated in the steam reforming plants and R i are recycles of hydrogen in the consumer plants, which are linked to the operation of the recycle compressors. Here, p HC , p H2 and p R stand for prices associated with hydrocarbons, fresh hydrogen and compressors in order to provide an economic meaning to the cost function. The problem has to be solved under the constraints imposed by the model and operation of the units, taking also into account the specifications coming from the refinery planning. Constraints apply mainly to pipes’

Fig. 3. Block diagram of the main elements involved in the hydrogen network management 4. TWO-STAGE STOCHASTIC REAL TIME OPTIMIZATION 4.1 Load changes As mentioned above, an oil refinery normally receives petroleum supplies from different sources every two or three days that are processed continuously to generate a wide range 259

2018 IFAC ADCHEM 266 Gloria Gutierrez et al. / IFAC PapersOnLine 51-18 (2018) 263–268 Shenyang, Liaoning, China, July 25-27, 2018

of refinery products. The quality and composition of these supplies may vary quite a lot, depending of the country of origin and the type of oil. This means that, after being processing in the crude distillation tower, the different streams and products that have to be treated in the downstream hydro-treatment processes may present significant changes of the hydrogen demand over time. The operation of the plants involved in the hydrogen network, alternates in this way periods of relatively stable hydrogen consumption with transients where the estimation or prediction of the specific hydrogen demands in the reactors is difficult to perform. Of course, there are many others sources of uncertainty in the operation of the network, including the state of the equipment, the effect of disturbances, changes in the molecular weight of the hydrocarbons and light ends generated in the reactors, etc. but this is the one that has a mayor impact in production and appears with a frequency low enough to be treated in the optimization layer, while other changes of higher frequency require more frequent corrections in the range of the control actions.

Fig 4. (Left) First stage variables are unique for al scenarios, while the recourse (second stage) variables are particular of every scenario considered for the uncertainty. (Right) The state of the process, when applied the first stage decision variables, may evolve to different values according to the realization of the uncertain variables ξ i , but the subsequent evolution is associated to a specific action Su(ξ i ) for every scenario.

As a consequence of the oil supply changes, the optimization of the hydrogen production and distribution in the network and the computation of the maximum admissible hydrocarbon load to the hydro-treating plants is more difficult to perform in the transient periods and would benefit of integrating the associated incertitude explicitly in the formulation of the optimization problem.

min

F

{

}

J ( Fu ) + E S J ( Fu ,S u( ξ ),S x( ξ ))

F

u ,S u ( ξ )

F

h( Fx( ξ ),F u ) = 0 ,

F

u( ξ ) = F u

S

h( Fu ,S u( ξ ),S x( ξ )) = 0,

F

∀ξ ∈ Ξ

g( Fx( ξ ),F u ) ≤ 0 S

(2)

g( Fu ,S u( ξ ),S x( ξ )) ≤ 0

The notation requires some explanation: F(.) refers to variables or functions in the first stage and S(.) denotes the ones in the second stage. The decision variables are denoted as u and the remaining ones as x. The uncertainty is represented by the parameters ξ that can take values within a set Ξ according to a certain probability distribution. Normally this set is sampled and only a finite number ξ i , i = 1,2,3,…,n of elements is considered which constitute the scenarios that will represent the uncertainty. E{.} stands for the expected value.

4.1 Two-Stage Stochastic Optimization A common way of considering uncertainty in the decision making process is incorporating the concept of recourse variables: If one have to make a decision now and some parameters of the problem are unknown, one should take into account the different values that these parameters may get (different scenarios), but also should consider when making the decision the possibility of correcting the initial one (changing the so called recourse variables) when, later on in the future, the uncertain parameters may become known. In this approach, the time horizon is divided in two stages: in the first one we decide on the value of the “here and now” variables, while in the second stage, we decide on the values of the recourse variables, which have different values for each of the scenarios considered and depend also on the first stage decisions. The idea is represented in Fig. 4 (left), where we can see that the first stage variables are unique for all scenarios, while the second stage ones are particular of every scenarios. Fig.4 (right), displays the evolution of the process states according to the realization of the uncertain. In the first stage, once the first stage decision variables are applied to the process, the state may evolve to different values depending on the value of the uncertain parameters, while in the second stage the evolution will depend on the specific value of the recourse variables for each scenario.

The cost function is composed of two terms: The first one, FJ, is the cost in the first stage which depends on the first stage decisions Fu. These are decisions made and applied at current time, without knowing the particular realization of the uncertainty ξ, that will be maintained over the time horizon covered by the optimization problem. Consequently, they are the same for all values of ξ, what is represented by the constraint Fu = Fu(ξ) known as non-anticipativity one. Nevertheless, we can correct the effects of the Fu decisions in the second stage once the value of the ξ parameters materializes, using the recourse variables Su(ξ) that take a particular value for each realization of the uncertainty. The second term of the cost function, E{sJ(.)}, represents the effect of these second stage corrections on the total value of the cost function, which also depends on the Fu decisions and the uncertainty ξ.

Mathematically, a typical two-stage stochastic optimization problem is formulated as the minimization of a cost function under constraints involving a set of stochastic variables ξ as in (2):

The variables of the problem have to satisfy the constraints imposed by the model h and additional inequality constraints g in every stage for all possible scenarios considered. In (2), the corresponding equations, that depend on the stochastic 260

2018 IFAC ADCHEM Shenyang, Liaoning, China, July 25-27, 2018 Gloria Gutierrez et al. / IFAC PapersOnLine 51-18 (2018) 263–268

parameter ξ, should be interpreted as being fulfilled with probability one.

267

defaults in the reactors, changes in that production aim are not effective in the short term. Instead, one has to act on other faster variables such as hydrocarbon loads to the plants, fuelgas purges or recirculation purity. Taking this into account, we propose to use the hydrogen generated in the producer plants as first stage variables and the other ones as recourse variables.

Notice that the two-stage stochastic optimization approach to dealing with decision problems in uncertain environments provides more degrees of freedom, represented by the use of the recourse variables, than classical robust ones. Robust optimization formulates the problems as min max ones, providing decisions that fit the worst case of all scenarios without considering the second stage corrections, leading consequently to more conservative solutions than the twostage approach. At the same time, two-stage is not as computationally demanding as a considering the full stochastic problem.

The two-stage stochastic optimization can then be formulated as (3): 2

min S

FH 2i , u ( ξ )

∑p i =1

H 2 i FH 2 i

 14 − E ∑ p HCi HCi ( ξ j ) − p Ri Ri ( ξ j  i =1

 ) 

∀ξ j ∈ Ξ s.t.

4.3 Stochastic optimization formulation

(3) Process model(ξ j ) Process constraints(ξ j ) Refinery planning specifications

The task of formulating an optimization problem that considers explicitly the uncertainty in the refinery hydrogen network is not easy and has to balance different aspects, taking as starting point the configuration of the existing RTO system. Critical elements of the formulation are the selection of the uncertain variables and scenarios, the choice of the first and second stage decision variables, the coherence with the global operation and the feasibility of computing the solutions in a short time so that they can be useful for the online operation of the network.

Here, the process model and constraints are the same as in the deterministic case, but particularized for every scenario, which largely increases the number of variables and equations. Notice that the first stage decision variables F H2i are the same for all scenarios, according to the nonanticipativity constraints. The first stage cost corresponds to the production cost of fresh hydrogen, while the second stage includes the expected value of the hydrocarbons processed and the cost of the hydrogen recycles. The aim is maximizing the hydrocarbon load (HC) to consumer plants, minimizing the use of fresh hydrogen generated in the steam reforming plants (F H ) and minimizing the internal recycles of hydrogen (R) in the consumer plants, considering all possible values of the uncertainty. Su refers to the remaining variables of the model.

The hydrogen network involves eighteen plants so that if the uncertain variables are not chosen carefully, the number of scenarios, generated from combinations of the values of the uncertainties in all of them, can blow up easily. Fortunately, if we assume that the main source of incertitude is the change of quality of the oil supplies as discussed above, and considering as its main effect the variations of specific hydrogen consumption in the reactors, we can notice that the changes in quality affects in parallel to all plants. This means that if the refinery receives crude with e.g. a higher sulphur content, the hydrogen demand will increase in all hydrodesulphurization plants, avoiding the need of covering all possible combinations of increments and decrements in every plant, that can be substituted by a small number of scenarios all of them in the same direction of increment or decrement of the specific hydrogen consumption specified as a set of per cent changes over the current estimation of the specific hydrogen consumption given by the data reconciliation module according to the analysis performed in the crude being processed.

Within a stochastic environment, particularly relevant in periods of petroleum supply changes, the formulation tries to find the best choice of the fresh hydrogen production targets such that, when the actual hydrogen demands in the reactors are revealed, it is possible to recourse to the correction action of other variables (load changes, membranes, purges, etc.) such that the operation constraints are satisfied for all scenarios considered and the expected value of the cost function in (3) is optimized. 5. RESULTS 2.1 Implementation

The reformulation of the RTO as a two-step stochastic optimization problem has to consider that RTO is basically a static optimization one where the aim is to compute targets for the different variables involved, while the problem of dealing with the supply changes has a certain dynamic character linked to the load transients. One important aspect of the problem is the fact that the hydrogen producer plants have slow dynamics, needing around two hours to reach a new production target. Because of that, once a hydrogen production aim is given to a producer plant, if there are sudden changes in the hydrogen demand, in order to avoid wasting hydrogen to the fuel-gas network or facing hydrogen

The problem (2) has been implemented in the GAMS environment and solved using the EMP feature. Due to the large amount of variables involved, it is not possible to present all of them in a paper. In addition, due to confidentiality reasons, we cannot offer information of the actual value of many key variables. Considering these constraints, we will present values of the main variables in percent, taking as 100% the corresponding value obtained in the data reconciliation step before optimization. The following tables compare the solution obtained with the 261

2018 IFAC ADCHEM 268 Gloria Gutierrez et al. / IFAC PapersOnLine 51-18 (2018) 263–268 Shenyang, Liaoning, China, July 25-27, 2018

deterministic approach (1) and the stochastic one for three scenarios S1, S2, S3, where the specific hydrogen demand in the reactors has been assumed to be the same, a 5% higher and a 10% higher than the one computed in the DR step, with probabilities 0.6, 0.3 and 0.1 respectively. The first stage solution is also given in the tables. The first column displays the acronym of the plants involved. Two plants, D3 and RB4, were not in operation at the time when the data were collected.

Table 4. Fresh Hydrogen production in %

Table 1. Scenario probabilities and hydrogen demands. * No change. S1

S2

S3

Probability

0.6

0.3

0.1

Hydrogen demand

NC*

+5%

+10%

100.9

100.9

100.9

106.31

106.31

106.31

S2

S3

120.34

185.98

120.11

AKNOWLEGMENT The authors wishes to express their gratitude for the financial support received from the Spanish Government with project INOPTCON (MINECO/FEDER DPI2015-70975-P) and the EU ITN PRONTO, Grant agreement No 675215. The authors are also grateful to Petronor and its management for supporting this study.

BD6

34.49

711.72

149.63

50.17

144.16

F3

94.53

121.38

109.23

126.89

110.17

G1

101.68

95.55

98.50

97.61

98.25

G2

122.42

108.80

113.98

110.45

112.10

G3

91.37

99.63

102.07

101.98

102.68

G4

100.

108.59

107.55

107.42

115.42

HD3

113.45

109.65

109.72

110.06

108.17

NC6

99.99

102.01

102.7

95.76

95.73

REFERENCES Darby, M.L.; Nikolaou, M.; Jones, J.; Nicholson, (2011) D. RTO: An overview and assessment of current practice. J. Process Control, 21, 874–884. De Prada C., Sarabia D., Gutierrez G., Gomez E., Marmol S., Sola M., Pascual C., Gonzalez R. (2017) Integration of RTO and MPC in the hydrogen network of a petrol refinery, Processes, 5(1), 3; doi:10.3390/pr5010003. 7 Gomez, E. (2016) A Study on Modelling, Data Reconciliation and Optimal Operation of Hydrogen Networks in Oil Refineries. Ph.D. Thesis, University of Valladolid, Spain, Martí R., Lucia S., Sarabia D., Paulen R., Engell S., de Prada C. (2015) Improving Scenario Decomposition Algorithms for Robust Nonlinear Model Predictive Control, Computers and Chemical Engineering, 79 30– 45 Elsevier Nicholson, B.; Lopez-Negrete, R.; Biegler, L.T. (2014) Online state estimation of nonlinear dynamic systems with gross errors. Comput. Chem. Eng., 70, 149–159. Sarabia, D.; de Prada, C.; Gómez, E.; Gutiérrez, G.; Cristea, S.; Mendez, C.A.; Sola, J.M.; González, R. (2012) Data reconciliation and optimal management of hydrogen networks in a petro refinery. Control Eng. Pract. 20, 343–354.

Table 3. HC loads to the consumer units in %

BD3

100.

1st stage 115.96

BD6

99.99

115.99

119.99

119.99

79.99

F3

100.0

116.0

120.0

120.0

80.0

G1

100.0

100.0

100.0

100.0

100.0

G2

100.0

80

80.0

80.0

80.0

G3

100.0

100

100.0

100.0

100.0

G4

99.99

100

99.99

99.99

99.99

100.21

100.18

100.211

100.21

99.949

N1

100.

116.0

120.0

120.0

80.0

N2

100.0

116.0

120.0

120.0

80.0

NC6

99.99

104.50

107.2

107.23

79.99

NF3

99.99

115.99

119.99

119.99

79.99

HD3

S3

S1

98.65

Det.

106.31

S2

The paper shows the applicability of two-stage stochastic approach in this type of problems, but further work is required before implementation, in particular in solving more efficiently the associated optimization problem, using decomposition methods as in Martí et al. (2015).

BD3

Plants

104.55

S1

6. CONCLUSIONS

1st stage 118.00

Det.

70.02

H4

Det.

As can be seen, significant corrections can be made in the hydrogen to the plants via recirculation from the low purity header, while changes in the hydrocarbon loads are also affected in some scenarios.

Table 2. H 2 feed to the consumer units in % Plants

H3

1st stage 100.9

Plants

S1

S2

S3

120.0

120.0

80.0

262