Next Article in Journal
Textiles for Very Cold Environments
Previous Article in Journal
Study on the Damage Mechanism of Coal under Hydraulic Load
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Data-Driven Heuristic Optimization for Complex Large-Scale Crude Oil Operation Scheduling

1
Industrial Engineering Department, Ankara Yıldırım Beyazıt University, 06010 Ankara, Turkey
2
Industrial Engineering Department, İstanbul Technical University, 34367 Istanbul, Turkey
*
Author to whom correspondence should be addressed.
Processes 2024, 12(5), 926; https://doi.org/10.3390/pr12050926
Submission received: 22 March 2024 / Revised: 24 April 2024 / Accepted: 28 April 2024 / Published: 1 May 2024
(This article belongs to the Section Energy Systems)

Abstract

:
This paper addresses the challenging scheduling of crude oil operations (SCOO) problem, characterized by the intricate sequencing of activities involving discrete events and continuous variables. Given the NP-Hard nature of scheduling problems due to their combinatorial complexity, this study employs a data-driven optimization approach. Initially, historical operational data relevant to the SCOO are scrutinized; however, due to data limitations, small-scale instances are solved using a mathematical programming model to generate data. Subsequently, operational solution data are processed using the Apriori algorithm, a renowned data mining technique. The insights gained are translated into heuristic rules, laying the groundwork for a novel data-driven heuristic algorithm tailored for the SCOO problem. This algorithm is then applied to a 45-day scheduling scenario, demonstrating the efficacy of the proposed approach.

1. Introduction

Refinery processes are generally where operational processes are scheduled within the framework of agreements made by the central planning unit that include vessel arrivals and information about the demanded product [1]. This scheduling process is of great importance for the competitiveness of refineries [2]. The scheduling of crude oil operations (SCOO) problem is defined by the combination of both discrete events and continuous processes. The fact that the SCOO problem includes both discrete events and continuous processes makes it an interesting problem in terms of both theoretical research and practical application [3]. The combinatorial structure of this problem causes the high complexity of the problem [4] and allows for each decision to create a different probability tree, and therefore, this makes the problem an NP-Hard problem [5].
The refinery process encompasses three distinct phases: crude oil operations, production, and final product delivery. During the crude oil operation management phase, crude oil is transported to the docking station via vessels, then conveyed into charging tanks at the refinery plant through a pipeline. Subsequently, the crude oil undergoes distillation in CDUs, with the careful management of various chemical and operational constraints throughout the process, including during the unloading of crude oil into tanks and the charging of CDUs from these tanks. A refinery processes various types of crude oil, each with its unique composition. The distillers in the refinery can process certain types of crude oil but not all. While a type of crude oil may be processed by multiple distillers, the effectiveness of each distiller in processing that type of crude oil may vary. It is possible to rank the effectiveness of each distiller in processing a particular type of crude oil. The planning department, responsible for crude oil operations, faces significant time constraints in solving this complex problem and making optimal decisions. Given the limited time available, even achieving an optimal, feasible decision is improbable. In refinery short-term operations management, scheduling crude oil operations proves to be one of the most challenging tasks [6].
The SCOO problem has a nonlinear mixed integer optimization structure, and this increases complexity and makes the problem challenging [7]. Mathematical programming models for the SCOO problem for time representation can be broadly classified into two categories: discrete-time and continuous-time representation [8]. In discrete-time problems, the planning interval is divided into small pieces, and the presence or absence of operations in these pieces is controlled with binary variables. There should be many time-intervals in the discrete-time representation to increase the precision and applicability of decisions made. However, as the time period represented becomes smaller, the complexity of the problem increases significantly [2]. In these approaches, each decision must start at the beginning of any time interval and end at the end of any time interval. Mixed integer programming models are commonly used to represent the problem [9]. The biggest disadvantage of this method is that the planning time must be divided into many intervals for the proposed model to be applicable. This requirement requires the use of many binary variables in the mathematical model, which causes a significant disadvantage in solution time.
To deal with large number of variables, researchers have turned to an event-based discrete-time modeling of the SCOO problem. Although event-based modeling allows for reducing the number of variables, the requirement that events start at the beginning of the time interval significantly negatively affects applicability [10].
The continuous-time representation is another way of approaching the SCOO problem. In continuous-time modeling, the planning period is not divided into time intervals, but the planning period is handled on an event basis. This situation allows for the elimination of a large number of binary variables, which is the most important disadvantage of discrete-time modeling. In a continuous representation, the event can occur at any time, which significantly reduces the number of binary variables in the model. However, this causes a new difficulty, nonlinear constraints, to be included in the problem [10]. Moreover, these events must be known before the planning period begins. To make the problem solvable, most discrete-time and continuous-time mathematical programming models make special assumptions. Unfortunately, these assumptions often result in a low-quality or unrealistic solution for real-world cases.
In the SCOO problem, there are many uncertainties in refinery management processes, such as vessel arrival times, unplanned maintenance, and product quality. Like time-based breakdowns, such as discrete or continuous models, the SCOO problem is considered, and the uncertainties in the processes are addressed as another breakdown. In addition to deterministic modeling, there are also stochastic models in the literature that take into account the uncertainty in SCOO processes [1].
Mathematical modeling is widely used for the especially short-term SCOO problem, involving a period of 1 week or 10 days in the literature; however, this preference compromises the optimal result due to the consideration of situations that may occur unique to the problems and the assumptions made to solve the model. The large-scale SCOO problem is difficult to solve with traditional optimization methods because it contains many binary variables and non-linear constraints [2]. Because of SCOO’s NP-Hard structure, heuristic approaches can be a good alternative to solve it [6]. Heuristics approaches can be an alternative to solve this kind of complex problem. However, it is not possible to directly apply heuristic and metaheuristic methods to the SCOO problem [11]. These techniques are only suitable for problems where the tasks to be scheduled are known in advance and feasibility is not an issue. However, to create a short-term schedule for a refinery process, one must first determine the number of tasks, define the specific activities and duration for each task, and establish their sequence. In order to apply existing heuristics to the problem, detailed information is needed, such as the tasks to be assigned about the problem to be clearly known and whether the solution to be proposed is feasible or not, which should not be an important issue. However, contrary to what is desired, in the SCOO problem, the only thing known at the beginning is the initial state of the refinery [10].
Ramteke and Srinivasan [12] has proposed the structure adapted genetic algorithm for the SCOO problem. In this study, the SCOO problem is first shown with a graph structure, and the crude oil flows between units are expressed as a network. Basically, the proposed method aims to determine the network that will be active for each period and the weight of that network, that is, the amount of crude oil. In this context, the chromosomes that express the solution of the genetic algorithm are defined as a matrix that is the combination of two structures, networks and weights. In this approach, the number of genes on each chromosome defined for each period must be very large. However, in the proposed approach, for each period, only networks that can perform operations in the relevant period are represented in the chromosome structure. The proposed solution approach has been tested on different cases. The case with the largest structure among these cases includes three crude distillation units (CDUs), eight tanks, and two types of crude oil. Additionally, this case involves 26 discharges, and this case has been solved for 60 periods. Although the study includes a very small number of crude oil types, it does not impose any restrictions on the mixability of these crude oil types. In addition, it is not touch about any additional constraint in the feeding process of CDUs. The absence of mixability and feeding constraints both significantly reduce the complexity of the SCOO problem and facilitate the application of the proposed solution approach to the problem.
In Hou’s [8] study, a genetic algorithm-based solution approach has been proposed for the SCOO problem. Applying a metaheuristic or heuristic algorithm to the SCOO problem is a serious, challenging issue and is stated in the study. To overcome this difficulty, a method is first proposed to find a feasible population, which is used in a genetic algorithm. The proposed solution approach has been applied to a case containing 3 CDUs, 12 tanks, and 7 types of crude oil for a 10-day planning period. In the case considered in the study, the number of tanks is greater than the number of crude oil, and a single type of oil is placed in each tank. This means that the mixability of crude oil is not included in the problem. Additionally, when the obtained solution is examined, it is seen that the CDUs are fed from only one tank at a time. These two features significantly reduce the complexity of the SCOO problem and limit the possibility of applying the proposed method in real-life problems.
In Zhang et al. [10], they proposed a decomposition strategy for the large-scale SCOO problem and an approach that hybridized a competitive swarm optimizer and mathematical programming to find feasible solutions. The problem has been handled as 12 h periods and made 10-day planning. In evolutionary optimization, decision matrices consist of the operation tanks and rates in each planning period. In the application case, there are 3 CDUs, 19 tanks, and 14 crude oil types. They claim that to best of their knowledge, in the literature, there is not any study as large as the one they worked on. However, in their cases, having a larger number of tanks than the number of crude oil types provides very a significant advantage, which simplifies the solution process. In their application, a crude oil mixture has been not allowed. However, it is known that when the crude oil mixture feature enters the problem makes it more complicated.
Kaid [13] has proposed a new hybrid petri net and tabu search approach to solve the short-term SCOO problem, which consists of two CDUs, two tanks, four types of crude oil, and a 10-day planning period under unreliable CDU property. The unreliability of CDUs has been modeled by a petri net algorithm, and this information has been used in the tabu search process.
Zhang et al. [2] proposed a two-stage evolutionary optimization algorithm driven by heuristic rules. The competitive swarm optimizer and the composite differential evolution optimizer have been used in steps of a proposed solution approach, respectively. In the first stage, the algorithm has created heuristic rules by making use of existing operational information, and then, in second step, a local search in the solution pool formed within the framework of these rules to reach a feasible solution is operated. In application, operational days have been divided into two parts, and the total application period is 10 days maximum. The method they apply is a population-based development algorithm and has some disadvantages, like all other population-based approaches. In addition, there is also a very strong assumption having a positive effect on the solution process that the tank contents are suitable for direct charging to the CDU. This assumption is generally not suitable for real cases.
In recent years, metaheuristics have begun to become important tools in solving nonlinear large-scale problems. However, metaheuristics cannot achieve the desired level of success in solving the SCOO problem. In this framework, there is a big gap for the SCOO problem [2]. Additionally, the use of information in these approaches is quite low. In fact, problem-specific information can be used to solve the problem [14].
In this study, a new heuristic algorithm based on the data-driven optimization (DDO) methodology is proposed for the large-scale SCOO problem. In DDO, parameters are obtained by first processing the operational data of the problem. Then, in the second stage, these parameters are used in the proposed model to solve the problem [15]. In DDO, the fact that the parameters of the problem are obtained from the data eliminates the need for assumptions to be made to solve the problem, and this allows for the proposed solution to be more suitable for real life [16]. In this context, historical operational data have been first investigated for the SCOO problem discussed in this study. However, due to insufficient data obtained, a different method has been followed to obtain operational data for the problem. First, short-term problems have been solved using the event-based mathematical model [17] recommended for similar problems in the literature. To best of our knowledge, such an approach does not exist in the literature. The operational data obtained from solving these problems has been analyzed using statistical methods and the Apriori algorithm, which is a well-known data mining algorithm in the literature. Using the obtained results, heuristic rules have been created, and the data driven-based novel heuristic approach proposed for the large-scale SCOO problem has been revealed. The proposed heuristic approach has been applied in a real case, and a 45-day planning period has been scheduled.
In summary, this study makes several significant contributions: (1) the introduction of a novel data-driven heuristic approach tailored for large-scale SCOO problems; (2) addressing the absence of past operational data by utilizing a mathematical model to solve short-term problems, with resultant insights used to inform the heuristic algorithm; (3) using a closed-loop data-driven optimization methodology by examining the operational decisions to be obtained as a result of the heuristic algorithm with data analysis methods and updating the heuristic rules again; (4) the inclusion of the transfer between tanks, a crucial aspect of real refinery management often overlooked in prior heuristic algorithms; (5) the incorporation of crude oil mixability considerations in both tank storage and CDU feeding processes; and (6) the application of the proposed heuristic approach in a real-world operational setting at a crude oil refinery in Turkey.
The rest of the paper is structured as follows. The description of the problem worked on is given in Section 2. In Section 3, the details of the proposed data driven-based novel heuristic approach for the SCOO problem are presented. The real case application is given in Section 4. Finally, the paper concludes with Section 5.

