INTRODUCTION
Since the discovery of petroleum, the rational utilization of the fractions
that compose it has strongly influenced the development of refining processes
as well as their arrangement in refining flow sheets. In the late 60’s,
oil refining has significantly transformed being linked to the continuous increase
in the need of oil light products at the expense of heavy products (Wauquier,
1995).
Whereas owing to its flexibility, the refining industry has proven its ability to adapt and being capable to meet changes in demand and quality, in the light of introducing new antipollution standards as well as preset limitations for the chemical composition of finished products. So it’s obviously seen that current refinery flow sheets, especially beyond the year 2000 would be more restricted to the new specifications using new processes.
Refining processes are basically divided into two main categories: Separation
and Conversion. Separation processes include primary distillation of crude oil,
secondary distillation or Vacuum Distillation absorption processes, extraction
processes, crystallization processes and adsorption processes. Conversion processes
include processes for the improvement of properties by: molecular rearrangement,
using coreactants, thermal cracking, catalytic processes, finishing processes
and environmental protection processes (Wauquier, 2000).
With all the complexities of the abovementioned processes, linear programming stands out as a practical convenient and effective tool for solving refinery optimization problems, based on data of unit yields, unit capacities, utilities consumption and the like, as well as product blending operations of the refinery by means of linear objectives and constraints.
THE PETROLEUM REFINING INDUSTRY
Petroleum refining has evolved continuously in response to the always changing
consumer demand of energy starting with the whale oil to the development of
the internal combustion engine led to the production of gasoline and diesel
fuels. Presentday refineries produce a variety of products including many required
as feedstock for the petrochemical industry (Meyers, 2003;
Prasad, 2002).
A refinery is basically a factory that takes crude oil as raw material and transforms it into hundreds of other useful products. A typical large refinery costs billions of dollars to build and millions more to maintain and upgrade. It runs around the clock 365 days a year, employs between 1,000 and 2,000 people and occupies as much land as several hundred football fields. Roughly, a refinery process can be divided into three parts: crude oil operations, production and product blending as shown in Fig. 1.
In crude oil operations, a variety of crude oil is fed into production devices for refining. In the production process, crude oil is decompounded into different product components. The components then are blended into numerous products.
Crude oil characteristics: Crude oil, also called petroleum, is a complex
mixture of carbon and hydrogen (hydrocarbons), which exists as a liquid in the
earth's crust. Crude oil has many forms; some is black, thick and tar like,
while other crude oils are lighter in color and thinner. The carbon and hydrogen
in crude oil are thought to have originated from the remains of microscopic
marine organisms that were deposited at the bottom of seas and oceans and were
transformed at high temperature and pressure into crude oil and natural gas
in petroleum traps. Several different types of oil and gas traps exist; a common
dome is formed by folded sedimentary rocks.

