Algorithm for Long-Term Scheduling of Multiproduct Pipelines

Figure 1 shows a multiproduct pipeline with one refinery and multiple DCs. .... To provide a mathematical model, the following assumptions are conside...
1 downloads 0 Views 997KB Size
ARTICLE pubs.acs.org/IECR

Algorithm for Long-Term Scheduling of Multiproduct Pipelines S. A. MirHassani,* S. Moradi, and N. Taghinezhad Faculty of Mathematics and Computer Science, Amirkabir University of Technology, Tehran, Iran ABSTRACT: In this article a mixed integer linear programming (MILP) model is presented for scheduling a multiproduct oil pipeline that connects a refinery to a few distribution centers. The scheduling task was carried out while considering a number of aspects such as satisfying daily demand, forcing settling periods for quality control, observing prespecified shutdown periods, and calculating batch size by considering the type of product. Finally, an approach to solve the model in long-term planning is proposed. The algorithm is able to achieve a near-optimal solution in reasonable running time.

1. INTRODUCTION Transportation planning of petroleum products is one of the most challenging management problems in the oil industry. The task is usually done by four different means including trucks, trains, vessels, and pipelines. A high percent of petroleum products in most countries is transported through pipelines because of high security, little impact on environment and traffic, and the possibility of high-volume transportation and low cost for long distances. In this system, various petroleum products such as gasoline, gas oil, and kerosene are usually produced at a refinery and injected to a pipeline back to back, without any separator and discharged into distribution centers (DCs). Therefore, scheduling multiproduct pipelines is a serious and valuable task. The challenge is to specify when and how much of each product should be injected into the pipeline to satisfy demand with minimum delay while observing many operational restrictions in DCs. The most comprehensive system consists of a network of pipelines that has a refinery or DC at any node. In such a system, refineries and DCs can often pump products to the pipeline, receive from it, or both. Since a larger network leads to a more complex modeling task, in most previous works either a small network has been studied (usually just a straight line with no branch) or some restrictions have been relaxed. The simplest pipeline system consists of a straight pipeline that usually connects a refinery to one or more DCs in order to supply the local market. In this operation, a specified volume of the product that will be injected into the pipeline is called a batch. During an injection, a small fraction of the incoming batch will be mixed with the previous one, making a mixture called interface or trans-mix. The volume and estimated costs of interfaces are different based on the type of products, pipeline geographical situation, and rate of injection. Figure 1 shows a multiproduct pipeline with one refinery and multiple DCs. In the last two decades, transferring crude oil and refined products has been studied from various points of view, mostly based on mathematical modeling and the use of exact or heuristics solution algorithms. To the best of our knowledge, two methods for scheduling oil pipelines are presented: scheduling based on search techniques1and mixed-integer linear mathematical programming (MILP) formulations. The presented MILP models are divided into discrete and continuous models. Hane and Ratliff2 did present the problem of sequencing commodities r 2011 American Chemical Society

in a large petroleum products pipeline. Rejowski and Pinto3 presented a scheduling technique for a real pipeline system. In this system, a multiproduct pipeline connects a refinery to a number of DCs. In their models a part of the pipeline located between two consecutive DCs is considered a section, and then each section is divided into segments. In the first model the volume of all segments is equal, but in the second model they are different. The aim is to minimize the costs of storage, pumping, and interfaces. Time has been considered discrete, which leads to more binary variables. In a real case it is impossible to solve the problem directly with available software. Therefore, by adding some specific constraints and proper cuts earlier models were improved.4 MirHassani and Ghorbanalizadeh5extended the presented models by Pinto and Rejowski to the issue of product transportation on tree structure pipelines. They defined a path between refinery and DC and investigated the transfer of products in the relevant pathway.Magatao et al.6 provided a model for scheduling the operations of product transfer from one port to an oil refinery using a multiproduct pipeline in a limited period. In this particular model time is considered a discrete variable, so they divided the main model into two models and solved them separately. Cafaro and Cerda7provided a new MILP model for scheduling a pipeline that transfers some petroleum products from a refinery to many DCs. In this model, time was treated continuously. Fewer numbers of binary variables and less running time are the main features of this model. Here, the total demand for each product for the entire time horizon is given and the model will determine what percentage of the demand for each product must be delivered to the customer at any time. Later, by considering due dates on demand, Cafaro and Cerda8 presented a dynamic model that approximated real conditions. In their model, the time horizon is divided into several periods and demand for each period is given. After solving the model, the achieved plan for the first period is implemented. Then for scheduling the second period, the first period is omitted from the beginning of the time horizon and the new period is added to the end of the time horizon and so on. MirHassani and Fani9 Received: February 4, 2011 Accepted: November 3, 2011 Revised: October 16, 2011 Published: November 03, 2011 13899

