May 2019

Process Optimization

Case study for a high-performing refinery loss control program

Most refineries have some sort of mass balance and loss control program in place for accounting, planning and scheduling, as well as for financial and operational evaluation purposes.

Valentine, J., Emerson Automation Solutions; Videla, R., YPF

Most refineries have some sort of mass balance and loss control program in place for accounting, planning and scheduling, as well as for financial and operational evaluation purposes. Improvements to mass balance, along with a clear understanding of losses and where they occur, are critical for a refinery’s performance. Hydrocarbon loss-reduction programs can typically save $2 MM/yr–$10 MM/yr for an average-sized refinery. This can be from not only the value of loss material, but also from the introduction of errors in yield models (including catalyst performance evaluation), which affects overall optimization.

The YPF refinery in Luján de Cuyo, Argentina has been through a process of continuous improvement in terms of measuring and controlling loss for more than 20 yr. The refinery—which processes approximately 111,000 bpd—has reduced losses, including unaccounted losses and flare, from 5%–6% to 1.5%–2%. The unaccounted yearly losses have averaged less than 0.11%, which puts them among the highest performers in terms of loss control (FIG. 1).

FIG. 1. Losses at the Luján de Cuyo refinery have fallen from 5%–6%  to 1.5%–2%.
FIG. 1. Losses at the Luján de Cuyo refinery have fallen from 5%–6% to 1.5%–2%.

While the Luján de Cuyo refinery (FIG. 2) is a medium-sized refinery in terms of throughput, its complexity is quite high. It includes crude and vacuum units, a coker, a fluid catalytic cracker (FCC), a hydrocracker, a reformer and hydrogen (H2) production units. It processes primarily a sweet crude from YPF’s production sites.

FIG. 2. A view of the YPF Luján de Cuyo refinery.
FIG. 2. A view of the YPF Luján de Cuyo refinery.

The following will describe the refinery’s process for achieving an accurate mass balance, and the lessons learned through its program of continuous improvement and operational changes. It will also describe common practices and opportunities for improvement.

Reducing refinery losses

The objective of reducing refinery losses started 20 yr ago by measuring loss, using the following formula:

Refinery losses = shipments in – shipments out – fuel consumed + inventory changes

At the time, most measurements for incoming and outgoing shipments were done through rudimentary tank-gauging systems. The first level of improvement came by changing the system of measurement to include flowmetering systems for many of the input and output streams, primarily using direct mass measurements with Coriolis meters. The Luján de Cuyo refinery utilizes about 40 Coriolis meters to ensure accurate custody transfer measurements.

As the loss control program progressed, the refinery realized that any hydrocarbon loss calculation must be viewed at a molecular level to truly balance the refinery and calculate losses. For example, the water that enters the refinery (to react in the form of steam with natural gas) must be accounted for, as H2 is consumed in various processes and the carbon dioxide (CO2) is flared.

TABLE 1 identifies the source and typical quantities of loss at the Luján de Cuyo refinery. These results, which provided positive economical and managerial impacts for YPF, were achieved by improving measurements and adding a significant number of measurement points.

The relationship between reported losses and the energy intensity index (EII) is important to understand and analyze. The EII is primarily affected by the energy consumed in fired equipment, and the quality of measurement is typically poor. If the energy consumption number is overstated, the losses may appear low; however, the EII will be high. In reporting, one benchmark trades against the other.

Strategies for reducing unaccounted losses

A loss reduction program starts with a clear understanding of the project’s scope and goals. Generally, starting at the fence line and moving in is a good practice, since the custody measurements can then act as anchors in developing both mass and energy balances throughout the plant. The most common sources of loss and uncertainty, shown in TABLE 1, provide an excellent starting point for an analysis of measurement uncertainties that could be significant contributors to the plant balance.

Common sources of loss and uncertainty associated with measurements include:

  • Incoming crude, especially if measured by a ship
  • Water in the crude
  • Variability in crude gravity/properties that do not match the crude assay
  • Insufficient density measurements
  • Natural gas imports
  • Coke
  • Flare
  • Internally generated fuel gas consumed by fired equipment
  • Inventory changes.

Best practices for a loss control program

It is important to clearly define the battery limit, which should be where the custody transfer measurement is performed, and not in any other location. Consideration of the battery limit location should include the terminal, if one is associated with the refinery.

Redundancy in measurement is also important for reconciliation purposes. The types of measurements do not have to be the same. For example, a flowmeter could be compared to a tank volume, but a pay-and-check system is important for most primary measurements.

