**An Optimization Model for Operational Planning and Turnaround Maintenance Scheduling of Oil and Gas Supply Chain**

### **Ahmed M. Ghaithan**

Construction Engineering and Management Department, College of Environmental Design, King Fahd University of Petroleum and Minerals, Dhahran 31261, Saudi Arabia; ahmedgh@kfupm.edu.sa; Tel.: +966-138603212

Received: 1 October 2020; Accepted: 22 October 2020; Published: 26 October 2020

**Abstract:** Hydrocarbon supply chain (HCSC) is a complex network that extends from oil and gas fields to demand nodes. Integrating operation and maintenance activities along this complex network is crucial since the hydrocarbon industry is the most influential sector in the world economy, and any disruptions or variations in hydrocarbon product supply will affect the whole world economy. Therefore, effective and thoughtful maintenance extends the life of an asset and enhances its reliability. To prevent huge losses in production and ultimately satisfy customer needs, the maintenance jobs are preferred to be performed during times of low demand. Thus, operation planning and maintenance scheduling decisions are dependent and should be optimized simultaneously. Therefore, the aim of this study is to develop an integrated mathematical model for the operation and maintenance planning of the oil and gas supply chain. The utility of the proposed model has been demonstrated using the Saudi Arabian HCSC. The proposed model effectively produces optimal operation and maintenance schedule decisions. A sensitivity analysis was conducted to study the effect of critical parameters on the obtained results.

**Keywords:** supply chain optimization; oil and gas supply chain; maintenance scheduling; operation planning; energy

### **1. Introduction**

The hydrocarbon supply chain (HCSC) comprises oil and gas networks. The oil network involves oil fields, oil and gas separation plants (GOSPs), primary storage facilities, oil processing plants, refinery plants, secondary storage facilities, and demand nodes. In comparison, the gas network consists of gas fields, storages facilities, gas plants, fractionation plants, secondary storage facilities, and demand nodes. The two networks overlap in some entities and share some products.

Few researchers have studied the optimization of operational planning under the assumption of plant availability with full capacity, yet this assumption is practical. It is crucial to consider interruptions or plants' sudden shutdown when planning for operation. In the real world, plants might be totally or partially unavailable due to periodic maintenance, shutdown, etc. Thus, production capacities will be reduced or reach zero. To restore the plants to their full capacities and keep them in good condition, plants should be maintained regularly and routinely to prevent unplanned failures and increase production rates. Maintenance activities reduce the sudden breakdown and prolong the unit's life. Thus, operation planning models need to be more realistic and should consider the maintenance schedule. To prevent huge losses in production and eventually satisfy customer needs, maintenance jobs should be performed during times of low demands. Besides, connections between upstream and downstream plants need to be considered before deciding to perform maintenance activities, especially in complex networks such as HCSC.

Thus, operation planning models must be more realistic and take into account maintenance tasks. Several studies have addressed the integration of operation and maintenance planning activities within the scope of a single machine in different areas and applications, such as the inventory control area. According to the author's knowledge, no work has been done to integrate operation planning and maintenance scheduling in the supply chain.

The study aimed to develop a mixed integer programming (MIP) model to coordinate the operation and maintenance activities of the oil supply chain plants, taking into account the best use of available human resources and maintenance resources, while satisfying the maintenance and operational constraints. The expected outputs of the proposed model are the production volumes, flow quantity, exportation volume, inventory level, as well as maintenance schedules for influential HCSC plants while maximizing profit. Maximizing profit is necessary for any organization to meet financial obligations and support the country's budget.

