Abstract
Short-term scheduling of oil refinery operations is a complicated optimization problem that requires a high level of detail and needs efficient approaches and software tools. Oil refineries are naturally categorized as continuous process industries due to their production processes, which have essentially different characteristics and constraints from discrete manufacturing processes. It is a significant problem to design effective approaches for oil refinery scheduling optimization. Therefore, this paper aims to provide solutions to the above very challenging problem by proposing a novel methodology. The problem is how to optimize crude oil unloading to charging tanks and charging schedules for different types of crude oils to distillation units (CDUs). Several realistic operational features are considered, such as different arrival times for crude oils, continuous operation of CDUs, no rework of crude oils, and the ability to perform preventative maintenance on CDUs. To solve this problem effectively, a new mixed-integer nonlinear programming (MINLP) model is developed. Industrial case studies are used to demonstrate the effectiveness of the proposed formulation. The computational results show that the case studies are effectively solved with the proposed solution approach.
1. Introduction
Global market competitiveness and the related sustainability issues make it critical for a company to identify ways to improve profit, minimize carbon dioxide emissions, and reduce costs. It is demonstrated that efficient production planning and scheduling can yield economic and environmental benefits for industries that are characterized as high energy consumption [1]. Process industries, such as steel manufacture and oil refining, have a high energy consumption, and a high cost. Therefore, it is important to propose effective methods for efficiently managing the operations of a plant.
Nowadays, a new factory is managed in a hierarchical way, with three layers: production planning at the top, scheduling at the meddle, and process control at the bottom. It is well established that, practically in all modern process plants, unit control objectives have been optimized at the process control layer through the installation of advanced control systems. Additionally, with the commercialization of linear-programming-based approaches, planning technology has advanced significantly, allowing for the efficient development of an optimal plan [2]. At the middle layer, however, one needs computationally efficient approaches and associated software tools for industrial-scale applications [3, 4]. Indeed, in practice, a planner develops a short-term schedule manually using a trial and error method [3]. With a gap between the upper and lower layers, the three layers cannot be merged, resulting in a plant that cannot be efficiently run [5, 6]. Therefore, it is necessary to investigate effective strategies for short-term scheduling in order to design tools. Because an oil refinery is a typical process industry that contributes significantly to the economy, this research examines its short-term scheduling difficulty in detail.
Figure 1 depicts a general oil refinery system. As illustrated in Figure 1, there are several storage tanks near the port, a pipeline, charging tanks inside the plant, distillation units, and other industrial equipment. In terms of operations, crude oil operations and production are two different processes. Ships carrying crude oil bring it to the port. The crude oil is subsequently transferred to storage tanks. Pipelines deliver oil from storage tanks to charging tanks. Oil is transferred to the distillation units via charging tanks. This is referred to as crude oil processes. Distillation products are subsequently processed in different production units to provide a variety of components. The production stage involves the combination of these components to create a complete product.