Utilizing multiple independent measurement points in parallel, instead of a single larger measurement point, is also a way of significantly reducing uncertainty (FIG. 3). Multiple flow measurements can result in a significant randomization effect and overall uncertainty improvement. The total flow equals the sum of the individual stream flows, and the uncertainty is calculated as the uncertainty of the individual measurement divided by the square root of the number of meters. If a single meter has an uncertainty of 0.5%, and if the stream is split between two meters with the same uncertainty of 0.5%, then the uncertainty of the metering system is reduced to 0.35%.

FIG. 3. Diagram of uncertainties.
FIG. 3. Diagram of uncertainties.

The mass balance can be calculated on a daily, weekly or monthly basis. At the Luján de Cuyo refinery, the mass balance is calculated daily, including changes in inventory. Therefore, all measurements must be reconciled simultaneously throughout the plant. By performing a daily balance, any issues or problems are immediately identified, making it significantly easier to resolve an issue. The daily balance feeds into the weekly balance, which feeds into the monthly balance.

Crude measurement. The most important measurement in the mass balance is the crude measurement, as it is the largest measurement in the balance system, and the one against which all other measurements are balanced. Measuring crude only by tank gauging, especially on a ship, generally has significant uncertainties associated with it. High-quality custody flow measurements of the crude, which follow American Petroleum Institute (API) or other international standards, should be used to verify and reconcile against ship tank measurements.

The quantity of water in the crude is another source of uncertainty with crude measurement. Water content can be measured in the fullbore pipe to avoid problems associated with water droplets unevenly dispersed, or water slugs that may occasionally come through the crude inlet piping.

Density measurements. If volumetric measurements are used, density measurements must be included, as they are critical for the mass balance. If this is done through sampling, methods and procedures should follow strict standards, and the frequency of sampling should be carefully considered. The addition of online density measurements should be considered for the fluids with the most composition variability to make the conversion to mass for the mass balance.

If mass measurement by Coriolis meters is used at the custody transfer point, then there is no need for a conversion to mass. The density measurement, which is also measured in a Coriolis meter, can be used to calculate volumetric flow, or as an individual output as a quality parameter.

Natural gas measurements. One of the most common measurement problems at a refinery is with natural gas, which is imported into the refinery to supplement its energy requirements from fuel gas in the form of process unit offgas. The utility provider is responsible for the measurement device used for this custody transfer transaction. Refineries should have their own measurement system as a check to ensure that both the heating value and flowrate are accurate and reliable. Coriolis or ultrasonic meters, along with some type of energy value analyzer, are recommended.

Coke measurements. Many refineries see a coke measurement uncertainty in the range of 5%–10%; this is typically among the highest measurement uncertainties for refineries. If the refinery configuration includes a coker, then the coke pile is one source of uncertainty, and the coke burned in the FCC unit is another source. Regarding the FCC coke, the mass of carbon and H2 burned is calculated through measurement of the air inflow and the exhaust concentrations of CO2, carbon monoxide, oxygen and nitrogen.

Typically, the measurement of the coke pile is a significant challenge for refineries. The Luján de Cuyo refinery has tried several different methods to measure its coke pile, including radiometry, level gauging and infrared technologies. At present, the method that is the most accurate involves weighing the material as it is transported from the refinery by railcar or truck, along with moisture analysis in the laboratory. The coke piles are segregated daily, so that those measurements are compared against the estimates for daily production of coke in the coke drum.

Flare systems. Losses through the flare system are typically the largest source of identifiable loss. The flare system is primarily a safety system, and it must be available for burning off excess hydrocarbon whenever a plant upset is experienced, as well as for burning off excess gas or leaks from processing units. An increased focus in controlling the flare, along with any improvement in control, begins with measurement.

Although flow technology measurements have improved over time, at low flowrates, the uncertainty is often above 10% due to numerous challenges, including very wide turndown requirements, widely changing composition, and very low gas pressure resulting in ill-defined flow profiles. Ultrasonic meters are used in most refineries. Advances in flow profile modeling and diagnostic information from flow devices have improved these measurements significantly. Gas composition analysis—either by laboratory sampling and analysis, or online gas chromatography (GC) or mass spectrometry—is also necessary for both environmental reporting and mass balance purposes.

Fuel gas. Fuel gas is consumed within the fired equipment of the refinery. Generally, it makes up 5%–7% of the crude import figure. Flowmeters used to control the combustion are typically standard orifice plate differential pressure (DP) meters, which are heavily impacted by specific gravity changes. Since the specific gravity of the gas changes significantly in most refineries, the accuracy of the meters is 5%–10% at best. The overall contribution to the mass balance uncertainty is 0.25%–0.7%, which is significant. The fuel gas consumption, which is the number used to calculate the EII, is a critical parameter by which the refinery is benchmarked, as well as an important key performance indicator (KPI) for refinery management. A recommended practice is to use Coriolis meters on fuel gas at the heaters and boilers, which not only improves combustion control but also improves the accuracy of the fuel consumption value.

