MixerLight Simulation in Petroleum Refining

       A MixerLight is a Anylogic-based Petroleum Refining Library simulation element used for mixer simulation in petroleum refining to combine two incoming material flows into a single output. The mixed flow can be routed to downstream process units, pipelines, storage, or other elements of a petroleum refining model. Mixer simulation in petroleum refining supports controlled material flow mixing within refinery process models and digital twin systems. The MixerLight is part of the broader group of separation and mixing simulation elements. Unlike MixerLight, the Mixer can combine multiple input flows into a single output flow.
MixerLight can select one of its two inlets by closing the other. The network determines the achievable throughput through the selected inlet.
       The priority mechanism in the standard AnyLogic FluidSplit and FluidMerge components does not guarantee that a higher-priority flow will be accepted or transferred in full. Although these components support neutral, proportional, and priority-based allocation algorithms, the priority mode represents a preference rather than a strict allocation rule.
       The configured priority coefficients are incorporated into the objective function of the underlying linear programming (LP) flow-network model as penalty or benefit factors. As a result, in complex networks, the LP solver may allocate flow from a lower-priority connection if this produces a more advantageous overall solution.
       MixerLight selects one inlet by closing the other. Flow through the selected inlet depends on available supply, outlet capacity, and valve limits.

Controlling Mixer Simulation in Petroleum Refining

       In petroleum refining simulation, the MixerLight provides several methods for controlling how two incoming material flows are combined into a single output.

       Setting the Mix Ratios
       The setMerge() method sets the relative flow values for the first and second inputs. The values do not need to be normalized. The mixer uses proportional merge mode when both factors meet the minimum threshold. An inlet whose factor falls below that threshold is closed. When either inlet is closed, the binary merge uses neutral mode. The mix can be specified as two individual values or as a two-element array: [firstInput, secondInput].

       Other Flow Controls
       The MixerLight provides direct control of the incoming flows and the resulting mixed stream. The setSpeedLimit() method limits the maximum outlet flow rate, while getSpeedLimit() and resetSpeedLimit() allow the current limit to be read or reset. The resetState() method removes active flow restrictions and restores the mixer to its default operating state. Output valve can be controlled with setClosed() and checked with isClosed(). getMixFactors() returns the configured factors. getMixRatios() returns the effective ratios for the current merge mode and inlet valve states. Call setSelectInput1(true) to select inlet 1 or setSelectInput1(false) to select inlet 2. isFirstOnly() checks for a positive first factor and a zero second factor.

       Properties and Events
       MixerLight uses direct flowchart connectors for two inlets and one outlet. outputProductId identifies the outlet product, and useIniSettings enables loading supported settings from an INI file. The onAfterInitialize() event is triggered after the component is initialized, while onSpeedChange(double newSpeed) reports the outlet rate in tons per hour when the change exceeds the configured threshold or the rate switches between zero and a positive value.
The deprecated setFixedMerge2(double secondarySpeedLimit) enables flowLimitMergeEnabled and stores the argument in totalFlowLimit. A positive totalFlowLimit caps the combined outlet rate. The calculation assigns the available contribution from inlet 2 first within that cap and uses inlet 1 for the remaining target.

MixerLight Statistics

       The MixerLight provides statistics for monitoring material flows, mix ratios, and flow limitations in refinery simulation models. The statistics interface is divided into input and output statistics, providing access to flow values and formatted summaries. MixerLight provides statistics for its two input flows and single output flow, including inlet contribution ratios, mix factors, flow-limited merge status, maximum output speed, and outlet valve state. Mixer provides additional statistics for analyzing active products.
       Input Statistics
       The input statistics object provides methods for monitoring the flow from both mixer inlets, their combined flow, each inlet’s ratio to the output flow, and the configured mix factors and ratios. MixerLightStatistics.Input extends AbstractInputFlowsProvider.
       Output Statistics
       The output statistics object provides methods for monitoring the outlet flow, checking whether it is positive, reading the outlet valve state, and formatting the maximum output speed when it differs from the default. MixerLightStatistics.Output extends AbstractSingleFlowProvider.

Conclusion

       Mixer simulation in petroleum refining allows two incoming material flows to be combined into a single output stream. MixerLight supports proportional mixing, flow-limited merge operation, inlet flow control, and outlet flow limits. Built-in statistics provide information about individual and total inlet flows, the resulting outlet flow, mix ratios, and active flow limitations, supporting monitoring and analysis within refinery simulation and digital twin models.

FAQ

1. What is MixerLight in petroleum refining simulation?
MixerLight is a simulation element that combines two incoming material flows into a single output stream.

2. How does MixerLight control the mixing of two flows?
The incoming flows can be combined using configurable mix factors and proportional merge mode.

3. Can MixerLight limit the flow from one input?
The deprecated flow-limited merge mode caps the combined outlet rate through totalFlowLimit. It allocates the available contribution from inlet 2 first within that cap, then uses inlet 1 for the remaining target.

4. Can the outlet flow be limited?
Yes. The maximum outlet flow rate can be controlled using setSpeedLimit(). The current limit can be obtained with getSpeedLimit() and removed with resetSpeedLimit().

5. Can the output be opened or closed?
Yes. The MixerLight has a single output flow that can be controlled using setClosed(). Its current valve state can be checked using isClosed().

6. What statistics are available?
MixerLight provides statistics for individual and total inlet flows, outlet flow, inlet contribution percentages, mix ratios, flow-limited merge mode, and outlet flow limitations.