The study of [9] proposes a precise scheduling crude-oil problem including crude unloading at ports, designs a discrete-time mixed-integer nonlinear programming model, and addresses the model's linear relaxation. In [10–14] illustrative models of mixed-integer programming are presented. The primary disadvantage is that the constant time period must be small enough to achieve an accurate solution that leads to an enormous set of binary variables and complicates the solution problem [15, 16]. Studies in [11, 17–20], continuous-time models are used to decrease the set of discrete variables. While this method reduces the set of discrete variables, it has the disadvantage of containing nonlinear constraints [21]. The study of [22] modifies the model and develops an iterative method to solve the MINLP model while taking nonlinear blending requirements into consideration. The refinery systems are represented using a global event formulation, including crude-oil unloading from pipelines [21, 23–25]. The scheduling horizon is initially segmented into fixed-length sub-intervals and then into different variable-length time windows.
Application of heuristics algorithms, which include genetic algorithms, simulated annealing algorithms, and tabu search algorithms, is a good choice for complex scheduling problems [26–29]. These methods are only applicable to problems in which the scheduled jobs are initially deterministic and the feasibility of solution is not an issue. To create a short-term schedule for a refinery process, the set of jobs should be determined, the detailed operations for each job should be defined, the time required for each operation should be determined, and the jobs should be sequenced. Meanwhile, there is no clear method to determine whether a schedule is feasible. In addition, these approaches are not appropriate for short-term refinery scheduling. Therefore, a novel technique for addressing this challenge should be proposed.
To address a short-term scheduling problem for crude oil operations, the study in [3] divides the scheduling problem into two hierarchical subproblems. At the highest level, one must determine a refining schedule by optimizing specific objectives, while, at the lowest level, a comprehensive schedule for a certain refining operation is developed. In [3, 8, 30, 31], a heuristic is presented to determine the realizability of a certain refining schedule in [3] using a Petri net model. Then, a detailed schedule is developed. However, without a detailed schedule, that method cannot determine whether or not the refining schedule is feasible. Moreover, no approach is described in [3] for efficiently generating a realizable refining schedule.
The major challenges in developing an optimal refining schedule are as follows: (1) several objectives require optimization; and (2) discrete-event and continuous variables interact. To address these obstacles, this paper aims to provide solutions to the above very challenging problem by proposing a novel methodology. The problem is how to optimize the unloading of crude oil from storage tanks, its transfer to charging tanks, and the charging schedule for each crude oil to the CDUs.
The contributions of this paper are stated as follows:(1)A new mixed-integer nonlinear programming (MINLP) model is developed to solve the scheduling problem of oil refinery operations; compared with current studies [3, 8, 16, 30–33], it can handle all unreliable CDUs in the oil refinery system.(2)Many actual operational characteristics are considered in the proposed model, including different crude oil arrival times, continuous running of CDUs, no rework of crude oils, the ability to perform preventative maintenance on the CDUs, and the changeovers required when switching from one type of oil to another during changing from one charging tank to another for CDU feeding.(3)The operation of an oil refinery is characterized by a combination of discrete and continuous operations. Therefore, both discrete-event and continuous behavior is properly modeled using the proposed model.
This paper is organized as follows. Section 2 presents the statement and complexity of scheduling crude oil activities on a short-term basis. Then, in Section 3, the method of scheduling is presented. Using industrial case studies, Section 4 demonstrates the applicability and effectiveness of the proposed approach. The conclusions are presented in Section 5.
2. Problem Description
2.1. Problem Definition
The purpose of this study is to address a problem related to oil refinery activities. The operation of an oil refinery is a large-scale system that is characterized by a combination of discrete and continuous operations. On the one hand, to make an obtained model tractable, the size of the model must not be large. On the other hand, both discrete-event and continuous behaviour should be properly modelled.
The complexity of the model is proportional to the size of the system when using the resource-oriented Petri net (ROPN) modelling approach developed in [34–39], as each resource in the system is represented by a single point in the model. This paper will extend the ROPN modelling method to model an oil refinery process by modelling each resource in the system as a module to make the obtained model tractable. The Petri net model is originally designed to represent discrete event processes and the discrete-event behaviour of a refinery can be naturally modelled. The key is to describe the continuous behaviour. This can be done by defining continuous places and transitions, continuous tokens, and continuous transition firing rules.
In this research, a crude-oil operation system consists of two different types of resources: charging tanks and crude distillation units. There are two types of activities allowed: the arrival of crude oil at charging tanks and the transfer of crude oil from charging tanks to CDUs. A crude-oil scheduling problem is described by the following: (a) a time horizon, (b) the arrival time of crude oils, (c) tank capacity constraints, and (d) unloading rate to tanks constraints, and (e) feeding rate to CDUs constraints.
The problem has the following assumptions:(1)All CDUs are available for crude oil processing at time 0 and throughout the scheduling horizon(2)A CDU can process at most one oil type at a time(3)The crude oil can be processed at most two CDUs at a time(4)Without interruption, each crude oil operation must be completed(5)Continuous operation of CDUs is needed throughout the scheduling horizon(6)The unloading and feeding rates, arrival times of crude oils, and preventive maintenance windows are fixed and known in advance(7)The crude oils is processed properly (no rework allowed)
The objective is to determine the number of times each operation will be performed, the start and end times of each activity, and the volume of crude oil to be transferred in order to minimize the cost of oil distillation.
2.2. Complexity of the Problem
The oil refinery is an example of a continuous process, as the materials used in it are continuously transported between its components via pipelines. However, the running of a refinery requires a significant number of discrete events, including the start and end of charging the tanks, the changeover of crude types via pipeline, and the changeover of charging tanks to deliver oil to CDUs. This implies that oil refinery activities are hybrid in nature because they combine discrete-event operations with continuous operations. Since operating a refinery involves discrete events, the scheduling problem is combinatorial and belongs to a set of NP-complete problem [15]. In addition, the limited number of charging tanks further complicates the scheduling problem. It is more difficult than solving a scheduling problem with sufficient charging tanks since operational constraints and costs must be considered [40].
3. The Scheduling Method
To develop a refining schedule, the scheduling conditions should be considered as constraints. As previously stated, the scheduling conditions are associated with the number of available tanks and the initial state of oil inventory of various types. One needs merely to verify that these conditions are met. We suppose that they are satisfied in this case; otherwise, no schedule is feasible. Other conditions should be associated with each CDU’s production rate, which should be represented as constraints. Because the oil in the arriving tankers must be refined and is not immediately available, the oil in an arriving tanker becomes available sometimes after the tanker arrives. Several tankers arrive at varying times. Suppose that throughout the scheduling horizon, crude oil types will arrive. To compute the amount of crude oil types to be processed on every CDU, this section propose the MINLP model. The following notations are used:
3.1. Indices
c is the number of oil types n is the number of charging tanks m is the number of CDUs j, l are the index of oil types, j, l = 1, 2, …, c i is the index of CDUs, i = 1, 2, …, m k is the index of charging tanks, kq = 1, 2, …, n
3.2. Parameters
is arrival time of a crude oil j Fi(Min) is the minimum feeding rate of the CDU i Fi(Max) is the maximum feeding rate of the CDU i Uk(Min) is the minimum unloading rate of the tank k Uk(Max) is the maximum unloading rate of the tank k is the initial volume of a crude oil j is the maximum capacity of the charging tank k tBi is the starting time of the PM on the CDU i tEi is the ending time of the PM on the CDU i Ckij is the cost of the operation oil type j that fed from the tank k to the CDU i H is the scheduling horizon, which is often a week or ten days in duration
3.3. Operation Variables
ξkij is the amount of the oil type j to be fed from the tank k to the CDU i γjk is the amount of the oil type j to be unloaded to the tank k
3.4. Time Variables
SUjk is the starting time of the unloading oil type j from the tank k to the CDU i CUjk is the completion time of the unloading oil type j to the tank k SFkij is the starting time of the feeding oil type j from the tank k to the CDU i CFkij is the completion time of the feeding oil type j from the tank k to the CDU i
3.5. Binary Variables
Xkij = 1 if oil type j is fed from the tank k to the CDU i, Xkij = 0 otherwise Ojk = 1 if oil type j is unloaded to the tank k, Ojk = 0 otherwise Ajlk = 1 if oil type l is unloaded after oil type j to the tank k, Ajlk = 0 otherwise Yjlki = 1 if oil type k is processed after oil type j on the CDU i, Yjlki = 0 otherwise Zkij = 1 if PM action is performed immediately before the start time of the feeding oil type j from the tank k to the CDU i, Zkij = 0 otherwise
The model contains sets of constraints that represent conditions that must be satisfied. The first set of constraints represents the oil type unloading to the tanks.
The crude oil j must be unloaded exactly one time to tank k as illustrated in.
To represent the crude volume unloaded into a tank, we define a positive variable γjk. SUjk and CUjk are used to indicate the start and completion times of crude oil j unloaded to tank k. Then, the crude volume must satisfy its minimum and maximum unloading rates.
The crude oil j must appear once in their sequence on the same tank k.
Constraint (4) confirms the correct order of the oil types and the starting time of oil type l should be greater than or equal to the completion time of the oil type j.
The start time of an oil type j must be unloaded to tank k based on their arrival time.
Tanks must receive oil types continuously without interruption. The continuous operation constraint is obtained by comparing the sum of the unloading durations to the time horizon, as tanks only receive one oil type at a time.
The total crude amount of the oil type j unloaded to tank k cannot exceed the initial crude oil volume.
The total crude amount of the oil type j unloaded to tank k cannot exceed the maximum capacity of the charging tank.
To model tank feeding CDU operations, Constraint (9) ensures that each oil type j is fed from tank k to at most two CDUs.
To represent the crude volume fed to CDUs, we define a positive variable ξkij. SFkij and CFkij are used to indicate the start and completion times of oil type j from fed tank k to each CDU i. Then, the crude volume must satisfy its minimum and maximum feeding rates as shown in Constraints (10) and (11).
Constraints (12) and (13) confirm that assigned oil type j must appear once in their sequence on the same CDU i.
Constraint (14) confirms the correct order of the crude oils and the starting time of crude oil l should be greater than or equal to the completion time of the crude oil j.
CDUs operate without interruption. The continuous operation constraint is obtained by comparing the sum of the distillations durations with the time horizon, as CDUs only receive one oil type at a time.
The completion time of an oil type j must be finished based on the end time of the scheduling horizon.
On a tank, the inlet and outlet transfer operations must not overlap.
The total amount of the oil type j fed from tank k to each CDU i cannot exceed the amount of the oil type volume unloaded to tank k.
Constraints (19) and (20) confirm that the completion times of the oil types on the CDUs have to respect the preventive maintenance period [tBi, tEi].where is the duration of feeding operation of oil type j from tank k to CDU i and can be formulated as
Constraint (22) guarantees that the difference between the start and end times of an oil type j and its oil type is not greater than the total feeding time (No idle time constraint).
The objective function is to minimize the cost associated with oil type operations in the distillation unit.
Finally, Constraints (24)–(35) define the non-negativity and integrality of the variables.
4. Industrial Case Studies
This section includes case studies that demonstrate how the approach presented in this study can be implemented.
4.1. Case Study 1
This case study is based on a real-world application in Saudi Arabia's refinery industry. The refinery has two CDU 1 and 2. A short-term schedule for the next ten days should be developed three times per month. There are four types of oil to be processed in this scheduling horizon. Both two CDU can process any type of crude oil. Table 1 shows the costs associated with different oil types and CDU. Two charging tanks are available during the scheduling horizon. Initially, charging tanks have no crude oil. Distillers 1 and 2 are being fed by tanks 1 and 2. Table 2 shows the charging tanks in their initial state. The minimum and maximum unloading rates for three tanks are [0 400] tons/h. The minimum and maximum feeding rates from three tanks to CDU are [0 350] tons/h and [0 400] tons/hr, respectively. The parameters of the preventive maintenance for CDU are displayed in Table 3. All experiments were conducted on the computer with Intel(R) Core (TM) i7-4702MQ CPU @ 2.20 GHz, 16 GB RAM. The developed mathematical model is solved using a Lingo solver that can solve linear, nonlinear, integer, and quadratic models.
It is simple to write down the MINLP model for case study 1 using the initial state information. We obtain the optimal solution for case study 1 by solving the MINLP model, as shown in the Gantt chart illustrated in Figure 2. The following results of the optimal cost and crude oil assignment are obtained by the MINLP model.(1)The optimal cost is 287,150 SR(2)The computational time is <976 seconds(3)Tank 1: 16,000 tons of type #3 oil and 30,000 tons of type #1 oil are unloaded from storage tanks(4)Tank 2: 20,000 tons of type #4 oil and 25,000 tons of type #2 oil are unloaded from storage tanks(5)CDU 1: 14,700 tons of type #3 oil is fed from tank 1, and 24,150 tons of type #2 oil is fed from tank 2(6)CDU 2: 1,300 tons of type #3 oil is fed from tank 1, 20,000 tons of type #4 oil is fed from tank 2, 30,000 tons of type #1 oil is fed from tank 1, and 850 tons of type #2 oil is fed from tank 2

