Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

8
Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF) i n d u s t r IAL g o r i t h m s LLC. (IAL) www.industrialgorithms.com August 2013 Introduction to RPSO, UOPSS and QLQP Presented in this short document is a description of what we call Refinery Process Scheduling Optimization (RPSO). This is the problem of scheduling via optimization the logistics details of the major distillation and conversion processes found in an integrated oil-refinery. We have relegated the scheduling optimization of the blending and storing of the crude-oils and products to our CBSO and PBSO-IMF's. Figure 1 depicts an oil-refinery flowsheet drawn using our unit- operation-port-state superstructure (UOPSS) (Kelly, 2004, 2005, and Zyngier and Kelly, 2012). Figure 1. Refinery Process Scheduling Optimization UOPSS Flowsheet.

description

Presented in this short document is a description of what we call Refinery Process Scheduling Optimization (RPSO). This is the problem of scheduling via optimization the logistics details of the major distillation and conversion processes found in an integrated oil-refinery. We have relegated the scheduling optimization of the blending and storing of the crude-oils and products to our CBSO and PBSO-IMF's. Figure 1 depicts an oil-refinery flowsheet drawn using our unit-operation-port-state superstructure (UOPSS) (Kelly, 2004, 2005, and Zyngier and Kelly, 2012).

Transcript of Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

Page 1: Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

i n d u s t r IAL g o r i t h m s LLC. (IAL)

www.industrialgorithms.com August 2013

Introduction to RPSO, UOPSS and QLQP Presented in this short document is a description of what we call Refinery Process Scheduling Optimization (RPSO). This is the problem of scheduling via optimization the logistics details of the major distillation and conversion processes found in an integrated oil-refinery. We have relegated the scheduling optimization of the blending and storing of the crude-oils and products to our CBSO and PBSO-IMF's. Figure 1 depicts an oil-refinery flowsheet drawn using our unit-operation-port-state superstructure (UOPSS) (Kelly, 2004, 2005, and Zyngier and Kelly, 2012).

Figure 1. Refinery Process Scheduling Optimization UOPSS Flowsheet.

Page 2: Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

Found in every process industry is the "mixing, transforming and separating" tuple and an integrated oil-refinery is no exception where the transforming and separating activities are referred to as reacting and converting processes and distilling and fractionating processes respectively. The rectangular shapes with the cross-hairs are continuous-process types of unit-operations of which there are several i.e., CDU, VDU, DCU, CRU, FCCU, HCU, GPU, AKU, HPU and SPU defined later. The triangular shapes are pool unit-operations and the diamond shapes are called perimeters and represent the points where resources, materials or substances enter and leave the flowsheet i.e., sources and sinks. The circles without cross-hairs are inlet ports and with cross-hairs are outlet ports where ports are the flow interfaces to the unit-operations. The lines with arrow-heads connecting outlet ports to inlet ports are called "external" streams or in graph theory they are called arcs or directed-edges. The lines without arrow-heads are "internal" streams and refer to inlet ports connected to unit-operations and unit-operations connected to outlet ports. The rectangular shapes without cross-hairs are pipeline unit-operations (Zyngier and Kelly, 2009) and the upside-down triangular shape is a parcel unit-operation which is modeled similar to a batch-process and represents the flow of material from one place to another i.e., known as the "industrial shipping" problem and may represent road, rail and marine modes of transportation (Zyngier and Kelly, 2009). The dotted line boxes surrounding several of the shapes implies that the physical unit has more than one procedural operation assigned, attached or associated with it (has multiple modes of operation) and together forms what we call a projectional unit-operation i.e., a physical unit times a procedural operation equals a projectional unit-operation. Each unit-operation and external stream have both a quantity and a logic variable assigned or available and represent either a flow or holdup if quantity and either a setup or startup if logic. Continuous-processes have flows and setups and pools have holdups and setups where perimeters only have a logic setup variable. The internal streams have neither explicit nor independent flow and setup variables given that their flows are uniquely determined by the aggregation of the appropriate external streams and their setups are taken from the setup variables on the unit-operation they are attached to. We have chosen for this demonstration to highlight only the quantity and logic aspects or phenomena of the problem (what we term "logistics"). The quantity and quality details of the problem (what we term "quality") are not described where these deal with the attributes of densities, components, properties and conditions and require special processing subtypes such as blenders, splitters, separators, reactors, fractionators and black-boxes (Kelly and Zyngier, 2014). The quality phenomenon is fully detailed in the CSBO and PBSO-IMF's and can be easily applied here to the other oil-refinery processes as well. In addition, for each of the reacting or converting types of processes, user, adhoc or custom black-box models can be written as either simple nonlinear formulas coded in single-valued infix expressions and/or as sophisticated multi-valued functions coded in C, C++ or Fortran. Industrial Modeling Framework (IMF), IMPRESS and SIIMPLE To implement the mathematical formulation of this and other systems, IAL offers a unique approach and is incorporated into our Industrial Modeling and Pre-Solving System we call IMPRESS. IMPRESS has its own modeling language called IML (short for Industrial Modeling Language) which is a flat or text-file interface as well as a set of API's which can be called from any computer programming language such as C, C++, Fortran, Java (SWIG), C# or Python (CTYPES) called IPL (short for Industrial Programming Language) to both build the model and to view the solution. Models can be a mix of linear, mixed-integer and nonlinear variables and constraints and are solved using a combination of LP, QP, MILP and NLP solvers such as