2. Definition of Scheduling of Crude Oil Operations Problem

The structure of the SCOO problem under study, which involves three key decisions, is illustrated in Figure 1. Initially, the unloading of crude oil arriving at the docking station via vessels is planned, with the unloading process executed through pipelines. The second decision concerns the charging process of CDUs, determining the tanks involved, the duration, and the amounts. Lastly, in the real-world problem at hand, there is a need for tank-to-tank transfers to prepare for future unloading or charging operations. Each operational decisions in the SCOO problem fraught with various chemical and operational challenges.
The planning department, tasked with managing crude oil operations, grapples with significant time constraints in resolving this intricate problem and making optimal decisions. Given the constraints of time, attaining a feasible decision, let alone an optimal one, is nearly improbable. Therefore, this study employs the proposed DDO methodology to model the problem and generate an acceptable solution for the SCOO problem within the confines of a restricted timeframe.
Manually determining the crude oil operations of a refinery is increasingly challenging due to a growing number of constraints. In this problem scenario, there is one docking station, 12 crude oil tanks, and two CDUs. The problem is divided into three stages: feeding, blending the tanks in, and charging the CDUs.
The refinery receives and processes 50 types of crude oil, each with operational parameters. Moreover, the number of crude oil types processed is expected to increase for more profitable operational outcomes. During processing, considerations of immiscibility and the precipitation of different crude oil types are vital. Due to cost considerations, crude oil storage, blending, and charging operations occur in the same tanks, with blending also possible in the pipelines when multiple tanks are opened to CDUs.
Crude oil properties necessitate the classification of tanks as national and non-national as well as with or without pumping infrastructure. Certain crude oil types are stored in tanks equipped with pumping infrastructure for continuous feeding, which introduces additional complexity and constraints related to pumps. For instance, there are limitations on the number of pumps for the simultaneous feeding of CDUs from specific tanks. Moreover, tank operations are complex due to piping system infrastructure and tank content properties. Operations such as unloading, and transfers cannot occur simultaneously using the same piping system. Additionally, only one of the unloading or charging operations per tank is allowed to evaluate crude oil mixtures accurately. Furthermore, tanks become temporarily out of service after transferring or unloading operations to allow for the mixture to homogenize at the desired level.
The complexity of SCOO problems lies in numerous chemical, economic, and capacity-related constraints observed at every stage of the process. With each crude oil type having unique characteristics affecting chemical, economic, and capacity constraints, operational processes become significantly challenging. Furthermore, the processability of crude oil in CDUs is subject to certain limits due to their chemical properties. These constraints, specific to the real oil refinery discussed, are scarcely addressed in the existing literature. The goal of this problem, defined with such complex constraints, is to minimize operational loads such as the number of charge changes and transfers and to unload crude oil vessels promptly to avoid substantial penalties.
Available information about the current system includes the scheduling horizon, refinery layout, arrival times and volumes of crude oil vessels, initial system state, crude oil properties (e.g., American Petroleum Institute (API) and sulfur content), tank properties (e.g., minimum and maximum capacity, inventory, pumping systems), processing limits of crude oil in CDUs, mixing properties of crude oil types, and pipeline flow rate constraints.
The optimization problem has two primary objectives: minimizing costs and the operational workload. To minimize costs, maximizing oil processing and avoiding delays in unloading vessels at the port are crucial. However, in this problem scenario, the amount of crude oil processed per hour is predetermined by the central planning unit, becoming a constraint rather than an objective. Minimizing the operational workload involves reducing transfers between tanks and maximizing the duration of unloading or charging operations. This problem, with its dual objectives of minimizing operational changes (transfers and operations) and demurrage time (time vessels spend in port), must be optimized within specified constraints.
The assignment constraints were as follows:
  • ✓ Maximum number of tanks for charging;
  • ✓ Mixing of crude oil constraints in the tanks;
  • ✓ Compatibility of final products in terms of crude oil properties (sulfur and API).
The volume and component balance constraints were as follows:
  • ✓ The constraint of unloading the entire volume of the vessels;
  • ✓ Crude oil balance.
The scheduling constraints were as follows:
  • ✓ Vessel sequencing rules;
  • ✓ A vessel only being processed after its release date;
  • ✓ Continuous operation for all the CDUs throughout the time horizon.
The tank operation constraints were as follows:
  • ✓ Simultaneous charging and unloading not being allowed;
  • ✓ Simultaneous transfer and unloading not being allowed;
  • ✓ Multiple tanks feeding a single CDU;
  • ✓ A single tank feeding multiple CDUs;
  • ✓ Constraints related to pump usage.

3. Data-Driven Optimization Approach to Scheduling of Crude Oil Operations