4.2. Case Study 2
This case study has three CDU 1, 2, and 3. A short-term schedule for the next ten days should be developed three times per month. There are six oil types to be processed in this scheduling horizon. All three CDU can process any type of crude oil. Table 4 shows the costs associated with different oil types and CDU. Three charging tanks are available during the scheduling horizon. Initially, charging Tanks 1–3 have no oil type. CDU 1–3 are being fed by tanks 1–3. Table 5 shows the charging tanks in their initial state. The minimum and maximum unloading rates for three tanks are [0 400] tons/h. The minimum and maximum feeding rates from three tanks to CDU are [0 400] tons/h, [0 450] tons/hr, and [0 500] tons/hr respectively. The parameters of the preventive maintenance for CDU are displayed in Table 6.
The optimal solution for case study 2 is shown in the Gantt chart displayed in Figure 3 and summarized as follows:(1)The optimal cost is 366,400 SR(2)The computational time is <1962 seconds(3)Tank 1: 16,000 tons of type #4 oil and 30,000 tons of type #1 oil are unloaded from storage tanks(4)Tank 2: 30,000 tons of type #2 oil is unloaded from storage tanks(5)Tank 3: 5,000 tons of type #6 oil, 16,000 tons of type #5 oil, and 30,000 tons of type #3 oil are unloaded from storage tanks(6)CDU 1: 5,000 tons of type #6 oil is fed from tank 3, and 30,000 tons of type #1 oil is fed from tank 1(7)CDU 2: 16,000 tons of type #5 oil is fed from tank 3, 30,000 tons of type #2 oil is fed from tank 2, and 21,600 tons of type #3 oil is fed from tank 3(8)CDU 3: 16,000 tons of type #4 oil is fed from tank 1 and 8,400 tons of type #3 oil is fed from tank 3