Page 3: Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

COINMP, GLPK, LPSOLVE, SCIP, CPLEX, GUROBI, LINDO, XPRESS, CONOPT, IPOPT and KNITRO as well as our own implementation of SLP called SLPQPE (Successive Linear & Quadratic Programming Engine) which is a very competitive alternative to the other nonlinear solvers and embeds all available LP and QP solvers. The underlying system architecture of IMPRESS is called SIIMPLE (we hope literally) which is short for Server, Interacter (IPL), Interfacer (IML), Modeler, Presolver Libraries and Executable. The Server, Presolver and Executable are primarily model or problem-independent whereas the Interacter, Interfacer and Modeler are typically domain-specific i.e., model or problem-dependent. Fortunately, for most industrial planning, scheduling, optimization, control and monitoring problems found in the process industries, IMPRESS's standard Interacter, Interfacer and Modeler are well-suited and comprehensive to model the most difficult of production and process complexities allowing for the formulations of straightforward coefficient equations, ubiquitous conservation laws, rigorous constitutive relations, empirical correlative expressions and other necessary side constraints. User, custom, adhoc or external constraints can be augmented or appended to IMPRESS when necessary in several ways. For MILP or logistics problems we offer user-defined constraints configurable from the IML file or the IPL code where the variables and constraints are referenced using unit-operation-port-state names and the quantity-logic variable types. It is also possible to import a foreign LP file (row-based MPS file) which can be generated by any algebraic modeling language or matrix generator. This file is read just prior to generating the matrix and before exporting to the LP, QP or MILP solver. For NLP or quality problems we offer user-defined formula configuration in the IML file and single-value and multi-value function blocks writable in C, C++ or Fortran. The nonlinear formulas may include intrinsic functions such as EXP, LN, LOG, SIN, COS, TAN, MIN, MAX, IF, NOT, EQ, NE, LE, LT, GE, GT and KIP, LIP, SIP (constant, linear and monotonic spline interpolation) as well as user-written extrinsic functions. Industrial modeling frameworks or IMF's are intended to provide a jump-start to an industrial project implementation i.e., a pre-project if you will, whereby pre-configured IML files and/or IPL code are available specific to your problem at hand. The IML files and/or IPL code can be easily enhanced, extended, customized, modified, etc. to meet the diverse needs of your project and as it evolves over time and use. IMF's also provide graphical user interface prototypes for drawing the flowsheet as in Figure 1 and typical Gantt charts and trend plots to view the solution of quantity, logic and quality time-profiles. Current developments use Python 2.3 and 2.7 integrated with open-source Dia and Matplotlib modules respectively but other prototypes embedded within Microsoft Excel/VBA for example can be created in a straightforward manner. However, the primary purpose of the IMF's is to provide a timely, cost-effective, manageable and maintainable deployment of IMPRESS to formulate and optimize complex industrial manufacturing systems in either off-line or on-line environments. Using IMPRESS alone would be somewhat similar (but not as bad) to learning the syntax and semantics of an AML as well as having to code all of the necessary mathematical representations of the problem including the details of digitizing your data into time-points and periods, demarcating past, present and future time-horizons, defining sets, index-sets, compound-sets to traverse the network or topology, calculating independent and dependent parameters to be used as coefficients and bounds and finally creating all of the necessary variables and constraints to model the complex details of logistics and quality industrial optimization problems. Instead, IMF's and IMPRESS provide, in our opinion, a more elegant and structured approach to industrial modeling and solving so that you can capture the benefits of advanced decision-making faster, better and cheaper.

Page 4: Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