The basic philosophy in the DDO approach is to process the data to be used as a parameter in the model of the problem and to use this parameter in the model of the problem. Although there is no clear definition of DDO methodology in the current literature, there are examples where data are processed with one of the machine learning methods as well as data mining methods, such as the Apriori algorithm. Therefore, the process of obtaining parameters by processing the data, which is the first step in DDO, can be considered the subject of data analysis from a broad perspective. The next step is to model the problem. The DDO flow is roughly presented in Figure 2.
In the DDO philosophy, the modeling phase is generally considered mathematical modeling. However, when real lives are evaluated in today’s conditions, mathematical models may be insufficient in terms of effectiveness in solving many problems. Although mathematical models promise optimum results, they are far from being applied in many real-life problems in terms of computation time. At this point, the problem-specific heuristic methods do not guarantee the optimum result, but they provide an advantage because they can reach acceptable solutions quickly. Considering that the DDO approach is an approach that has emerged in recent years within the framework of changing and developing conditions, it is obvious that it should also consider heuristic modeling to include a wider range in terms of modeling problems.
The proposed DDO approach for the SCOO problem is presented in Figure 3. The first step in the DDO approach is to obtain historical operational data. In our case, a different method has been followed because there is not sufficient historical operational data for a data analysis. An event-based continuous-time MILP model [17], previously recommended for short-term crude oil scheduling in the literature, has been used to obtain operational data. The results of this mathematical model and the tank combinations have been analyzed and used in the evaluation of alternatives. Since the amount of data on past operations is currently very limited, this stage is of great importance and innovation for the proposed DDO method.
The data obtained according to the results of the mathematical model have been analyzed by the data analysis method, which is a well-known data mining method named the Apriori algorithm and statistical methods; then, the results obtained have been used as model parameters in the proposed heuristic. Since the accuracy of these parameters will directly affect the performance of the proposed heuristic, the data analysis phase and, therefore, the data acquisition process are vital for the proposed method. The data analysis phase holds significant weight in the proposed methodology, directly impacting the efficiency and solution time of the heuristic model. Initially, outcomes from the mathematical model were scrutinized by utilizing the Apriori algorithm. This analysis aims to uncover potential decision patterns within the mathematical model’s output. In our proposed heuristic, charging decisions are tailored to facilitate the unloading of incoming crude oil. To achieve this, the Apriori algorithm was employed to ascertain how frequently the mathematical model grouped crude oil in the same tanks. Such insights play a pivotal role in determining the tank allocation for incoming crude oil in our intuitive model, streamlining process management for future operations. Tanks were assessed based on incoming crude oil by considering the mixtures within, guiding the design of charging operations. This strategic approach not only reduces the pool of candidate tanks and charging combinations but also aims to decrease the computation time to get results from the intuitive model, particularly in scenarios with numerous potential tank placements for incoming crude oil.
In the proposed heuristic method, two important parameters are calculated by taking the averages of the relevant parameters in the mathematical model. These calculation steps are called statistical methods in the flowchart. Within the proposed heuristic model, charging decisions are strategically crafted to make preparations for future unloading operations. In this context, assessing the contribution of each charging decision to future crude oil discharges becomes crucial in selecting the optimal charging combination. However, setting this preparation ratio too high can complicate finding suitable tank combinations for the charging operation, whereas setting it too low may result in inadequate preparation for future unloading operations. To address this, the results from the mathematical model were scrutinized. The average preparation of the charging decisions on future discharges, as determined by the mathematical model, was utilized as a parameter in the heuristic model.
Another parameter derived from the data analysis is the decision-making time for transfers. Transfers typically occur as a necessity when there is no suitable tank combination available for the upcoming unloading process. Consequently, minimizing transfer operations is preferable. However, it is unclear when and under what conditions the need for transfer will be unloading during the planning phase. Conducting transfer assessments long before the next crude oil unloading process can lead to an increase in potential transfer operations. This is because while the current charging operation might create space for the future unloading during this extended period, premature transfer planning imposes unnecessary operational burdens. Conversely, delaying transfer assessments until very close to the next unloading can result in transfer delays due to potential charging combinations, leading to demurrage costs. Determining the optimal timing for transfer assessments relative to the next unloading is thus a critical challenge. In the proposed heuristic, this parameter is determined by analyzing the average time difference between unloading and transfer operations.
Our study serves as a noteworthy instance of a closed-loop DDO application, making a significant contribution to the DDO literature. This structure is epitomized by the “Feedback Mechanism,” depicted with dashed lines in Figure 3. It is important to note that this mechanism deviates from the typical flow; instead, it symbolizes the process of enhancing the rules of the heuristic algorithm through the utilization of solutions generated by the system as data. The proposed method was applied to the large-scale SCOO problem.

3.1. Mathematical Model of Problem

In the current situation, for the real-life SCOO problem being studied, historical operational data are not sufficient to perform a data analysis and obtain the desired results. For this reason, by using the event-based continuous-time mathematical model proposed by Marttin et al. [17] in the literature, short-term problems have been solved, or even if some problems cannot be solved completely, operational decisions have been collected in the part solved by the model. These operational decisions were used as parameters in the rules constructed in the heuristic model and also provided input to the Apriori algorithm. Furthermore, another objective of incorporating this mathematical model into the study is to demonstrate the complexity of the proposed heuristic in offering a solution to the problem. This model is presented in Appendix A.
In mathematical model, the primary goal is to minimize the demurrage cost of vessels. To attain this objective, the model incorporates details regarding the commencement and culmination of essential charging, unloading, and transfer operations throughout the planning period, along with the identification of tanks to be utilized in these operations. A distinct operation decision, the charging decision diverges from the other two operational decisions: unloading and transfer. In this studied real-life problem, predetermined by the main planning department, the amount of hourly crude oil needed is presented in the model; hence, the charging amount for each hour is integrated into the model as a parameter.
Therefore, the hourly charging amount serves as a parameter, with the model tasked to ascertain the tanks chosen for charging, the quantities drawn from these tanks, and the time intervals involved in the charging operations. Designed to encompass real-life scenarios of the SCOO problem, this mathematical model endeavors to execute operations within numerous constraints.
These constraints, akin to operations, fall under three categories: unloading constraints, transfer constraints, and charging constraints. The summarized mathematical model, presented in the Appendix A, includes constraints such as the minimum and maximum volume constraints of tanks, mixture-related constraints, ensuring continuous charging at predetermined amounts constraints, charge component constraints, crude oil processing constraints, the selection of unloading vessel and crude oil constraints, tank unloading limits constraints, pipeline crude oil limits constraints, transfer amounts constraints, and the characteristics of crude oil to be transferred constraints. Throughout these operations, crude oil properties, including API and sulfur values, and miscibility are considered, with constraints adjusted accordingly. Moreover, as operations unfold sequentially, constraints define the start and end times of each operation alongside requisite waiting periods in between.
This mathematical model reflects all the features of the real-life problem studied in this study. Therefore, the proposed data-driven optimization-based novel heuristic approach is designed to meet all the constraints and conditions presented in this mathematical model.

3.2. Proposed Heuristic Model

