Optimisation of Diesel and Gasoline Blending Operations
Optimisation of Diesel and Gasoline Blending Operations
Doctor of Philosophy
2016
Shixun Jiang
Abstract ........................................................................................................................ 8
DECLARATION ........................................................................................................ 10
Acknowledgement...................................................................................................... 13
                                                                2
2.5.1 Refinery planning............................................................................................ 39
Nomenclature ............................................................................................................. 75
Nomenclature ............................................................................................................. 93
                                                              4
                                     List of Figures
Figure 5.4 Gantt Chart for the scheduling result .............................................. 112
                                                   5
                                           List of Tables
Table 1.5 Selected specifications of diesel fuel for motor vehicles ................... 19
Table 3.8 Comparison between two results of the proposed model and LP model
.................................................................................................................... 72
Table 3.9 Comparison of linear result CFPP and Validated CFPP ..................... 73
Table 4.4 The First Blending Recipe from the NLP model................................ 88
                                                         6
Table 5.6 Detailed product composition and production ................................. 110
                                          7
                                      Abstract
Diesel, one of the main petroleum products, is widely used in industry and
transportation. Only high quality diesel product can survive in the more and more
LP/MIP models have been applied in diesel blending planning and scheduling in the
last decades. With the benefits of reducing the model scale and computing efforts,
LP/MIP models lead to operation results with inaccurate property estimation and
profit loss due to the accuracy loss in the linearisation of blending models. To
improve model accuracy, more accurate property prediction models for diesel
blending should be incorporated into the refinery planning and schedule methods to
improve decision making procedure in the case of scheduling for diesel blending,
A model for planning of refinery diesel streams is developed to optimise the diesel
properties more precisely than conventional linear models. Due to the large number
initial points are not good enough. To avoid this situation, a solution algorithm is
proposed. Based on the NLP planning model, a model for scheduling diesel blending
correlations are used, which lead to a complicated MINLP problem that cannot be
this thesis to help optimizing the MINLP problem. A case study of diesel production
scheduling problem and the efficient and reliability of the solution algorithm.
                                            8
Besides, the proposed MINLP model and the solution algorithm can be extensively
blending models are taken into account, the model can be modified to optimize the
                                        9
                               DECLARATION
No portion of the work referred to in the thesis has been submitted in support of an
application for another degree or qualification of this or any other university or other
institute of learning.
                                           10
                           Copyright Statement
The author of this thesis (including any appendices and/or schedules to this thesis)
owns any copyright in it (the “Copyright”) and he has given The University of
Manchester the right to use such Copyright for any administrative, promotional,
Copies of this thesis, either in full or in extracts, may be made only in accordance
with the regulations of the John Rylands University Library of Manchester. Details
of these regulations may be obtained from the Librarian. This page must form part of
The ownership of any patents, designs, trademarks and any and all other intellectual
property rights except for the Copyright (the “Intellectual Property Rights”) and any
which may be described in this thesis, may not be owned by the author and may be
owned by third parties. Such Intellectual Property Rights and Reproductions cannot
and must not be made available for use without the prior written permission of the
exploitation of this thesis, the Copyright and any Intellectual Property Rights and/or
Reproductions described in it may take place is available from the Head of School of
                                         11
Dedicated to my dearest parents and wife
                   12
                              Acknowledgement
who provides continuous guidance, support and advice throughout the period of my
research. Without his persistent help, this dissertation would not have been possible.
for me to do my research.
My deepest thank to my wife, my parents and all my other family members, for their
I would like to give special thanks to Dr. Luyi Liu and other colleagues and teachers
                                          13
                          Chapter 1 Introduction
1.1 Diesel
The name ‘diesel’ comes from the German inventor and mechanical engineer who
invented diesel engine. Today, diesel engines are used worldwide for transportation,
from their efficiency, economy, and reliability. Sales of on-road diesel fuel in the U.S.
rose from 32 billion gallons in 1999 to over 37 billion gallons in 2004, an increase of
nearly three percent annually. In UK, road diesel fuel sales increase from 11 billion
litres in 1988 to 28 billion litres in 2013 (Vandervell, 2015). Over the period to 2030,
energy analysts forecast that diesel demand will continue to grow and petrol demand
to decline, albeit both at a much slower rate than that seen in the last decade (IHS,
2013).
Diesel fuel is a mixture of hydrocarbons obtained from oil petroleum. Its boiling
points are normally in the range of 150 to 380°C. It is produced from oil refineries
by refining and converting crude oil into various hydrocarbon fractions. The
beginnings of the oil refining industry date back to 1859, when crude oil was
discovered in Pennsylvania. The first product refined from crude was kerosene,
which was used as lamp oil (Chevron 1998). Since only a fraction of the crude could
didn’t work, the engine concept was re-designed by other engineers, resulting in a
successful prototype in 1895. Both the engine and the fuel still bear the name of
Diesel.
                                          14
Nowadays, diesel has become one of the most important petrol products due to its
high and increasing demand globally. From Figure 1.1, sales of diesel in UK have
been steadily increasing for the last twenty years, with demand exceeding 27 billion
litres in 2014. Meanwhile, Sales of petrol have been falling since reaching a peak of
33 billion litres in 1990, which was equivalent to 73% market share of transport fuels.
Till the end of 2014, sales of petrol have fallen to below 17 billion litres. However,
after barring a short decline period in 2008 and 2009 due to the economic recession,
sales of diesel has increased to around 27 billion litres till the end of 2014.
                                            15
The increasing in diesel sales in UK is part of a Europe-wide trend, which has
largely been fiscally driven for over two decades (UKPIA, 2015). In 2004, petrol
sales were 4 billion litres greater than those of diesel, whilst annual registration of
new diesel vehicles was still only one third of the total vehicle fleet. A key reason for
this relatively slow uptake had been the lack of any tax advantage for diesel, which is
taxed at the same rate as petrol. However, with the advances achieved in diesel
with changes in company car personal tax policy and VED (Vehicle Excise Duty)
rates, consumers in recent years have increasingly favoured diesel cars. Today,
approximately 53% of new registered vehicles in the UK are diesel fuelled (up from
49% in 2013), and over 61% of the 44 billion litres of road fuels sold in 2014 was
diesel.
For diesel engine technical and environmental reasons, there are strict diesel fuel
standard covers seven grades of diesel. The specifications are presented in Table 1.1.
Grade No.1 –D and No.2 –D both are consisted of 3 sub-grades: S5000, S500 and
S15. The ASTM D975-04 edition of the standard first adopted the ‘Sxxx’ designation
to distinguish grades by sulfer content. The S5000 grades correspond to the “regular”
sulfer grades, the previous No. 1-D and No. 2-D. S500 grades correspond to the
previous “Low Sulfer” grades (D975-03). S15 grades are commonly referred to as
“Ultra-Low Sulfer” grades or ULSD in which the maximum requirement for sulfur
content 15 ppm.
European Union Directive sets specifications for fuels to be used in Europe. For
compression ignition engine fuels, the technical properties regulated by this directive
                                           16
                         Table 1.1 U.S. requirements for diesel fuel oils
Besides, to provide options for different climates, the EN 590 standard specifies six
Temperature Climate Grades of diesel fuel (Grade A...F) which differ in the Cold
Filter Plugging Point (CFPP) value (Table 1.3). In addition, there are five Arctic
                                                         17
Classes of diesel fuel (Class 0...4) characterized by different properties (Table 1.4).
Each country shall detail requirements for a summer and winter grade, and may also
emission limits for China III-V stages, but included fuel specifications for the China
III stage only. Faced with the lack of official fuel standards to ensure availability of
ultra-low sulphur fuels that were necessary to enable emission technologies at the
                                                       18
         Table 1.5 Selected specifications of diesel fuel for motor vehicles
For sulfer content, the limit was set as 50 ppm in several cities in 2008. From 2013,
the State Council issued a timetable for upgrading fuel quality nationwide. . By the
end of 2014, automotive diesel fuel sulfer will be set at 50 ppm (China IV) and by
the end of 2017, sulfer limits for automotive gasoline and automotive diesel will be
10 ppm maximum (China V). Diesel fuel standards for China V were required to be
issued by July 2013. In April 2015, the State Council advanced timeline for 10 ppm
gasoline and diesel fuel by one year making it nationwide available by January 2017.
In the globalized world today,the products form a refinery may serve several regions.
Refiners need to acquaint the varying specifications in different regions. For instant,
the cetane number limit in U.S. is 40, but in Europe it is 51, which is similar in
China. The specification differences in various regions may influence the diesel
Refining is the process of converting crude oil into high value products. The main
(CDU).
                                          19
The products that are obtained directly from CDU are called straight-run products
(e.g., straight-run diesel). The material that is too heavy to vaporize under
distillation carried out under reduced pressure. The lower pressure in the distillation
column allows some of the heavier components to be vaporized and collected. This
process is called vacuum distillation; the distillated product is called vacuum gas oil
present in trace amounts that give the material an undesirable quality, such as
hydrotreating to remove sulfer. Otherwise the bulk properties of the streams are not
changed.
structure of the feedstock streams, usually by “cracking” large molecules into small
ones. Examples of these process units are Fluidized Catalytic Cracking Unit (FCCU),
The primary aim of the FCCU is to convert streams suitable for the gasoline pool;
however, one product stream, light cycle oil (LCO), is often blended into diesel fuel.
which makes the LCO more stable and suitable for adding to diesel fuel. To meet the
because it uses a catalyst, but the reactions take place under a high pressure of
                                          20
hydrogen. The primary feed to the hydrocracking unit is VGO. During
hydrocracking, large VGO molecules are cracked into smaller molecules by either
cleaving carbon-carbon bonds or by plucking out sulfer and nitrogen atoms from
extracting sulfer and nitrogen linkage atoms; in addition, rings of some aromatic
compounds are saturated with hydrogen during the hydrocracking process. Kerosene
and diesel form a large percentage of the product from a hydrocracker. These
products are nearly devoid of sulfer and nitrogen and are enriched in hydrogen.
unconverted oil between feed and product divided by the amount of unconverted oil
in the feed. Unconverted oil is defined as material that boils above a specified
temperature. For vacuum gas oil (VGO), a typical specified temperature is around
The vacuum residue can be processed in a Coker Unit that thermally cracks the long
chain hydrocarbon molecules in the residual oil feed into shorter chain molecules
that forms the Coker Light Gas Oil (CLGO), which can either be blended into diesel
In a modern refinery (Figure 1.2), diesel intermediates can be produced from various
operating units such as CDU (crude oil distillation unit), catalytic cracking,
hydro-treater, hydro-cracker and delayed coker etc. Various streams from different
units with different specifications can be classified to diesel. However, not all
streams within the required carbon atom numbers (C10-C23) and boiling ranges (150℃
                                           21
-370℃) of diesel from the units can be blended to meet the quality requirements for
market. Compared with the standard specifications, some of the diesel streams have
According to particular blending ratios, the diesel streams with inferior properties
processing chain with a large number of processes involved, various grades of diesel
                                          22
products, fluctuated market demands, and comprehensive quality requirement.
profitability.
The hierarchy of decision making mainly consists of three levels: planning for the
higher level, scheduling at the intermediate level and advanced control at the lower
level (Gupta, 2008). In a refinery, the planning level provides targets for the
scheduling operations and the scheduling provides targets for the advanced
scheduling model and the scheduling sends feedback to the planning model.
Feedbacks come from monitoring the results of processes and will reflect the effects
Planning is essential for successful scheduling as it provides the activities and targets
Planning is essential for successful scheduling as it provides the activities and targets
Planning of a refinery contains the long-term aspects, which normally takes months,
in which refiners operate equipment, crude oils and products. It is the first step to run
products) is obtained.
short-term scheduling and process control. The hierarchical management levels are
shown in Figure 1.3 with the longest planning horizon at the top which shortens
rapidly while moving down to the process control level. On the other hand, the
reliability of information and their detail increases from the top to the bottom in the
hierarchy. The complex planning and scheduling tasks are broken into simpler ones
that can be solved at each stage separately. Three levels in the hierarchy are
connected in a way that the results of each level are forwarded to the next level.
                                           24
                    Figure 1.3 Hierarchical management levels
In long-range planning horizon, refiners deal with feedstocks and products according
lasts 1-3 months while a scheduling period is generally 1 week. The optimal process
variable values are transferred to the short-term scheduling level in which the time
horizon is counted by week, and the due date of each product should be met.
Afterwards, parameters of each process are derived on the base of scheduling recipe.
The processes can be operated with the help of the parameters, which comes to the
process control level. To sum up, the operating instructions are based on the three
levels. A design which is optimized in all the three levels can be called optimised.
The refining industry today has to comply with both higher product quality
                                          25