Oil-Refinery Process Scheduling Optimization Synopsis At this point we further expose the logistics scheduling optimization problem which is typically and tactically decomposed or partitioned into three specific areas or sectors previously referred to as the crude-oil blend scheduling, refinery process scheduling and product blend scheduling. Traditionally, oil-refinery planning optimization focusing on the quantity and quality aspects provides the "relaxed coordinated" view of the overall oil-refinery whereas the CBSO (Kelly and Mann, 2003) , RPSO and PBSO's (Kelly, 2006) provide the "rigorous cooperated" views of the individual oil-refinery sections (Kelly and Zyngier, 2008). The interaction between the planning coordinator and the scheduling cooperators is managed using the concepts of planning "offers" and "objectives" (targets) downloaded to the scheduling cooperators and scheduling "obstacles" (penalties) and "opportunities" (slacks) uploaded to the planning coordinator where in practice only planning objectives are implemented. Any infeasibilities and/or improvements seen at the scheduling level are unfortunately not exposed nor realized whereas with better scheduling optimization as described here can provide tremendous chances for better decision-making workflows and hence leading to significant benefits and savings. That said, our purpose is to discuss techniques available with IMPRESS to advance the current practice of performing scheduling using simulation and what-if, trial-and-error and manual decision-making with scheduling optimization and automation where the power of faster computers and algorithms are employed to find solutions faster, better and cheaper than previously possible. Although Figure 1 shows an almost complete and integrated oil-refinery minus the crude-oil and product blending and storing areas, we highlight only the Crude-oil Distillation Unit (CDU), Vacuum Distillation Unit (VDU) and Delayed-Coking Unit (DCU). The other included major process units known as the Catalytic Reforming Unit (CRU), Fluidized Catalytic Cracking Unit (FCCU), Hydrocraking Unit (HCU), Gas Processing Units (GPU1 and GPU2), Alkylation Unit (AKU), Hydrogen Producing Unit (HPU) and Steam Producing Unit (SPU) are not discussed further. The two-mode CDU with operations of "maximum gasoline" (MAXGSL) and "maximum diesel" (MAXDSL) is of interest given that we have included a pipeline with significant holdup where two segregated crude-oil mixes labeled MAXGSL and MAXDSL are transported from the crude-oil blending and storing area located several kilometers away from the oil-refinery typically at an off-site terminal. Following the pipeline modeling found in Zyngier and Kelly (2009) and given that we have digitized the 30-day future time-horizon into arbitrarily 30 one-day discrete time-periods, we have specifically decomposed or discretized the pipeline into two pipes where the pipeline can be arbitrarily shutdown at any time (i.e., has zero or no flow) in any time-period and when flowing has a constant nominal flowrate. At the start of the scheduling horizon, we have MAXGSL in the first pipe and MAXDSL in the second pipe. As can be seen in Figure 2 for the Gantt chart resource row "PIPELINE,MAXGSL,o," in time-period 3 or day 3 there is a flow out of the pipeline of the MAXGSL crude-oil mix even though the flow into the pipeline in time-period 3 is MAXDSL i.e., see Gantt chart row "PIPELINE,MAXDSL,i,". In the next time-period (time-period 4) there is a flow of MAXGSL into the pipeline but instead MAXDSL flows out of the pipeline. This is directly related to the fact that a pipeline is modeled as a first-in-first-out (FIFO) queue or renewable resource. There are two other necessary logic features of the CDU's feed operation and they are what we call "multi-product" and "standing-gauge" tanks. The multi-product logic is implemented for TANKCDU2 which can store MAXGSL and MAXDSL but not at the same time or in the same time-period. This means that when the optimizer decides to switch the tank's material service

Page 5: Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

from one to the other, the holdup or heel in the tank must be at a certain amount specified by the user and in this case it is set to zero (0 KB). The standing-gauge logic, also known as a dead-tank, ensures that if there is flow into the tank then there can be no flow out of the tank and vice-versa. This is configured for the three crude-oil tanks and is apparent from the Gantt chart where the grey trend lines below the black horizontal bars indicates the flow in (port-state "i,") and flow out (port-state "o,"). The standing-gauge can be generalized to restricting that if there is flow in then the flow out be at least some number of time-periods after and this can be used to model "mixing-" or "certification-delays" for example. The other important feature of the CDU operation is the switching between the two modes MAXGSL and MAXDSL. This has been implemented as specifying a minimum run-length or what we call a lower uptime and a maximum run-length or upper uptime. This means that if the unit-operation is to be started up then it must be setup for at least the number of time-periods configured for the lower uptime and if an upper uptime exists then its setup must not exceed the number of time-periods indicated where a shutdown of the unit-operation will be initiated.

Figure 2. Gantt Chart for CDU with 1-day and 30-day Past and Future Horizons.