Fig. 1: 
Illustration of a standard refinery system 
Crude oil is obtained by drilling a hole into the reservoir rock (sandstone,
limestone etc.) and pumping it out.
What is Naphtha? Naphtha is a complex mixture of hydrocarbons with boiling range of 38 to 205°C, which corresponds to carbon numbers of C5 to C14. Naphtha is produced from petroleum crude oil by fractionation at crude distillation tower working under atmospheric pressure. Crude distillation residues are fed to conversion process units like hydrocracker and cooker units. Residues from atmospheric crude distillation are fed to vacuum distillation, which separates them to vacuum gas oil and vacuum residue. Vacuum oil is fed to hydrocracker unit, where through utilizing Ni and Mo catalysts at an atmosphere of hydrogen, vacuum residue is thermally cracked in cooker unit. Naphtha from crude atmospheric distillation, hydrocracking and cooker units has low octane number, also it contains a big amount of contaminants like sulfur, nitrogen, oxygen, olefins and metals. So Naphtha is fed to hydotreating unit, where hydrogen is reacted with contaminants on catalysts of CoMo and NiMo, giving H_{2}SNH_{3}H_{2}O at an atmosphere of 315 to 340°C and pressure of 50 bar.g. Treated Naphtha is sent for further processing by splitting it into:
• 
Light Naphtha that consists of C5 and C6, that passes to isomerization
unit 
• 
Heavy Naphtha with carbon number of C7 to C14, that passes
to a catalytic reforming unit 
After that both resulting streams are being blended together in a process called gasoline blending, to produce gasoline fuel as a final product.
LINEAR PROGRAMMING IN REFINERY SCHEDULING
In the context of oil industry, a Linear Programming (LP) model is a mathematical
model of the refinery, representing all refinery unit yields, unit capacities,
utility consumption, as well as product blending operations of the refinery
by means of an objective function subject to a number of constraints (Speight,
2002).
Refinery linear programming modeling: As in most industries operating
in a competitive environment, refineries must maximize their economic results,
to do that; they must maximize their margins, i.e., the difference between their
revenues from the products they manufacture and their costs (Gao
et al., 2008). However, the refining industry has a particular characteristic,
which is that the products manufactured from the various crude oils are interdependent.
It is not possible to manufacture just one product from the treatment and conversion
units that make up a traditional refinery. The relative proportions of the resulting
products depend on the characteristics of the different feed stocks, process
units used and the unit operating parameters set (Wu et
al., 2005). The proposed work focuses on the refinery process unit configurations
to meet the market demand for products (AlOthman et
al., 2008). Thus the task is to find the combination of feed stocks
and the appropriate way of processing them, for the objective of giving the
best overall margin (Speight, 2002).
Refinery linear program development: In the 1950s, a standard input
format to describe a matrix was agreed on, opening the market to LP software
from different vendors, as Modeling the oil refinery process and carrying out
a Simplex procedure by hand was very tedious and time consuming (Parkash,
2004). With a Simplex algorithm available as a computer program, interest
quickly developed in optimizing via a linear programming. Prior to the advent
of LP techniques, all optimization studies were done by calculating several
hand balances, moving toward an optimal solution by trial and error. The typical
refinery LP model used for planning has approximately 300500 equations and
8001500 activities to optimize.
Linear programming as a performance monitoring tool in oil refineries:
The use of Linear Programming (LP) tools for both longterm planning and day
to day scheduling is fairly common in any refinery; still there is a gap between
the LP run results and the actual operations. The related variations can be
attributed to both external or market forces and internal operational constraints.
There are many approaches followed for finding and attributing the money values
of these variations in performances. Use of some of the LP tools is one of the
best ways for identifying and quantifying these variations. The refining business
is piloted on the basis of a Business Plan which is usually developed using
a Linear programming package (Pan et al., 2009).
The LP tool is an optimizer whose objective function is the GRM (Gross Refining
Margin) of the refinery and attempts to maximize this GRM subject to many constraints
which are modeled (Balasubramanian, 2003).
Optimization refinery models: Studies were always searching and will
continue to search for the optimum working conditions for optimizing the output
of production processes (Lan, 2008; Lan
et al., 2008; Nja and Udofia, 2009).
Scheduling and planning of the flow of crude oil is a very important problem
in a petroleum refinery due to the potential realization of large cost savings
and improved feeds. Linear Programming (LP) models have been historically used
in the analysis of scheduling and planning problems. Refinery planning problems
have been addressed using computational tools such as AspenTech® PIMS (Process
Industry Modeling System) that are largely based on Successive Linear Programming
(Uri, 1985). However, it is difficult to model refinery
operations since they involve units operating in both batch and continuous modes
along with multiple grades of crude oil and products. Furthermore, detailed
scheduling models often require a continuous time representation and a more
general treatment of nonlinear equations, as well as binary variables to model
discrete decisions which give rise to Mixed Integer Nonlinear Programming (MINLP)
models. These models impart additional flexibility to the problem allowing the
modeling of discrete decisions and constraints (Karuppiah
et al., 2008).
Refining industry is under immense pressure to produce cleaner products that
may lower the economic margins because of stricter environmental regulations
and depressed market demand. In this situation, refinery planning becomes very
important as it can exploit all potential opportunities to push the economic
margins to the maximum limit. The problem of optimizing refinery activities
is very complex in its own right. To make the problem of overall optimization
solvable, the refineries’ practice adopts a decomposition approach, in
which material processing is optimized first using Linear Programming (LP) techniques
to maximize the overall profit (Hofferl and Steinschorn,
2009). Supporting systems, including the hydrogen network and the utility
system, are optimized to reduce operating costs using LP optimization. Essentially
these systems are dealt with separately, which usually leads to nonoptimal
solutions for refinery operations (Zhang et al.,
2001).
MATHEMATICAL MODEL BUILDING
The meant objective of this work focuses on improving the Naphtha productivity,
through the utilization of better crude oils mixing procedure. The highlighted
case study was carried out duringthe period from 2007 to 2009 in one of the
biggest oil refineries in the MiddleEast with a total refining capacity of
100,000 Barrels/day, equivalent to about 665 m^{3} h^{1} and
is classified as a Complex Oil Refinery producing a variety of products, such
as LPG, gasoline, jet fuel, gas oil, green coke and sulfur, etc.

