ProductMixer Simulation for Petroleum Refining Digital Twins

       ProductMixer is designed to model refinery product blending and blend optimization in AnyLogic-based refinery digital twins. Modern refineries combine multiple intermediate streams to produce finished products through refinery product blending while meeting strict quality specifications. ProductMixer evaluates available streams, their properties, and product requirements to determine the appropriate blend.
       In Automatic Mode, ProductMixer uses linear programming (LP) to optimize the blend while respecting product specifications and operating constraints. Manual Mode allows engineers to define their own blending strategy, objective function, and constraints for the underlying linear programming optimization. During simulation, ProductMixer determines the accepted and residual portions of incoming streams and applies the resulting flow distribution to the model. When stream availability, flow rates, or product specifications change, the blend can be recalculated and updated dynamically.

Key Features

       Automatic Product Blending – performs automatic blending optimization using available streams, their properties, product specifications, and operating constraints.
       Manual Product Blendingallows users to define blending strategies, objectives, decision variables, and constraints.
       Fuel Quality Control – evaluates properties such as octane number, sulfur content, density, and Reid Vapor Pressure (RVP).
       Dynamic Recalculation – recalculates the blend when operating conditions or product specifications change.
       Residual Flow Management – separates residual portions of incoming streams from the finished product.
       Additive Management – optimizes balancing additive consumption while meeting product specifications.
       Performance Metrics – provides statistics for incoming flows, product contributions, residuals, quality constraints, additives, and optimization results.
       Digital Twin Integration – connects product blending with refinery process simulation, production planning, and operational analysis.

How ProductMixer Works

       During each blending cycle, ProductMixer evaluates the available refinery streams and active product specifications, then calculates the required blend using either Automatic or Manual Mode.

The workflow consists of five steps:
       1. Collect incoming streams and product specifications.
       2. Build or execute the blending model.
       3. Calculate the blend composition.
       4. Produce the finished product and route residual flows.
       5. Update performance statistics and wait for the next recalculation.

Operating Modes

       ProductMixer supports two operating modes for different refinery blending scenarios.
       Automatic Product Blending – automatically generates and solves an LP model using stream properties, product specifications, and operating constraints to determine the optimal blend for refinery blending operations.
       Manual Product Blending – allows engineers to define the objective, decision variables, and linear constraints, providing full control over the blending strategy.

Fuel Blending Properties

       ProductMixer separates stream properties from finished product specifications. Each incoming stream can have properties such as octane number, sulfur content, density, Reid Vapor Pressure (RVP), and other refinery-specific quality parameters. Fuel quality specifications define the required minimum or maximum limits for the finished product. During automatic blending, these specifications are converted into optimization constraints, allowing ProductMixer to determine a blend that meets the required product quality specifications.

Performance Metrics

       ProductMixer provides performance metrics for incoming flows, product contributions, residuals, quality constraints, additives, and optimization results in both Automatic and Manual modes. These metrics allow engineers to monitor blending performance, verify product quality, analyze residual streams and additive consumption, and evaluate optimization results during simulation.

Typical Applications

       ProductMixer can be used for fuel blending simulation, including gasoline and diesel blending, intermediate product preparation, feedstock allocation, production planning, and refinery scheduling across petroleum refining operations.

Example Model: ProductMixer Simulation in AnyLogic

Automatic blending mode (RON95 production)
       This example demonstrates RON95 gasoline blending optimization using ProductMixer under changing operating conditions. Five blending streams are used to produce RON95 gasoline: the 50–100°C fraction, the 85°C initial boiling fraction, isopentane, light reformate, and heavy reformate. Each stream enters the ProductMixer at its own flow rate, with a default flow rate of 10 t/h. ProductMixer adjusts the contribution of each stream according to the selected season—winter or summer—and objective: maximum product production or minimum balancing additive consumption. The maximum gasoline production rate is controlled by a slider, with a default value of 100 t/h. A downstream FlowQuota limits total gasoline production to 1,800 tonnes per day. MTBE is used as a balancing additive to increase the gasoline octane number. The model allows the minimum and maximum MTBE inclusion limits to be configured. As stream conditions change, ProductMixer dynamically adjusts the blend to maintain gasoline specifications while respecting production and additive constraints.
Manual blending mode (LDGC production)
       The second part demonstrates Manual Product Blending for LDGC (low-density gas condensate) production. Four streams enter the mixer, and the blend is optimized using user-defined equations and constraints derived from historical blending data for similar streams at the refinery. These refinery-specific relationships are incorporated into the linear programming model to reproduce established blending practices and produce on-spec LDGC, including:
        - 50–100°C && 85–180°C fractions at least 60%;
        - BP-85°C fraction at last 25%;
        - PHF [C5–C6] fraction at least 6%;
        - 50–100°C fraction in the heavy part: at least 15%.
       ProductMixer adjusts the incoming stream contributions to produce on-spec LDGC at the maximum permitted rate while respecting these blending constraints. The model also provides productMixer control stream flow rates, blending properties, and mixing limits can be changed directly through the interface. to observe ProductMixer's response in real time.
Important: This is not a video demonstration! It is a fully interactive digital twin running in AnyLogic Cloud. Feel free to experiment with the model by changing process parameters in real time.
Petroleum Refining Library free to try version can be download here
A working version of this model is also available on AnyLogic Cloud
Watch the full model walkthrough on our YouTube channel

Conclusion

       ProductMixer enables product blending simulation within refinery digital twins, helping model and optimize refinery blending operations under changing process conditions. Its combination of automatic and manual blending, product quality constraints, additive management, production limits, and runtime control provides a practical framework for simulating and analyzing refinery blending operations.

FAQ

1. Can ProductMixer produce different fuel grades?
Each ProductMixer is configured for a single product. To produce different products or grades, use a separate ProductMixer for each product, with its own product specifications and blending configuration.

2. Does ProductMixer support custom optimization models?
Yes. Manual Mode allows users to define their own decision variables, objective function, and linear constraints.

3. When is the blend recalculated?
ProductMixer can automatically recalculate the blend when inlet flow rates or product specifications change. Recalculation can also be triggered through the runtime API.

4. What happens if no feasible blend exists?
ProductMixer does not apply an infeasible blend. Depending on the configuration, non-compliant streams can be redirected to residual outputs, while a penalty-based objective can be used to minimize quality violations.

5. Can ProductMixer be integrated into a refinery digital twin?
Yes. ProductMixer is designed to operate within refinery digital twin simulations and adapt blending decisions to changing process conditions.

6. What statistics does ProductMixer provide?
It provides inlet and product flows, residuals, quality indicators, additive consumption, constraint evaluation, and optimization results through a unified API.