The SCOO problem discussed in this study is a real-life problem, and it is desired to reach an acceptable solution in computation time. For this reason, designing a problem-specific heuristic algorithm is seen as the only suitable method for solving the problem. In the literature, a specially designed heuristic approach for the SCOO problem has not been found. For much smaller problems, specific cases, with strong assumptions and by ignoring some of the constraints, are presented [2,3,8,12,13,18].
The SCOO problem that is dealt with is primarily handled in a discrete structure that is decided at the beginning of each hour, and the heuristic to be proposed is designed according to this assumption. This assumption was made due to the fact that operational transactions for less than 1 h could not be carried out in the refinery where the application was carried out. In this way, the problem has turned into a discrete problem that has to be decided at the beginning of every hour. Although operational decisions are made at the beginning of each hour, an operation can start and end in the middle of any hour interval, meaning that the problem is only discrete in terms of making decisions but continuous in terms of managing operations. Each decision, which will be made at the beginning of each hour, consists of two stages; first, which of the unloading, transfer, or charging operations will be performed between which units, and second, how much the amount to be performed will be. Therefore, a process with infinite alternatives operates at every decision point. Considering the effect of the decision to be made at each decision point on the next decisions, it becomes clear that all decisions should be made holistically by calculating the effects from the first ring to the last ring of the system.
The grouping of sub-decisions that make up the decision is presented in Figure 4. Two of the decision options that can be selected individually or in combination at each decision stage under a lot of constraints, unloading and transfer, are the decisions about whether the proposed solution is optimal or not. Since the central planning unit determines how much crude oil should be processed every hour and since this amount is required to be processed every hour, the other option, charging, is about whether the proposed solution is feasible.
In the problem discussed in this study, the crude oil volume that needs to be processed by the CDUs for each hour is determined by the central planning unit at the beginning of the scheduling period and presented as parameters. Transfer and unloading decisions, on the other hand, are the decisions that must be made both in order to provide the desired charges and to minimize the additional costs that may occur. Therefore, the solution in which the desired amount of crude oil cannot be processed every hour as a result of the decisions to be made is not an acceptable solution. However, demurrage paid because of late unloading or extra operational costs because of excessive transfers may be part of an undesirable but acceptable solution.
In the proposed heuristic, each decision is designed to be made taking into account the current operational situation and future operational situations. In this framework, considering the unloading process that should take place in the following hours, the tanks that need to be opened for charging are determined in order for the system to be ready for that unloading process. At this point, there are many possible tank alternatives and many different quantity alternatives. However, this stage ensures that the system is ready for unloading when the unloading process should occur, as it will provide a preliminary preparation for the unloading process that will take place in the future. After the tank alternatives that need to be unloaded in preparation for unloading are determined, in the second stage, the crude oil mixture contents of the tanks are evaluated in terms of suitability for charging. In this evaluation, the aim is that each tank will meet the conditions for the tank to be opened for charging alone after the unloading process in the future. In this way, the aim is to provide the amount of charge, which is the decision of feasibility, continuously. In the proposed heuristic algorithm, there are parameters that should be used in the decision processes, such as the transfer control threshold, the number of tanks to be used for unloading, and the suitability threshold of the charge content for future unloading. To determine these parameters, previous operational data and an analysis of these data are needed. However, currently, the amount of data regarding past operations is quite limited. For this reason, there was a need to design a separate process to obtain the required data. In this study, this need was met by using the operation results obtained from the mathematical model for small-scale cases.
Another point is the miscibility of the crude oil in the tanks. Some crude oil is miscible with most crudes, while some crudes have very little miscibility. At this point, the miscibility score will be calculated based on the available crude oil combinations of all tanks. By using this score, a tank with low score will be forced to be selected. Therefore, this criterion is also taken into account when deciding which of the alternative tanks to select for charging. The steps of the proposed heuristic method are presented in Table 1.
In the proposed heuristic model, the initial state of the current situation is given to the model at the beginning of planning. At this stage, information such as the status of the tanks, the types and amounts of crude oil that will come in the planning period, the miscibility information between crude oil types, the processability limits of crude oil types in the units, and the amount of crude oil that needs to be processed per hour are presented in the model. Then, it moves on to the stage where the heuristic model will make iterations for the scheduling period. Although the heuristic model is modeled discretely to make decisions for each hour, the amount of information in the decisions made maintains its continuous form. That is, decisions are made at the beginning of each hour, but the length of the decision does not have to be an integer value.
The decision that the proposed heuristic model makes at the beginning of each hour includes three sub-decisions: charging operation decision, transfer operation decision, and unloading decision. While every decision made must be a charging operation decision, a transfer operation decision and unloading operation decision are made only when necessary. In other words, the appropriate charging decision is about whether the model is feasible or not, and the transfer and unloading operation decisions are decisions about optimality. Another meaning of this is that unloading and transfer operations can be postponed if deemed necessary to enable proper charging operations. Therefore, in the proposed heuristic, the necessity of transfer or unloading operations of the current situation is first questioned. The main purpose of the model is to unload the vessel without being kept waiting when the vessel arrives for unloading. In this context, first of all, when the arrival time of a vessel is approaching, it is checked whether the unloading plan of the incoming vessel has been made. If the time remaining until the vessel’s arrival is less than the transfer threshold, the model triggers the transfer module and searches for possible transfer scenarios for the unloading of the incoming crude oil. After suitable scenarios are determined, the selected tanks and transfer amount information are noted for transfer planning. However, at this stage, transfer planning is not yet done.
The second control is to check whether there is any vessel that has arrived but has not been unloaded. If a vessel has arrived and an unloading plan has been made, this unloading plan is noted with the note, tank, and amount information, but it is not put into action yet. Up to this stage, possible transfer and unloading operations have been identified but have not yet been planned to be implemented. The main reason for this is that both of these operations have the potential to cause the charging decision to become infeasible. That is, a tank receiving transfer or unloading operations cannot give a charge for a certain period of time, and this means that the number of tanks suitable for possible charging decreases. If the appropriate charging combination cannot be found in the scenario where transfer and unloading operations take place, the problem will become infeasible. To avoid this, before transfer and unloading decisions are made, it is checked whether the appropriate charging combination can be found in case these decisions are made.
In the next stage, the charging operation decision phase begins after the possible transfer and unloading decisions are determined. At this stage, there are many constraints due to the nature of the problem, and the selected tank combination must meet all of these constraints. First of all, at this stage, the first crude oil that is not in an unloading plan is detected because the charging decision is aimed to be made in a way that will help this plan. After the incoming crude oil is detected, a potential tank cluster is created where the incoming crude oil can be unloaded. At this stage, tanks from which incoming oil cannot be unloaded due to legal or technical reasons and tanks from which discharge cannot occur due to the types of crude oil they contain are removed from the candidate list. At this stage, the candidate tank list is revised, taking into account the previously noted transfer and unloading tanks. If, after all these operations are completed, there are still too many tanks available for charging, this is a positive situation for the possible solution of the problem, but it is a very negative situation for the solution time because the higher the number of candidate tanks, the more possible combinations there will be, which will greatly lengthen the process of determining the best charge combination. This is exactly the point where the probability values are obtained during the data analysis phase using the Apriori algorithm. If there are many possible tanks, the tanks with the highest scores are selected according to the formula presented during the data analysis phase, and the possible charge combination is first searched among these tanks.
After all this elimination, a list of candidate tanks to be used in the charging operation in the upcoming period has been obtained. After this point, tank combinations that will meet the charge-related quantity, quality, charging time, and miscibility constraints are sought from the candidate tanks. This search is done according to certain heuristic rules in addition to the constraints of the problem itself. In this problem, a maximum of 5 tanks are allowed to be charged at the same time. In this context, first of all, all possible charge combinations of candidate tanks are determined. In addition, possible volume combinations are calculated for each possible charge combination. Volume combinations are also a matrix containing information about what percentage of the relevant charge will be covered by which tank. After the tank and volume combinations are determined, tank combinations that cannot meet the chemical constraints in any volume combination are removed from the list. The remaining tank combinations and volume combinations are matched according to their suitability and checked for whether they meet other operational constraints. Candidates that satisfy all constraints inherent in the problem are determined. These candidates represent a new matrix that includes both tank combinations and volume combinations. Ultimately, these candidates meet the necessary operational conditions for the charging operation, but in addition to the existing constraints, a heuristic rule was defined to choose between them, and the candidate that complies with this rule and has the highest score is opened to charging. This rule checks how well candidates have prepared for the possible unloading of incoming crude oil, for which the unloading plan was not done. This control is designed in three stages. First of all, if the candidate tank is suitable for unloading, the hourly charge volume amount is added to that candidate’s score. Second, even if the selected tank is not suitable for the direct discharge of incoming crude oil, if it will be emptied as a result of the charging process, the total volume of the tank is divided by the planned charging time and added to the candidate’s score. Because even though the relevant tank is not currently suitable for unloading due to the combination of crude oil it contains, it will become suitable for unloading when the tank is emptied. Third, if the candidate tank is emptied as a result of the charging operation and allows for the tank to be completely ready for unloading by taking a transfer from a large volume tank, the volume of the large tank is divided by the planned charging time and added to the candidate’s score. In this way, the candidate with the highest score is selected for charging.
If a feasible charging combination can be determined, both transfer and unloading decisions are added to the scheduling. If a suitable combination cannot be found, first, the tanks removed from the candidate list as a result of data analysis are added to the list, and the possible charging combination is searched again. If a feasible charging combination can be found, this charging decision is added to the planning along with the transfer and unloading decisions. If a feasible charge combination cannot be found, the transfer operation is canceled first, and if it cannot be found again, the unloading operation is also canceled. In this case, if there is a previous charging operation, it is continued as is; if not, the appropriate charging combination is searched using all possible tanks. After this entire process is completed, the data are updated according to the decisions made, and the next iteration is started.

4. Real-Case Application of the Proposed DDO Method

The first step of the methodology suggested in Figure 3 is to obtain data related to the problem being studied. In this step, since there are not enough data to be used in solving the problem in the current situation, the required data were produced. At this point, considering that the parameters obtained from the data to be produced will directly affect the decision processes in the heuristic algorithm, it is of great importance that the data to be produced is suitable for the real problem. This is exactly why an event-based mathematical model previously proposed in the literature was used for data generation [17].
This mathematical model was applied for 10 different short-term planning periods, and the decisions made by the model up to the time it could produce results under a certain time constraint were taken as data. Since different types of oil were processed and there were different operational constraints for each planning period, the different data tables obtained were first combined into a single data table and subjected to a pre-processing process. Although 50 types of crude oil can be processed in the refinery, 20 different types of crude oil were processed during the period of the cases studied. The rows with missing data were identified and removed from the table in order to avoid negative consequences. As a result of these operations, a data table with 3667 rows and 20 columns was obtained. In this data table, there is the crude oil mixture information in the tanks at each decision moment of the mathematical model. The probability and scores of co-occurrences of oil types will be obtained from this table. A small part of this table is presented in Table 2.
At this point, the data set was prepared using the results obtained from the mathematical model, and data pre-processing was carried out.

4.1. Apriori Algorithm and Parameter Detection

In this point, the Apriori algorithm was applied. First of all, the data in Table 2 were processed so that whether the relevant crude oil was present in each row was a 0–1 variable. Then, the frequency of the presence of all crude oil types in the data set was determined. The results with these data are presented in Table 3.
When Table 3 is examined, it is seen that the most common crude oil is CO5, which is found in 1618 rows. Considering that the table consists of 3667 rows, this crude oil was found in tanks in almost half of the planning process.
This step is the first stage of the Apriori algorithm. However, the most important parameter in the heuristic algorithm is the frequency of the pairwise coexistence of crude oil types. This information will be obtained in the second stage of the Apriori algorithm. In Table 4, the frequency of the occurrence of data of two crude oils together has been shared.
The main goal of using the Apriori algorithm in this study is to speed up the process of selecting the tank from which the incoming crude oil will be unloaded. In other words, the mathematical model determines which crude oil types are frequently placed in the same tanks, and in the light of this information, the heuristic model accelerates the process by performing a similar behavior. At this stage, the frequency data obtained in Table 4 has been normalized, and a data table has been prepared for the score calculation stage for the tanks where the incoming oil can be unloaded. These data are presented in Table 5.
The frequency data in each line are divided by the frequency of the occurrence of the crude oil to which the relevant line belongs while making this calculation. In this way, if the relevant crude oil type is in the tank, the probability of the crude oil type in the column being together in the same tank is calculated.
Data in this table were used to calculate which tanks should have priority for incoming oil. Tank scores were calculated by the formula given in Equation (1).
S c o r e T a n k i = j = 1 # C O X j Y j k j = 1 # C O X j ,
In Equation (1), the value of X j takes the value of 1 if crude oil j is in T a n k i , and 0 otherwise. The Y value is the probability value in Table 5. In this way, points are calculated for each tank according to the probability of the incoming crude oil being found together with the crude oil previously in that tank. The tank with the highest calculated score means that the crude oil in that tank and the incoming crude oil was frequently found together before and that tank is prioritized for unloading. In the heuristic model, this calculation is made at every decision stage, and this score has a direct impact on decisions.