Fig. 2: 
Crudenaphtha route inside oil refinery 
The study deals with the processing of Naphtha feeds directed from different
process units, such as Crude Distillation Unit (CDU), Hydrocracker Unit (HCK)
and Delayed Cooker Unit (DCU) to the Naphtha Hydrotreater Unit (NHT), then to
the Splitter Unit; being referred to as the first stage of Naphtha Complex as
shown in Fig. 2.
Model assumptions: The model is built on the following assumptions:
• 
The model is general for middleeast refineries with similar
refining capacities and utilizing same process technology 
• 
The casestudy refinery is free to buy the selected crude
mix supplies 
• 
The refinery as well is free to deliver products without demand
constraints 
• 
Crude purchases cost limitation is neither taken into consideration
in this model nor products sales as well 
• 
No operating or maintenance costs, either fixed or variable
are included in the study 
• 
The process flow is not utilizing storage capacities except
for received crude blends and overall produced Naphtha to NHT unit 
• 
Crude distillation and Vacuum distillation units compromise
a collective structure as the receiving area for crude oil fractionation 
• 
Blending for used crudes is being performed online 
• 
The decision to be taken regarding Naphtha further processing
into gasoline or selling it as hydrotreated Naphtha stream is to be taken
independently 
• 
Crude yields are taken from laboratory results 
• 
Process and units’ yields are taken from technical, operations
and production planning departments 
• 
Minimum and maximum crude participation percentages are given
as per production planning department recommendations 
• 
A decrease in minimum crude participation level in recipe
by 1% shall be committed and analyzed from 15% and down to 10% while keeping
the maximum values 
• 
An extra proposed case with no constraints on minimum participation
values for used crudes in recipe was introduced as well 
Mathematical model formulation
Decision variables:
Xi: quantity of the ith crude type in m^{3} h^{1}
where: i = 1, 2, 3, ……Y 6; representing the six main types of crudes used in the case study, which are:
X1: ARH Arab Heavy Crude
X2: ARL Arab Light Crude
X3: QRN Qaroun Crude
X4: VDA Val D’Agri Crude
X5: BLT Basra Light Crude
X6: OMN Oman Export Crude
Objective function: The overall Naphtha produced is the sum of the straight run Naphtha, the cooker Naphtha and the hydrocracker Naphtha and the objective function is to maximize this overall amount.
Overall Naphtha produced (Ntotal) = Straight run Naphtha (Nsr) + Cooker Naphtha (Nckr) + Hydrocracker Naphtha (Nhck).
Thus the objective function can be written as:
where, Z : overall Naphtha produced (Ntotal).
where, ai is Naphtha (NAP) yield in crude I, bi is vacuum residue (VR) yield in crude i, cij is light vacuum gas oil (LVGO), heavy vacuum gas oil (HVGO) and heavy cooker gas oil (HCGO) yields, respectively in crude i, where i =1, 2,3,……6 and j = 1, 2, 3. Values for ai, bi and cij for case study are given in Table 1. m is naphtha yield percentage in cooker unit, n is naphtha yield percentage in hydrocracker unit, m and n values (for case study) are equal to 11% (0.11)and 20% (0.2), respectively.
Table 1: 
Crude yields (vol. %) for naphtha, LVGO, HVGO, VR and HCGO
yields 