Inventory changes. Accurate and reliable tank inventory values are another significant challenge for many refineries. Many sources of error exist in the calculation of volumes in a tank and conversion to mass for the mass balance. Tank level measurements have become very accurate, but tank non-uniformities, stratification of product in the tank, and both density and temperature changes through the dimensions of the tank present challenges for accurate measurements. Investments in instrumentation to reduce the uncertainty are recommended for the most important feedstock and product tanks.

An additional challenge facing many refineries is that some tanks are live tanks that are filling and draining simultaneously. The Luján de Cuyo refinery has resolved this issue by investing in Coriolis meters at both the inlet and outlet of the tank to effectively monitor inventory changes (FIG. 4).

FIG. 4. Coriolis meters located at the inlet to a crude tank.
FIG. 4. Coriolis meters located at the inlet to a crude tank.

Inventory changes should be recorded daily to minimize the chances of a measurement error being overlooked, thus allowing prompt corrections to be made.

Process unit mass balance

Once the fence line boundary is established, the next step is to balance the process units. The process unit mass balance is to validate process data that is used to monitor the performance of the unit. Accurate monitoring provides the information necessary to increase product quality and reduce operating costs. To calculate conversion and product yields, as well as catalyst selectivity and energy efficiency, the unit must be balanced. The data can then be used to optimize the process unit, which includes catalyst performance evaluation and expected yields.

The goal for many refineries is to mass balance the process units to 100 +/– 2%. Achieving this goal can be challenging for some process units. Top-performing refineries are making efforts to balance their critical process units to +/– 1%. A strong effort is necessary to meet this goal, since process-quality, uncompensated orifice plate DP technology is commonly used for the measurements. This technology is particularly influenced by the density of the fluid being measured; in a refinery, densities are commonly changing. FIG. 5 shows the impact of changing process conditions on flow measurement.

FIG. 5. Equation for changing process conditions on flow measurements.
FIG. 5. Equation for changing process conditions on flow measurements.

Due to these issues, the Luján de Cuyo refinery invested in Coriolis meters on all mass balance points for the critical process units. Coriolis meters measure mass directly and are not affected by changing process conditions, including density changes. In addition, the meters measure density, which is used to track compositional changes and to calculate volumetric flowrates.

At the Luján de Cuyo refinery, Coriolis meters are used on the mass balance streams for the following units:

  • Crude and vacuum distillation
  • Coker
  • FCC
  • Distillate hydrotreater
  • Hydrocracker
  • Reformer
  • Gas conversion.

Most process units can achieve a mass balance within 1% during a test run. This allows the process engineers to effectively evaluate and optimize their units with confidence. Studies have shown that poor measurements can often lead to improper decisions that affect both the profitability and the safety of the operating unit. Improvements in the accuracy of data can lead to several million dollars in improved profitability.

Yield accounting and data reconciliation

As is the case with most refineries, yield-accounting and data-reconciliation software systems are utilized at the Luján de Cuyo refinery. The quality of the reconciliation depends on the uncertainties of the measurement points, or nodes, that are used in the mass balance system. FIG. 6 shows the importance of accuracy on the ability to reconcile data. For each measurement point, the uncertainty must be entered into the software, and that uncertainty is utilized to reconcile the data. For example, if a measurement device with an uncertainty of 1% is reconciled with another measurement device with the same uncertainty, the accuracy of the reconciled measurement is only 0.7%. However, if a device with an uncertainty of 0.1% is reconciled with the device with an accuracy of 1%, the accuracy of the reconciled measurement improves to 0.07% (FIG. 6).

FIG. 6. Accuracy of redundant measurement.
FIG. 6. Accuracy of redundant measurement.

More accurate data reconciliation results in a more accurate and reliable yield accounting system so that overall refinery performance measured against critical KPIs for the refinery can be effectively evaluated.


The importance of a mass balance—at both the process unit level and at a refinery-wide level—cannot be underestimated. At a process unit level, the mass balance data is the foundation upon which operating decisions are made and optimization is accomplished. At a facility-wide level, the mass balance verifies that custody transfer and quality measurements are accurate, and that the operator is paying for—and getting paid for—the materials being transferred in and out of the refinery. Visibility into the causes of loss is achieved, resulting in reduced loss and improved profitability. HP

The Authors

Related Articles

From the Archive



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