dx.doi.org/10.1021/ie200101a | Ind. Eng. Chem. Res. 2011, 50, 13899–13910

Industrial & Engineering Chemistry Research

Figure 1. Single multiproduct pipeline.

extended the Cafaro model8 to the tree structure pipelines. Relvas et al.10 presented an MILP model, based on the Cafaro model7for a system in which a refinery is connected to a DC via a pipeline. Unlike the Cafaro model, the size of each batch is chosen among several options depending on the type of product. More attention was given to inventory management, and for the first time, the new concept of a product settling period was considered. Also, the customer demand is offered daily and should be delivered at the end of the day. By changing the fixed pumping rate to a variable rate, this model was more complete and a special settling period for any product was also considered.11 Because of the existence of a large number of binary variables the running time of the presented model is high. In fact, the model running time depends on clarifying the sequence of products that must be pumped into the pipeline; therefore, a heuristic method was presented to determine the products sequence.12 In this method, the highest priority was given to the product that faces shortage in an inventory. Then by considering a constant pumping rate for each product, Cafaro and Cerda13provided a new formulation for the Relvas model10that dramatically reduced the running time of the model. The formulation is applied to a system with only one refinery and one DC. Recently, in presented work, most the pipeline systems with more complexity have been studied. Cafaro and Cerda14 presented an MILP continuous formulation for the operational scheduling of unidirectional pipeline networks that allows simultaneous batch injections. Broschetto et al.15studied a real-world pipeline network and proposed an optimization model in order to address the network scheduling activities. The contribution of this paper is 2-fold: Initially, a generalization of the model presented by Cafaro13 from one DC to multi-DCs was introduced. In our model the pumping rate is not fixed for each product and may be varied in a predefined interval and the batch size is restricted between lower and upper bounds by considering the type of product. Also, the priority for discharging batches at DCs will be set. Second, since the running time of this model in long-term planning is high, a heuristic approach which simplifies the model solution process in long-term planning was proposed. In this paper, section 2 includes the problem definition and assumption. Section 3, by considering the volume and the time as continuous variables, presents the formulation for the problem, and section 4 proposes an algorithm for long-term planning. Finally, section 5 includes algorithm validation and computational results for a real-life pipeline.

2. PROBLEM DEFINITION The system under investigation consists of a straight pipeline that connects one refinery to multiple DCs. It is supposed that the refinery is the only source of products and has the capability to inject into the pipeline. All DCs are able to act as a removal point. DCs should provide local markets’ daily demands. Various batches of petroleum products from the refinery are pumped into

ARTICLE