Constraints: A number of constraints apply to this oil mixing problem; these are grouped by unit capacities, crude shares in blend recipe, productivity limitations and unit participations in overall production, all are being presented as follows:
Group 1: Refining capacity constraints: Maximum crude refining capacity,
represented by the overall crudes blend
Minimum crude refining capacity, represented by the overall crudes blend
Where:
Qmax: Maximum refining capacity for CDU, in case study = 665 m^{3} h^{1}
Qmin: Minimum refining capacity of CDU, in case study = 450 m^{3} h^{1}
Group 2: Crude participation constraints: Minimum value of participation for individual crude type of Xi, such that i = 1, 2,3,……. 6:
where, k is minimum percentage of individual crude participation in blend. For case study runs, k is taking the values 15% (0.15), 14% (0.14), 13% (0.13), 12% (0.12), 11% (0.11) and 10% (0.1)
N.B: This constraint is eliminated as a special case in the last model run.
Maximum value of participation for individual crude types:
For case study: d1, d2, d5 and d6, where = 50% (0.5), while d3 and d4 where = 25% (0.25).
Group 3: Naphtha Productivity Constraints for case study: Minimum Naphtha production capacity is L = 109 m^{3} h^{1}.
Minimum production value for straight run Naphtha (Nsr) from CDU is U1 = 109 m^{3} h^{1}; so as to enable the operation of Naphtha Processing Units in case of DCU and HCK shutdown:
Maximum production value for straight run Naphtha (Nsr) from CDU is U2 = 125 m^{3} h^{1}:
Maximum production limit for LVGO from VDU is T1 = 216 m^{3} h^{1}:
_{}
Maximum production limit for HVGO from VDU is T2 = 230 m^{3} h^{1}:
Maximum production limit for VR from VDU is T3 = 240 m^{3} h^{1}:
_{}
Maximum collective production limit for LVGO, HVGO and VR from CDU to Vacuum Distillation Unit (VDU) is V = 361 m^{3} h^{1}:
Group 4: Units Participation Constraints: We have:
where, E is the maximum Cooker Naphtha participation percentage in overall Naphtha and for case study = 11% (0.11)
Also, we have:
where, F is the maximum Cooker and Hydrocracker collective Naphtha participations percentage in overall Naphtha and for case study = 40% (0.4)
Finally, we apply the: Nonnegativity constraint:
The script of the model is shown in appendix.
Table 2 lists the average prices for crudes in refinery case during the year of 2007, which was the year taken as the base for the study.
Table 3 lists the average petroleum products’ prices during the base year of 2007.
Model scenarios: Seven scenarios have been proposed for the model runs
based on the proposed blend cases. Each scenario puts a constraint on the minimum
individual crude participation that is allowed.
Table 2: 
Average prices for crudes used in refinery during year 2007 

Table 3: 
Average products prices (Platts) for year 2007 