4.2. Implementation of Proposed Heuristics to Real Case

The proposed heuristic model was applied for a 45-day planning period. During this planning period, 10 different types of crude oil were supplied from 19 vessels. The amount of crude oil on incoming ships varies between 44,000 m3 and 164,000 m3. The total amount of crude oil brought by 19 vessels in a 45-day period is approximately 1,700,000 m3. During the planning period, 10 of 12 tanks were operable, and 2 CDUs are actively operating. At the beginning of the period, 78% of the total tank volume is full. In other words, charging operations must be carried out with great care so that the incoming crude oil can be unloaded to minimize the waiting time of vessels. In Table 6, the unloading schedule of the period is presented.
The table contains information about which vessel will arrive and when during the planned 45-day period, which type of crude oil it carries, which tanks and how much of the incoming crude oil will be unloaded, when the unloading will begin, and when the vessel will depart. In fact, this table contains all the information the planner needs for unloading operations. When the table is examined carefully, it is seen that vessel number 10 is located in two rows. The reason for this is that there are two different types of crude oil on 10. The vessel and unloading operation are planned according to the type of crude oil. The performance criterion in the unloading process is how long it takes for incoming vessels to be unloaded and departed and whether it is subject to penalty this time.
The first performance criterion is the waiting time between the arrival of the vessel and the time it begins to be unloaded. The unloading process started as soon as ships arrived for 12 of the 19 vessels. This shows that the preparation for unloading operations in the planning of operations is quite successful. On average, the average waiting time for incoming vessels before an unloading operation is 7 h. To evaluate the performance of the proposed heuristic with respect to the departure time of vessel, checking average departure time is good data, and it is seen that on average, a vessel is unloaded and departs within 25.1 h. This is a very successful time considering that the unloading of an average vessel takes approximately 15 h.
The time until the start of unloading and the time between arrival and departure mentioned in unloading operations can be considered in-company performance criteria for unloading operations. Because being successful or unsuccessful in these criteria does not cause any additional costs for the company. Therefore, the main performance criterion in unloading operations, and the criterion that has a place in the objective function is the penalty cost to be paid due to the delay. This value is presented in the last column of Table 7 for each vessel. According to the agreements, there is no penalty if an incoming vessel is unloaded and departs within 48 h. However, if the waiting period exceeds 48 h, a penalty amount is billed to the company for each hour. The success of the proposed heuristic algorithm in this criterion is clearly seen in Table 7. Considering that 19 vessels arrived during the 45-day planning period and that there was an average of 90,000 m3 of crude oil in each vessel, even during such an intense planning period, there was a total time of 31.2 h that exceeded the solution produced by the proposed heuristic algorithm on the 17th and 18th vessels. This outcome demonstrates significant success compared to the demurrage resulting from real-life planning. Essentially, the proposed planning incurs substantially lower demurrage costs than the planning undertaken and executed by the planning department in practice.
Other operational decisions are charging and transfer decisions. Due to the nature of the problem, crude oil mixtures must be constantly charged to the CDUs from tanks at all times. However, performing the transfer operation as little as possible is an important criterion in terms of the operational workload. In Table 8, the number of charges changing, average charging time, number of transfers, and average transfer time is shared.
As mentioned before, there are two units in the real case studied. As seen in Table 8, during the 45-day planning period, charging changes occurred 33 times in the first CDU and 31 times in the second CDU. In this context, a charge in the first CDU takes an average of 34.9 h, while a charge in the second CDU takes an average of 37.2 h.
Considering that the minimum charging time should be 24 h in order to prevent an increase in workload in the field in charging operations, the proposed model has planned charging for approximately 50% longer than this period on average. In addition, the shortest charging time, 24 h, was used in only three charges for both CDUs, and all other charges were above the lower limit of 24 h.
One of the important difficulties in the real case where the application is made is that the mixture of the charge given to the units must remain between certain API and sulfur values. Figure 5 gives the API values of the charge combinations opened for both CDUs, the lower and upper bounds.
During the planning period, charge changes occurred 33 times in CDU1 and 31 times in CDU2. As seen in the graph, all selected charge combinations occurred between the determined lower and upper bounds. Similarly, the sulfur values of the charge combinations are presented in Figure 6.
There is no lower bound for sulfur values; only the upper bound has been defined in real-case parameters. When the solution is examined in terms of sulfur values, some mixtures touch the upper limit; however, they are not violated. All suggested charge mixtures are a relevant upper-limit condition.
In Figure 7, all operation decisions, including charging, unloading, and transfer operations, for the 45-day of planning period are shared. If a tank charges just CDU 1, these charging operations are presented with blue color; if a tank charges just CDU 2, they are presented with yellow color; and if a tank charges both CDUs, they are presented with green color. The operation times of the tank in unloading operations and the tank receiving transfers are presented in red and black colors, respectively. As seen in the Gantt chart, all operations were coordinated, ensuring nonstop charging operations, and by not activating the tanks without resting for certain periods after the unloading and transfer operations, 45-day planning was successfully carried out, and this planning process is presented in Figure 7.

5. Conclusions

The SCOO problem is a complex and challenging scheduling problem because the decision variables it contains can be both discrete and continuous. This structure makes it difficult to solve the SCOO problem with the mathematical modeling method. In addition, since the SCOO problem is an operational problem and new plans need to be made according to instant changes during the implementation of the planning, it is of great importance to produce fast and acceptable solutions.
In this study, the SCOO problem was addressed and solved according to the proposed DOO methodology. The first stage of the proposed DDO methodology is data analysis and information/parameter generation from data. In this study, first, the process of obtaining the data to be used at this stage was carried out. For this purpose, first of all, an event-based continuous-time MILP for short-term crude oil scheduling model, which is proposed in the literature for the SCOO problem, was used.
Using this model, we first tried to solve some cases, and the results and operation decisions produced by the mathematical model in those cases were used as data. First of all, the tank crude oil mixtures that formed as a result of the decisions made by the mathematical model were examined, and the co-occurrence of crude oil was investigated. For this purpose, the Apriori algorithm, which is a data mining method frequently used in the literature, was used, and the probability of crude oil being found together in tanks was calculated. These probabilities were used as parameters in the proposed heuristic algorithm in the modeling phase, which is the second phase of DDO.
The second phase of DDO is the modeling phase of the problem. At this stage, a novel heuristic approach is proposed due to the complex structure of the SCOO problem. This intuitive approach aims to complete the unloading operations and send the ships without keeping the incoming ships waiting with minimal transfers, ensuring the continuity of charging operations. In the heuristic algorithm proposed in accordance with these objectives, the answers to questions such as in what situation the transfers will be made and to what extent the discharge of the incoming crude oil will be taken into consideration when choosing the charging combination have been obtained by taking the average of the relevant values from the results given by the mathematical model. At the stage of deciding on the charge combination, the existing tanks were scored according to the incoming crude oil, using the probability values obtained using the Apriori algorithm in the first stage of DDO, and the tanks with the highest scores were prioritized. This situation is aimed to both increase the possibility of reaching a feasible solution and shorten the solution time.
The heuristic model constructed within this framework was tested for an intensive planning period of 45 days. During the relevant planning period, a new vessel arrives on average every 55 h, and the majority of the tanks’ volumes are initially full. In addition, although the vessels arrive every 55 h on average, the arrival times of the ships decrease to 24 h from time to time, and this makes the planning process very difficult. Despite all these difficulties, the proposed heuristic model successfully implemented 45-day planning. To the best of our knowledge, it is the only study in the literature that deals with such a long period for such a complex SCOO problem. The obtained results were evaluated according to the performance criteria, and it was revealed how successful the proposed heuristic method was. In the realm of intricate and long-range planning challenges, even a week’s worth of planning in real-world SCOO problem scenarios demands days of effort. Given this context, even simply attaining a workable solution is adequate to illustrate the effectiveness of the proposed heuristic. Upon comparing the outcomes derived from our proposed methodology and heuristic approach during the planning phase with those stemming from real-world planning applications, our method has showcased notably successful results. This success is evident in terms of reduced demurrage costs as well as decreased numbers of transfers and charging operations.
Another contribution of this study is that a closed-loop DDO feature has been designed, which is rarely seen in the literature. In the closed-loop DDO approach, it is aimed to obtain more successful results by feeding the data analysis phase, which is the first phase of DDO, with the results obtained at the end of the modeling phase. In this context, in the methodology proposed in this study for the SCOO problem, we aim to analyze the results of the heuristic model, to use it together with the limited results previously obtained from the mathematical model, and to increase the performance of the heuristic model.
The proposed heuristic approach is designed to be easily applicable to SCOO problems with different characteristics regardless of the real case studied. Therefore, its performance on SCOO problems with different characteristics can be examined in future studies.