Figure 3 highlights the operation of the VDU which receives atmospheric residue or reduced crude-oil (ATR) from both the upstream CDU and from an off-site oil-refinery imported by rail. Similar to the CDU which receives its crude-oil feed by pipeline, the VDU can receive a certain amount of its feed from other sources. In this situation, the VDU feed ATR is transported by what are known as "unit-trains" which will usually have around 100 tanker rail-cars per train. There is a round-trip or travel-time in this case of 4-days where on the first day the ATR is loaded, on the second day it is hauled from the source oil-refinery or terminal to the destination oil-refinery, on the third day it is unloaded and on the fourth day it travels back to the source and this is called industrial-shipping as opposed to liner or tramp shipping. On the Gantt chart row labeled "TANKVDU,i," we see the extra amount of ATR being received into TANKVDU from the parcel unit-operation representing the unit-train deliveries of ATR.

Page 6: Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

Figure 3. Gantt Chart for VDU with 1-day and 30-day Past and Future Horizons.

Figure 4 displays the Gantt chart for the DCU operation which converts the vacuum residue labeled as VR into pyrolysis naphtha (PN) and distillate (PD) as well as light gases such as methane, ethane (C1C2), propane, propylene, butanes and butylenes (C3C4) including a solid coke material (COKE) which can be used as a fuel. The interesting aspect of the DCU is the production of coke which is modeled as a semi-batch arrangement using pool unit-operations. The two physical coke drums COKEDRUM1 and COKEDRUM2 have two operations or modes of FILL and DRAW where the FILL operation can only charge material and the DRAW mode can only discharge material. This means that if COKEDRUM1 is filling then it cannot be drawing which implies that COKEDRUM2 must be drawing. The converse is also true in the sense that if COKEDRUM1 is drawing then it cannot be filling and therefore COKEDRUM2 must be filling. We can observe this behaviour or functionality on the Gantt chart where we see that when COKEDRUM1 is in the FILL mode COKEDRUM2 is in the DRAW operation and vice-versa.

Page 7: Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

Figure 4. Gantt Chart for DCU with 1-day and 30-day Past and Future Horizons.

In summary, we have demonstrated some of the salient features or characteristics of modeling and solving the oil-refinery scheduling logistics optimization problem. The primary objective or purpose of better modeling and solving is to better understand the true or realistic capability of your system in order to prevent over and under-optimization which will translate into serious plan or schedule versus actual discrepancies or deviations. When schedules are created which over-estimate your oil-refinery's capabilities, this will cause disruptions, distractions and disturbances not only internally within your production-chain but also externally to your outer supply and demand-chains i.e., sometimes referred to as the "bull-whip effect". When schedules are generated which under-estimates your systems capabilities you will miss chances or possibilities to increase your economics and/or efficiencies as well as reducing the value of your existing assets because you fail to understand their potential. References Kelly, J.D., Mann, J.M., "Crude-oil blend scheduling optimization: an application with multi-million dollar benefits", Hydrocarbon Processing, June, 47, July, 72, (2003). Kelly, J.D., "Production modeling for multimodal operations", Chemical Engineering Progress, February, 44, (2004). Kelly, J.D., "The unit-operation-stock superstructure (UOSS) and the quantity-logic-quality paradigm (QLQP) for production scheduling in the process industries", In: MISTA 2005 Conference Proceedings, 327, (2005). Kelly, J.D., "Logistics: the missing link in blend scheduling optimization", Hydrocarbon Processing, June, 45, (2006). Kelly, J.D., Zyngier, D., "Hierarchical decomposition heuristic for scheduling: coordinated reasoning for decentralized and distributed decision-making problems", Computers & Chemical Engineering, 32, 2684, (2008).

Page 8: Refinery Process Scheduling Optimization Industrial Modeling Framework (RPSO-IMF)

Zyngier, D., Kelly, J.D., "Multi-product inventory logistics modeling in the process industries", In: W. Chaovalitwonse, K.C. Furman and P.M. Pardalos, Eds., Optimization and Logistics Challenges in the Enterprise", Springer, 61-95, (2009). Zyngier, D., Kelly, J.D., "UOPSS: a new paradigm for modeling production planning and scheduling systems", ESCAPE 22, June, (2012). Kelly, J.D., Zyngier, D., "Unit-operation nonlinear modeling for planning and scheduling applications", To Appear In: Optimization and Analytics in the Oil and Gas Industry, Springer International Series on Operations Research and Management Science, (2014). Appendix A - RPSO-IMF.UPS File

Appendix B - RPSO-IMF.IML File