the pipeline, and the same quantity of products are discharged at DCs. In each DC, there are many tanks and each product is stored in its own storage tank. To provide a mathematical model, the following assumptions are considered. • The pipeline is always full, and the only way to discharge a volume of product (at one or more DCs) is to inject the same quantity into the pipeline. • When a batch is pumped into the pipeline, a small size of it is mixed with the previous batch. The volume of the interface depends on the type of products. The interface or contamination volume between each particular pair of refined products is a known constant. • For preventing contamination in the pipeline, the interface material is never discharged at intermediate DCs and will remain in the pipeline until reaching the final DC. • Because of excessive contamination, some sequences of products in the pipeline are forbidden. • The volume of each batch must lie between known lower and upper bounds considering the type of product, and no two consecutive batches could contain one product. • The refinery is capable of providing the required products. • Product injection takes place only in the refinery, and DCs are not able to inject. • At most, one DC at a time is connected to the pipeline during discharge operations. • In each DC all tanks for each product are considered as an aggregate tank. • During injection of a new batch discharging priority is with the batches that are located at the entrance of DCs more distal to the refinery. In other words, the rule “farthest terminalfirst served” when multiple product deliveries from a batch to depots during a pumping run is executed. • Due to quality control of discharged products in DCs, each batch that is discharged at any DC should be kept outside of the distribution process for a certain period, until its impurities are settled. The settling period of each product is given. • When the last part of a batch is discharged at one of the DCs during injection of a new batch, the settling period will begin. • The contaminated volume of each batch can be used after discharging at the final DC and settling period. • Daily demand for each product is specified in DCs throughout the time horizon and must be provided before the end of the day, back order carrying a penalty cost. • Due to technical problems such as repairs or high pumping costs the pipeline stops in several predetermined periods. The solution vector consists of the following outcome. • Pipeline optimal schedule includes a sequence of products that should be injected into the pipeline, size of batch, duration and completion time of pumping each batch, availability time of each batch after passing the settling period in DCs, and its discharge duration due to injecting a new batch. • Inventory management, i.e., the allowable level of each product in the tanks to provide the demands with minimum possible delay. • The minimum cost of interfacing the products in the pipeline and penalties. • The maximum use of the pipeline during the time horizon. 13900

dx.doi.org/10.1021/ie200101a |Ind. Eng. Chem. Res. 2011, 50, 13899–13910

Industrial & Engineering Chemistry Research

ARTICLE

3. MODEL FORMULATION To formulate the problem, the notations used by Cafaro8,13 are applied and the batches are shown by the index i and sorted in an ascending manner (batch i is injected after batch i1). Total batches are divided into two groups: the first group includes batches that had already been in the pipeline and are shown by the index r. The second group includes those batches that can be injected during the time horizon and may not be used completely. These batches are shown by the index j. DCs are shown by the index n and are sorted in ascending manner (DCs that are closer to the refinery are shown by smaller indexes). Days are shown by the index t and are sorted in an ascending manner. Products are shown by the index p or q, and pipeline stop periods are shown by index k. The constraints used in the problem formulation are based on problem conditions and assumptions, and divided into a few groups. 3.1. Allocating Products to the Batches. Each new batch might include at most one of the products. Binary variable yj,p takes the value 1 if and only if batch i is the product p, thus



p∈P

yj, p e 1, " j ∈ I new

ð1Þ

If one of the considered batches contains no product, all subsequence batches will be considered empty.



p∈P

yj, p e



p∈P

yj1, p " j ∈ I new

ð2Þ

Note that batch j1 is injected before batch j, and if batch j1 is empty the RHS will be zero. As a result, variable yj,p will be zero for every product p. If the sequence of two products p and q are not allowed, the value of parameter sequencep,q is zero and will be excluded from final batch sequences. Thus yj1, p þ yj, q e 1 þ sequencep, q , " j ∈ I new , " p, q ∈ P ð3Þ Types of batches that already exist in the pipeline are defined by parameter inityr,p. This parameter is equal to 1 if and only if the content of batch r is p yr, p ¼ inityr, p , " r ∈ I , " p ∈ P old

of a new batch j in the pipeline should start after dispatching the previous one (j1) and performing the required changeover operation ð5Þ

Continuous variables Lj and Cj show the duration and completion time for batch j, and Cj  Lj represents the beginning time of pumping batch j. The completion time should terminate before the end of time horizon. Also, the pumping duration of batch j is always inferior to the completion time of batch j Lj e Cj þ h̅ max , " j ∈ I new

3.3. Length and Size of Each Batch. Because of operational restrictions, the volume of each batch must rest in a specific range based on product type. Therefore p

p

lot min  yj, q e Q j e lot min þ ð1  yj, p Þ  Q̅ max , " j ∈ I new , " p ∈ P

ð7Þ