4.3. Case Study 3
This case study has four CDU 1, 2, 3, and 4. Three charging tanks are available during the scheduling horizon. There are seven types of oil to be processed in this scheduling horizon. A short-term schedule for the next ten days should be developed per month. All four CDU can process any type of crude oil. Table 7 presents the costs associated with different oil types and CDU. Initially, charging Tanks 1–3 have no oil type. CDU 1–4 are being fed by tanks 1–3. Table 8 shows the charging tanks in their initial state. The minimum and maximum unloading rates for the three tanks are [0 500] tons/h. The minimum and maximum feeding rates from the three tanks to CDU are [0 500] tons/h. The parameters for maintenance are displayed in Table 9.
The optimal solution for case study 3 is shown in the Gantt chart illustrated in Figure 4 and summarized as follows:(1)The optimal cost is 123,000 SR(2)The computational time is <2562 seconds(3)Tank 1: 16,000 tons of type #2 oil, 16,000 tons of type #4 oil, and 25,000 tons of type #1 oil are unloaded from storage tanks(4)Tank 2: 5,000 tons of type #7 oil and 21,000 tons of type #3 oil are unloaded from storage tanks(5)Tank 3: 30,000 tons of type #5 oil and 10,000 tons of type #6 oil are unloaded from storage tanks(6)CDU 1: 25,000 tons of type #1 oil is fed from tank 1(7)CDU 2: 16,000 tons of type #2 oil is fed from tank 1 and 16,000 tons of type #4 oil is fed from tank(8)CDU 3: 30,000 tons of type #5 oil is fed from tank 3, 5,000 tons of type #7 oil is fed from tank 2, and 10,000 tons of type #6 oil is fed from tank 3(9)CDU 4: 21,000 tons of type #3 oil is fed from tank 2

