Mixing Simulation in Petroleum Refining

       Mixing simulation in petroleum refining is used to combine multiple material flows into a single downstream flow in refinery process simulation models and digital twins. Petroleum Refining Library provides two components:
       MixerLight — combines exactly two incoming material flows.
       Mixer — combines any number of incoming material flows into a single output flow.
       Both components support proportional mixing and neutral mixing, dynamic changes in mixing coefficients, and flow constraints.They are commonly used in refinery process simulation to combine flows from parallel process units, storage tanks, tank farms, and alternative flow routes.
The key difference between the Petroleum Refining Library Mixer and the standard AnyLogic Fluid Merge component is the ability to guarantee that the entire flow can be received from a specific input.
Another difference is the ability to combine any number of incoming flows simultaneously, rather than being limited to two flows.
       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.
       The Petroleum Refining Library Mixer provides a different mechanism: guaranteed flow acceptance. A designated input can be treated as mandatory, ensuring that its available flow is accepted in full before the remaining capacity is allocated among other inputs.

How Mixing Simulation in Petroleum Refining Works

       Mixer and MixerLight perform material flow mixing using mixing coefficients. In proportional mixing mode, the coefficients define the relative contribution of each input flow. For example, coefficients [1, 2, 3] produce the following mixing ratio:
Input 1: 1/6; Input 2: 2/6; Input 3: 3/6. The coefficients do not need to be specified as percentages. A coefficient of 0 closes the corresponding input, while all-zero coefficients block the resulting flow.
       Mixer and MixerLight also support neutral mixing. In this mode, no predefined mixing ratio is enforced, and the flow is determined by the available incoming flows. In proportional mixing mode, the specified mixing ratios are preserved. If one input cannot provide the required flow, the total throughput is reduced rather than redistributing the missing flow among the other inputs.

Mass Balance and Flow Composition

       Mixer and MixerLight preserve mass balance according to the law of conservation of mass: tthe output mass flow equals the sum of all incoming mass flows. Incoming flows can represent different products. However, the base Mixer logic does not calculate their composition. It simply combines the incoming mass, while the output product is defined by the corresponding FluidEnter. The task of mixing different product streams to obtain an output product with the desired composition and properties is handled by the ProductMixer component.

Dynamic Mixing

       Once established, connections cannot be changed. Depending on the connectAfterStart parameter, input flows can be connected either during model initialization or after the simulation has started.
       Mixing coefficients can change dynamically during the simulation, allowing mixing proportions and material flow rates to be adjusted when operating conditions or operating modes change. New coefficient values take effect immediately without transition delays.
       Mixer and MixerLight are used in refinery process simulation to combine material flows from multiple sources into a single downstream flow. Typical applications in refinery process simulation include:
For example, gasoline produced by three parallel process units can be combined into one gasoline flow before further transportation, storage, or processing.

Conclusion

       Mixing simulation in petroleum refining provides a flexible way to combine multiple material flows into a single downstream stream in refinery simulation models and digital twins. MixerLight supports two inputs, while Mixer can combine any number of incoming flows. With proportional and neutral mixing, dynamic mixing coefficients, and flow constraints, these components can model flow consolidation across refinery process units, tank farms, storage systems, and refinery logistics.

FAQ

1. What is a Mixer in Petroleum Refining Library?
A Mixer is a component used to combine multiple incoming material flows into one output flow.

2. What is the difference between Mixer and MixerLight?
MixerLight — combines exactly two incoming material flows, while Mixer can combine any number of incoming flows.

3. How are incoming flows controlled in Mixer?
Incoming flows can be controlled using mixing coefficients and flow rates.

4. How do mixing coefficients work?
Mixing coefficients define the relative contribution of each incoming flow. For example, [1, 2, 3] produces a mixing ratio of 1/6 : 2/6 : 3/6.

5. What does a mixing coefficient of zero mean?
A coefficient of 0 closes the corresponding input. If all mixing coefficients are zero, the output flow is blocked.

6. What happens if one incoming flow is constrained?
In proportional mixing mode, the total throughput is reduced to preserve the specified mixing proportions. The missing flow is not automatically redistributed among the other inputs.

7. What is neutral mixing?
In neutral mixing mode, no predefined mixing ratio is enforced. The resulting flow depends on the available incoming flows.

8. Can Mixer connections be changed after the simulation starts?
Yes. Mixing coefficients can change dynamically, and new values take effect immediately without transition delays.

9. Can Mixer connections be changed during simulation?
No. Mixer connections are established only once and cannot be changed afterward. However, the connectAfterStart parameter allows the connection to be established after the simulation has started, effectively delaying its creation.

10. Do Mixer and MixerLight preserve mass balance?
Yes. The output mass flow equals the combined mass flow of the incoming streams, subject to flow availability and mixing constraints.

11. Can Mixer combine flows with different products?
Yes. However, the base Mixer logic does not calculate product composition. It combines mass flows, while the outgoing product type and name is defined by the connected FluidEnter.

12. Where can Mixer be used in refinery simulation?
Mixer can combine flows from parallel process units, storage tanks, tank farms, and alternative material flow routes.