If batch j contains product p, then the binary variable yi,p takes the value 1 and therefore the volume of batch j (Qj) should be between its minimum and maximum size; otherwise, the constraint (eq 7) is redundant. Note: If the consecutive batches contain the same product then this assumption (batch size) may be violated. Therefore, we assume that it is not possible that consecutive batches contain one product; however, this assumption may exclude some feasible solutions. The batch volume is restricted by the minimum and maximum pumping rate Lj  vbmin e Q j e Lj  vbmax , " j ∈ I new

ð8Þ

If batch j is not empty (∑p ∈ Pyj,p = 1) then its length must be ranged between a minimum and maximum length; otherwise, it is set to 0. ! ! Q̅ min Q̅ max  ∑ yj, p e Lj e  ∑ yj, p , " j ∈ I new vbmax vb p∈P p∈P min ð9Þ 3.4. Volume of the Interface between Consecutive Batches. When batch i is injected, a small volume is mixed with batch i1. Depending on the products, the volume of the mixture is different and for simplicity is assumed to be constant value IFp,q (see Figure 2). The lower bound of continuous variable Ifi,p,q, which represents the amount of produced mixture, is obtained through

Ifi, p, q g IF p, q  ðyi, p þ yi1, q  1Þ, " p, q ∈ P, " i ∈ I, i > 1

ð10Þ

ð4Þ

3.2. Length and Completion Time of Each Batch. Injection

Cj  Lj g Cj1 þ τ̅ p, q ðyj1, p þ yj, q  1Þ, " j ∈ I new , " p, q ∈ P

Figure 2. Interface material between batches i1 and i2.

Since we want the value of variable Ifi,p,q be minimum in objective function, its upper bound is controlled by minimizing the objective function. 3.5. Batch Position in the Pipeline after New Injection. When a new batch is injected, then the position and volume of some batches in the pipeline may change. Therefore, the discharged volume and remaining volume of each batch in the pipeline must be calculated. To determine the position of batch i in the pipeline after pumping the new batch j (i e j), the continuous variables Fij and Wji are used. According to the definition, the upper volumetric coordinate of batch i at the completion time of pumping run j is equal to the remaining volume of batch j in the pipeline plus the upper volumetric coordinate of the batch behind it (batch i+1) at time Cj j

ð6Þ

j

j

Fi þ 1 þ Wi ¼ Fi , " i ∈ I, " j ∈ I new , i < j 13901

ð11Þ

dx.doi.org/10.1021/ie200101a |Ind. Eng. Chem. Res. 2011, 50, 13899–13910

Industrial & Engineering Chemistry Research

ARTICLE

Figure 3. Batch movement and product delivery while pumping batch i4. j In fact, Fi+1 represents the lower volumetric coordinate of batch i at the completion time of run j. Also, the remaining volume of batch j in the pipeline at time Cj is the same as the upper volumetric coordinate of batch j at the completion time of pumping run j

j

j

Fj ¼ Wj , " j ∈ I new

ð12Þ

The upper volumetric coordinate of batch i at the completion time of pumping run j1, after injection of new batch j, is increased at most as much as the volume of new batch j, but during the injecting of batch j part of batch i and batches behind it (i e i) may be discharged; therefore, the upper volumetric coordinate of batch i at the completion time of pumping run j1, after injection of new batch j, is increased as much as Qj  ∑n∈N∑igIDij,n . j

j1

Fi ¼ Fi

þ Qj

∑ ∑ Dj,i n, n ∈ N

" i ∈ I, " j ∈ I new , i < j

i gi