Author Contributions

Conceptualization, N.G.; Methodology, N.G.; Writing—original draft, N.G.; Writing—review & editing, Ö.K.; Supervision, Ö.K. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

The Mathematical Model of SCOO Problem [17] is presented as follows. Please see Table A1 for the notation.
Table A1. Notations used in the Mathematical Model.
Table A1. Notations used in the Mathematical Model.
Sets and Parameters
i ϵ I: crude oil tanks
h ϵ H: crude oil types
a: tasks set
k(a): unloading
ar(a): transfer
as(a): charging
p ϵ P: properties of crude oil
k: vessel
n: events
Kh: set of arriving crude oil types
Tk is : the set of available tanks for vessel k
nk: set of main unloading events
nk’’: set of pipe unloading events
PH: scheduling time horizon
KTk,t: arrival time of vessels (hr)
KVk: amount of arriving crude oil vessels (m3)
DMk: demurrage ($/hr)
LTk: lay time of vessels (hr)
PRh,p: crude oil properties
LCih: minimum capacity of tanks
LCih: maximum capacity of tanks
R: tank rest times after unloading and transfer
VIh,i: initial tank volume and compositions
FUih,: max flow rates of the unloading streams
FTa: max flow rates of the transfer streams
FCa: max flow rates of the charging streams
Bh: set of immiscible crude oil
Aps: receiving transfer tank for a transfer
Ang: sending transfer tank for a transfer
GNk: group numbers (for optional crude oil)
Ot: set of all optional crudes
Ol: the different types of crude in group l
Sa: the set of these concurrent arrival crudes
MH: the minimum charging hours for a charging task
[LAj, UAj]: [minimum-maximum] API limit for charging task
USj: maximum Sulfur limit for charging task
Decision Variables
[sa,n, fa,n]: the start and end times of all operations
[tsn,I, tfn,I]: the start and end times of operations in tanks
[rsn, rfn]: the start and end times of unloading and transfer operations
vti,n: the total volume of tanks
vi,h,n: the volume of components in the tanks
bkk,n,i: the amount of crude oil that flows from one unit to another in unloading
bhar,n,h: the amount of crude oil that flows from one unit to another in transfer
bsas,n,h,i: the amount of crude oil that flows from one unit to another in charging
gk: delay time of vessel unloading
ba,n: total amount of flowing
wa,n: whether a task is assigned to an event
wtk,n,i: whether an unloading is assigned to an event
wsas,n,i: whether a charging is assigned to an event
wtbk,n,i: whether a pipe unloading is assigned to an event
wk,n: represents whether a vessel is unloaded
wbk,n: the same for unloading the crude in the pipe
qk: The selection of optional crude oil
en,i: whether the volume in the tank is above the minimum capacity
tn,i,h: whether a crude oil type exists in a tank
The primary goal is to minimize the demurrage cost of vessels, as expressed in Equation (A1). Equations (A2)–(A4) provide the balance of tank components, total tank volume, and capacity limits, respectively. The calculation of processed volumes for transfer and charging tasks is managed in Equations (A5a) and (A5b), while unloading is addressed in separate equations for the pipe part and the main part of the crude, as shown in Equations (A6a) and (A6b). To ensure flow at any event, Equations (A7a)–(A7c) set binaries to 1, with ‘M’ representing a large number. Equations (A8a)–(A10c) establish timing and sequencing rules for each task. A continuous operation of CDUs mandates that charging commences at the outset, with the total operation time of each CDU matching the time horizon (PH), specified in Equations (A11a) and (A10b). Additionally, transfer operations are excluded, as expressed in Equation (A12), due to their undesirability.
C o s t = k g k D M k
v i , h , n = v i , h , n 1 + k b k k , n , i + k w t b k , n , i V P + a r A p s b h a r , n , h a r A n g b h a r , n , h a s b s a s , n , h , i   n 2 , n k   , n k , h K h , i T k
v t i , n = h v i , h , n   n , i
L C i v t i , n U C i   n , i
F T a r f a r , n s a r , n = b a r , n   a r , n
F C a s f a s , n s a s , n = b a s , n    a s , n
f k , n s k , n = i w t b k , n , i V P F U i    k , n k
f k , n s k , n = i T k b k k , n , i F U i    k , n k
b a r , n M w a r , n    a r , n
b a s , n M w a s , n    a s , n
b k , n M w k , n    k , n k ,   n k
f k , n = s k , n   k , n
f k , n s k , n   k , n k ,   n k
s k , n f k , n 1   k , n
f a r , n s a r , n + 60 24 w a r , n   a r , n
f a r , n s a r , n   a r , n  
s a r , n f a r , n 1   a r , n
f a s , n s a s , n + 60 24 w a s , n   a s , n
f a s , n s a s , n   a s , n
s a s , n = f a s , n 1   n > 1 , a s
n b a s , n     F C a s P H 24    a s  
s a s , n = 0   n = 1 , a s
w a r , n = 0   a r , n
Equation (A13) ensures the complete unloading of vessel volume, excluding the portion within the pipe. The main unloading and pipe unloading operations for each vessel are assigned to specific events in Equations (A14a) and (A14b). Equations (A15a) and (A15b) impose the same condition on optional crudes that are chosen. If unloading occurs at an event, the binary related to the tank involved also assumes a value of 1, as described in Equations (A16a) and (A16b). Equation (A17) mandates the selection of one crude oil from each optional crude oil vessel group. Unloading flow boundaries are defined in Equations (A18a) and (A18b). Unloading can only commence after a vessel’s arrival, and the same condition applies to optional crudes (Equations (A19a) and (A19b)). In Equations (A20a) and (A20b), the demurrage cost-based delay time for unloading is calculated for both vessel types. Equation (A21) ensures that the unloading of remaining crude from the previous vessel begins after the arrival of the next vessel. Following the pipe crude, the main part of the next vessel should be unloaded immediately (Equation (A22)). Vessels are unloaded sequentially, and concurrent crudes in a vessel are unloaded repeatedly, as outlined in Equations (A23) and (A24). Equations (A25a) and (A25b) specify that the crude in the pipe should be unloaded into the set of tanks Tk where the next vessel can be unloaded. Lastly, Equations (A26a)–(A28b) govern the sequencing of unloading and transfer operations.
i T k b k k , n , i = K V k ( V P ( 1 b y k ) ) w k , n    k , n k
w b k , n = 1    k O t , n k
w k k , n = 1    k O t , n k
w b k , n = q k    k O t , n k
w k k , n = q k    k O t , n k
i T k w t k , n , i w k , n I    k , n k
i w t b k , n , i = w b k , n    k , n k
k O l q k = 1   l
b k k , n , i M w t k , n , i    k , n k , i T k
b k k , n , i V P w t k , n , i    k , n k , i T k
s k , n K T k   k O t , n k
s k , n K T k q k   k O t , n k
g k f k , n K T k L T k   k O t , n k
g k + 24 P H ( 1 q k ) f k , n K T k L T k   k O t , n k
s k , n + G N k 24 P H 1 q k K T k + 1 G N k + 1 24 P H 1 q k + 1   k K b , n k
f k , n + G N k 24 P H 1 q k s k + 1 , n + 1 G N k + 1 24 P H 1 q k + 1   k K b , n k
s k , n G N k 24 P H 1 q k r f n 1   k , n k
s k + 1 , n + 1 f k , n   k S a , n k
w t b k , n , i = 0   k O t , n k , i T k
w t b k , n , i 1 q k + 1   k O t , n k , i T k
r s n s a r , n   a r , n
r f n f a r , n   a r , n
r s n s k , n   k , n
r f n f k , n   k , n
r s n r f n   n
r s n r f n 1   n
Equations (A29a) and (A30b) establish the relationship between tank and crude oil flows with event-based flow quantities. Tank operation times must align with task times and are managed in Equations (A31a) and (A31b) for charging, Equations (A32)–(A36) for unloading, and Equations (A37)–(A38b) for transfer operations considering tank rest times. Sequencing of events within tanks is addressed in Equations (A39a) and (A39b). Equation (A40) ensures that simultaneous input–output is prohibited at any event. Additionally, simultaneous unloading and transfer operations are disallowed due to the utilization of the same line, as specified in Equation (A41).
i T k b k k , n , i = b k , n    k , n k
i w t b k , n , i V P = b k , n    k , n k
h b h a r , n , h = b a r , n    a r , n
i h b s a s , n , h , i = b a s , n   a s , n
t s n , i s a s , n + 24 60 ( 1 w s a s , n , i )   a s , n , i
t f n , i f a s , n 24 60 ( 1 w s a s , n , i )   a s , n , i
t s n , i s k , n + 24 60 ( 1 w t k , n , i )   k , n k , i T k
t f n , i f k , n + R k 1 S F k 24 P H 1 w t k , n , i   k , n k , i T k
t s n , i s k , n + 24 60 1 w t b k , n , i   k , n k , i
t f n , i f k , n + R k 1 w t k + 1 , n + 1 , i 24 P H 1 w t b k , n , i   k O t , n k , i T k
t f n , i f k , n + R k 1 w t k + 1 , n + 1 , i 24 P H 1 w t b k , n , i 24 P H 1 q k + 1    k O t , n k , i T k
t s n , i s a r , n + 24 60 1 w a r , n   n , i , a r
t f n , i f a r , n + R a r 24 60 1 w a r , n   n , i , a r A p s
t f n , i f a r , n 24 60 1 w a r , n   n , i , a r A n g
t s n , i t f n , i   n , i
t s n , i t f n 1 , i   n , i
k w t k , n , i + k w t b k , n , i + a r A p s w a r , n + 0.5 a r A n g w a r , n + 0.25 a s w s a s , n , i 1   n k   , n k , i T k
w a r , n = 0   n k , n k , a r
If a tank’s volume is above the minimum capacity, e n , i takes value 1, meaning that there is a significant amount of crude that is to be considered for mixing rules, Equation (A42). Mixing constraint is handled in Equation (A43). Operational rules for charging are considered as follows: The binding of related variables is given in Equation (A44). Minimum hours of charging for a charging task is handled in Equation (A45). API and Sulfur limitations are given in Equations (A46)–(A47).
e n , i U C i   v t i , n 1 L C i     n > 2 , i
t n , i , h + w t k , n , i   1 e n , i + 1    n k 2 , i , h B h , k K h
h b s a s , n , h , i w s a s , n , i M   a s , n , i
b a s , n w a s , n   F C a s M H   n , a s
L A a s i h b s a s , n , h , i i h b s a s , n , h , i   p h , A P I U A a s i h b s a s , n , h , i   n , a s
i h b s a s , n , h , i   p h , S u l f u r U S a s i h b s a s , n , h , i   n , a s
This mathematical model reflects all the features of the real-life problem studied in this study. Therefore, the proposed data-driven optimization based novel heuristic approach is designed to meet all the constraints and conditions presented in this mathematical model.