waste productions. This means that refineries are now faced with the pressure of
reducing emissions that arise from its operations. Product specifications are always a
interaction of these groups makes the predictions of future trends difficult. In old
days, many refiners used to consider product blending as a linear problem but the
need to comply with the environmental restrictions and the demand for higher grades
accurate ways.
Table 1.2 shows diesel fuel standards in Europe. The minimum cetane number of
diesel product has been driven up slowly due to the requirement of new technology
in the engine designs, which in turn requires higher grade diesel to produce lower
emissions. This is one of the major problems that refiners face as high cetane blend
is the core reason for the need to reduce specific gravity and ASTM 95% temperature.
This increases the problems that refiners face as this further put limitation on the use
The need for reduction of PAH (Polycyclic aromatic hydrocarbons) is due to the
This in turn increases the use of straight run blend stocks as possible blending stock.
facilitate the advanced engine design and fuel economy are the main reason behinds
the pressures imposed on the specifications (Simon 2001). Refiners face difficulties
in practically meeting the tight specifications with existing blend stocks and limiting
                                          26
the cut range of blend stocks. Hence, product yield and profit are reduced due to the
The planning and scheduling of diesel production blending are very important in
diesel producing processes. The intermediate streams have different properties. They
need to be processed before enter diesel product market because they cannot
compliance with the requirements. Blending is one of the most commonly used
processes in a refinery. Refiners simulate the blending process and predict the
linearization, the blending problem can be solved directly but linear correlations can
Since 2000, diesel specification has become more and more strict. The minimum
cetane number of diesel has been driven up slowly due to the requirement of new
technology in the engine designs, which in turn requires higher grade diesel to
produce lower emissions. This is one of the major problems that refiners face as high
heavy diesels tend to produce higher particulate emissions, is the core reason for the
need to reduce specific gravity and ASTM 95% temperature. This increases the
problems that refiners face as this further put limitation on the use of catalytic
cracker light cycle oil. The need for reduction of polynuclear aromatics is due to the
This in turn decreases the use of straight run blend stocks as possible blending stock.
Due to the stringent quality requirements, it is critical for refiners to improve the
                                          27
In recent years, oil refineries are increasingly concerned with improving the planning
such as RPMS and PIMS, are based on linear models. It was interpreted as general
trends that don’t allow to use more complex models and nonlinear mixing rules
(Moro el al. 1998). In the new century, due to the pressure from more stringent
specifications and competitors, refiners and researchers started to put more emphasis
precisely.
As mentioned before, the diesel product specification has become more stringent.
models for higher accuracy and optimality that can reduce profit loss. Since the
nature of diesel blending is nonlinear, linear models in property prediction will lead
feasible solution algorithm to solve and optimise the MINLP planning and
model.
In Chapter 2, current approaches for diesel planning, scheduling and blending are
                                         28
reviewed. The basic features for each approach, as well as its advantages and
In Chapter 4, a new MINLP model has be built for the scheduling problem of diesel
scheduling problem. The extending process and how the model works will be
presented.
Finally in Chapter 6, conclusions are drawn for this research work together with
                                         29
 Chapter 2 Existing Work on Diesel Blending Optimization
2.1 Introduction
In this chapter, existing researches on diesel fuel and production processes are
discussed. As diesel production processes are attached to refineries, the planning and
scheduling methods for refinery operations are reviewed, especially for those that are
Diesel engines have become increasingly common as a power plant source for
and also for industrial applications. In the last two decades, diesels have expanded
their preserve from traditional heavy duty applications such as buses and trucks to
even light duty passenger cars, where their operation is almost indistinguishable
their advantages of better thermal efficiency and fuel economy. This has led to a
spurt in demand for diesel fuel globally, as a result of which increased middle
Diesel engines most commonly use a four-stroke operating cycle (see Figure 2.1). In
the first stroke (intake stroke), the intake valve opens while the piston moves down
from its highest position in the cylinder (closest to the cylinder head) to its lowest
position. This draws air into the cylinder in the process. In the second stroke
(compression stroke), the intake valve closes and the piston moves back up the
cylinder. This compresses the air and, consequently, heats it to a high temperature,
                                           30
typically in excess of 540°C (1,000°F). Near the end of the compression stroke, fuel
is injected under high pressure up to 30,000 psi (200 MPa or 2,000 bar) into the
produce a fine spray of small fuel droplets that will evaporate quickly in order to
Since diesel fuel mostly serves diesel engine, the initial motivation of research on
diesel fuel properties is to make diesel engine work in a safe and effective way. On
the other hand, diesel, as a product of petroleum, could cause many environment
of diesel fuel has become more and more stringent in recent year. Researches on
diesel properties would benefit more clean and environmental friendly diesel
production.
                                           31
1. Cetane number
The catane number is a measure of how readily the fuel starts to burn (auto-ignite)
under diesel engine conditions. The ignition delay period can be evaluated by cetane
number of 60.
The cetane number of a diesel fuel can be measured by ASTM D 613 test method. A
diesel fuel with a higher cetane number has a better performance in ignition by a
shorter ignition delay. A diesel fuel with a higher cetane number can also reduce
combustion noise and increase engine efficiency and power output (Riazi, 2005).
paraffins have high cetane numbers that increase with molecular weight. Isoparaffins
have a wide range of cetane numbers, from about 10 to 80. Molecules with many
short side chains have low cetane numbers; whereas those with one side chain of
Naphthenes generally have cetane numbers from 40 to 70. Higher molecular weight
molecules with one long side chain have high cetane numbers; lower molecular
weight molecules with short side chains have low cetane numbers.
Aromatics have cetane numbers ranging from zero to 60. A molecule with a single
aromatic ring with a long side chain will be in the upper part of this range; a
molecule with a single ring with several short side chains will be in the lower part.
Molecules with two or three aromatic rings fused together have cetane numbers
below 20.
                                         32
2. Diesel Index or Cetane Index
standard engine (Cooperative Fuel Research Engine), reference fuels and also tends
diesel index and cetane index, are often used for routine control purposes. ASTM
(2.1)
                                    (𝐴𝑃𝐼)(1.8𝐴𝑃+32)
                             𝐷𝐼 =                                                 (2.2)
                                         100
which is the function of API gravity and aniline point in ℃. Cetane index is
CI=0.72DI+10 (2.3)
CI=AP-15.5 (2.4)
3. Viscosity
Viscosity is defined as the ratio of absolute viscosity to absolute density at the same
                                               33
In the case of diesel fuels, low viscosity may give rise to:
(2) Abnormal rate of wear of the moving parts of pumps and injectors owing to lack
of lubricity.
(3) Too fine a degree of atomisation with the result that the fuel will not penetrate
sufficiently far into the compressed air in the cylinder to give the food mixing
(i4) Overheating of the injector owing to the concentration of the fuel spray and
hence the flame in a relatively small area around the injector nozzle.
However, if the viscosity of the fuel is too high, it will impede the flow of fuel to the
pump, giving rise to poor atomisation and excessive penetration with inefficient
combustion of fuel.
4. Carbon residue
Different fuels have different tendencies to crack and leave carbon deposits when
heated under similar conditions. It measures coking tendency of a fuel and will affect
the engine deposit. Heavier fractions with more aromatic contents have higher
carbon residues while volatile and lighter fractions such as naphthas and gasolines
have no car- bon residues. There are two older methods to measure carbon residue,
Ramsbottom (ASTM D 524) and the Conradson (ASTM D 189). The relationship
between these methods are also given by the ASTM D 189 method. There is a more
recent test method (ASTM D 4530) that requires smaller sample amounts and is
practical technique
                                           34
5. Sulphur content
Sulphur content is significant because it governs the amount of sulphur oxides formed
during combustion. Water from combustion of fuel collects on the cylinder walls,
whenever the engine operates at low jacket temperatures. Under such conditions,
sulphurous and sulphuric acids are formed, which attack the cylinder walls and piston
rings, promote corrosion and thus cause increased engine wear and deposits. These
effects can to some extent be overcome by the use of lubricants containing alkaline
additives. If the diesel fuel is refined from a very high sulphur crude, it may become
Europe, the sulphur content of diesel fuel specifications has decreased from 0.2 w%
6. Ash content
percentage of the weight of the fuel sample. In the case of distillate fuels, it usually
consists of rust, tank scale or sand, which settles out readily. Blends of distillate and
residual fuel, e.g. LDO may additionally contain metal oxide derived from oil
soluble and insoluble metallic compounds. Ash is significant because it can give rise
                                           35
7. Pour Point
The pour point of a fuel is the lowest temperature at which it will pour or flow when
temperature at which a given fuel can be readily pumped. However, since practical
conditions are quite different from those under which the laboratory test is conducted,
many fuels can be pumped at temperatures well below their laboratory pour point.
Test procedures for measuring pour points of petroleum fractions are given under
The cold filter plugging point (CFPP) is defined as the highest temperature at which
the fuel, when cooled under prescribed conditions, either will not flow through the
filter (45 microns) or will require more than 60 seconds for 20 ml to pass through.
This is the temperature at which wax crystals begin to cause blockage of filters.
9. Freezing Point
The freezing point of diesel describes a temperature at which it changes state from
The cloud point is the lowest temperature at which wax crystals begin to form by a
gradual cooling under standard conditions. At this temperature the oil becomes cloudy
and the first particles of wax crystals are observed. Cloud point is another cold
                                          36
characteristic of diesel under low temperature conditions. The standard procedure to
The four properties above can all represent diesel performance in a cold weather. In
Europe and China, CFPP is used to grading the diesel fuel products to indicate the
which equal volumes of aniline and the oil are completely miscible. Method of
determining aniline point of petroleum products is described under ASTM D 611 test
method.
The value of aniline point gives an approximation for the content of aromatic
compounds in the oil, since the miscibility of aniline, which is also an aromatic
compound suggests the presence of similar (i.e. aromatic) compounds in the oil. The
lower the aniline point, the greater is the content of aromatic compounds in the oil as
The flash point of a diesel is the lowest temperature it will ignite. Therefore, the
flash point of a fuel indicates the maximum temperature that it can be stored without
serious fire hazard. This has no bearing on performance but is important largely from
the point of view of safety in handling the fuel and minimum values are usually
There are several methods of determining flash points of petroleum fractions. The
Closed Tag method (ASTM D 56) is used for petroleum stocks with flash points
                                          37
below 80 ℃. The Pensky-Martens method (ASTM D 93) is used for all petroleum
Property estimation is the key part of diesel blending problem. Among the properties
that we need to consider, many of them are not linear depend on the composition,
which means quality loss and prediction error will occur if linear correlations are
For properties such as carbon residue, sulphur content, ash content, linear addition is
suitable for property prediction of blending diesel oil. But for the calculation of
cetane number, CFPP, freezing point, flash point, pour point, cloud point, viscosity,
and distillation range, linear addition is not suitable. For these properties, the
available for diesel blending. A planning model for refinery diesel production is
addressed by Moro, Zanin and Pinto (1998). In order to achieve an optimal solution,
including density, flash point, boiling range, cetane number and sulphur content.
                                           38
Due to the more stringent environment regulations, it cannot meet the requirements
of current diesel blending situations. On the other hand, since the Moro’ model
process.
The common industrial perception for the diesel blending problem is that it is
considered as simpler than the gasoline blending problem, with less nonlinear
behavior in property mixing. Therefore, most research effort for refining product
problem is mostly treated as a linear problem, which can be dealt with in overall
refinery LP optimization.
Therefore, the techniques for refinery diesel blending optimization are reviewed in
the context of overall refinery planning and schedule in the next section.
There are a lot of processes including separation processes, upgrading processes and
distillation columns, heat exchangers, pumps, etc. Raw materials are turned into
various higher value petroleum products. Refiners plan and schedule their operations
satisfied.
                                          39
In the oil refining industry many products are produced from only one feedstock
(crude oil) and the values of these products are in the same order of magnitude and
this result as a complex economics of petroleum refining. Also cheaper products can
straightforward production cost. The aim of the optimization process is not only to
achieve a single optimum operating point but also to understand the economics and
Objective function:
Subject to:
 Process connections
   Operation policy (e.g. allocation of the storage tanks, loading and unloading
    procedure of tanks, product grade transition policy in pipeline), etc.
Depending upon the amount of details incorporated, the formulations can generally
details such as inventories, operating policy, etc. and focuses on long-term goals
nonlinear programming (NLP). If all the objective function and constraints are linear,
formulation.
Linear programming is the most popular optimization techniques used by the refiners.
processing, blending and selling activities that generate the maximum profit. Besides,
the linear programming output can also provide the marginal values of all refinery
flows (that helps to understand the economics), marginal values of constraints such
product and deciding market) and marginal values of additional processing capacity
several cases and sub cases (Hartmann, 1999, 2003). By solving a large number of
LPs systematically eliminating the options and providing and optimum solution, a
mixed integer linear programming (MILP) can calculate these different scenarios.
The linear programming techniques for overall refinery optimization are relatively
Technology (1993) and RPMS from Honeywell. In the meantime, many petroleum
companies have developed their own LP tools in-house. The disadvantage of the
                                           41
refining process models are nonlinear and as a result, linear models cannot describe
and it provides the starting point for the next LP. Although recursion gives more
accurate solutions, it not only increases computing time, but also reduces the
transparency of LP’s value structure and its economic driving forces, and therefore
On the other hand, a rigorous nonlinear programming model for overall plant
operation can be formulated by lumping all the rigorous process models together.
Porn, Harjunkoski & Westerlund, 1999) allowed many researchers to use NLP
models for optimization. However, most of the applications are limited to single unit
optimization or a group of units. Moro, Zanin and Pinto (1998) optimized diesel
production in RPBC refinery with considering density, flash point, boiling range,
cetane number and sulphur content. Neiro and Pinto (2004) used NLP based
method for the overall refinery optimization. Li et al. (2005) used integrated CDU,
FCC and product blending models for refinery planning. However, researchers
reported the need for decomposition method that would solve such a large size
based rigorous individual plant optimization and the overall refinery optimization. In
his method, the optimization model has been decomposed into two levels: the site
level (master model) and the process level (sub models). The site level optimization
                                         42
deals with the major refinery aspects such as flow arrangement and the process level
optimization deals with process operating conditions for given flow arrangements. A
feedback procedure is used with the help of marginal values derived from the site
level optimization and iterations between both levels of optimization are performed
refinery price values and allows users to use in-house process models. The method is
planning model has limits that it doesn’t consider the time issue and storage element.
It assumes that the refinery doesn’t have a deadline of an order and unlimited
capacity of processes.
2.5.2 Scheduling
The long-term and the plant wide planning problems in the petrochemical industry
1995). Pure linear programming methods have been used for long-term planning, but
they are not suitable for the short-term scheduling and on-line optimization, since
they are based on simplified correlations, without being able to deal with both
(Zhang and Zhu, 2000). The mathematical formulation for scheduling problem can
nonlinear programming (MINLP). If all the constraints and objective function are in
MINLP formulation.
The combined crude allocation/pooling problem have been examined by Lee et al.
model for proposing a short-term crude oil unloading, tank inventory management,
                                         43
and CDU charging schedule.        Pinto et al. (2000) presented the results of the
their model time is represented by variable length time slots, which corresponds to
crude oil receiving operations (vessels unloading) as well as to periods between two
which, tanks may store only one crude type and each CDU runs exactly one crude
type from one tank at a time. In modelling of a refinery process, the calculation of
crude oil mixing generates non-convex bilinear constraints. Some researchers have
within a provably convergent branch and bound algorithm. This RLT process yields a
LP problem whose optimal value provides a tight lower bound on the optimal value
of the bilinear programming problem. Quesada and Grossmann (1995) applied the
consisting of one or several splitters, mixers, and linear process units that involve
short-term scheduling and blending process. The product recipe of each period is
problem can be modified, the scheduling problem cannot be optimized. Mendez and
Grossmann (2006) presented an approach that can optimize off-line blending and
scheduling of oil refinery operations. Nonlinear correlations are applied for the
The correlation factor ‘bias’ is introduced to modify the error between nonlinear and
linear correlations and converge the solution in the iteration procedure. In this model,
                                          44
one of the most important assumptions is that the non-linear properties are a weak
correlations for non-linear properties are very complex. So the application of this
In recent years, A number of review papers on scheduling have been written across
different scientific communities, e.g. Floudas and Lin (2004), Méndez, Cerdá,
Grossmann, Harjunkoski, and Fahl (2006), Li and Ierapetritou, 2008a and Li and
Although there are little research in diesel blending scheduling can be found in
referred.
Many papers research scheduling methods based on crude oil operations. In crude oil
scheduling problem, refinery operations involve three main segments: crude oil
distribution. The crude oil needs to be blended before it arrives refining process,
multiple jetties, crude blending and etc. are incorporated. Several examples
illustrated that better solutions are obtained. Li et al. (2012a) proposed a framework
fluctuations, ship arrival delays, equipment malfunction and tank unavailability. The
novel MINLP formulation developed by Li et al. (2012b) and the robust optimisation
frame work developed by Lin et al. (2004) and Janak (2007) are successfully utilized
and applied to develop robust optimisation models. To solve the MINLP optimisation
model, a robust optimisation approach and an extended branch and bound global
                                         45
optimisation algorithm for demand uncertainty are also proposed. Castro and
formation to variable recipe tasks with multiple input materials. In this mode, the
objective is gross margin maximisation and can be solved close to global optimality.
The advantage of this model is based on a new single time grid formulation, which is
optimise blend recipes and the scheduling of blending and distribution operations.
This MILP approach is able to find optimal solutions at much lower computational
cost than previous contributions when applied to large gasoline blend problems. Dut
Cao and Gu (2014) proposed an online scheduling model for diesel production of a
viscosity, flash point, and solidifying point are considered as nonlinear. For
solidifying point, the equations are derived according to the experimental data.
Summarily, in the past literatures on blending and scheduling problems, most of the
research regards oil blending as a linear problem. Some works proposed algorithm to
make linear result more close to nonlinear result by correction model. These methods
are more accurate than LP models. But there still are shortcomings. The modified
linear result is still inaccurate comparing with nonlinear result. Besides, the
application of the models is limited due to the assumptions made in the modelling
process.
                                            46
The difficulties in a diesel blending scheduling problem concerns primarily 1)the
specifications, 2) the nature of blending model is nonlinear, which would make the
models.
discrete-time approach, in which the time horizon is divided into a number of time
intervals of uniform durations and events such as the beginning and ending of a task
time horizon is divided into a number of time intervals of uniform durations. The
start/end of a task and other important events are associated with the boundaries of
these time intervals. With such a common reference time grid for all the operations
competing for shared resources, such as equipment items, the various relationships in
                                          47
                      Figure 2.3 Discrete-time representation
grid of time for all operations competing for shared resources, such as equipment
items. This renders the possibility of formulating the various constraints in the
The discrete-time models provide a relatively simple way to represent time and
Nevertheless, there are two main limitations in discrete-time models. First, as the
way, which would cause inaccuracy. Second, the duration of a time interval is a
tradeoff problem between accuracy of the problem and difficulty of solving it. If the
time interval is small, the problem can be modeled precisely while the scale of the
model will be relatively large. It is difficult to obtain the solutions. However, if the
time interval is too big, there is an incredible loss of model accuracy and the value
been researched in the past decade. From the literature, this model can be classified
into two categories. One defines a set of events that are used for all the units and
tasks. All units share same time slots which are continuous. The other one defines
                                          48
event point based on a unit, in which all units have different time points subject and
allowing different tasks to start or end at different time instances in different units in
All continuous-time approaches can be classified into two categories based on the
processes. The critical differences between these two types of processes is that
sequential processes are order or batch oriented and do not require the explicit
is usually possible to define processing stages, which can be single stage or multiple
stages. There can be only one unit per stage or parallel units at each stage. For this
type of process, batches are used to represent production and it is thus not necessary
to consider mass balances explicitly. At each stage, there can be one or multiple
parallel units. When multiple units are involved, time slots are defined for each unit.
                                           49
2.5.4.2 Network-represented processes
When production recipes become more complex and/or different products have low
sequences. This corresponds to the more general case in which batches can merge
and/or split and material balances are required to be taken into account explicitly. It
can be classified into state-task network (STN) (Kondili, Pantelides, and Sargent,
 STN
graph with two types of distinctive nodes: the state nodes denoted by a circle,
representing raw materials, intermediate materials or final products, and the task
consumed or produced by a task, if not equal to one, is given beside the arch linking
                                          50
   RTN
resources in a unified way. The RTN representation of the same process as in the
denoted also by circles, the related four pieces of equipment, denoted by ellipses, are
also included. Tasks taking place in different units are now treated as different tasks.
Both STN and RTN can be extended to represent storage vessels and alternative
material locations, as well as different equipment states (e.g. clean, dirty, ready to
process). Both STN and RTN representations were originally used for problems in
                                           51
network environments but have recently been used to address problems also in other
2013).
2.6 Summary
In this chapter, the basic information of diesel properties and the existing methods
for diesel blending optimization are reviewed. The following areas of improvement
        Even though diesel production from oil refineries plays a significant role of
         economic contribution in the refining business, the problem of diesel
         blending optimization has not received sufficient attention from the academic
         research so far.
        More accurate property prediction models for diesel blending should also be
         incorporated into the refinery planning and schedule methods to improve the
         overall decision making procedure, especially in the case of scheduling for
         diesel blending, where academic effort is almost absent.
Chapter 3 to optimize the recipe of diesel blending problem, and further applied for
diesel blending scheduling method, for which the overall problem becomes an
MINLP problem. To overcome the difficulty in convergence and ensure the overall
                                           52
methodology is applied to the gasoline blending problem, in order to further test its
                                         53
 Chapter 3 Modelling and Optimisation of Diesel Blending
Planning
3.1 Introduction
Products blending tries to make use of available components for effective mixing in
order to produce valuable products that meet demands and specifications to achieve
maximum profit (Wu, 2010). Gasoline, diesel, aviation fuel, lubricating oils and
heating fuels are the main products from refinery product blending. Since in normal
conditions, the volumes of products sold by a refiner are very huge. As such, even
Furthermore, the demand of refining products has been increasing gradually in the
last years and the trends shows possibility of continuing increase in the foreseeable
future. On the other hand, in recent years, modern refineries have been confronted
specifications. These situations make the product blending strategy more crucial in a
refinery upstream units along with additives to produce different grades of diesel
products. The blending ratio depends on the quality, the quantity and the cost of
available blending streams, the demand and the price of the final products. Selection
between 6 and 8 (Riazi 2013). The diesel blending component streams are mainly as
following:
                                         54
   Straight Run Diesel from CDU
 Coker Light Gas Oil (CLGO) produced from the Coker Unit
The component properties vary since they come from different processes. For
example, Straight Run Diesel usually has a high cetane number due to high
composition of paraffin while the cetane number of Light Cycle Oil from FCCU is
various refinery units along with additives to produce different grades of diesel
products. The blending ratio depends on the quality, the quantity and the cost of
available blending streams, the demand and the price of the final products. Selection
 Coker Light Gas Oil (CLGO) produced from the Coker Unit
The component properties vary since they come from different process. For example,
Straight Run Diesel usually has a high cetane number due to high composition of
                                         55
paraffin while the cetane number of Light Cicle Oil from FCCU is normally very
As Figure 3.1 shows, in a blending process, intermediate diesel streams are delivered
to several blending tanks. They are blended according to particular recipes in order
to satisfy the product property requirement. After the blending complete (normally
several hours), the diesel streams are delivered to product tanks, where they are
For diesel blending, there are two general blending methods: continuous blending
and batch blending. Continuous blending, also named in-line blending, is a process
of the blend are tested to obtain the sample properties periodically. The feedstock
flow rate is adjusted to ensure the blend meets quality specifications. Continuous
                                          56
In batch blending, various component streams are fed one after another into a
blending tank, until product specifications of a particular grade are all met and the
liquid level reaches the required value. The next run of blending can only be started
after completing the offloading of previous product finishes. Storage tanks for both
batch blending the feed quality can be fairly constant over the time and the products
can be more flexible. However, these benefits are obtained at the expense of higher
Commercially, batch blending methods are commonly used that continuous blending
for diesel production. Therefore, this work focuses on developing modelling and
3.1.3 Motivation
considered as a key process. As reviewed before, many refiners used to treat diesel
Therefore, the solution algorithm would be much easier than nonlinear problems.
the quality of diesel products. Even though a linear model contains the property
specifications as constraints, it is still possible that the products are unqualified due
On the other hand, diesel product specifications include many properties, such as
density, viscosity, cetane number/cetan index, etc. In the literature, none of the
Therefore, a diesel blending model with more accurate nonlinear property prediction
correlations and the full coverage of diesel property specifications is highly desirable
The objective of diesel product blending is to obtain a optimal blending recipe with
Decision variables:
Major parameters:
 Feedstock properties
Major constraints:
Assumptions:
 The input bounds of each components stream to each blender are neglected.
     The inventory limits are not considered in the planning model, but will be
      considered in the scheduling model in Chapter 4.
profit is considered as the total price of all the diesel products that are sold to the
follows:
Maximise
                            𝑃𝑟𝑜𝑓𝑖𝑡 = ∑𝑁𝑃                 𝑁𝐹
                                      𝑗=1 𝑃𝑗 ∙ 𝑃𝑟𝑖𝑐𝑒𝑗 − ∑𝑖=1 𝐹𝑖 𝐶𝑜𝑠𝑡𝑖             (3.1)
where 𝑃𝑗 is the production flow for product 𝑗, 𝑃𝑟𝑖𝑐𝑒𝑗 is the market price for
3.2.1.2 Constraints
𝐹𝑖 = 𝑅𝑖 + ∑𝑗 𝐹𝐵𝑖,𝑗 ∀𝑖 (3.2)
                                          59
                                          𝐹𝑖 ≤ 𝐹𝑖𝑢𝑝              ∀𝑖            (3.3)
𝑃𝑗 = 𝑅𝑗 + ∑𝑖 𝐹𝐵𝑖,𝑗 ∀𝑗 (3.4)
   Where 𝑃𝑗 is the amount of diesel product 𝑗 that can be sold to market after the
   blending process, 𝑅𝑖 is residue amount of component 𝑗 before the blending
   process starts, 𝐹𝐵𝑖,𝑗 is the amount of component 𝑖 blended into product 𝑗
   during the blending process.
𝑃𝑗 ≥ 𝑃𝑗𝑚𝑖𝑛 ∀𝑗 (3.5)
c) Other constraints
                                          60
where 𝑦𝑦𝑗 is the mass amount of product 𝑗 and 𝑑𝑒𝑛𝑠𝑗 is density of product 𝑗
components
                                            61
On the other hand, a number of properties of interest to the refiners are not additives
and need to be treated non-linearly. The correlations that are applied in this model
are as follows:
 Pour point
                                   1⁄𝑦              1⁄𝑦
                                  𝑇𝑗     = ∑𝑖 𝑉𝑖𝐴 𝑇𝑖            ∀𝑗              (3.14)
Where 𝑉𝑖       and 𝑇𝑖 are volume fraction and pour point in degrees Rankine of stream
                    1⁄𝑦
𝑖, respectively, 𝑇𝑗       is the blend pour point in Rankine. 𝐴 and 𝑦 are parameters
to be estimated.
cold filter plugging point of blended diesel which is similar to the pour point
correlation:
Where C𝐹𝑃𝑃𝑖 is the cold filter plugging point of the stream 𝑖, 𝑉𝑖 is volume
 Viscosity
The viscosity of the blend of different component streams can be estimated using the
                                             62
Refutas (2000) equation. In this method a Viscosity Blending Number (VBN) of
each component is first calculated and then used to determine the VBN of the liquid
specifications.
                             𝑉𝐵𝑁𝑗 = ∑𝑁
                                     𝑖=1 𝑥𝑖 ∗ 𝑉𝐵𝑁𝑖                   ∀𝑗             (3.15)
                                            𝑉𝐵𝑁𝑗 −10.975
                             𝑉𝑗 = exp (exp (            )) − 0.8               ∀𝑗   (3.16)
                                               14.534
 Flash point
Wickey. R. O. and Chittenden, D. H (1963) suggested that the flash point of the
blend should be determined from the flash point indexes of the components as given
below:
                                                           2414
                               𝑙𝑜𝑔10 𝐵𝐼𝐹 = −6.1188 + 𝑇                              (3.17)
                                                           𝐹 −42.6
where 𝑙𝑜𝑔10 is the logarithm of base 10, 𝐵𝐼𝐹 is the flash point blending index, and
𝑇𝐹 is the flash point in kelvin. Once 𝐵𝐼𝐹 is determined for all components of a
                                         63
blend, the blend flash point index (𝐵𝐼𝐵 ) is determined from the following relation:
where 𝑥𝑣𝑖 is the volume fraction and 𝐵𝐼𝑖 is the flash point blending index of
component 𝑖
 Cetane number
complicated than those for pour and cloud point (Riazi, 2005). In order to control the
model scale and computing cost, in this work, the cetane number prediction of diesel
 Boiling range
                                                                  𝐺        𝐺
    BV𝑥𝑖 = 𝐶0𝑥 + 𝐶1𝑥 𝐴𝑖 + 𝐶2𝑥 𝐴2𝑖 + 𝐶3𝑥 𝐴3𝑖 + 𝐶4𝑥 𝐴𝑖 𝐺𝑖 + 𝐶5𝑥 𝐴𝑖 + 𝐶6𝑥 𝐴2𝑖 + 𝐶7𝑥 𝐺𝑖
                                                                       𝑖    𝑖
(3.21)
Where 𝐷86𝑋𝐵 stands for the predicted temperature at a given point X, 𝐵𝑉𝑥𝑖 is the
                                          64
(T90-T10), and 𝐶0𝑥 − 𝐶7𝑥 are the coefficients for each included D86 distillation
 Cetane Index
(3.22)
where 𝑇50 is the ASTM D86 temperature at 50% point in ℃, SG is the special
gravity.
As the product density is assumed blended by linear correlation and boiling range
can be predicted by the models above, the cetane index of the product can be
A diesel blending model should solve the following variables that are very
1) Blending ratio
Blending ratio of a diesel blending problem describes how to blend feedstocks into
2) Productivity
                                           65
3) Products properties
Products specifications are the key constraints of a diesel blending model. Properties
diesel fuel market. Properties are also the key to optimise the profit of a diesel
blending process. Imprecise property calculation leads to property loss and profit
loss. That's the reason why more and more refiners make efforts to develop and
together to produce the diesel product. Blending ratio in volume is shown in Table
3.1. Measured properties of both blending components and the diesel product,
including flash point, pour point, cold filter plugging point, cloud point, viscosity,
and distillation point, as well as blending ratio, are shown in Table 3.2. The product
properties are calculated by both linear and nonlinear correlations. The calculated
properties are compared with the measured properties of blending product to show
Through Table 3.2, the result from linear model is slightly better than nonlinear when
predicting Cetane Index. For flash point, pour point, CFPP, and distillation point,
nonlinear model gives us much more accurate result. The validation illustrates the
of this research.
                                          66
                                              Table 3.1 Blending ratio
                                       blending ratio(volume)             %
                                                 F1                       10
                                                 F2                       30
                                                 F3                       15
                                                 F4                       43
                                                 F5                       2
                        C0            C1          C2       C3       C4        C5           C6             C7
       D10            -0.0504       1.6746    -0.002205 0.000029 -0.12954 -3.34E+03    -5.24E+01       43.67155
       D50           3.767599     -4.40E+03   1.67E+01 -0.02055 17.93395 3.89E+06      -3.36E+08       1.15E+04
       D90           2.80E+05     -2.61E+03   8.04E+00 -0.008151 9.976215 3.16E+06     -3.36E+08      -9.79E+03
After refiners discovered that linear models for the diesel blending problem are not
accurate, they realised that the nature of the problem is a nonlinear problem.
simplification, they used linear correlations which resulted in reduced accuracy for
                                                            67
Due to the complexity of the diesel blending problem, it could be difficult to solve
Pour Point and CFPP estimation. If the planning model is solved directly by the
To overcome the solving difficulty, a solution strategy is introduced. Since one of the
initial point. A solution strategy that emphasised the use of a good initialisation for
Minimize f(x)
St g(x) ≤ 0
L ≤ x ≤ U
where x is a vector of variables that are continuous real numbers. f(x) is the objective
function, and g(x) represents the set of constraints. L and U are vectors of lower and
When solving an NLP problem, it is highly desirable to provide initial values for all
the variables as a starting point. Even though algorithms are different depending on
different solvers, the initial values of variables will influence whether the problem
can be solved or not and the solving time. A poor initial value may lead to more
solving time and infeasible solution from the solver. On the other hand, a good initial
value could allow for much quicker convergence to the optimal solution. However,
                                                68
To improve the efficiency of solving the nonlinear diesel blending model, a multi
Since there are so many constraints in the diesel blending problem, it is decomposed
into two parts. The first part is the objective function and the most crucial constraints
that are related to the variables in the objective function (Equation 3.1, 3.2, 3.3, 3.6,
3.7, 3.8, 3.9, 3.10 and the mixing correlation of density Equation 3.11). The
following parts consist of other constraints (other equations mentioned in the model)..
After the first part is solved, which is simple and easy to work out, the variables
those are in the objective function are valued. Then, the second part is added into the
model and solved. Sequentially, the others parts are added into the model and
solved .
Through this method, the solver firstly solves a simple NLP problem to determine
the variables in the first part. The values of the variables will be the initial point
when it comes to the next step. These values are results of a part of the model, so
study is shown as follows. The feedstocks properties comes from diesel streams of a
                                           69
                     Table 3.4 Feedstock availability and properties
                                                 F1            F2        F3         F4
                Avalability(t)                 1500           1200      1300        800
               Cetane Number                    68             34        73          73
            Sulphur Content(ppm)                 12             8         2          8
                                 -1
               Density(g*ml )                  0.867         0.8559    0.8287      0.8162
                  CFPP(°C)                     -15             -8        -15         4
                             2
            Viscosity(mm /sec )                 3.8            1.5       4.4        2.7
           Ash Content(% (m/m) )               0.003           0.1      0.01       0.008
              PAH(% (m/m) )                      9             13         4          2
              Flash Point(°C)                    50            70        60          55
                            10%(℃)             137.2          165.4     262.6      256.9
         Distillation(D86)       50%(℃)        143.8          199.2     301.8      307.9
                                 90%(℃)        185.6          266.8     372.3      396.7
Four diesel intermediate feedstocks need to be blended to diesel products that can be
sold directly to the market. Feedstock properties are presented in Table 3.4. Every
product must satisfy the EN 590 diesel fuel product standard and the market
demands simultaneously. The product specification and demands are shown in Table
3.5.
                                          P1                  P2          P3             P4
          Cetane Number                  ≥46                ≥46         ≥46           ≥46
       Sulphur Content(ppm)              ≤10                ≤10         ≤10           ≤10
          Density(g*ml-1)              0.82-0.86           0.82-0.86   0.82-0.86    0.82-0.86
             CFPP(°C)                      0                  -5         -10             -15
                      2
        Viscosity(mm /sec )              2-4.5              2-4.5       2-4.5         2-4.5
       Ash Content(% (m/m) )            ≤0.01               ≤0.01       ≤0.01        ≤0.01
          PAH(% (m/m) )                 ≤11                 ≤11         ≤11          ≤11
          Flash Point(°C)               ≥55                 ≥55         ≥55          ≥55
             Price($/t)                 1270                1290        1320         1330
            Demand(t)                    500                 900        1150         2150
                                                      70
The objective of the diesel blending problem is to generate a local optimal solution
that meets all the specifications and market demand for each product while
maximising the overall profit. For feedstock F2, the cetane number 34 cannot meet
the specification, and the CFPP (cold filter plugging point) 9℃ is not qualified for
product P3 and P4. If it is blended into products, theses inferior properties need to be
The blending ratio of each product is the key variable of the case since it determines
the product properties. To predict the boiling range, parameters in Equation 3.16 and
(3.2) – (3.21).
                                          71
                          Table 3.7 Properties of each product
                                  P1            P2             P3             P4
      Cetane Number               54.2         52.6           58.7           66.7
   Sulphur Content(ppm)          8.076        8.347          9.803          6.794
      Density(g*ml-1)            0.836        0.841          0.852          0.846
        CFPP(°C)                  -3.3         -5.0          -10.0          -15.0
   Viscosity(mm2/sec )           2.000       2.000           2.591          3.523
  Ash Content(% (m/m) )          0.009       0.009           0.006          0.007
     PAH(% (m/m) )               7.521       8.354           8.762          6.901
     Flash Point(°C)              60.1        60.0            55.0           55.7
From Table 3.7, by adopting the proposed model, the market demands and product
specifications are both achieved, especially CFPP (cold filter plugging point) which
is critical property to winter diesel grades definition. The optimisation result based
on the proposed model is compared with the linear model in which linear correlation
Table 3.8 Comparison between two results of the proposed model and LP model
                                 P1        P2          P3            P4
                 Model 1         500       900        1150           2250
                 Model 2         591       900        1150           2150
In Table 3.8, the production of each product from the two models is different. The
result from the proposed model prefers to produce as much Product 4 as possible.
However, the result from the linear model prefers to produce more Product 1. As
there is difference in the recipe of the two models, the composition and products
The difference of the two results is due to the difference between the linear
correlations and the nonlinear correlations. The less accurate linear correlations
could make big difference when considering the large amount of petroleum products
                                           72
produced everyday all over the world.
Inaccurate correlation could result in unqualified products, which can lead to not
only a financial penalty, but also potential safety hazard. Even though all the product
properties based on the recipe from the linear model seem to be within the limit,
when validating the product properties with the nonlinear models, some of the
properties exceed the bounds of specifications. In this case, for instance, after
Table 3.9 illustrates that the difference between the linear result and the validated
property. With the diesel stream CFPP decreasing from 0 ºC to -15 ºC, the
deviation of the linear correlation increase from about 0.8 ºC to about 1.2 ºC. The
relative error of 5.3% cannot be neglected. Due to the inaccurate CFPP prediction,
the linear model leads to a property loss in the products, which would cause a profit
loss. In this case, the total profit optimised by linear model is 7.44 M$. However, the
proposed nonlinear planning model could optimize the profit to 7.69 M$. With better
property estimation methods, the total profit of the blending process is increased by
3.3%.
This case is solved by CONOPT in GAMS 23.5 on Dell M14 (Intel® Core™
2.40GHz) running Windows 10. It contains 161 equations and 133 variables. The
                                          73
3.5 Summary
Diesel Product blending is one of the most important steps in refining operations.
Most refining products are blended from intermediate process streams. Due to the
challenging for modern refiners. For predicting diesel blending properties, the
investigation shows that the nonlinear models have better accuracy than the linear
models. The different results of linear models and nonlinear models are validated in
this chapter. To improve the feasibility of the results for diesel blending optimization,
optimisation, due to the large number of variables, it obtains infeasible result from
existing solver to solve this nonconvex NLP model. A solution strategy is introduced
In the case study, a diesel blending problem is solved by the nonlinear model and a
conventional linear model. Compared with the linear model, the nonlinear model can
deliver a more accurate property prediction and a better objective, which is a higher
                                           74
                                  Nomenclature
Sets
𝑖 component index
𝑗 product index
Parameters
𝑅𝑖 residue of component 𝑖
𝑅𝑗 residue of product 𝑅𝑗
Continuous variables
𝐹𝑖           feedstock of component 𝑖
                                        75
𝐹𝐵𝑖,𝑗         amount of component 𝑖 blended into product 𝑗
𝑃𝑗 amount of product 𝑗
CI cetane index
                                        76
        Chapter 4 Scheduling of refinery diesel blending
4.1 Introduction
Planning and scheduling approaches for overall modeling are linked for the best
combinatory solution solved for a suitable objective function (Lee et al, 1996), which
The overview for planning and scheduling hierarchy is related to the other
constituents involved across the network. This enables the successful function of the
planning models are capable of making decisions that are fairly independent of time
such as long-term contracts. Otherwise, they are less applicable for short-term needs
where both the market and a plant are fluctuant. On the other hand, scheduling,
which aims to achieve planning targets and ensure stable operations while satisfying
the market requirements. For a scheduling plan, the optimal process variables, which
come from individual or several scheduled horizon, must lie within the overall
optimal solution space and within the defined constraints supplied at the beginning
difficulty, most of the existing mathematical approaches are not ideal for the
and even modern industries, it is necessary to develop a model for diesel blending
(MINLP) model for optimizing diesel blending scheduling which considers all the
Scheduling is a sequence of jobs, with their start time and end time, that certain
ensures constraints are met. Scheduling is carried out for minimizing cost and/or
some measure of time like the overall project completion time. The diesel blending
scheduling system consists of three pieces of equipment i.e. component stock tanks,
blending tanks and product stock tanks as shown in Figure 4.1. These three pieces of
equipment are linked together through various piping segments, flow meters and
valves. The components from the component tanks are transferred to the blending
(mixing) tanks according to the recipes. Thus, different products can be produced
1. A single period optimization model is developed that is able to deal with multiple
   product demands with the same due date while satisfying the product
   specifications.
The key elements in a diesel blending planning and scheduling problem that requires
Decision variables:
      Amount and type of product being produced from blending tanks in each time
       interval.
 Blending ratio of product blended in the blending tank in each time interval.
Parameters:
      Minimum and maximum inventory capacities for each blending tank and storage
       tank
 Minimum and maximum flow rate capacities for the blending tank
Constraints:
 Blending tank can store only one product during the scheduling horizon
                                             79
      Demand of different grade of diesel must be satisfied.
 Mass balance.
Assumptions:
 The input bounds of each components stream to each blender are neglected.
A new nonlinear diesel blending model is presented in this section. This model is
based on an assumption that the blenders have the same capacities that are available
for different kind of diesel products.
Objective function: to maximum the total profit for all the diesel products.
                                            80
               𝑃𝑟𝑜𝑓𝑖𝑡 = ∑𝑁𝑃                   𝑁𝐹
                         𝑗=1 𝑃𝑗 ∙ 𝑃𝑟𝑖𝑐𝑒𝑃,𝑗 − ∑𝑖=1 𝐹𝑖 ∙ 𝑃𝑟𝑖𝑐𝑒𝐹,𝑖                   (4.1)
Subject to:
1) Operation constraint
∑𝑗 𝐴𝑗,𝑛,𝑡 ≤ 1 ∀ 𝑛, 𝑡 (4.2)
Binary variable 𝐴𝑗,𝑛,𝑡 denotes that product 𝑗 is blended in blender 𝑛 during time
interval 𝑡. Constraint 4.2 donates that only 1 product can be produced in 1 blender
Constraint (4.5) specifies that minimum and maximum volumetric flowrates must be
where 𝑦𝑦𝑗 is the mass amount of product 𝑗 and 𝑑𝑒𝑛𝑠𝑗 is density of product 𝑗
7) Product demand
The constraint above defines all the products to be achieved the market demand at
                                               82
the due date.
As we know, an MINLP model is difficult to solve. The existing MINLP solvers can
blending problem contains large number of binary variables and massive equations,
which exceeds the solving capacity of existing MINLP solvers. Therefore, a modest
requirements. For instance, in the case shown in section 4.4, there are more than 300
continuous variables and 24 binary variables. Besides, all existing algorithms scale
exponentially in the worst case (Floudas and Lin, 2004). If the case is solved by the
existing MINLP solvers (DICOPT etc.), an infeasible result will be obtained. The
4.2.
The first one is the Non-Linear Programming (NLP) diesel blending planning
problem. This problem is formulated and optimized using the method proposed in
the NLP model. Once the result is obtained, it provides the component volume
fractions blended in each diesel product, which is incorporated into the next
blending recipe is fixed by the result from the first NLP blending model. By
                                         83
optimizing the MILP problem, the scheduling result for blending operation is
scheduling model, the solution from the scheduling model will be more practical to
be used for daily operation. The next step is to validate the solution for the blending
scheduling problem using the NLP model. This is where the iteration starts. The
solution for the diesel scheduling problem is optimised in one iteration. This process
will be repeated until the solution of the MILP scheduling model is equal or close
enough to the solution in the previous iteration, which indicates the maximum profit
                               Figure 4.284
                                          Solving Algorithm
4.5 Case study
of the proposed diesel blending scheduling model. The data of the scheduling part
Grossmann’s oil blending scheduling case (Mendes and Grossmann, 2006), while the
The objective of this case study is to find an optimal schedule for the blending of
four components streams to produce three different grades of diesel products. The
number of blenders available is 3 and the capacity of each is 5.0 Mbbl. A certain
amount of feedstocks are placed in the storage tanks before the blending, The
products are transferred to storage tanks every day in a fixed daily production.
Properties, production and inventory limits are listed in Table 4.1 along with cost of
each component. During the blending process, the inventory varies depend on
production and blending recipe, but it need to be in line with the storage tank
capacity range.
                                          85
                               Table 4.1 Feedstock properties
                                              F1         F2          F3          F4
                Cetane Number                 68         34          73          73
             Sulphur Content(ppm)             12          8           2           8
                Density(g*ml-1 )            0.867       0.8559      0.8287      0.8162
                 CFPP(°C)                     -4          -2          -12         -10
                           2
          Viscosity(mm /sec )                3.8         1.5         4.4         2.7
         Ash Content(% (m/m) )              0.003        0.1         0.01       0.008
            PAH(% (m/m) )                     9          13            4          2
            Flash Point(°C)                  50          70           60         55
               Cost($/bbl)                   24          20           36         34
       Production Rate (Mbbl/day)            1.5         3.3           2         1.4
          Initial Stock (Mbbl)               4.8          2          7.5         2.2
         Minimum Stock (Mbbl)                0.5         0.5         0.5         0.5
         Maximum Stock (Mbbl)                10          25           25         10
Product specifications are specified in Table 4.2. Three diesel products graded by
CFPP (cold filter plugging point) have different prices. This is the key variable in
this case.
                                               P1          P2          P3
                     Cetane Number            ≥46         ≥46         ≥46
                  Sulphur Content(ppm)        ≤10         ≤10         ≤10
                      Density(g*ml-1)       0.82-0.86   0.82-0.86   0.82-0.86
                        CFPP(°C)                0           -5         -10
                  Viscosity(mm2/sec )        2-4.5       2-4.5       2-4.5
                 Ash Content(% (m/m) )       ≤0.01       ≤0.01       ≤0.01
                    PAH(% (m/m) )            ≤11         ≤11         ≤11
                    Flash Point(°C)          ≥55         ≥55         ≥55
                      Price($/bbl)            31          33          34
Table 4.3 allocates the daily requirements or the three grades of products. The
inventory of products must be greater than the due day demand besides of the
                              P1                  P2                     P3
 Requirements (Mbbl)   MIN   MAX   LIFT   MIN    MAX    LIFT    MIN      MAX    LIFT
        Day1           0.5    5      1    0.5     0.5    1.2    0.5       5       1
        Day2
        Day3                               0.5    5      2.5
        Day4           0.5    5     2.5    0.5    5      2.3
        Day5
        Day6
        Day7           0.5   5      3
        Day8           0.5   5      1                           0.5       0.5   2.2
  Inventory (Mbbl)     0.5   15            0.5    15            0.5       15
   Rate(Mbbl/day)      0.5   5              0      5            0.5        5
In this case, the objective is to find an optimal scheduling to maximize the profit
with satisfying the product specifications and daily demand during an 8-day period.
The major constraints are the inventory limits for feedstocks and products, product
The solving algorithm proposed in this chapter is applied to optimize the diesel
Secondly, the model is decomposed into 2 sub models, an NLP model for blending
planning and an MILP model for scheduling. The problem is then solved by
optimising the planning model. The iterative method is applied to obtain an overall
optimal solution.
Firstly, the NLP blending planning model is solved by CONOPT, which contains 106
                                          87
             Table 4.4 The First Blending Recipe from the NLP model
                                   P1            P2         P3
                        F1        0.443         0.511      0.206
                        F2        0.537         0.372      0.099
                        F3          0           0.061      0.462
                        F4        0.021         0.057      0.233
In Table 4.5 when the volume fractions of the same product are added together, the
Then, fix the recipe in the scheduling model as in Table 4.3. Solve the MILP problem
using CPLEX, with 1380 equations, 492 single variables and 72 binary variables.
Generation time is 0.032s. Through optimizing the MILP scheduling problem, new
                                          P1         P2         P3
                 Production (Mbbl)        7.5       54.0       43.7
The new productions are different from the first productions due to limitations of
blender capacity and operating constraints. The new productions are more in line
with the practical situation and operating conditions. Afterwards, the productions in
the NLP planning model are fixed and the iteration started as Figure 4.2 represents.
The optimal solution is achieved in iteration 2. The product properties are shown in
Table 4.6.
                                          88
            Table 4.6 Productions properties of the optimal solution
                                         P1         P2            P3
                   Cetane Number         47.1       49           67.4
                Sulphur Content(ppm)      9.2       8.7           6.9
                   Density(g*ml-1)      0.856       0.85      0.827
                     CFPP(°C)            -0.2       -5.4      -10.6
                 Viscosity(mm2/sec )     2.000     2.000      2.773
                Ash Content(% (m/m) )    0.008     0.008      0.008
                   PAH(% (m/m) )        11.000     9.984      4.413
                   Flash Point(°C)        59.6      60.1       60.0
                     Price($/bbl)          31        33         34
                     Production          20.84     6.50       18.20
scheduling problem. The inventory should be in the range of limits during the whole
time horizon.
A B
C D
                                        89
        Figure 4.3 Inventories of feedstocks during the blending process
A B
From Figures 4.3 and 4.4, the inventory of feedstock and product varies during the
process, but remains between the upper and lower bounds at all the times.
                                         90
 Blender   Product       1        2       3         4      5       6        7        8
             P1                                                                      5
   n1        P2
             P3         2.627                              5
             P1                                     5
   n2        P2          5                                         5        4.5      5
             P3
During the problem time period, the blender operations are as shown in Figure 4.5.
In summary, the diesel blending scheduling case has been modelled and optimized
by the methods proposed in this chapter. The optimal objective is $605 Million. The
market daily demand is achieved with all the product specifications satisfied.
This case is solved by CONOPT in GAMS 23.5 on Dell M14 (Intel® Core™
2.40GHz) running Windows 10. It contains 1380 equations, 492 single variables and
4.6 Summary
In this chapter, a new MINLP model has be developed for scheduling of refinery
diesel blending. This model applies nonlinear correlations for property prediction,
which will make the model more accurate and complex. All the specifications from
diesel product standards are included in the model, which will increase the model
scale. Existing MINLP solvers are not capable of solving a nonconvex diesel
blending scheduling problem which contains a large number of binary variables and
equations. In order to solve the MINLP model, a new solution algorithm has been
applied to decompose the MINLP problem into two parts: NLP and MILP and
                                              91
combine them with iterations. A case study shows that the scheduling model is
                                           92
                               Nomenclature
Sets
𝑖 component index
𝑗 product index
𝑛 blender index
Parameters
Binary variables
Continuous variables
                                         93
𝑃𝑟𝑜𝑓𝑖𝑡     profit of a process
                                  94
      Chapter 5 Modelling and Optimisation of Gasoline
Blending Scheduling
5.1 Introduction
5.1.1 Gasoline
Gasoline, also called gas or petrol, is a mixture of volatile, and flammable liquid
engines. It is also used as a solvent for oils and fats. Originally a by-product of the
petroleum industry (kerosene being the principal product), gasoline became the
preferred automobile fuel because of its high energy of combustion and capacity to
automobiles boils mainly between 30°and 200° C, which is normally lower than
diesel (150°C-300°C).
refinery. Due to the different sources of gasoline streams, they contain both superior
may have different requirement and regulatory specifications that may also vary
                                          95
small portion of distillates from distillation unit can go directly to blending processes.
Most out-streams from the distillation unit are transported to upgrading processes.
The streams coming from these upgrading processes are much more valuable and are
Major gasoline components come from: distillation unit, catalytic reforming unit,
fluid catalytic cracking unit, isomerisation unit, alkylation unit, and other units such
detergents, lubricants, etc. are used to further improve the gasoline products’ quality
                                           96
The objective of gasoline blending is to find the optimal blending recipe to achieve a
best overall profit while satisfying the environmental regulations and market
demand.
From the introduction above, gasoline and diesel blending operations share a lot of
similarities:
 Several feedstocks are blended into several grades of products with various
specifications.
 Accurate prediction of product properties is the key part of the optimization due
to product specifications.
 The nature of gasoline blending and diesel blending is nonlinear, but linear
In recent years, much work has been done for gasoline blending optimization in the
2003). To obtain more accurate production targets, the above formulations have also
utilization. These extensions form the basis of many production planning systems
                                         97
(Pochet and Wolsey, 2006). In addition, in industries, commercial applications such
as Aspen Blend™ and Aspen PIMS-MBO™ from AspenTech are also available for
models have been adopted so far. Some researchers tried to apply nonlinear blending
non-linear model is used for the recipe optimization whereas a Mixed-Integer Linear
models for the property prediction for gasoline blending. Therefore, it would be
relevant to see whether the developed methodology for nonlinear diesel scheduling
In this Chapter, the model is modified by using gasoline blending models to replace
the diesel blending models. The scheduling part remains the same since both are
scheduling problems.
There are several properties that are important in characterizing automotive gasoline
such as octane number (ON), Reid vapor pressure (RVP), ASTM distillation points,
viscosity, flash point, and aniline point. Ideal mixing refers to quality blending as its
                                           98
non-ideal and nonlinear fashion, necessitating the use of more complex blending
models to predict these properties (Rusin, 1975). In this section, blending models for
key properties – octane number, RVP, and ASTM distillation points - are presented
and discussed.
Octane numbers indicate the antiknock characteristics of gasoline or the ability of the
are two types of octane number: research octane number (RON) is measured by
ASTM D 908 under city condition, and, motor octane number is measured by ASTM
D 357 under road conditions. RON is normally greater than MON by 6-12. Since
RON and MON both are not linear properties, complex blending models are needed
Early research on the octane number of hydrocarbons showed that octane numbers of
aromatics and branched iso-paraffins are higher than those of the corresponding
paraffins (Lovell, 1931). The American Petroleum Institute (API) analyzed octane
numbers of more than 300 hydrocarbon molecules and developed several gasoline
Anderson (1972) developed a linear octane number prediction method for different
gasoline using 31 molecular lumps based on the gas chromatographic (GC) analysis.
However, a high average error around 2.8 is shown when predicting catalytically
                                          99
octane number by neural networks; Meusinger (1999) and Moros (2000) used
chemical composition based ON methods include Twu and Coon (1997), and Albahri
prediction model covering variety of gasoline process streams based on the analysis
of 1471 gasoline fuels with 57 hydrocarbon lumps from GC analysis. The model
provides an acceptable accuracy within a standard error of 1 number for both RON
and MON.
For blending index method, the simplest form of their tabulated blending indexes has
𝐵𝐼𝑅𝑂𝑁
   36.01 + 38.33𝑋 − 99.8𝑋 2 + 341.3𝑋 3 − 507.2𝑋 4 + 268.64𝑋 5     11 ≤ 𝑅𝑂𝑁 ≤ 76
={    −299.5 + 1272𝑋 − 1552.9𝑋 2 + 651𝑋 3                    76 ≤ 𝑅𝑂𝑁 ≤ 103
            2206.3 − 4313.64𝑋 + 2178.57𝑋 2                  103 ≤ 𝑅𝑂𝑁
X=RON/100 (5.1)
5.2.2 RVP
The RVP (Reid vapour pressure) of a gasoline blend affects the gasoline performance
fundamental methods for predicting blended RVP are given in Stewart et al. (1959)
and Vazques-Esparragoza et al. (1992). Stewart et al. (1959) presented one of the
first theoretical approaches for predicting blended RVP. The method uses component
relationships, and a set of simplified assumptions (i.e. presence of air and water
vapour are ignored, absolute pressure is taken as the RVP, volatile components are
                                         100
assumed to have the density of butanes, and the non-volatile components are
procedure that extended Stewart's method. In this approach, the additivity of liquid
and gas volumes is assumed and a different equation of state is used. Furthermore,
The easiest blending index method for RVP prediction is developed by Chevron.
                                                            0.8
                                     𝑅𝑉𝑃𝑏 = (∑ 𝑉𝑖 𝑅𝑉𝑃𝐼𝑖 )                       (5.3)
For gasoline boiling range, Ethyl Corporation model mentioned in Chapter 3 can
                                                                               𝐺𝑖
          BV𝑥𝑖 = 𝐶0𝑥 + 𝐶1𝑥 𝐴𝑖 + 𝐶2𝑥 𝐴2𝑖 + 𝐶3𝑥 𝐴3𝑖 + 𝐶4𝑥 𝐴𝑖 𝐺𝑖 + 𝐶5𝑥                 +
                                                                               𝐴𝑖
                               𝐺𝑖
                         𝐶6𝑥         + 𝐶7𝑥 𝐺𝑖                                   (5.5)
                               𝐴2𝑖
Gasoline blending planning and scheduling are interactive. Planning operation deals
with recipe generation according to market demand and product specifications. The
                                            101
result of planning model, which is the recipe, is sent to the scheduling level.
each time interval, including conducting the process in terms of, where streams go
and when an assignment ends. On the other hand, the feedback from the scheduling
level can help the planning operationists make better decision at the planning level.
achieve an optimal overall profit while the product specifications and market
demands are satisfied. After obtaining the blending recipe, the scheduling level deals
with how to achieve an optimal profit according to the recipe and market demand
constraints.
Assumptions:
 The input bounds of each components stream to each blender are neglected.
The objective of planning model is to maximize the profit through the process, which
                  𝑃𝑟𝑜𝑓𝑖𝑡 = ∑𝑁𝑃                 𝑁𝐹
                            𝑗=1 𝑃𝑗 ∙ 𝑃𝑟𝑖𝑐𝑒𝑗 − ∑𝑖=1 𝐹𝑖 𝐶𝑜𝑠𝑡𝑖                       (5.6)
Subject to:
                                            102
4) Material balance for component tanks
𝐹𝑖 = 𝑅𝑖 + ∑𝑗 𝐹𝐵𝑖,𝑗 ∀𝑖 (5.7)
𝑃𝑗 = 𝑅𝑗 + ∑𝑖 𝐹𝐵𝑖,𝑗 ∀𝑗 (5.8)
𝑃𝑗 ≥ 𝑃𝑗𝑚𝑖𝑛 ∀𝑗 (5.9)
7) Composition concentration
   In order to satisfy product qualities and market conditions, upper and lower
   bounds can be forced on the component concentration for different grades of
   gasolines
                                         103
                                 𝑃𝑟𝑗,𝑧 = 𝑓(𝑥𝑖,𝑗 , 𝜖𝑧 )      ∀ 𝑖, 𝑗, 𝑧          (5.13)
To improve its applicability, this model gives priorities to the blending index
methods for nonlinear properties. This is because these methods require less data
                            Method                  Property
                              Riazi              Octane Number
                            Chevron                    RVP
                       Ethyl Corporation          Boiling Range
RON, RVP, D86 and blending ratio, are shown in Table 5.2. The linear result
comes from volume based property indices and the nonlinear result comes from
the correlations mentioned before. The calculated properties are compared with
                                           104
                   Table 5.2 Gasoline blending model validation
Comparing the results, nonlinear model delivered better results on RON and D86.
For RVP, the results are similar. In order to reduce the prediction error, it is necessary
Objective function: to maximum the total profit for all the diesel products while
                   𝑃𝑟𝑜𝑓𝑖𝑡 = ∑𝑁𝑃                   𝑁𝐹
                             𝑗=1 𝑃𝑗 ∙ 𝑃𝑟𝑖𝑐𝑒𝑃,𝑗 − ∑𝑖=1 𝐹𝑖 ∙ 𝑃𝑟𝑖𝑐𝑒𝐹,𝑖               (5.13)
Subject to:
1) Operation constraint
∑𝑗 𝐴𝑗,𝑛,𝑡 ≤ 1 ∀ 𝑛, 𝑡 (5.14)
                                           105
3) Material balance for blending tanks
4) Component concentration
6) Product demand
Equation 5.14-5.20.
                                             106
This case study was curled from the work by Mendez (2006) and Gupta (2008). The
components and n-butane are blended into two grades of gasoline. Component
streams are available in storage tanks with an available initial inventory, and will be
produced and transferred to storage tanks daily. From the component storage tanks,
the component streams can be sent to blending tanks for mixing and from blending
tanks the product streams can be transferred to different product storage tanks. In
addition, two kinds of additives, ethanol and alkylate, can be blended into the blends
in order to improve the product quality to meet the specifications. Properties of the
five component streams, n-butane stream and additives are specified in Table 5.3.
should not exceed 10% in the two grades of products. Ethanol and alkylate can be
purchased from the market at the price of $189/bbl and $123.9/bbl respectively.
The two final gasoline products can be sold at the price of $115/bbl for Gasoline 89
and $126.8/bbl for gasoline 91. The product specifications are listed in Table 5.4.
                                                             107
                    Table 5.4 Product specifications and prices
                                         Gasoline 89       Gasoline 91
                           AKI               89               91
                           RON               94               96
                          MON                84               86
                         RVP(psi)           6.9               6.9
                       Aromatics(%)          35               35
                       Price ($/bbl)        115              126.8
Table 5.5 allocates the daily requirements or the two grades of products. The
inventory of products must be greater than the due day demand besides of the
minimum inventory.
                                       P1                                 P2
 Requirements (Mbbl)      MIN          MAX          LIFT      MIN        MAX    LIFT
        Day1              0.5          5.0           1.0      0.5        5.0     1.2
        Day2
        Day3                                                   0.5       5.0    2.5
        Day4              0.5          5.0          2.5        0.5       5.0    2.3
        Day5                                                   0.5       5.0    5.0
        Day6                                                   0.5       5.0    5.0
        Day7              0.5           5.0         3.0        0.5       5.0    5.0
        Day8              0.5          5.0          1.0
  Inventory (Mbbl)        0.5          60.0                    0.5       60.0
   Rate(Mbbl/day)         0.5          5.0                     0.0       5.0
The objective of this case study is to find an optimised schedule in an 8-day period
                                              108
•   The blending index method proposed by Riazi (2005) is applied to calculate
RON for blends. Meanwhile MON can be calculated using the method proposed
by Jenkins (1980)
MON=22.5+0.83RON-20*SG-0.12(%O)+0.5(TML)+0.2(TEL) (5.21)
SG is specific gravity and TML and TEL are the concentration of tetra methyl
lead and tetra ethyl lead in mL/UK gallon. And %O is the volume fraction of
olefins in the gasoline. In this case, since the densities are not provided, SG is
assumed to be 0.72, a very normal SG for gasoline stream. And TEL, TML
As nonlinear correlations are applied to predict ROM, MON, RVP of the blends, this
NLP blending planning model and MILP scheduling model. The NLP model deals
with the nonlinear blending optimization. The result, which is gasoline blending
recipe in this case, is transferred to the next MILP scheduling problem as a fixed
recipe. After optimizing, the scheduling model returns a new production, in which
blending operation constraints are considered, to the NLP planning model. By fixing
the production, the NLP planning model starts the next iteration. As the MILP
scheduling model deals with specific blending operations, the result from it is more
realistic and practical than the planning result. After getting the feedback, the NLP
model can optimize the planning problem in a higher horizon. The process continues
until the result from scheduling model is the same or very close to that in last
iteration. This is the optimal point of the gasoline blending scheduling problem.
(Equation 5.6) subject to constraints (Equation 5.7-5.20). The solving process ends at
                                          109
iteration 2.
                                          110
                                      Invetory of Products
                         70
                         60
       Invetory (Mbbl)   50
                         40
                         30
                         20
                         10
                          0
                               1      2      3       4      5      6       7      8
                          P1   2      2      7      4.5    4.5     4.5    1.5    0.5
                          P2   3.8   13.8   16.3    24     32.6   42.6    52.6   62.6
From Table 5.5, since the price of Gasoline 89 is very low compared with the
component cost, the local optimal solution only produces minimum amount of this
product that can meet the market demand and inventory requirement.
                                                    111
 Blender             1        2       3         4       5       6        7        8
            P1
   n1       P2       5        5       5         5       5      3.604     5        5
            P1       5                3
   n2       P2                5                 5       5       5        5        5
During the problem time period, the blender operations are as shown in Figure 5.4.
This case is solved by CONOPT in GAMS 23.5 on Dell M14 (Intel® Core™
2.40GHz) running Windows 10. It contains 1171 equations, 403 single variables and
32 discrete variables. The execution time is 0.032s. The local optimal profit of this
5.5 Summary
correlations and property prediction accuracy haven’t receive enough attention. After
modification, the model can deal with gasoline blending successfully. Due to
because of the complexity of the equations and the large number of variables and
two-level optimisation problem. NLP part generates a blending recipe and fixes the
the scheduling problem. The iteration between the two-level models provides a
near-optimal solution for the gasoline blending scheduling problem. to A case study
is presented to prove the reliability, efficiency and superiority of the proposed model
                                          112
and solving algorithm.
                         113
                                Nomenclature
Sets
𝑖 component index
𝑗 product index
𝑛 blender index
Parameters
Binary variables
                                      114
𝐴𝑗,𝑛,𝑡       binary variable to denote that product j is blended in blender 𝑛
Continuous variables
                                       115
              Chapter 6 Conclusions and future work
6.1 Conclusions
Due to decreased oil prices and degrading qualities of crude oil, stiff market
competition and stringent fuel specifications, refinery need to have smarter strategies
to meet product demands and generate profit. However, diesel production blending
problem has not received sufficient attention from academic researchers. Refineries
widely apply Linear Programming (LP) models, which could lead to big properties
and profit loss due to inaccuracy, to operate diesel blending process. More accurate
correlations for property estimation, which is mostly used in the refining industry,
improve the model accuracy. The properties in the diesel product specifications are
taken into account in this model. With the application of nonlinear correlations in the
model, the accuracy and complexity of the problem both increase. To avoid
into several sub-models, the problem is solved layer by layer. The initial point of
each layer comes from the upper level layer, until to a simply NLP model that can be
easily worked out by the solvers. A diesel blending production case is optimized by
this model. The NLP model with complex Non-Linear correlations is solved using
On the basis of the NLP model, an MINLP model for diesel blending scheduling is
developed. For diesel production blending, the nature of nonlinear blending makes
scheduling an MINLP problem. Existing MINLP solvers fail to solve this problem
is decomposed into two sub-models: NLP model for planning part and MILP model
for scheduling part. The NLP model deals with the diesel blending planning
delivered to the next level, MILP scheduling model as a fixed recipe. After the
planning mode to modify the blending optimization. After several iterations, the
overall optimal solution can be achieved. Through this algorithm, the MINLP
blending. Considering the difference between the blending model of gasoline and
diesel, the proposed model needs to be modified before modelling the gasoline
blending problem. However, due to the same nature of nonlinear blending, the
In this work, NLP models are developed in diesel blending planning and scheduling.
The proposed model and solution algorithm can improve the model accuracy,
increase the profit and reduce the computation effort. This provides a significant
operation..
As this work introduces a model for diesel product blending, it is just the first step
for refining optimization. Therefore, there is a large scope of the future research.
                                          117
Nonlinear blending models have been researched for years. They are more accurate
than LP models in refinery optimization. But there still are potential in improving
model accuracy. More industrial case studies can be applied to validate and improve
Only off line blending is considered in this work, however, in line blending is also a
expanded to consider detailed upstream processes for producing more cost effective
                                         118
                                     References
Bacha, John, et al. "Diesel fuels technical review." Chevron Global Marketing
Castro, Pedro M., and Ignacio E. Grossmann. "Global optimal scheduling of crude
15127-15145.
Castro, Pedro M., Iiro Harjunkoski, and Ignacio E. Grossmann. "Optimal short-term
Cerdá,, Jaime, Pedro Carlos Pautasso, and Diego Carlos Cafaro. "Optimizing
gasoline recipes and blending operations using nonlinear blend models."Industrial &
Cerdá,, Jaime, Pedro C. Pautasso, and Diego C. Cafaro. "A cost‐effective model for
161-193.
modelling into overall refinery optimisation. Applied Thermal Engineering, 2001, 21,
pp 1331-1348
                                        120
Jia, Zhenya, and Marianthi Ierapetritou. "Mixed-integer linear programming model
Janak, Stacy L., Xiaoxia Lin, and Christodoulos A. Floudas. "A new robust
optimization approach for scheduling under uncertainty: II. Uncertainty with known
Kelly, J. D. and Mann, J. L., Crude oil blend scheduling optimisation: an application
10707-10719.
Lee, H., Pinto, J. M., Grossmann, I. E. and Park, S., Mixed integer programming
model for refinery short-term scheduling of crude oil unloading with inventory
and global optimization approach for scheduling of crude oil operations." AIChE
Li, Jie, Xin Xiao, and Christodoulos A. Floudas. "Integrated gasoline blending and
order delivery operations: Part I. Short‐term scheduling and global optimization for
Li, Jie, and I. A. Karimi. "Scheduling gasoline blending operations from recipe
                                        121
Li, Jie, I. A. Karimi, and Rajagopalan Srinivasan. "Recipe determination and
Li, Jie, Ruth Misener, and Christodoulos A. Floudas. "Scheduling of crude oil
Li, W., Hui,C. and Li, A., Integrating CDU, FCC and product blending models into
Li, Zukui, and Marianthi G. Ierapetritou. "Rolling horizon based planning and
models: A case study using FCC. Poster at the Engineering Foundation Conference
Lin, Xiaoxia, Stacy L. Janak, and Christodoulos A. Floudas. "A new robust
Lotero, Irene, et al. "An MILP-MINLP decomposition method for the global
Méndez, Carlos A., et al. "A simultaneous optimization approach for off-line
                                          122
blending and scheduling of oil-refinery operations." Computers & chemical
Moro, L. F. L., Zanin, A. C. and Pinto, J. M., A planning model for refinery diesel
S1039-S1042.
situation and future trends. Computers and Chemical Engineering, 2003, 27, pp 1303
-1305.
Nick Vandervell, Readdressing the balance between petrol and diesel demand
September 2015
Neiro, S. M. S. and Pinto, J. M., A general modelling framework for the operational
28, pp 871-876.
Pantelides, C. C., Unified frameworks for optimal process planning and scheduling.
multiproduct batch plants under demand uncertainty. Ind. Eng. Che. Res., 1997, 36,
pp 4864.
                                       123
Pelham, R. and Pharris, C., Refinery operations and control: a future vision.
439-448.
and cold filter plugging point for future diesel fuels with application
1219-1242
Reddy, P. C. P., Karimi, I. A. and Srinivasan, R., Novel solution approach for
0803133642
Riazi, M. R. (Kuwait U), Eser, S. (Penn State), Pena-Diez, J.L. (Repsol, Spain) and S.
Rigby, B., Lasdon, L. S. and Waren, A. D., The evolution of Texaco blending
                                              124
chemical reactor networks." Industrial & Engineering Chemistry Research 38.3
(1999): 744-766.
Simon, C. C., Managing the molecule II. Foster Wheeler technical papers, 2001.
Singh, A., Forbes, J. F., Vermeer, P. J. and Woo, S. S., Model-based real-time
Sourabh Gupta., 2008. Planning and scheduling of refinery operations .Ph.D. Thesis,
Yongwen Wu, 2010. Molecular Management for refining operations. Ph.D. Thesis,
                                        125
Zahed, A. H., Mullah, S. A. and Bashir, M. D., Predict Octane Number for Gasoline
Zhang, N. and Zhu, X. X., A novel modelling and decomposition strategy for overall
1543-1548.
Zhang, N., Novel modelling and decomposition for overall refinery optimisation and
                                       126
       Appendix A Diesel blending optimization in GAMS
parameters
/ F1 1500
F2 1200
F3 1300
F4 800
/ F1 68
F2 34
F3 73
F4 73
                              /
                                            127
SC(i)     Sulphur content of diesel i (ppm)
/ F1 12
F2 8
F3 2
F4 8
/ F1 0.8670
F2 0.8559
F3 0.8287
F4 0.8162
/ F1 -20
F2 -14
F3 -37
F4 -5
                            128
            /
/ F1 -15
F2 -9
F3 -16
F4 3
/F1 3.8
F2 1.5
F3 4.4
F4 2.7
/F1 0.2
F2 0.1
                                    129
           F3                0.3
F4 0.4
/F1 0.003
F2 0.01
F3 0.01
F4 0.008
/F1 9
F2 13
F3 4
F4 2
/F1 50
                                    130
              F2           70
F3 60
F4 55
/ P1 1270
P2 1290
P3 1320
P4 1330/
/ P1 46
P2 46
P3 46
P4 46/
/ P1 10
P2 10
                                 131
                P3 10
P4 10/
/ P1 0
P2 -10
P3 -20
P4 -35/
/ P1 0
P2 -5
P3 -10
P4 -15/
/ P1 0.82
P2 0.82
P3 0.82
P4 0.82/
                                  132
 Densityupper(j) upper limit of density         (g*ml-1)
/ P1 0.86
P2 0.86
P3 0.86
P4 0.86/
/P1 2
P2 2
P3 2
P4 2/
/P1 4.5
P2 4.5
P3 4.5
P4 4.5 /
/ P1 55
                              133
                              P2 55
P3 55
P4 55/
/F1 131.5
F2 140.7
F3 205
F4 151.7
/F1 137.2
F2 165.4
F3 262.6
F4 256.9
/F1 139.9
                                           134
                            F2       173.4
F3 275.6
F4 272.2
/F1 143.8
F2 199.2
F3 301.8
F4 307.9
/F1 158.5
F2 246.9
F3 349.9
F4 367.6
                                         135
BP95(i) 95% boiling point
/F1 166.2
F2 254.8
F3 361.6
F4 387.6
/F1 185.6
F2 266.8
F3 372.3
F4 396.7
POSITIVE VARIABLES
                                          136
variables
CarbonP(j)
CNP(j)
PAHP(j)
ashP(j)
SulphurP(j)
                                           137
               VBNj(j)     Viscosity Blending Index of product j
FB(i)
PourP(j)
CFPPp(j)
BVXi(i)
BVX10(i)
                                               138
    BVX30(i)
BVX50(i)
BVX90(i)
BVX95(i)
BVXf(i)
Ai(i)
Gi(i)
equations
density(j)
                                      139
densityl(j)
densityu(j)
profit
Cetanenumber1(j)
Cetanenumber2(j)
Sulphurcontent1(j)
Sulphurcontent2(j)
Cfpp1(j)
VBN1(i)
VBN2(j)
                     140
Viscosity(j)
viscositystand1(j)
viscositystand2(j)
ashcontent1(j)
ashcontent2(j)
pahydro1(j)
pahydro2(j)
BI1(i)
BI2(j)
BI3(j)
BI4(j)
A(i)
C(j)
D(i,j)
E(i,j)
                     141
G(j)
Boilingpoint2(i)
Boilingpoint4(i)
Boilingpoint5(i)
Boilingpoint9(j)
Boilingpoint11(j)
Boilingpoint12(j)
Aieq(i)
Gieq(i)
                    142
;
densityu(j).. dens(j)=l=densityupper(j);
densityl(j).. dens(j)=g=densitylower(j);
Cetanenumber1(j).. sum(i,x(i,j)*CN(i))=g=CNsta(j);
Cetanenumber2(j).. sum(i,x(i,j)*CN(i))=e=CNP(j);
Sulphurcontent1(j).. sum(i,xx(i,j)*SC(i)/((yy(j)+0.000001)))=l=SCsta(j);
Sulphurcontent2(j).. sum(i,xx(i,j)*SC(i)/((yy(j)+0.000001)))=e=SulphurP(j);
Aieq(i).. Ai(i)=e=(BP10(i)+BP50(i)*2+BP90(i))/4;
Gieq(i).. Gi(i)=e=BP90(i)-BP10(i);
Boilingpoint2(i)..
BVX10(i)=e=-1120+Ai(i)*(17.77218623)+Ai(i)*Ai(i)*(-0.05949307)+Ai(i)*Ai(i)*
Ai(i)*(0.00006561)+Ai(i)*Gi(i)*(-0.04940709)+(-11600)*Gi(i)/(Ai(i)+0.000000001
                                          143
)+(1030000)*Gi(i)/(Ai(i)*Ai(i)+0.0000001)+(37.7815769)*Gi(i);
Boilingpoint4(i)..
BVX50(i)=e=-6.77060E+3+Ai(i)*(42.62167742)+Ai(i)*Ai(i)*(-0.05126593)+Ai(i)*
Ai(i)*Ai(i)*
01)+(5.055108E+6)*Gi(i)/(Ai(i)*Ai(i)+0.0000001)+( 2.202761E+2)*Gi(i);
Boilingpoint5(i)..
BVX90(i)=e=-3170+Ai(i)*(58.53687623)+Ai(i)*Ai(i)*(-0.25951042)+Ai(i)*Ai(i)*
Ai(i)*
(0.00034356)+Ai(i)*Gi(i)*( -0.0512486)+(-204000)*Gi(i)/(Ai(i)+0.000000001)+(16
80000)*Gi(i)/(Ai(i)*Ai(i)+0.0000001)+(64.70628018)*Gi(i);
Boilingpoint9(j).. BPF10(j)=e=sum(i,x(i,j)*BVX10(i));
Boilingpoint11(j).. BPF50(j)=e=sum(i,x(i,j)*BVX50(i));
Boilingpoint12(j).. BPF90(j)=e=sum(i,x(i,j)*BVX90(i));
Cfpp1(j)..
                                     144
13.45*log(cfppsta(j)+459.67)=g=log(sum(i,(((x(i,j))**1.03)*((cfpp(i)+459.67)**13.
45)+0.00000001)));
ashcontent1(j).. sum(i,xx(i,j)*AC(i)/(yy(j)+0.00000001))=l=0.01;
ashcontent2(j).. sum(i,xx(i,j)*AC(i)/(yy(j)+0.00000001))=e=AshP(j);
pahydro1(j).. sum(i,xx(i,j)*pah(i)/(yy(j)+0.00000001))=l=11;
pahydro2(j).. sum(i,xx(i,j)*pah(i)/(yy(j)+0.00000001))=e=PAHP(j);
VBN1(i).. VBNi(i)=e=14.534*log(log(v(i)+0.8))+10.975;
VBN2(j).. VBNj(j)=e=sum(i,(xx(i,j)/(yy(j)+0.0000001)*VBNi(i)));
viscosity(j).. vis(j)=e=exp(exp((VBNj(j)-10.975)/14.534))-0.8;
viscositystand1(j).. vis(j)=l=viscosityupper(j);
viscositystand2(j).. vis(j)=g=viscositylower(j);
BI1(i).. log10(BIF(i)+0.00001)=e=-6.1188+(2414/(FP(i)+273.15-42.6));
BI2(j).. BIfp(j)=e=sum(i,x(i,j)*BIF(i));
BI3(j).. log10(BIfp(j)+0.00001)=e=-6.1188+(2414/(flashp(j)+273.15-42.6));
                                            145
BI4(j)..     flashp(j)=g=FPtsta(j);
A(i).. sum(j,xx(i,j))=l=amount(i);
C(j).. yy(j)=e=sum(i,xx(i,j));
D(i,j).. volume(i,j)=e=y(j)*x(i,j);
E(i,j).. volume(i,j)*den(i)=e=xx(i,j);
G(j).. dens(j)*y(j)=e=yy(j);
yy.lo('P1')=500;
yy.lo('P2')=800;
yy.lo('P3')=700;
yy.lo('P4')=300;
                                           146
option     NLP= conOPT ;
densityl
densityu
profit
                           147
/;
densityl
densityu
profit
Cetanenumber1
Cetanenumber2
Sulphurcontent1
Sulphurcontent2
Cfpp1
                                        148
VBN1
VBN2
Viscosity
viscositystand1
viscositystand2
ashcontent1
ashcontent2
pahydro1
pahydro2
BI1
BI2
BI3
                  149
BI4
/;
                                          150
display yy.l,yy.m, x.l,x.m, XX.L,s.l,s.m;
                                            151
   Appendix B Diesel blending scheduling optimization in
GAMS
n blender /n1,n2,N3/
parameters
AVA(I)
/F1 39.9
F2 28.4
F3 23.5
F4 13.4/
/ F1 4.8
F2 2.0
F3 2.6
                                                152
                 F4 2.3
/ F1 1.5
F2 3.3
F3 2.0
F4 1.4
/ F1 0.5
F2 0.5
F3 0.5
F4 0.5
/ F1 10
                              153
               F2   25
F3 25
F4 10
/ P1 0.5
P2 0.5
P3 0.5
/ P1 15
P2 15
P3 15
                          154
CN(i)      Cetane number of diesel i
/ F1 68
F2 34
F3 73
F4 73
/ F1 12
F2 8
F3 2
F4 8
/ F1 0.8670
F2 0.8559
F3 0.8287
F4 0.8162
                            155
            /
/ F1 -20
F2 -14
F3 -37
F4 -5
/ F1 -4
F2 -2
F3 -12
F4 -10
/F1 3.8
F2 1.5
F3 4.4
                                 156
          F4            2.7
/F1 0.2
F2 0.1
F3 0.3
F4 0.4
/F1 0.003
F2 0.01
F3 0.01
F4 0.008
/F1 9
F2 13
                               157
                  F3             4
F4 2
/F1 50
F2 70
F3 60
F4 55
/ P1 31
P2 33
P3 35
cost(i)
/F1 22
F2 20
                                          158
                 F3             26
F4 24
/ P1 46
P2 46
P3 46
/ P1 10
P2 10
P3 10
/ P1 0
P2 -10
                                     159
                      P3   -20
/ P1 0
P2 -5
P3 -10
/ P1 0.82
P2 0.82
P3 0.82
/ P1 0.86
P2 0.86
P3 0.86
                                       160
            viscositylower(j) lower limit of viscosity
/P1 2
P2 2
P3 2
/P1 4.5
P2 4.5
P3 4.5
/ P1 55
P2 55
P3 55
Table LIFT(j,t)
                                              161
         1            2             3            4   5   6    7
1.0
P3 1.0
2.2
Table xmilp(i,j)
P1 P2 P3
F1
F2
F3
F4
positive variables
                                         162
       yy(j)       amount of product j (MASS)
y(j)
volume(i,j)
time slot t
ymilp(j)
SCALARS PPPPP/ 0 /
number /1/ ;
variable
                                            163
totalpro
PourP(j)
CFPPp(j)
AVAdaily(i,t)
AVARESj(j,t)
bias(j)
                                           164
            CarbonP(j)
CNP(j)
PAHP(j)
ashP(j)
SulphurP(j)
FB(i)
binary variable
equations
                                           165
density(j)
densityl(j)
densityu(j)
profit
Cetanenumber1(j)
Cetanenumber2(j)
Sulphurcontent1(j)
Sulphurcontent2(j)
Cfpp1(j)
VBN1(i)
VBN2(j)
Viscosity(j)
viscositystand1(j)
viscositystand2(j)
ashcontent1(j)
ashcontent2(j)
pahydro1(j)
                     166
pahydro2(j)
BI1(i)
BI2(j)
BI3(j)
BI4(j)
AA(i)
B(J)
C(j)
D(i,j)
E(i,j)
F(j)
GG(j)
profitMILP
blendingbalance2(j,n,t)
blendingbalance3(i,j,n,t)
blendingbalance4(j)
                            167
blendingbalance5(j,n,t)
blendingbalance6(j,n,t)
blendoperation3(n,t)
D2(i,j,n,t)
*D3(i)
AVA1(i,t)
AVA2(i,t)
AVA21(i,t)
AVA22(i,t)
AVA23(i,t)
AVA24(i,t)
AVA25(i,t)
AVA26(i,t)
AVA31(j,t)
AVA32(j,t)
AVA33(j,t)
                          168
AVA34(j,t)
AVA35(j,t)
AVA36(j,t)
AVA3(j,t)
AVA4(j,t)
AVA5(i,t)
AVA6(i,t)
AVA7(j,t)
AVA8(j,t)
density(j).. dens(j)=e=(sum(i,x(i,j)*den(i)));
densityu(j).. dens(j)=l=densityupper(j);
densityl(j).. dens(j)=g=densitylower(j);
Cetanenumber1(j).. sum(i,x(i,j)*CN(i))=g=CNsta(j);
Cetanenumber2(j).. sum(i,x(i,j)*CN(i))=e=CNP(j);
Sulphurcontent1(j).. sum(i,xx(i,j)*SC(i)/((yy(j)+0.000001)))=l=SCsta(j);
                                          169
Sulphurcontent2(j).. sum(i,xx(i,j)*SC(i)/((yy(j)+0.000001)))=e=SulphurP(j);
Cfpp1(j)..
13.45*log(cfppsta(j)+459.67)=g=log(sum(i,(((x(i,j))**1.03)*((cfpp(i)+459.67)**13.
45)+0.00000001)));
ashcontent1(j).. sum(i,xx(i,j)*AC(i)/(yy(j)+0.00000001))=l=0.01;
ashcontent2(j).. sum(i,xx(i,j)*AC(i)/(yy(j)+0.00000001))=e=AshP(j);
pahydro1(j).. sum(i,xx(i,j)*pah(i)/(yy(j)+0.00000001))=l=11;
pahydro2(j).. sum(i,xx(i,j)*pah(i)/(yy(j)+0.00000001))=e=PAHP(j);
VBN1(i).. VBNi(i)=e=14.534*log(log(v(i)+0.8))+10.975;
VBN2(j).. VBNj(j)=e=sum(i,(xx(i,j)/(yy(j)+0.0000001)*VBNi(i)));
viscosity(j).. vis(j)=e=exp(exp((VBNj(j)-10.975)/14.534))-0.8;
viscositystand1(j).. vis(j)=l=viscosityupper(j);
viscositystand2(j).. vis(j)=g=viscositylower(j);
BI1(i).. log10(BIF(i)+0.00001)=e=-6.1188+(2414/(FP(i)+273.15-42.6));
BI2(j)..         BIfp(j)=e=sum(i,x(i,j)*BIF(i));
                                            170
BI3(j)..        log10(BIfp(j)+0.00001)=e=-6.1188+(2414/(flashp(j)+273.15-42.6));
BI4(j).. flashp(j)=g=FPtsta(j);
B(J).. sum(i,x(i,j))=e=1;
C(j).. yy(j)=e=sum(i,xx(i,j));
D(i,j).. volume(i,j)=e=y(j)*x(i,j);
E(i,j).. volume(i,j)*den(i)=e=xx(i,j);
F(j).. sum(i,volume(i,j))=e=y(j);
GG(j).. dens(j)*y(j)=e=yy(j);
h.. sum(j,y(j))=l=120;
profitMILP..
sum((j,n,t),
FlowrateP(j,n,t)*price(j))-sum((i,j,n,t),FlowrateB(i,j,n,t)*cost(i))=e=totalpro;
blendingbalance2(j,n,t)..
sum(i,FlowrateB(i,j,n,t))=e=FlowrateP(j,n,t) ;
                                           171
blendingbalance3(i,j,n,t)..
FlowrateB(i,j,n,t)=e=FlowrateP(j,n,t)*xmilp(i,j); ;
blendingbalance5(j,n,t)..
FlowrateP(j,n,t)=l=5*A(j,n,t);
blendingbalance6(j,n,t)..
FlowrateP(j,n,t)=g=0.5*A(j,n,t);
blendingbalance4(j)..
yMILP(j)=e=sum((n,t),FlowrateP(j,n,t));
                                          172
D2(i,j,n,t)..
FlowrateP(j,n,t)*xMILP(i,j)=e=FlowrateB(i,j,n,t);
*D3(i)..
Volumeres(i)=e=AVA(i)-sum((j,t),FlowrateB(i,j,t))+INIINVENTORY(I);
AVA1(i,t).. AVAres(i,'1')=e=
iniinventory(i)+production(i)-sum((j,n),FlowrateB(i,j,n,'1'));
(i)-sum((j,n),FlowrateB(i,j,n,'2'));
(i)-sum((j,n),FlowrateB(i,j,n,'3'));
(i)-sum((j,n),FlowrateB(i,j,n,'4'));
(i)-sum((j,n),FlowrateB(i,j,n,'5'));
(i)-sum((j,n),FlowrateB(i,j,n,'7'));
(i)-sum((j,n),FlowrateB(i,j,n,'8'));
AVA3(j,t).. AVAresj(j,'2')=e=
AVAresj(j,'1')+sum(n,FlowrateP(j,n,'2'))-LIFT(j,'2');
AVA31(j,t).. AVAresj(j,'3')=e=
AVAresj(j,'2')+sum(n,FlowrateP(j,n,'3'))-LIFT(j,'3');
AVA32(j,t).. AVAresj(j,'4')=e=
AVAresj(j,'3')+sum(n,FlowrateP(j,n,'4'))-LIFT(j,'4');
AVA33(j,t).. AVAresj(j,'5')=e=
AVAresj(j,'4')+sum(n,FlowrateP(j,n,'5'))-LIFT(j,'5');
AVA34(j,t).. AVAresj(j,'6')=e=
AVAresj(j,'5')+sum(n,FlowrateP(j,n,'6'))-LIFT(j,'6');
AVA35(j,t).. AVAresj(j,'7')=e=
AVAresj(j,'6')+sum(n,FlowrateP(j,n,'7'))-LIFT(j,'7');
                                         174
AVA36(j,t)..                                                    AVAresj(j,'8')=e=
AVAresj(j,'7')+sum(n,FlowrateP(j,n,'8'))-LIFT(j,'8');
AVA4(j,t).. AVAresj(j,'1')=e=
sum(n,flowrateP(j,n,'1'))-LIFT(j,'1');
AVA5(i,t).. AVAres(i,t)=g=minstock(i);
AVA6(i,t).. AVAres(i,t)=l=maxstock(i);
AVA7(j,t).. AVAresj(j,t)=g=minstockj(j);
AVA8(j,t).. AVAresj(j,t)=l=maxstockj(j);
y.lo('p1')= 7.5;
y.lo('p2')= 6.0;
y.lo('p3')=3.2;
densityu
profit
*avalable
AA
GG
h/
densityl
densityu
profit
                                        176
Cetanenumber1
Cetanenumber2
Sulphurcontent1
Sulphurcontent2
*avalable
Cfpp1
VBN1
VBN2
Viscosity
viscositystand1
viscositystand2
                  177
ashcontent1
ashcontent2
pahydro1
pahydro2
BI1
BI2
BI3
BI4
AA
GG
/;
              178
solve diesel1 using nlp maximazing s;
xmilp(i,j)=x.L(i,j);
blendingbalance3
blendingbalance5,
blendingbalance6,
blendoperation3,
D2,
*D3,
*avalable
AVA1,AVA2,AVA3
AVA4
AVA21
AVA22
AVA23
AVA24
                                         179
AVA25
AVA26
AVA31
AVA32
AVA33
AVA34
AVA35
AVA36
AVA5
AVA6
AVA7
AVA8
/;
display totalpro.l,totalpro.m,y.l,y.m,flowrateB.l,flowratep.l,A.l,ymilp.l,XMILP;
PPPPP = totalpro.l;
                                         180
*            Pj(j)=    ymIlp.l(j);
number= number+1;
y.lo(j)=ymilp.l(j);
y.up(j)=ymilp.l(j);
xmilp(i,j)=x.L(i,j);
DISPLAY TOTALPRO.L,FLOWRATEP.L,PPPPP,
y.l,x.l,number,flowratep.l,A.L,avares.l, AVARESJ.L; )
181