ProductMixer Control in Refinery Simulation

ProductMixer Runtime Control

       Modern refinery product blending simulation requires more than simply calculating an optimal product blend. Engineers often need to modify blending parameters during simulation, switch between automatic and manual optimization modes, respond to changing feedstock conditions, update quality constraints, temporarily disable product production, or integrate the blending process with external optimization and production planning systems. ProductMixer provides a comprehensive product blending control framework that supports these tasks without requiring modifications to the refinery simulation model.
       ProductMixer combines flexible configuration, event-driven control, and a public ProductMixer API to manage refinery product blending throughout simulation execution. The component supports both automatic and manual blending algorithms, dynamic configuration updates, optimization control, flow rate management, runtime events, and integration with other Petroleum Refining Library for Anylogic components such as FlowQuota. These capabilities allow refinery digital twins to reproduce realistic blending operations while maintaining full control over optimization behavior and product quality requirements.
       Learn how ProductMixer performs automatic optimization in Automatic Product Blending or how to define custom optimization models in Manual Product Blending. For a detailed description of available runtime metrics and performance indicators, see ProductMixer Statistics.

Initialization and Configuration

       ProductMixer behavior is configured through a set of configuration properties that define the product blending algorithm, optimization objectives, product quality constraints, flow limits, additive management, and external integrations. Most settings can also be loaded from an external INI file, allowing operating conditions to be updated without rebuilding the simulation model.
ProductMixer supports both Automatic and Manual Product Blending modes. Both operating modes expose the same ProductMixer runtime API, allowing applications to switch calculation behavior without changing the surrounding refinery simulation logic. In automatic mode, the component builds and solves the LP optimization model based on configured constraints. In manual mode, the optimization problem is fully defined by the user.
       The component also allows engineers to configure input and output flows, residual streams, flow limits, product quality constraints, balance additives, and integration with external components such as FlowQuota, providing flexible control over refinery blending operations.

       The following sections describe the ProductMixer public API, including configuration properties, runtime methods, events, and advanced configuration options available to application developers.

Configuration Properties

       ProductMixer behavior is defined by a set of configuration properties that specify blending mode, flow configuration, additive management, automatic recalculation, and external integrations before simulation starts.. Blending calculations can be enabled or disabled at any time during simulation. When calculation is enabled, the component distributes incoming flows between the final product and residual streams according to the selected blending mode and optimization constraints. When calculation is disabled, all incoming flows are automatically redirected to the corresponding residual outputs without producing the final product.
Product blending can be recalculated automatically when operating conditions change or triggered manually through the public API. Automatic recalculation occurs in response to changes in incoming flow rates, seasonal constraint updates, configured recalculation dates, and other runtime events, ensuring that the blending solution remains consistent with current refinery operating conditions.

       The following ProductMixer configuration properties define the initial behavior of the component before refinery simulation starts.These settings specify the blending mode, flow configuration, additive management, and external integrations that remain active throughout the simulation unless modified programmatically.

General Configuration

Flow Configuration

Balance Additive Configuration

Additive Configuration
       Together, these configuration properties provide comprehensive control over ProductMixer behavior, including calculation modes, flow routing, additive management, automatic recalculation, and integration with external refinery components. Most properties can be configured during model initialization, while selected settings also support runtime updates through external configuration files or the public API.

Public Methods

       The ProductMixer API exposes a set of public methods for controlling refinery product blending and accessing optimization data during simulation. These methods allow applications to trigger recalculation, enable or disable product blending, retrieve the optimization model and results, and access product quality constraints and runtime information.

Calculation Control

Optimization

Status and Constraints
       All methods are available throughout simulation execution and can be called from events, custom Java code, or external control logic. Together, these ProductMixer API methods provide comprehensive runtime control over refinery product blending operations. They support blending execution, optimization management, and access to runtime information, enabling seamless integration with custom refinery applications, production planning systems, and digital twin models.

Public Events

       ProductMixer provides several runtime events that allow engineers to customize refinery product blending behavior, react to changing operating conditions, and integrate the component with external refinery control logic. These events support post-initialization configuration, monitoring of incoming flow changes, execution of custom optimization workflows, and collection of additional runtime statistics.
       Together, these events provide an event-driven mechanism for extending ProductMixer behavior. Events are optional and do not affect the default ProductMixer behavior unless custom logic is implemented. They allow applications to react to initialization, monitor changes in operating conditions, process optimization results, and collect additional runtime information without modifying the internal blending algorithm.

Advanced Configuration

       ProductMixer exposes an internal Constants object for advanced ProductMixer API configuration, database mappings, debugging options, and visualization settings. These parameters are typically configured once during model development and rarely require modification during normal simulation runs. The Constants object can be customized using the provided builder before simulation starts. Unlike configuration properties, these constants are intended primarily for library customization rather than day-to-day model configuration.

Conclusion

       ProductMixer provides a comprehensive runtime API and control framework for refinery product blending. Its flexible configuration, event-driven architecture, and optimization control capabilities allow engineers to adapt blending behavior, respond to changing operating conditions, and integrate external production planning and optimization systems without modifying the simulation model. Together with its ProductMixer API, configuration properties, runtime events, and advanced customization options, ProductMixer provides a complete control framework for refinery product blending simulation.

FAQ

1. Can ProductMixer operate without optimization?
Yes. ProductMixer supports both automatic and manual operating modes. In manual mode, the entire optimization model is defined by the user.

2. Can product blending be disabled during simulation?
Yes. Product blending calculations can be enabled or disabled at runtime. When disabled, all incoming flows are automatically redirected to the corresponding residual output streams.

3. When is ProductMixer recalculated?
ProductMixer can recalculate automatically when operating conditions change, such as input flow updates, seasonal constraint changes, configured recalculation dates, or it can be triggered manually through the public API.

4. Can ProductMixer use balance additives?
Yes. ProductMixer can automatically include a balance additive with configurable minimum and maximum dosage limits to satisfy product quality constraints.

5. Can ProductMixer be integrated with other refinery components?
Yes. ProductMixer can interact with components such as FlowQuota and respond to runtime events, allowing integration with production planning, optimization workflows, and refinery digital twins.

6. Does ProductMixer provide runtime events?
Yes. The component provides callbacks for post-initialization processing, input flow changes, and optimization completion, enabling event-driven control during simulation.

7. Can ProductMixer be integrated with external optimization systems?
Yes. Its runtime API, configurable optimization model, and event-driven architecture simplify integration with production planning systems, custom optimization algorithms, and refinery digital twin applications.