4.4. Case Study 4
Case study 4 consists of five CDU 1–5, three charging tanks, eight types of oil to be processed. A short-term schedule for the next ten days should be developed per month. Table 10 presents the costs associated with different oil types and CDU. Table 11 shows the charging tanks in their initial state. The minimum and maximum unloading rates for the three tanks are [0 500] tons/h. The minimum and maximum feeding rates from the three tanks to CDU are [20 500] tons/h. The parameters for maintenance are displayed in Table 12. The optimal solution for case study 4 is shown in the Gantt chart presented in Figure 5 and summarized as follows:(1)The optimal cost is 208,000 SR(2)The computational time is <33471 seconds(3)Tank 1: 16,000 tons of type #6 oil, 18,000 tons of type #8 oil, and 15,000 tons of type #7 oil are unloaded from storage tanks(4)Tank 2: 22,000 tons of type #3 oil and 16,000 tons of type #1 oil are unloaded from storage tanks(5)Tank 3: 25,000 tons of type #2 oil and 30,000 tons of type #4 oil, and 10,000 tons of type #5 oil are unloaded from storage tanks(6)CDU 1: there are no oil types are fed from charging tanks(7)CDU 2: 10,000 tons of type #2 oil is fed from tank 3(8)CDU 3: 22,000 tons of type #3 oil is fed from tank 2 and 30,000 tons of type #4 oil is fed from tank 3(9)CDU 4: 15,000 tons of type #2 oil is fed from tank 3 and 10,000 tons of type #5 oil is fed from tank 3(10)CDU 5: 16,000 tons of type #6 oil is fed from tank 1, 18,000 tons of type #8 oil is fed from tank 1, 15,000 tons of type #7 oil is fed from tank 1, and 16,000 tons of type #1 oil is fed from tank 2