ð13Þ For example, in Figure 3a, the upper volumetric coordinate of batch i2 at the completion time of pumping run i3 is equal to 13 (Fi3 i2 = 13). The volume of the new batch (i4) is equal to 7 volumetric units, and during its injection 4 units of batch i1 in DC n4 and 3 units of batch i3 in DCn2 are discharged, = 4 and Di4,n2 = 3). Since batch i3 is located respectively (Di4,n4 i1 i3 behind batch i2, the upper volumetric coordinate of batch i2 at the completion time of pumping run i4 is increased as many as = 7  3 = 4 units (see Figure 3b). Qi4  Fi4,n2 i3 The upper volumetric coordinate of new batch j at its completion time is equivalent to the volume of batch j minus the volume of the new batch which is discharged during the injection j Fj

¼ Qj



n∈N

j, n Di ,

"j∈I

new

ð14Þ

Upper volumetric coordinates of batches that existed before the start of scheduling are defined by parameter F 0r as in Frj  1 ¼ F̅ r0 , " r ∈ I old , j ¼ f irstðI new Þ

ð15Þ

3.6. Batches Discharging during New injection. In previous models researchers considered discharging order as a postsolve procedure. They used an algorithm to work out the order of DCs for discharging operation.8,9 In this model it is assumed that during injection of a new batch the first batches discharged are located in the entrance of DCs far away from the refinery. For example, in Figure 4 the volume of new batch i5 is equal to 11 volumetric units and during its injection 2 units of batch i4 in DCn2, 5 units of batch i1, and 4 units of batch i2 in DC n4 are = 2, Di5,n4 = 5, and Di5,n4 = 5). According to discharged (Di5,n2 i4 i1 i2 this assumption, at the first 9 units of batch i5 are injected 5 units

Figure 4. Discharge order during injection of new batch i5.

of batch i1 and 4 units of batch i2 at DC n4 are discharged, respectively. Immediately thereafter, 2 units of batch i5 are injected and 2 units of batch i4 at DCn2 are discharged. Equations 2123 force this requirement (the order of discharging operation when a new batch is injected). However this assumption may exclude some feasible solutions and even discard the optimal schedule, but the order and exact time of discharging of batches will be determined by the model. The remaining volume of batch i at time Cj1 is equal to Wj1 i , and the discharged part of batch i during the injecting of batch j is equal to ∑n∈NDij,n; thus, the remaining volume of batch i at the end of pumping batch j is j1

j

Wi ¼ Wi





j, n

n∈N

Di , " i ∈ I, " j ∈ I new , i < j

ð16Þ

If batch i can be discharged at DC n when batch j is pumped, the associated discharged volume is given by Dj,n i . Decision variable takes the value 1 if and only if part of batch i is discharged at xj,n i DC n when batch j is injected j, n

D̅ min  xi

j, n

e Di

j, n

e D̅ max  xi ,

" n ∈ N, " i ∈ I, " j ∈ I new , i e j

ð17Þ

The total discharged volume of batch i during injection of batch j is always less than or equal to the remaining volume of batch i in the pipeline at time Cj1 j, n j1 Di e W i , ∑ n∈N

" i ∈ I, " j ∈ I new , i < j

ð18Þ

As already mentioned in model assumption, the interface material is never transferred to intermediate depots. Therefore, it will remain in the pipeline until reaching the final depot, where it is withdrawn and reprocessed. Otherwise, a new interface will be generated, thus leading to higher product losses. Moreover, it will act as a plug between incompatible products when the batch separating them vanishes through stripping operations. Also, a forbidden sequence may occur in the pipeline because of a complete discharge of a batch. Thus, the interface volume should be discharged at the last DC when the batch reaches the end of the pipeline. The volume of batch i discharged at DCs (except for the last DC) during injection of batch j is always less than or equal to the remaining volume of batch i in the pipeline at time Cj1 minus the contaminated volume of batch i (∑p∈P∑q∈PIfi,p,q) j, n j1 Di e Wi  ∑ ∑ Ifi, p, q , ∑ p ∈ Pq ∈P n < jNj

" i ∈ I, " j ∈ I new , i < j

ð19Þ 13902

dx.doi.org/10.1021/ie200101a |Ind. Eng. Chem. Res. 2011, 50, 13899–13910

Industrial & Engineering Chemistry Research

ARTICLE

Figure 5. Discharging products from pipeline to DCs.

Figure 6. Feasibility condition for diverting products from pipeline to DCs.

The remaining volume of initial batches in the pipeline is determined by the parameter W 0r

The lower volumetric coordinate of batch i at time Cj1 is equal j1 . After injection of batch j the lower volumetric coordinate to Fi+1 of batch i is increased as much as the volume of batches that are ahead of batch i and being discharged during injection of batch j. Therefore, the lower coordinate of batch i at time Cj is equal to j1 + ∑ngn∑i