References

  1. Garcia-Verdier, T.G.; Gutierrez, G.; Méndez, C.A.; Palacín, C.G.; de Prada, C. Optimization of Crude Oil Operations Scheduling by Applying a Two-Stage Stochastic Programming Approach with Risk Management. J. Process Control 2024, 133, 103142. [Google Scholar] [CrossRef]
  2. Zhang, W.; Du, W.; Yu, G.; He, R.; Du, W.; Jin, Y. Knowledge-Assisted Dual-Stage Evolutionary Optimization of Large-Scale Crude Oil Scheduling. IEEE Trans. Emerg. Top. Comput. Intell. 2024, 8, 1567–1581. [Google Scholar] [CrossRef]
  3. Zhang, W.; Du, W.; Yu, G.; He, R.; Du, W. Large-Scale Crude Oil Scheduling: A Framework of Hybrid Optimization Based on Plan Decomposition. In Proceedings of the 2022 IEEE Congress on Evolutionary Computation (CEC), Padua, Italy, 18–23 July 2022; pp. 1–8. [Google Scholar]
  4. An, Y.; Wu, N.; Hon, C.T.; Li, Z. Scheduling of Crude Oil Operations in Refinery without Sufficient Charging Tanks Using Petri Nets. Appl. Sci. 2017, 7, 564. [Google Scholar] [CrossRef]
  5. Pereira, C.S.; Martí, L.; Dias, D.M.; Vellasco, M. A Multi-Objective Decomposition Optimization Method for Refinery Crude Oil Scheduling through Genetic Programming. In Proceedings of the GECCO 2023 Companion: Companion Conference on Genetic and Evolutionary Computation; Lisbon, Portugal: 15–19 July 2023; pp. 1972–1980. [CrossRef]
  6. Wu, N.; Member, S.; Bai, L.; Zhou, M. A Novel Approach to Optimization of Refining Schedules for Crude Oil Operations in Refinery. IEEE Trans. Syst. Man Cybern. Part C 2012, 42, 1042–1053. [Google Scholar]
  7. Floudas, C.A.; Lin, X. Continuous-Time versus Discrete-Time Approaches for Scheduling of Chemical Processes: A Review. Comput. Chem. Eng. 2004, 28, 2109–2129. [Google Scholar] [CrossRef]
  8. Hou, Y. A Genetic Algorithm Approach to Short-Term Scheduling of Crude Oil Operations in Refinery. IEEJ Trans. Electr. Electron. Eng. 2016, 11, 593–603. [Google Scholar] [CrossRef]
  9. Saharidis, G.K.D.; Minoux, M.; Dallery, Y. Scheduling of Loading and Unloading of Crude Oil in a Refinery Using Event-Based Discrete Time Formulation. Comput. Chem. Eng. 2009, 33, 1413–1426. [Google Scholar] [CrossRef]
  10. Wu, N.; Bai, L.; Zhou, M. An Efficient Scheduling Method for Crude Oil Operations in Refinery with Crude Oil Type Mixing Requirements. IEEE Trans. Syst. Man Cybern. Syst. 2016, 46, 413–426. [Google Scholar] [CrossRef]
  11. Wu, N.; Chu, F.; Chu, C.; Zhou, M.C. Tank Cycling and Scheduling Analysis of High Fusion Point Oil Transportation for Crude Oil Operations in Refinery. Comput. Chem. Eng. 2010, 34, 529–543. [Google Scholar] [CrossRef]
  12. Ramteke, M.; Srinivasan, R. Large-Scale Refinery Crude Oil Scheduling by Integrating Graph Representation and Genetic Algorithm. Ind. Eng. Chem. Res. 2012, 51, 5256–5272. [Google Scholar] [CrossRef]
  13. Kaid, H. An Effective Tabu Search-Based Petri Net Method for Scheduling Crude Oil Refinery Operations with Preventive Maintenance. In Proceedings of the 13th Annual International Conference on Industrial Engineering and Operations Management, Manila, Philipines, 7–9 March 2023; pp. 2818–2824. [Google Scholar] [CrossRef]
  14. Jin, Y. Knowledge Incorporation in Evolutionary Computation; Springer: Berlin/Heidelberg, Germany, 2013; Volume 167, ISBN 3540445110. [Google Scholar]
  15. Güleç, N.; Kabak, Ö. Data-Driven Multi-Criteria Group Decision Making Under Heterogeneous Information. In Multiple Criteria Decision Making with Fuzzy Sets: MS Excel® and Other Software Solutions; Springer: Berlin/Heidelberg, Germany, 2022; pp. 1–12. [Google Scholar]
  16. Kabak, Ö.; Güleç, N. Data Driven Approach to Order Picking Time Prediction Using Fuzzy Clustering and ANN; Springer International Publishing: Berlin/Heidelberg, Germany, 2022; Volume 307, ISBN 9783030856250. [Google Scholar]
  17. Marttin, İ.; Kurban, S.; Kaya, G.K.; Kabak, Ö.; Topcu, Y.İ. An Event-Based Continuous-Time MILP for Short-Term Crude Oil Scheduling. In Computer Aided Chemical Engineering; Elsevier: Amsterdam, The Netherlands, 2023; Volume 52, pp. 727–732. ISBN 1570-7946. [Google Scholar]
  18. Khalili Goudarzi, F.; Maleki, H.R.; Niroomand, S. Mathematical Formulation and Hybrid Meta-heuristic Algorithms for Multiproduct Oil Pipeline Scheduling Problem with Tardiness Penalties_Enhanced Reader. Concurr. Comput. Pract. Exp. 2021, 33, e6299. [Google Scholar] [CrossRef]