The minimum participations have been constrained between 10 and 15%, as no
crude percentage is allowed to be less that 10% to be able to judge its effect
of the overall Naphtha productivity; and when all the seven crudes are almost
equal in participation ratios, this will give a percentage of about 15%. For
the seventh run, the minimum crude participation constrain was eliminated to
give the freedom for the model to calculate the ratios according to the other
set of constraints.
Scenario (1): Model run with min. individual crude participation value of 15%
Scenario (2): Model run with min. individual crude participation value of 14%
Scenario (3): Model run with min. individual crude participation value of 13%
Scenario (4): Model run with min. individual crude participation value of 12%
Scenario (5): Model run with min. individual crude participation value of 11%
Scenario (6): Model run with min. individual crude participation value of 10%
Scenario (7): Model run by elimination of min. crude participation% constraint
For all scenarios, the model was run with max. individual crude participation% constraint for crudes X1, X2, X5 and X6 being 50% of total blend recipe, whereas for crudes X3 and X4 respectively the max. was 25%. These ratios are governing ratios depending on the design of the refinery and the availability of the crudes.
RESULTS AND DISCUSSION
The developed linear programming model has been solved using the data corresponding to the seven proposed cases detailed above. The proposed cases have shown that, output improvements have been achieved through better crude mixing procedures; the traced results have shown the improvement of Naphtha productivity through varying the blend recipes for the seven model runs. The seventh run was observed as the highest record for Naphtha productivity in m^{3} h^{1} unit for the year 2007 case study. Consequently, all records have shown better results than the study case refinery crude mixing schemes, but still the first two of them had shown figures that were a bit less than Naphtha productivity rate regarding the refinery’s actual run scenario for the meant year of study. The Naphtha Productivity for the Refinery Design Scheme (1): 50%ARH50%ARL was 172 m^{3} h^{1}, while for Design Scheme (2): 100%ARL was 171 m^{3} h^{1}, whereas for the Actual Run Scheme the output was 173.50 m^{3} h^{1}.
The Refinery LP model is such a complex and sophisticated model that relates crude purchases to operation parameters and used technologies together with cost and availability of purchased crudes in conjunction with product sales, taking into account the main aim of achieving minimum cost to maximum profitability with lots of fixed and variable costs to take into consideration regarding assisting units and operation costs including cooling water, steam, hydrogen, natural gas, chemicals , catalysts, laboratory examinations, inspection work, maintenance activities, spare parts, labor, asset depreciation, downtimes and etc.
It takes also into account the hierarchy of petroleum derived products in great attention, coping as well with supply chain functions and relating all of that to a strategic scheduling plan. As being in great concern for handling a continuous process such as oil refining and taking into account that it deals with all refining activities as a whole unit; thus being a global refinery optimization model. On the other hand, the developed LP model represents just a highlight of the CrudeNaphtha route inside the case study refinery, taking into attention parameters relating to the studied system, including crude characteristics and yields, process and units’ yields, constraints on crude participation, sources of Naphtha inside refinery, influenced units and methods used for productivity calculation.
Table 4, represents the different crude oils’ participations in the seven proposed model runs for mixing recipes. As noticed on the table, any decrease in the ARH, ARL, QRN and OMN participations will be an increase in the participation of BLL and that the participation of VDA is constant at 25%.
VDA has the maximum Naphtha yield and its percentage is already maximized at 25% and BLL has the second maximum yield, therefore any decrease in the other crudes participations will go the BLL ratio as till it reaches the maximum allowed ratio of 50%.
Table 5 shows that further improvement using the proposed mathematical model and the accompanying linear program are possible through better crude mixing scheme.
Results have shown the improvement of Naphtha productivity through the consecutive records of the model runs. Productivity of the first and second model runs have fallen below the actual rate of Naphtha productivity (173.50 m^{3} h^{1}), but still showing better figures for Naphtha productivity compared to the design cases for the refinery crude operations schemes. Table 5 also shows enhancement in the collective crude purchases from run 1 to 7.
Calculating the productivitycost index, which is the ratio of the overall produced Naphtha (m^{3} h^{1}) to the collective crude purchases ($1000) also shows improvement in the index from run 1 to 7. Figure 3 shows the decrease of crude purchases from run 1 to run 7. While Fig. 4 shows an increase in Naphtha productivity and in the mean time decrease in crude purchases from model run1 to 7.
Table 4: 
Crude participation percentages for model runs’ mixing
recipes 

Table 5: 
Model Scenarios output and calculated data 


Fig. 3: 
Crude purchases (1000$) for lingo model runs 

Fig. 4: 
Naphtha productivity versus crude purchases for lingo model
runs 