Finally, Table 13 shows the size and performance of the proposed model in all studies. As seen in Table 13, the proposed model contains many more variables and constraints if the size of the problem is increased. In addition, the CPU time is greatly increased if the size of the problem is increased. Therefore, the scheduling problem is a combinatorial and NP-complete problem.
5. Conclusions
Scheduling crude oil operations on a short-term schedule is a complex problem, as a schedule must include detailed operations that satisfy all resource and process criteria. Due to the NP-hard nature of the problem, there are no efficient methods or software tools that exist, and the scheduling process must still be performed manually. While scheduling a refinery with an insufficient number of charging tanks is a complicated problem, the limited number of charging tanks adds another level of complexity. It is more problematic than addressing a scheduling problem with an adequate number of charging tanks, as operational constraints and costs must be considered.
Three charging tanks are generally required for each CDU to determine a schedule that maximizes production rate in studies [3, 8, 16, 30–33]. Although many refineries can satisfy their charging tank requirement, there are other refineries for which this need is impossible. It is necessary to maintain a few charging tanks or to install more CDU without building enough charging tanks. Therefore, this study focuses on scheduling a refinery without sufficient charging tanks to solve such a practical problem with several realistic operational features. We develop a new continuous-time MINLP formulation for scheduling crude oil that can schedule the system. We incorporate several realistic operational features, such as different arrival times for crude oils at charging tanks, the ability to process crude oil type on at most two CDUs, no rework of crude oils, and the ability to perform preventative maintenance on a CDU. The MINLP’s computational performance is superior in terms of the quality of the solutions obtained. In summary, solving this scheduling problem as an MINLP demonstrates that the approach is feasible and the results are encouraging, as it was possible to solve instances with a compatible time horizon compatible with a time horizon suitable for the refinery environment, and it was sufficient to achieve a solution in acceptable computational time.
Preventive maintenance actions can significantly decrease the chances of unexpected CDU breakdowns, but they cannot completely eliminate them. As a result, when there is a failure, corrective maintenance (CM) actions are necessary. CM interventions do not change the CDU’s age; they only restore it to its pre-failure state of operation. Our future work will consider adding CM actions in the proposed model. For practical application, one requires effective software tools. Our future work will also include the development of such software tools using the proposed methods.
Data Availability
The raw data that are used to support the findings of this study are included within the article.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
This Project was funded by the National Plan for Science, Technology, and Innovation (MAARIFAH), King Abdulaziz City for Science and Technology, Kingdom of Saudi Arabia, Award Number (2-17-01-001-0008).