Figure 1. The SCOO problem.
Figure 1. The SCOO problem.
Processes 12 00926 g001
Figure 2. DDO process.
Figure 2. DDO process.
Processes 12 00926 g002
Figure 3. Proposed DDO methodology for the SCOO problem.
Figure 3. Proposed DDO methodology for the SCOO problem.
Processes 12 00926 g003
Figure 4. Groups of sub-decisions.
Figure 4. Groups of sub-decisions.
Processes 12 00926 g004
Figure 5. API values of mixtures.
Figure 5. API values of mixtures.
Processes 12 00926 g005
Figure 6. Sulfur values of mixtures.
Figure 6. Sulfur values of mixtures.
Processes 12 00926 g006
Figure 7. Gantt chart of proposed solution for 45 days of planning.
Figure 7. Gantt chart of proposed solution for 45 days of planning.
Processes 12 00926 g007
Table 1. Steps of the proposed heuristic algorithm.
Table 1. Steps of the proposed heuristic algorithm.
1:Input: Set Initial State Parameters
2:While time < planning period
3:  If coming time of unplanned vessel < transfer threshold time
4:    If there is suitable transfer for coming Crude Oil
5:      Find the transfer option
6:      If transfer tanks are not included in the charging operation
7:        Perform the transfer operation
8:      Else
9:        Wait until finding possible charging
10:  If planned vessel arrived
11:    If planned tanks are not included in the charging operation
12:      Unload according to plan
13:    Else
14:      Check the possibility of the charging operation without planned tanks
15:      If possible
16:        Unload according to plan
17:      Else
18:        Wait until finding possible charging
19:  If the remaining charging time is 0 or if a transfer or unloading operation is planned that will affect the current charging operation
20:    Find possible candidate unloading tanks for unplanned first incoming oil
21:    Remove Tanks for which transfer or unloading plans have been made
22:    Rank the remaining tanks using the scores obtained from the Apriori algorithm and choose the 5 best tanks.
23:    Search for the combination that will perform the charging operation with the 5 selected tanks
24:    If there is no suitable combination for charging operation
25:      Try planning the charging operation with all possible tanks by canceling tank scoring stage with Apriori algorithm
26:        If finding the suitable combination
27:          Start charging, unloading and transfer operations
28:      If there is no suitable combination for charging operation even though the scoring step is cancelled.
29:        Search tank combination for charging operation by canceling transfer operation
30:          If finding the suitable combination
31:            Start charging and unloading operations
32:      If there is no suitable combination for charging operation even though the scoring and transfer are cancelled.
33:          Cancel both transfer and unloading operations
34:    If there is an ongoing charging operation
35:      Continue the previously ongoing charging operation
36:    If there is not an ongoing charging operation
37:      Find the tank combination by searching all possible tanks for charging operation
38:      Start charging
39:  Update all state variables
Table 2. Sample data table.
Table 2. Sample data table.
CO1CO2CO3CO4CO5CO6………CO20
115.850.07 12.926.790.93
215.850.07 12.926.790.93
312.280.05 10.015.260.72
412.280.05 10.015.260.72
512.280.05 10.015.260.72
612.280.05 10.015.260.72
712.280.05 10.015.260.72
810.580.04 8.624.540.62
910.580.04 8.624.540.62 1.25
1010.580.04 8.624.540.62 1.25
112.630.01 2.141.130.15 1.25
122.630.01 2.141.130.15 1.25
132.630.01 2.141.130.15 1.25
142.630.01 2.141.130.15 1.25
152.630.01 2.141.130.15 1.25
Table 3. Frequency of type of CO.
Table 3. Frequency of type of CO.
Type of COFrequencyType of COFrequency
CO1903CO118
CO21318CO1262
CO3594CO13167
CO41112CO14946
CO51618CO1595
CO6741CO16507
CO7968CO1779
CO8636CO18166
CO9148CO19145
CO1089CO20104
Table 4. Frequency of COs being together.
Table 4. Frequency of COs being together.
CO1CO2CO3CO4CO5CO6CO7CO8CO9CO10CO11CO12CO13CO14CO15CO16CO17CO18CO19CO20
CO1-37388343485252273116242500486015961416210
CO2373-271291465167359182531004482593110114118452
CO388271-13516091681033210380543811528301031
CO4343291135-6412873371221219830681172117242561038
CO5485465160641-412454197453801683199621911475190
CO625216791287412-165118140004412519139026570
CO727335968337454165-1300290023297058019600
CO8116182103122197118130-73300046220385881328
CO9245332124514073-00015530238800
CO10251011938029300-003036000000
CO110008000000-008000000
CO1204383016000000-002120000
CO13484806883442346153000-360000290
CO14602595411719912529722053368036-0121108911
CO15153138216219030002100-60500
CO16961011151721911395885230020126-6510470
CO1714142842140088000011065-3600
CO18161130567526198800000510436-00
CO192184101019576013000029890700-0
CO20052313800028000001100000-
Table 5. Probability of COs being together.
Table 5. Probability of COs being together.
CO1CO2CO3CO4CO5CO6CO7CO8CO9CO10CO11CO12CO13CO14CO15CO16CO17CO18CO19CO20
CO11.000.410.100.380.540.280.300.130.030.030.000.000.050.070.020.110.020.020.020.00
CO20.281.000.210.220.350.130.270.140.040.010.000.000.040.200.020.080.010.010.060.04
CO30.150.461.000.230.270.150.110.170.050.000.000.060.000.090.060.190.050.050.020.05
CO40.310.260.121.000.580.260.300.110.010.020.010.030.060.110.020.150.040.050.010.03
CO50.300.290.100.401.000.250.280.120.030.020.000.010.050.120.040.120.010.050.010.00
CO60.340.230.120.390.561.000.220.160.020.000.000.000.060.170.030.190.000.040.080.00
CO70.280.370.070.350.470.171.000.130.000.030.000.000.020.310.000.060.000.020.060.00
CO80.180.290.160.190.310.190.201.000.110.050.000.000.070.350.000.130.010.010.020.04
CO90.160.360.220.080.300.090.000.491.000.000.000.000.100.360.000.160.050.050.000.00
CO100.280.110.010.210.430.000.330.340.001.000.000.000.340.400.000.000.000.000.000.00
CO110.000.000.001.000.000.000.000.000.000.001.000.000.001.000.000.000.000.000.000.00
CO120.000.060.610.480.260.000.000.000.000.000.001.000.000.000.340.030.000.000.000.00
CO130.290.290.000.410.500.260.140.280.090.180.000.001.000.220.000.000.000.000.170.00
CO140.060.270.060.120.210.130.310.230.060.040.010.000.041.000.000.010.010.000.090.01
CO150.160.330.400.220.650.200.000.030.000.000.000.220.000.001.000.060.000.050.000.00
CO160.190.200.230.340.380.270.110.170.050.000.000.000.000.020.011.000.130.210.010.00
CO170.180.180.350.530.180.000.000.100.100.000.000.000.000.140.000.821.000.460.000.00
CO180.100.070.180.340.450.160.110.050.050.000.000.000.000.000.030.630.221.000.000.00
CO190.140.580.070.070.130.390.410.090.000.000.000.000.200.610.000.050.000.001.000.00
CO200.000.500.300.370.000.000.000.270.000.000.000.000.000.110.000.000.000.000.001.00
Table 6. Unloading scheduling.
Table 6. Unloading scheduling.
VesselArrivel TimeType of COPlanned Unloading TanksUnloading to 1st TankUnloading to 2nd TankUnloading to 3rt TankUnloading to 4th TankUnloading Starting TimeUnloading Finishing Time
1844[9, 2]92.9%7.1%--8495.7
21081[9, 2, 6]37.6%34.2%28.2%-108121.0
313213[7, 4]61.4%38.6%--142149.4
41567[5, 6, 10]36.5%34.6%28.9%-156178.3
518015[3, 1]64.1%35.9%--180201.7
62286[9, 2, 6, 8]43.3%28.5%22.4%5.8%228246.2
73483[10, 5, 6]62.5%31.0%6.5%-348359.6
83964[4, 2, 9, 5]30.3%30.3%22.1%17.3%396415.3
951613[7, 4]68.2%31.8%0.0%-545553.3
105640[10]100.0%---564574.9
105641[5, 9, 10]77.8%13.1%9.1%-575586.4
1161214[6, 4, 2, 9]32.8%30.3%29.3%7.6%624650.3
126844[8, 10]62.8%37.2%--684698.2
1375613[8]100.0%---786793.6
148523[9, 10, 6]93.7%4.3%2.0%-852863.2
159007[7, 9, 5]36.4%33.1%30.5%-900912.6
169486[10, 4, 5, 8]36.6%28.7%19.7%15.1%948969.8
179964[6, 4, 9, 2]40.6%22.3%22.2%14.9%10311049.0
18104413[4, 7]65.4%34.6%--11191028.2
1911643[10]100.0%---11641174.0
Table 7. Performance of unloading schedule.
Table 7. Performance of unloading schedule.
VesselArrivel TimeUnloading Starting TimeDepart TimeWaiting Time to Start UnloadingTotal Waiting TimeDelay Subject to Penalty
1848495.70.011.70.0
2108108121.00.013.00.0
3132142149.410.017.40.0
4156156178.30.022.30.0
5180180201.70.021.70.0
6228228246.20.018.20.0
7348348359.60.011.60.0
8396396415.30.019.30.0
9516545553.329.037.30.0
10564564574.90.010.90.0
10564575586.411.022.40.0
11612624650.312.038.30.0
12684684698.00.014.00.0
13756786793.630.037.60.0
14852852863.20.011.20.0
15900900912.60.012.60.0
16948948969.80.021.80.0
1799610311049.035.053.05.0
18104411191128.26.084.226.2
19116411641174.00.010.00.0
Table 8. Summary operations data.
Table 8. Summary operations data.
Min. Operation TimeMax. Operation Time# of ChangingAverage Hours
CDU 124833334.9
CDU 224843137.2
Transfer215136.71
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Güleç, N.; Kabak, Ö. Data-Driven Heuristic Optimization for Complex Large-Scale Crude Oil Operation Scheduling. Processes 2024, 12, 926. https://doi.org/10.3390/pr12050926

AMA Style

Güleç N, Kabak Ö. Data-Driven Heuristic Optimization for Complex Large-Scale Crude Oil Operation Scheduling. Processes. 2024; 12(5):926. https://doi.org/10.3390/pr12050926

Chicago/Turabian Style

Güleç, Nurullah, and Özgür Kabak. 2024. "Data-Driven Heuristic Optimization for Complex Large-Scale Crude Oil Operation Scheduling" Processes 12, no. 5: 926. https://doi.org/10.3390/pr12050926

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop