June 2021

Special Focus: Process Optimization

Optimize product blending using Excel spreadsheets and LINGO software—Part 1

Linear programming (LP) is an optimization modelling technique in which a linear function is maximized or minimized when subjected to various constraints.

Coker, A. K., A.K.C. Technology; Alushaibani, A., Texas A&M University

Linear programming (LP) is an optimization modelling technique in which a linear function is maximized or minimized when subjected to various constraints. This technique has been useful for guiding quantitative decisions in business planning in industrial engineering, refineries and chemical plants. Petroleum refining involving gasoline blending bears a different cost of manufacturing; the proper allocation for each component into its optimal disposition is of major economic importance. To address this problem, most refiners employ LP that permits the rapid selection of an optimal solution from multiple feasible alternative solutions, as each component is characterized by its gasoline blending in petroleum refining. Examples provided in this article are the solver from Microsoft Excel and Lingo software.

Product blending plays a key role in preparing refinery products for the market to satisfy product specifications and environmental regulations. The objective of product blending is to assign all available blend components to satisfy product demand and specification to minimize cost and maximize overall profit. Almost all refinery products are blended for the optimal use of all the intermediate product streams for the most efficient and profitable conversion of petroleum to marketable products. For example, typical motor gasolines may consist of straight- run naphtha from distillation, crackate [from fluidized catalytic cracking (FCC)], reformate, alkylate, isomerate and polymerate, in proportions to make the desired grades of gasoline and the specifications.

Basic intermediate streams can be blended into different finished products. For example, naphthas can be blended into gasoline or jet fuel streams, depending on the demand. On-line blending is more prevalent than batch through optimization programs. In most cases, the component blend nonlinearly for a given property (e.g., vapor pressure, octane number cetane number, viscosity, pour point) and correlations and programming are required for reliable predictions of the specified properties in the blend.

One critical economic issue for refineries is selecting the optimal combination of components for the products. Refining does not provide commercially viable products directly, but rather semi-finished products, which must be blended to meet the correct customers’ specifications. Blending is an important operation within the refinery—it is a physical process in which accurately weighed quantities of two or more components are mixed thoroughly to form a homogeneous phase, which can be either similar or dissimilar in nature.

Blending specifications

Most products obtained from distillation/fractionation columns are blended with fractions obtained from other units to help minimize waste and invariably increase the quantity of the products. Almost all products—from gas to lube oil—are not only blended with fractions, but also with additives. All such blends are formulated to have the required properties conforming to the correct specifications.

Blended products include gasoline, jet fuels, heating oils and diesel fuels. The objective of product blending is to allocate the available blending components so that demands and specifications are met at the least cost and to provide products that maximize overall profit.

Gasoline blending is much more complicated than a simple mixing of the components. A typical refinery may have as many as eight to 15 hydrocarbon streams to consider as blendstocks. These may range from butane (the most volatile component) to a heavy naphtha and can include several gasoline naphthas from crude distillation, catalytic cracking and thermal processing units, in addition to alkylate, polymer and reformate. Modern gasoline may be blended to simultaneously meet 10–15 different quality specifications, including:

  • Vapor pressure
  • Initial, intermediate and final boiling points
  • Sulfur content
  • Color
  • Stability
  • Aromatic content
  • Olefin content
  • Octane measurements for several different portions of the blend
  • Local governmental or market restrictions.

Since each individual component contributes uniquely in each of these quality areas and each bears a different manufacturing cost, the proper allocation of each component into its optimal disposition is of major economic importance.

Different component streams are blended into various grades of gasoline, including 83 octane (blended with an oxygenated fuel such as ethanol), regular 87 octane and premium 92 octane. The Reid vapor pressure (RVP) is set depending on the average temperature of the location the gasoline will be used (cold temperatures require higher RVP than warmer climates). These two specifications are the most significant, and they are documented with each blend to minimize the potential of octane giveaways.

If the octane specification is 87, then each 0.1 octane over this target value incurs further costs to the refiner. For example, in the U.S., this cost calculates to approximately $1 MM per 0.1 octane giveaway per 100,000-bpd crude capacity. The RVP is slightly different, as refiners aim to blend as much low-value normal–butane (component RVP of 52 psi) into the final blend without exceeding the specification. For example, the cost of n-butane is $7/bbl that can be sold as gasoline at $25/bbl just by blending. The $18/bbl profit is significant to the refiner, making RVP economics important.

Distillate fuel blending has other specifications that must be ascertained. Distillate blending includes jet fuels, diesel fuels, kerosene and No. 1 and No. 2 fuel oils. Diesel fuels properties that are measured include:

  • Cetane number (analogous to octane number for the gasoline engine)
  • Flash points (relates to fire hazard in storage)
  • Low-temperature properties (including cloud point)
  • Pour point and sulfur content.

In blending some products, such as residual fuel oils or asphalt, viscosity is one of the specifications that must be met.

Previously, blending was performed in batch operations. However, with on-line equipment, computerization and improved techniques, blending is readily performed with greater efficiency and accuracy. Keeping inventories of the blending stocks along with cost and physical data have increased the flexibility and profits from on-line blending through optimization programs. In most cases, the components blend nonlinearly for a given property (vapor pressure, octane number, cetane number, viscosity, pour point, etc.), and correlations and programming techniques are required for reliable predictions of the specified properties in the blend.

Blends of petroleum-based gasoline with 10% ethanol (referred to as E10) account for more than 95% of the fuel consumed in motor vehicles with gasoline engines in the U.S. Ethanol-blended fuels are a pathway to compliance with elements of the federal Renewable Fuel Standard (FRS). The total volume of ethanol blended into motor fuels used in the U.S. has increased since 2010, although at a declining rate of growth; meanwhile, the use of ethanol-free gasoline (E0) by fuel consumers has declined.

FIG. 1 shows a refinery in-line blending facility.

FIG. 1. Refinery in-line blending.

Blending processes

Two types of blending exist: batch and continuous. Batch blending begins with mixing known amounts of components in a tank mixer using an agitator and other accessories, such as pressure gauge, liquid level indicators, etc. Agitation can also involve air where toxic materials like lead and biocides are blended. Mixing in tanks is also accompanied by heating or cooling coils.

Most refiners employ computer-controlled on-line blending for blending gasoline and distillates. All components to be blended are pumped simultaneously into a common header at rates specified as per the formulations in FIG. 2. The rate of flow is controlled by a valve operated by a pneumatic or electric relay system. The received signals correspond to the flowrates, and these can accurately modulate the flowrates by adjusting the valve. The long pipeline through which these proportioned components travel acts as a mixer to produce the blend. Additives can also be injected into the system.

FIG. 2. Schematic diagram of a blending process.

Inventories of blending stocks, together with cost and physical property data, are maintained in a database. Many of the properties of the blending components, such as the octane number, are non-linear; therefore, estimating final blend properties from the components can be quite complex. When a certain volume of a given quality product is specified, LP models are employed, permitting the rapid selection of an optimal solution from multiple feasible alternative solutions. The LP can be used to optimize blending operations to select blending components to produce the required volume of the specific product at the lowest cost. However, non-linear programming is preferred as enough data are available to define the equations because the components blend non-linearly, and values are functions of the quantities of the components and their properties.

Ensuring that the blended streams meet the desired specifications—such as boiling point, specific gravity, RVP and research and motor octane numbers—stream analyzers are installed to provide feedback control of blending streams and additives. The blending components involve an iterative process (i.e., trial-and-error) to economically achieve all critical specifications, as the large number of variables leads to several similar solutions that give the approximate equivalent total overall cost or profit. This is easily handled by a computer.

Each component is characterized by its specific properties and cost to manufacture, and each gasoline grade requirement is similarly defined by quality requirements and relative market value. The LP solution specifies the unique disposition of each component to achieve maximum operating profit. The next stage is to carefully measure the rate of addition of each component in the blend and collect it in storage tanks for final inspection before delivering it for sale.

The problem is not fully resolved until the product is delivered to the customer’s tanks; frequently, last-minute changes in shipping schedules, production qualities or demand require the re-blending of the finished gasoline or the substitution of a high-quality—and therefore more costly—grade, even though it may generate less income for the refinery. Blending equations based on the various parameters—such as RVP, octane numbers, viscosity, etc.—are shown here.

Volume blending equations: specific gravity, aromatics and olefins content (vol%) are calculated using Eq. 1:


Mass blending equations: sulfur and nitrogen content (wt% or ppm), nickel and vanadium (ppm) and carbon residue (CCR, MCRT, etc.) are calculated using Eq. 2:


RVP is calculated using Eq. 3:


Octane numbers [research octane number (RON) and motor octane number (MON)] are calculated using Eqs. 4 and 5, respectively:

                                 (4), (5)

Viscosity is calculated using Eq. 6:


Non-linear octane blending formula

The formulas for non-linear octane blending have been developed1,2 using a set of 75 and 135 blends (TABLE 1) and accounting for the aromatics and olefin contents of the blendstock. The model is expressed by Eqs. 7–16:

                  (7), (8), (9), (10)

             (11), (12), (13), (14)

Volume blending equations (Eq. 15):


Mass blending equations (Eq. 16):


where the terms represent volumetric average values of given properties of components as follows1,2:

      R = RON
      M = MON
      S = Sensitivity (RON – MON)
      RS = RON × sensitivity
      MS = MON × sensitivity
      O = Vol% olefins
      A = vol% aromatics

Gasoline blending

Different gasolines (alkylates, reformates, polymerate, crackate, straight runs, etc.) are blended along with various additives to boost the performance value of gasoline. Additives include octane enhancers, metal deactivators, antioxidants, anti-knock agents, gum and rust inhibitors, and detergents, and are added during and/or after blending to provide specific properties not inherent in hydrocarbons. However, the blend should be to specifications and the two essential properties on which blends are critically constituted are vapor pressure and octane number. The vapor pressure of a mixture can be estimated by Raoult’s law, but scant information on the molecular composition of a blend does not permit it; and laborious experimentation for evaluating molecular composition is unwise.

A gasoline blending example includes three blend stocks and two specifications to produce regular gasoline (87 RON) for both summer (9 psi RVP) and winter (15 psi RVP).

Non-linear programming

Non-linear blending rules can more closely match the physics of the problem. Depending on the availability of olefin and aromatic contents in the blended components, the octane number of the blend can be calculated using the linear mixing rule method with a correction factor.1

As an example, octane blending models using the values of coefficients a and b using the model referenced here gives Eqs. 17 and 18:

                            (17), (18)

Product qualities are estimated through correlations that depend on the quantities and the properties of the blended components. Mixing rules and these correlations are employed to estimate the blend properties (e.g., specific gravity, RVP, viscosity, flash point, pour point, cloud point, aniline point). The octane number for gasoline is correlated with corrections based on aromatic and olefin content. The desired property of the blend is determined by Eq. 19:


where Pi is the value of the property of component i, and qi is the mass, volume or molar flowrate of component i contributing to the total amount of the finished product.

For example, qi can be volume fraction xvi; therefore, the denominator in Eq. 19 = 1. Eq. 19 assumes that the given property is additive (or linear). Additive properties include specific gravity, boiling point and sulfur content. However, properties such as RVP, viscosity, flash temperature, pour point, aniline point and cloud point are not additive. TABLE 2 lists typical properties of pure components and petroleum cuts that can be blended for gasoline to meet market specifications.

The API gravity, RVP and average octane number for a 33/67 blend of light straight-run gasoline and mid-cut reformate can be determined using the Eqs. in the following section.

Since these values are vol%, they can be directly calculated as volume averages using Eqs. 20 and 21:

                                            (20), (21)

API gravity cannot be directly calculated as a volume average, but specific gravity can by using Eqs. 22 and 23:

                            (22), (23)

The volume average of the RVP is (Eqs. 24–27):

                                                                   (24), (25), (26), (27)

The Ethyl model1,2 considers the aromatics and olefin contents of the blend stocks (Eqs. 28–31):

             (28), (29), (30), (31)

The Ethyl model1,2 considers the spread between the RON and MON of the blend stocks (Eqs. 32–36):

                                                    (32), (33), (34), (35), (36)

Using the Ethyl model based on 135 blends, the RON and MON are (Eqs. 37 and 38):

                             (37), (38)

      Average of R and M = (96.4 + 87.6)/2 = 92.0
      Severity, J = 96.4 – 87.6 = 8.8

The model shows that the gasoline will meet the premium octane specification, and the Excel spreadsheet shows the calculations of the Ethyl model. FIG. 3 shows a screenshot of the Excel program. FIG. 4 shows the relationship between octane number vs. fraction of light straight-run naphtha for an Ethyl 135 blend model.

FIG. 3. Screenshot of the blending of linear straight run (LSR) naphtha and mid-cut reformate using the Ethyl model.
FIG. 4. Octane number vs. fraction light straight-run gasoline for Ethyl 135 blend model.


Petroleum blending of refinery products is a rather complex mixture of hydrocarbons with components that frequently vary widely in properties. The final blended products must meet certain specifications, and optimization techniques can be employed to achieve the desired parameters; otherwise, a trial-and-error procedure can prove costly in time and materials.

Furthermore, due to the complexity of the blending problem, many blends can be used to meet the required specifications. Such a problem becomes more complicated as refiners resort to a linear program to optimize their blends, especially in the case of gasoline.

Refiners still blend products batch-wise; however, most facilities apply continuous or inline blending with much-improved analyzers for octane and volatility by applying optimization techniques. Refiners can confidently blend directly to tankers and pipelines at considerable savings over batch blending.

Part 2

Part 2 of this will appear in the July issue and further explores the optimization technique in Microsoft Excel and the LINGO program with the application of a case study. HP


  1. Maples, R. E., Petroleum refinery process economics, 2nd Ed., PennWell Corp., January 2000.
  2. Healy Jr., W. C., C. W. Maasen and R. T. Peterson, “Predicting octane numbers of multi-component blends,” Report number RT-70, Ethyl Corp., Detroit, Michigan, April 1959

The Authors

Related Articles

From the Archive



{{ error }}
{{ comment.comment.Name }} • {{ comment.timeAgo }}
{{ comment.comment.Text }}