The utility of the model is demonstrated using a real case (Saudi Arabia's oil and gas supply chain). The model is expected to have a positive impact on the future management of this important component of the energy sector. A valuable and practical sensitivity analysis was conducted to study the effect of the key parameters on the obtained results. Some managerial insights will be derived and are expected to help and guide decision-makers as they build their decisions.

The integration of operation and maintenance activities have not been studied adequately, specifically in the supply chain context. In the area of the hydrocarbon supply chain, no work has tackled production planning and maintenance scheduling simultaneously. Therefore, the maintenance scheduling models of petroleum plants and integrated models in the area of inventory control will be reviewed in this section. In the HSCS, operation and maintenance schedules have been treated independently. For example, [1] developed a multi-objective model for the operational planning of the Hydrocarbon supply chain under the assumption of the entities available during the planning horizon. Few studies have studied the maintenance scheduling of single entities of a petroleum network such as the refinery plant. For instance, [2] developed a Mixed Integer Linear Programming (MILP) model for scheduling the preventive maintenance of units of a refinery plant. The proposed model aims to maximize the utilization level of units while satisfying maintenance constraints.

Mendez et al. [3] developed an MILP model for the optimization of the short term blending and scheduling problem in applications of an oil refinery. The model aims to optimize the profit and satisfy the quality requirements. The authors developed a novel method to solve the proposed model. Göthe-Lundgren et al. [4] proposed an MILP model for the production scheduling of the oil-refinery problem. In the proposed model, the production process consisted of two hydro-treatment units and one unit of distillation. The aim of the scheduling was to decide which model of operation to use in each processing unit at each point in time in order to satisfy the demand while minimizing the production cost and considering storage capacities. Antomarioni et al. [5] developed a data-driven model for determining the type of maintenance that should be performed to a refinery plant. Bertolini et al. [6] addressed an approach based on risk inspection and maintenance for maintaining activities in an oil refinery to minimize the risk. A heuristic algorithm was utilized to solve the proposed model, considering the time, human resources, and budget constraints.

Aissani et al. [7] presented a multi-agent approach for the scheduling of dynamic maintenance activities for the petroleum industry using a reinforcement approach. Amaran et al. [8] proposed an MILP model for planning the turnaround activities of interconnected plants in a chemical site. The aim of the proposed model was to maximize the net present value. Awad and Ertem [9] developed a stochastic model to schedule preventive maintenance for an oil refinery plant taking into consideration the uncertainty in maintenance time. The model aimed to minimize the total adjusted tardiness times while satisfying the amount of multiple-skill-level maintenance crew and budget limits. Xu et al. [10] developed a proactive scheduling model for maintaining refinery plants under the uncertainty of crude shipping delays. A mixed-integer nonlinear programming model was developed to optimize crude unloading, transferring, and processing at the refinery plant. Recently, [11] extended the [10] work by integrating proactive and reactive scheduling.

Several studies have tackled the issue of coordinating production and maintenance activities, especially in the inventory control area. The first pioneering work in this field was performed by Rosenblatt and Lee [12], who formulated a model to optimize economic production quantity and at the same time, generate a maintenance plan for a production system. Joshi and Gupta [13] employed the production plans along with a history of machine failure to optimize maintenance activities. In his dissertation, Pintelon [14] proposed an integrated model for production and maintenance planning simultaneously. The aim of the developed model was to find out the period between two consecutive preventive maintenance tasks. Ashayeri et al. [15] proposed an MILP model for scheduling production jobs and the preventive maintenance of a multi-line production system. The aim of the model is to examine the possibility of performing preventive maintenance before a new job or run the job without performing preventive maintenance until a breakdown happened then repair the production system. Rahim and Ben-Daya [16] reviewed inventory models that integrated production planning, quality, and maintenance activities. Iravani and Duenyas [17] developed a policy for a production inventory system operated by a single machine subjected to deterioration. The maintenance and production decisions were optimized by solving the model using the Markov decision process.

Cassady and Kutanoglu [18] developed an integrated preventive maintenance and production scheduling model. The aim of the model was to decrease the overall weighted job slowness. Cassady and Kutanoglu [19] investigated an integrated model for maintenance and production scheduling with the aim to minimize the overall anticipated weighted job completion time. Darwish and Ben-Daya [20] introduced an inventory model combining preventive maintenance and production and taking into account an inspection error. Aghezzaf et al. [21] developed a hybrid production planning and maintenance model for a deteriorating production system. To renew and restore the system, preventive maintenance was carried out on a regular basis, and minimal repair was carried out. Production and maintenance plans have been developed to reduce overall production and maintenance costs. Aghezzaf and Najid [22] extended the [21] work for a system consisting of more than one production line which operates in parallel.

Zied et al. [23] formulated a model for a manufacturing system that was subjected to random failure and assuming the demand was stochastic. The failure rate was assumed to be a function of machine working time and production rate. The output of the model was an optimal production plan combined with a preventive maintenance policy, which minimized the total cost subject to a target service level. Berrichi et al. [24] focused on the problem of maintenance and production planning in a parallel machine case by developing a bi-objective integrated model which enabled the manager to decide the production assignment to machine and plan the maintenance for each machine at the same time. Thus, machines not in duty can be taken for maintenance as per a pre-identified plan. Ayed et al. [25] developed a model for optimizing a manufacturing system that faces random failures. Due to failure, a random shortage demand was substituted by subcontracting from a different production system. It was assumed that the manufacturing system failure rates are both functions of time and production rate. A preventive maintenance schedule was determined to minimize manufacturing system decay.

Fitouhi and Nourelfath [26] formulated an integrated production and maintenance planning model for a single machine that was subjected to random failure. Preventive maintenance is applied periodically, and minimal repair was performed to renew the machine to its normal state. Yalaoui et al. [27] developed a model similar to [22] work for multi-machines. Assid et al. [28] developed a simulation model that integrated production, setup, and maintenance activities simultaneously.

Khosrojerdi et al. [29] developed a robust mathematical model for designing a power supply chain. The model considers planning the power generation and scheduling of preventive and corrective maintenance due to possible failures in the electricity transmission system. Cheng et al. [30] proposed a model for a machining system in which the production rate affects both the cutting tool age and the reliability of the machine. The developed model takes into consideration the addition to production

scheduling, a preventive maintenance of the machine, and the tool replacement. Ettaye et al. [31] explored the aspect of integrated production operations and maintenance planning activities at the tactical level of multi-line systems. The policy of maintenance provides preventive substitutions at the start of every cycle as well as minimal repairs in the event random failures occur. The aim of the model was to minimize the total costs and concurrently determine the maximum production plan alongside the replacement time.

Géhan et al. [32] presented a joint optimization model for integrating master production schedule and maintenance strategy for a manufacturing system. The proposed policy allows minimizing the impacts of potential random failures. A heuristic algorithm was invented for solving the proposed model. Liu and Lv [33] discussed a maintenance optimization strategy for a multi-component system with the use of the degradation information of the system. They argued that combining the maintenance activities was cheaper than having each component of a system planned separately. Zhao et al. [34] proposed a model for the integration of maintenance and production planning considering the production losses due to preventive maintenance, corrective maintenance and operation dependent failures. Hnaien et al. [35] discussed the problem of integrating production planning and preventative maintenance for a single machine in order to maximize its production capacity. A mixed-integer linear programming model was proposed to tackle the problem.

Askri et al. [36] proposed a preventive maintenance and production policy for a manufacturing system consisting of parallel machines considering the lease contract. The aim of the proposed model was to determine the economical production quantity and the preventive maintenance interval for the machines while minimizing the total cost of production and maintenance. Amiri and Honarvar [37] investigated a bi-objective mathematical model which integrated both tasks; preventive maintenance planning and energy hub components repair under the assumption of stochastic demand. Khatab et al. [38] discussed the integration of production quality and the condition-based maintenance of a single-machine production system. The problem tackled assumes that a machine will have some product defects after a certain level of degradation. The model considers the inspection time and preventive maintenance to reduce off-specification products.

The oil and gas supply chain includes many petrochemical plants such as sweetening plants, refinery plants, gas plants, and fractionation plants which constitute connected and advanced equipment to help maximize the value of the petroleum product. To reduce the sudden breakdown, prolong their lives, and minimize the lifetime cost of energy, both operations and maintenance costs need to be optimized simultaneously. Similarly, renewable energy plants such as onshore/offshore wind energy plants involve many connected units that need to be maintained regularly. Wind power is often considered as an expensive source of energy. Therefore, coordinating operations and maintenance decisions will reduce the costs for operations and maintenance which indicates that there is large potential in cost-savings. Several studies have optimized operation and maintenance scheduling for renewable energy power plants applications. For example, Rinaldi et al. [39] developed an optimization model to coordinate the operation and maintenance activities for offshore renewable energy farm. Martin et al. [40] studied the integration of operation and maintenance scheduling of an offshore wind farm by conducting a sensitivity analysis to identify the most significant factors affecting availability and operation and maintenance costs.

Rinaldi et al. [41] optimized the operation and maintenance activities of an offshore wind farm using genetic algorithms in order to minimize operation and maintenance costs of the offshore farm while maximizing both the availability and reliability. Helsen et al. [42] studied the optimization of the operation and maintenance strategy of a wind farm using a big data approach with the aim to understand the failure mechanisms of wind turbines. Nielsen and Sørensen [43] developed a mathematical model for operation planning and maintenance scheduling of a single wind turbine. Both condition-based and corrective maintenance are compared taking into consideration constraints of design and inspection. Dinwoodie [44] developed a mathematical model for coordinating the operation and maintenance decisions for an offshore wind farm. This model minimizes the lifetime

cost of energy by optimizing both the operations and maintenance costs of offshore wind farm. Seyr and Muskulus [45] conducted a comprehensive review on the area of operation and maintenance of offshore wind farms.

The above literature review revealed that the integration of operation and maintenance activities in the oil and gas supply chain area has not been tackled; however, several studies have addressed the integration of operation and maintenance activities in the scope of a single entity in different areas and applications such as inventory control. To the author's knowledge, no work has appeared in the literature to integrate operation planning and maintenance scheduling for HCSC. Therefore, this paper fills the aforementioned gaps.

### **2. Materials and Methods**

The focus of this research is on developing an optimization model for integrating operation planning and the turnaround maintenance of oil and gas supply. To achieve the research objectives and answer the research question, a systematic approach is followed as: first, the problem is formulated, and an optimization model is developed. Second, the actual case study employed to study the utility of the proposed model is presented. Finally, the output findings are discussed, and a sensitivity analysis is conducted to study the impact of changes in input parameters on the optimal findings.

### *2.1. Problem Statement*

Hydrocarbon supply chain (HCSC) is a complex and long network extending from the production of crude oil and natural gas to marketing the oil and gas products. The entities along the HCSC constitute oil and gas fields, oil and gas separation plants (GOSPs), primary storage facilities, oil and gas processing plants, refinery plants, fractionation plants, secondary storage facilities, and demand nodes. The crude oil from oil fields and/or GOSPs is pumped to oil processing plants for removing sulfur. After removing the sulfur, the oil is shipped to international and local terminals. Locally, the crude oil is further transformed in refinery plants into its oil by-products (i.e., diesel, naphtha, gasoline, Liquefied Petroleum Gas (LPG), fuel oil, asphalt, and kerosene). The oil by-products are then used to satisfy international and local demands. The associated natural gas produced at gas–oil separation plants (GOSPs) and the non-associated natural gas produced directly from pure gas fields are streamed to gas plants in which they are processed into natural gas liquid (NGL), methane and hydrogen sulfide. The methane is used as a raw material by industry, and the NGL is fractionated in fractionation plants into its gas products (i.e., ethane, propane, butane, and natural gasoline) used to satisfy the local and international demand. A general representation of the entities of the HCSC are shown in Figure 1.

**Figure 1.** Schematic representation of downstream oil and gas supply chain.

In the real-world, HCSC plants might be totally or partially unavailable due to periodic maintenance and sudden shutdown. Thus, their production capacities will be reduced or reach zero. To restore these plants to their full capacities and keep them in good condition, plants should be maintained regularly and routinely to prevent unplanned failures, increase plant production rates, and prolong their life. Thus, operation planning models need to be more realistic and should consider maintenance scheduling. The maintenance cycle and duration of petroleum plants such as oil processing plants, refinery plants, gas plants, and fractionation plants must be identified before model formulation.

The aim of the proposed MIP model is to coordinate the operation and maintenance activities of the HCSC plant network, taking into account the best use of available manpower and maintenance resources, while satisfying maintenance and operational constraints. The objective of the proposed model is to maximize the HCSC profit. The model will help to determine the optimal production, inventory and transport volumes and at the same time, generate an optimal maintenance schedule. Each HCSC plant is assumed to have its own storage facility to satisfy the needs during planned and/or unexpected failures, as well as a plant shutdown. In the hydrocarbon industry, inventory is an important and expensive asset; therefore, it is important to manage the inventory level and specify their capacities precisely.

### *2.2. Mathematical Model*

In this section, an integrated operation and maintenance scheduling model was developed. The sets, indices, variables, and parameters used in the proposed model are summarized in Table 1.

After defining the notations required for model development, the constraints and objective functions will be formulated below:

The following constraint limits the number of times a plant *i* has to be maintained during the planning horizon:

$$\sum\_{t \in T} St\_{it} = \mu\_i \quad \forall \ i \in \{\text{N1}, \text{N2}\} \tag{1}$$

The efficiency of the maintenance at time-period intervals is implemented by equating the corresponding binary variables using the following equation where fi represents the length of time between each maintenance activity for a plant *i*. For instance, if a particular plant *i* has been maintained at time *t*, the second maintenance task will be performed at time *t* + *f*:

$$St\_{it} = St\_{i \; t + f\_i} \quad \forall \; i \in \{\text{N1}, \text{N2}\}, t \in T \tag{2}$$

The size of the crew needed to perform maintenance jobs in plant *i* should not exceed the available manpower. The following constraint is added to ensure that there should be no maintenance task for the same crew while they are maintaining other plants. In addition, no more than a fixed number of plants can be served at the same time due to the limited number of crew available. This constraint can be represented mathematically as follows:

*<sup>t</sup>* <sup>τ</sup>=*t*−*ni*+<sup>1</sup> *Sti*<sup>τ</sup> *Rit* <sup>≤</sup> *Wit* <sup>∀</sup> *<sup>i</sup>* <sup>∈</sup> {*N*1, *<sup>N</sup>*2}, *<sup>t</sup>* <sup>∈</sup> *<sup>T</sup>* (3)

The material balance of the plants belong to the first level of HCSC (oil processing plant and gas plants) are represented by Equation (4) where the material flow from the upstream is equal to the the production volumes at each plant *i*. The processed quantities are then sent to the next level of the HCSC (refinery plants; N2, fractionation plant; N2 and demand node; N3) to satisfy the local and international demands:

$$\sum\_{r} w\_{\text{it}}^{p} Y\_{\text{it}}^{r} = \sum\_{j \in \mathbb{N}2} X\_{\text{ij}t}^{p} + \sum\_{j \in \mathbb{N}3} X\_{\text{ij}t}^{p} \quad \forall \ t \in T, p \in P, \ i \in \mathbb{N}1\tag{4}$$


**Table 1.** Sets, subsets, variable and parameters notations.

*Appl. Sci.* **2020**, *10*, 7531

The inlet to the second level of the HCSC (refinery plants and fractionation plant) is then processed and fractionated to its by-products based on the inlet compositions. The by-product flow is then forced to the third level of the HCSC to satisfy the local and international demands N3, Equation (5):

$$\sum\_{p} \sum\_{\substack{i \in \mathcal{N}1 \\ i}} w\_{ijt}^{b} X\_{ijt}^{p} = \sum\_{\substack{k \in \mathcal{N}3 \\ i}} X\_{jkt}^{b} \quad \forall \ t \in T, b \in B, \ j \in \mathcal{N}2, \ k > i \tag{5}$$

The material balance for the storage tanks belongs to the first and the second levels of the HCSC which are denoted by the two constraints:

$$\sum\_{i: i \in \mathcal{N}1} X\_{i\bar{j}t}^p + I\_{\bar{i}t-1}^p = \sum\_{j: i \in \mathcal{N}2} X\_{j\bar{k}t}^p + \sum\_{j \in \mathcal{N}3} X\_{j\bar{k}t}^p + I\_{\bar{i}t}^p \quad \forall \ t \in T, p \in P, \ j \in \mathcal{S}1, \ k > i \tag{6}$$

The inlet flows from the upstream plants to each store tanks plus inventory left from the previous period (t − 1) equal to the outlet from the store tank plus inventory level at time period *t*:

$$\sum\_{i \in \mathbb{N}2} X^{b}\_{i\bar{j}t} + I^{b}\_{it-1} = + \sum\_{j \in \mathbb{N}3} X^{b}\_{j\bar{t}t} + I^{b}\_{it} \ \forall \ t \in T, b \in B, \ j \in \mathbb{S}2, \ k > i \tag{7}$$

The inlet flows from plants located at the second level to each store tanks plus inventory left from the previous period (*t* − 1) equal to the outlet from store tank plus inventory level at time period *t*.

The inlet to any petroleum plant is limited to the plant's capacity. If a plant is in maintenance, the capacity is dropped to zero. Equations (8) and (9) represent the capacity constraints for the plants belong to the first and the second levels of HCSC, respectively:

$$\sum\_{r \in \mathbb{R}} Y\_{\text{it}}^r \le \left(1 - \sum\_{r=t-n\_i+1}^t S t\_{\text{it}}\right) \mathbf{C} a\_{\text{it}} \quad \forall \ i \in \text{N1}, t \in T \tag{8}$$

$$\sum\_{i:i\in\mathcal{N}1} \sum\_{p\in\mathcal{P}} X\_{ijt}^p \le \left(1 - \sum\_{\tau=t-n\_j+1}^t St\_{j\tau}\right) \mathbf{C} a\_{jt} \quad \forall \quad j\in\mathcal{N}2, t\in\boldsymbol{T} \tag{9}$$

The storage tanks' capacities are restricted by the following two constraints:

$$\text{CS}\_{j}^{\text{min}} \le I\_{jt}^{p} \le \text{CS}\_{j}^{\text{max}} \quad \forall \ j \in \text{S1}, \ p \in P, \ t \in T \tag{10}$$

$$\text{CS}\_{j}^{\text{min}} \le I\_{jt}^{b} \le \text{CS}\_{j}^{\text{max}} \quad \forall \ j \in \text{S2}, b \in B, t \in T \tag{11}$$

Exportation volumes from each crude oil type should not exceed the quota specified by OPEC to each member in the Organization of the Petroleum Exporting Countries, Equation (12). In this study, maintenance was carried out on a weekly basis, while demand is on a monthly basis. Therefore, *Dpt* represents the set of time periods included in the demand period starting at time *t*, and d*t* denotes the duration of the demand period:

$$\sum\_{i \in \mathcal{N}1} \sum\_{j \in \mathcal{N}3} \sum\_{p \in P} \sum\_{t \in Dp\_l} X\_{ijt}^p \le OPEC\_l \quad \forall \ Dp\_l = \{t, \dots, t + d\_l\} \tag{12}$$

Equations (13) and (14) denote that the amount of sales plus shortages minus excess equals demand at any time period *t*:

$$\sum\_{t \in N1} \sum\_{t \in Dp\_t} X\_{ijt}^p + X\_{it}^{p+} - X\_{it}^{p-} = D\_{jt}^p \quad \forall \ j \in \text{N3}, p \in P,\\ Dp\_t = \langle t, \dots, t+d\_l \rangle \tag{13}$$

$$\sum\_{i \in N2} \sum\_{t \in Dp\_l} X\_{ijt}^b + X\_{it}^{b+} - X\_{it}^{b-} = D\_{jt}^b \quad \forall \ j \in \text{N3}, b \in B, Dp\_l = \{t, \dots, t+d\_l\} \tag{14}$$

The profit Equation (15) involves two main parts: the revenue obtained minus expenses, which includes maintenance costs, processing costs, transportation costs, holding costs, and the penalty costs of producing over and under the specified demand.

*Max f* = - *i*∈*N*1 - *j*∈*N*3 - *p*∈*P* - *t*∈*T Sp<sup>p</sup> jt <sup>X</sup><sup>p</sup> ijt* + - *i*∈*N*2 - *j*∈*N*3 - *b*∈*B* - *t*∈*T Sp<sup>b</sup> jt <sup>X</sup><sup>b</sup> ijt* ⎤ ⎥⎥⎥⎥⎦ − - *i*∈*N*1,*N*2 - *t*∈*T Stit Rit t*+*ni*−1 τ *Cmi*<sup>τ</sup> + - *i*∈*N*1 - *r*∈*R* - *t*∈*T Cp<sup>r</sup> itYr it* + - *i*∈*N*1 - *j*∈*N*2 - *p*∈*P* - *t*∈*T Cpp ijt <sup>X</sup><sup>p</sup> ijt* + - *i*∈*N*1 - *j*∈*N*2 - *p*∈*P* - *t*∈*T Ctp ijtX<sup>p</sup> ijt* + - *i*∈*N*2 - *j*∈*N*3 - *b*∈*B* - *t*∈*T Ct<sup>b</sup> ijtX<sup>b</sup> ijt* + - *i*∈*S*1 - *p*∈*P* - *t Hcp it I p it* + - *i*∈*S*2 - *b*∈*B* - *t*∈*T Hcb it I b it* + - *i*∈*N*3 - *p*∈*P* - *t <sup>W</sup>p*<sup>+</sup> *it <sup>X</sup>p*<sup>+</sup> *it* + - *i*∈*N*3 - *p*∈*P* - *t Wp*<sup>−</sup> *it <sup>X</sup>p*<sup>−</sup> *it* + - *i*∈*N*3 - *b*∈*B* - *t Wb*<sup>+</sup> *it <sup>X</sup>b*<sup>+</sup> *it* + - *i*∈*N*3 - *b*∈*B* - *t wb*<sup>−</sup> *it <sup>X</sup>b*<sup>−</sup> *it* (15)

### *2.3. Case Study*

The Saudi Arabian oil and gas network was used to validate the proposed model. The entities of the oil and gas supply chain with the corresponding units and relevant data are reported below. The planning horizon was four years and discretized over 192 weeks. To simplify the development of a complex HCSC network, the supply chain was divided into two subnetworks shown in Figures 2 and 3. The HCSC network is a representation of Figure from [46].

**Figure 2.** The oil network.

**Figure 3.** The natural gas network.

The flow and operation of the HCSC is as follows: wellhead oil of different grades; Arabian light, Arabian extra light, Arabian medium, and Arabian heavy produced in upstream units of the HCSC are transported through pipelines to eight (8) oil processing plants for the processing and removal of sulfur. The crude oil is then transported to three (3) major international terminals and (9) local refineries where crude oil is transformed into seven (7) by-products (LPG, naphtha, gasoline, diesel, kerosene, fuel oil, and asphalt) based on their yield. Oil by-products are then distributed to meet the needs of local customers in the main five (5) regions of the Kingdom and three (3) major industrial cities. Parts of LPG, naphtha, and fuel oil are used to meet international demand through terminals.

On the other side, the associated and non-associated natural gas streams produced at gas–oil separation plants (GOSPs) and gas fields, respectively, are transported to nine (9) gas plants for the impurity removal and recovery of hydrogen sulfide. The output gases are NGL and methane. The NGL is supplied to five (5) fractionation plants for the further separation and fractionation into gas products (ethane, butane, propane, and natural gasoline). Part of NGL is exported through international terminals to meet international demand, while methane and ethane are used to meet local demand. At the same time, propane, butane, and natural gasoline meet the demands of international and local customers.

Entities such as oil processing plants, refinery plants, gas plants, etc. will be totally or partially unavailable due to failures or planned maintenance. Thus, their production capacity may be reduced or reached zero. Maintenance is used to restore these entities to their full capacity and keep them in good condition. Each HCSC plant is assumed to have its own storage facility to satisfy needs during planned and/or unexpected failures. In HCSC, inventory is an expensive asset that needs to be considered. Therefore, it is essential to manage inventory levels and capacities. Therefore, when optimizing the HCSC, there is a need to consider operation and maintenance activities in an integrated manner. In this study, a proposed MILP model will be developed and solved. The model will jointly produce a maintenance schedule for each HCSC plant and operational plans such as production volumes, transported volumes, inventory levels, shortages, and excess volumes, etc.

To develop a proposed model, the maintenance cycle and duration for oil processing plants, refinery plants, gas plants, and fractionation plants must be specified, and logical relationships between plants need to be considered. For example, dependent plants are preferred to be stopped for maintenance simultaneously. In addition, similar operating units cannot be taken for maintenance at the same time in order to prevent a huge loss in production. As per consultation with people working in the oil industry, the average maintenance duration for the HCSC plant is between 3–4 weeks. It is assumed that every HCSC plant needs to be maintained twice over the four-year planning horizon. The maintenance crew required to perform maintenance activity in each HCSC plant is ten workers, and the total number of crews available is 20. Every worker earns, on average \$120 a week.

Real data were collected from [1,47,48] and were used as input to the proposed model to evaluate its utility. To represent the above stated problem, the MIP model has been developed and solved using the CPLEX 13.3 commercial solver [49]. All computations were done on a PC type intel (R) Core (TM)2 Quad CPU processor with 2.67 GHz and 4 GB RAM using the GAMS (General Algebraic Modeling System) [50]. The model output will be discussed and analyzed in the following sections.

### **3. Results**

To investigate the utility of the proposed model, the Saudi Arabian oil and gas supply chain was employed. The entities of the HCSC with their associated units and relevant data are reported in Section 4. The planning horizon is four years with a one week planning period. In this study, maintenance tasks are carried out on a weekly basis, while demand is on a monthly basis.

The maintenance schedule for all HCSC entities over the planning horizon is displayed in Figure 4. The Gantt chart shows a schedule displaying which each unit will be taken for maintenance and in which weeks. The width of the bar indicates the duration of maintenance in weeks.

**Figure 4.** Maintenance schedule for all hydrocarbon supply chain (HCSC) plants (operations and maintenance model); Color code: Orange: oil processing plants; Purple: Refinery plants; Red: Gas plants; Light Blue: Fractionator plants.

The following conclusions can be derived to describe the Gantt chart:

• It was observed that the proposed model distributes maintenance activities uniformly and perfectly among the HCSC plants along the time horizon of four years.


For the deep investigation, a sample of output for some selected plants will be displayed. For instance, the maintenance schedule, utilization, and production for gas plants during the first year are shown in Figure 5. The third quarter represents the months of the highest demand. Therefore, almost all gas plants have been taken for maintenance during the months of the demand (Quarters 1, 2 and 4).

**Figure 5.** Gas plants maintenance scheduling, production plans, and utilization (year 1).

Similarly, Figure 6 shows the oil processing plants' maintenance schedule, production, and utilization for the first year.

**Figure 6.** Oil processing plants maintenance scheduling, production, and utilization (year 1).

Figure 7 indicates the fractionation plant storage capacities and inventory levels fluctuations across the planning horizon. Production and maintenance are carried out on a weekly basis, while demand is on a monthly basis. As a result, the inventory level accumulated over the first four weeks of a month, then decreased as demand occurred at the end of the last week of a month.

**Figure 7.** Fractionation plants inventory level and storage capacity.

### *Sensitivity Analysis*

A valuable sensitivity analysis was conducted to show how the model was sensitive to the changes in the key parameters. In this study, the impact of changes in selling prices, demand, and store capacity on model output will be evaluated. Figure 8 shows the variation in profit with changes in selling price. It is noted that as the selling price increases, the total profit linearly increases.

**Figure 8.** Profatibility changes with variation in demand.

Figure 9 shows the fluctuations in profit with variability in demand. As demand increases, profit decreases because plant and storage capacities are kept constant; therefore, lost sales increase, which leads to customer dissatisfaction and ultimately lower profitability.

**Figure 9.** Profitability changes with the variation in demand.

The impact of storage capacity variability on profitability is demonstrated in Figure 10. It is revealed that as storage capacity increases, profit increases due to a decline in lost sales and the satisfaction of most customer needs. Reducing store capacities by more than 55% will generate non-profitable plans.

**Figure 10.** Profitability changes with variation in store capacity.

The impact of upstream storage capacities on the maintenance schedule and arrangement is investigated in Figure 11.

**Figure 11.** Maintenance schedule for all HCSC plants (reducing the storage capacity of upstream petroleum plants by 50%); Color code: Orange: oil processing plants; Purple: Refinery plants; Red: Gas plants; Light Blue: Fractionator plants.

The subsequent investigations can be derived from the above Gantt chart after reducing the storage capacity of upstream petroleum plants by 50%:


To determine the significance of integration between operations and scheduling activities during modelling, the model was resolved without integration (only maintenance model). The obtained maintenance schedule is depicted in Figure 12.

**Figure 12.** Maintenance schedule for all HCSC plants (maintenance model only); Color code: Orange: oil processing plants; Purple: Refinery plants; Red: Gas plants; Light Blue: Fractionator plants.

It appeared that the HCSC units were taken for maintenance on a random basis during the planning period without taking into account the seasons of high or low demand, which would inevitably result in a huge loss of production and ultimately does not satisfy most customer needs.

### **4. Discussion**

In this study, an integrated operation and maintenance model for both the oil and gas supply chain was developed. The model integrated and generated operation plans and maintenance schedules for the HCSC plants jointly. The integration between the operation and maintenance activities was studied and compared to a model without integration. The obtained results justified the importance of the proposed model. The results of the model were promising in which the model forced all the HCSC plants to be maintained during the months of low demand to prevent huge losses in the production and satisfy most of the demand and minimize lost sales as much as possible. The output of the model shows the role of storage in satisfying needs during plant maintenance, as well as the impact of storage capacities on coupling or decoupling maintenance tasks for connected plants. The model can be extended by addressing the uncertainty of input parameters such as the demand, price, etc.

**Funding:** This research received no external funding.

**Acknowledgments:** The author would like to acknowledge the financial support provided by the Deanship of Scientific Research (DSR) at King Fahd University of Petroleum and Minerals (KFUPM) for funding this work through project NO. SR181022.

**Conflicts of Interest:** The author declares no conflict of interest.

### **References**


**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

© 2020 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

MDPI St. Alban-Anlage 66 4052 Basel Switzerland Tel. +41 61 683 77 34 Fax +41 61 302 89 18 www.mdpi.com

*Applied Sciences* Editorial Office E-mail: applsci@mdpi.com www.mdpi.com/journal/applsci

MDPI St. Alban-Anlage 66 4052 Basel Switzerland

Tel: +41 61 683 77 34 Fax: +41 61 302 89 18

www.mdpi.com