Fig. 5: 
Productivitycost index for lingo model case runs 
Figure 5 shows the productivitycost index for the different model runs. It is noticed that there is an increase (improvement) in the cost index going up from model run 1 to 7.
MODEL VERIFICATION AND VALIDATION
After the formulation of the mathematical model had been completed and the
generated LP model was run for seven consecutive times relating to the seven
proposed blend cases that were highlighted earlier. Taking into consideration
all model assumptions and system requirements that were given. The results were
then compared to the actual case for an operating day of the study year 2007.
The actual processed blend was originally composed of nine different crude types,
from which three were excluded in our study case due to their minor participations
in the crude recipe. The left six dominating types were analyzed through LP
techniques to see the extent of how much Naphtha productivity could be improved
with the different scenarios. The sensitivity analysis for the LP model was
performed by the LINGO package itself. A full review for the model verification,
validation and runs is following, that shall be used in further interpretation
and analysis.
Model verification: The model was reviewed mathematically regarding its linear programming format for verification and consistency, the suggested route and proposed assumptions were also given concern. The model context was then verified by the refinery LP team leader and confirmed for adequacy by the refinery production planning manager. The model was tested for validity and conformity, the highlighted case study criteria were also considered. Finally the model was validated by the LP team leader and confirmed by the refinery production planning manager.
Model validation: In the validation step of the model the crude participations for the different runs that were input to the model were also input to the refinery LP software to compare the results of both. Table 6 shows the comparison of the Naphtha productivity and yield calculated from the developed Lingo model and calculated also using the refinery LP software.
As shown on the table, there was a margin of error between the developed model and the refinery LP in productivity values that decreases from about 5 m^{3} h^{1} for run 1 to less than 1 m^{3} h^{1} for run 7. Comparing the yield calculations, there was a margin of error between the developed model and the refinery LP that decreases from 0.92% for run 1 down to 0.24% for run 7.
The error margins are due to the factors that were not taken into consideration in the construction of the model. These factors are directly related to the model assumptions mentioned earlier. Model run 7 has showed the maximum productivity, the best yield and highest productivitycost index. This should be correct as the constraint of minimum crude participation percentage have been removed, as a results, the model will utilize only the crudes with the maximum Naphtha yields. This is why we see on Table 4 that, both the ARL and the QRN crudes have been eliminated, BLL and VDA have reached their maximum allowable participation percentage at 50 and 25% respectively and the rest of the 100% went to the ARH and OMN with a higher percentage for ARH as it has a higher yield than the OMN crude. But unfortunately, this case is not always achievable as the refinery has to utilize the available crudes coming out of the oil fields and also has to satisfy the cost and productivity constraints as the refinery should be operating full time around the clock.
Figure 6 shows the comparison between the developed model and the running refinery LP model regarding the Naphtha productivity. Figure 6 shows the decreased difference between the two methods from run 1 to 7.
Table 6: 
Developed model versus refinery model statistics 


Fig. 6: 
Naphtha productivity for lingo LP versus refinery LP 

Fig. 7: 
Naphtha% yield for lingo LP versus refinery LP 
Figure 7 shows the comparison between the developed model and the running refinery LP model regarding the Naphtha yield. Again as shown in Fig. 6 and 7 the decreased difference between the two methods from run 1 to 7.
CONCLUSIONS
The developed linear program has been solved using data corresponding to the seven proposed cases detailed. Generally, the proposed cases have shown that further improvements can be achieved through better crude mixing procedures; the traced results have shown the improvement of Naphtha productivity in most of the runs being compared to the actual case. Starting from the third run and up to the seventh, the resulting values have exceeded the actual value for the year 2007 case. Productivity of the first and second runs have fallen below the actual rate of Naphtha productivity for actual case, but still showing better figures for Naphtha productivity rates regarding design cases for the proposed refinery crude operations schemes. To analyze the results for the performed model runs comparisons were made between their Naphtha's Productivities and Yields and their crude purchases were calculated for each model case run, also a ProductivityCoat Index was generated to show which scenario would have been more preferable to operate. The run 7 that of maximum Naphtha productivity and yield, as well as showing the biggest ProductivityCost Index value among other model case runs was compared with the actual case run for the study year 2007 on Refinery LP results basis due to the removal of the minimum participation level constraints. This comparison showed that this case would have been more beneficial to the Refinery regarding Naphtha Productivity and Yield issue. But this case is not always feasible due to the constraints on the available crudes, prices and refinery capacity utilization issues. The proposed model would be very beneficial when trying to optimize single components of the refinery outputs. As a simple and easy to construct and run, the developed model showed consistency, robustness and low error margin compared to the very sophisticated and very expensive refinery model. As a recommendation, the model can further be enhanced to compensate for the other variables that were not taken into consideration.
APPENDIX
Model script: