Linear Programming for Refinery Flow Allocation: Model Formulation and Constraints (part 2)
where is a sufficiently large positive coefficient. The secondary term is used to introduce preferences between alternative feasible flow allocations.
.
These constraints define the operating range of each line. If , then . If , the flow must satisfy:
Thus, a process line can either remain idle or operate within its allowable minimum–maximum throughput range.
The incoming flow must be distributed between the process lines and the unaccepted flow:
Therefore, .The variable represents the portion of the incoming flow that cannot be accepted by the process unit.
The unaccepted flow () represents the portion of the incoming flow that is not allocated to the process lines. Depending on the process unit configuration, a bypass route may or may not be available for this flow. If no bypass route is available, the unaccepted flow must be zero . In this case, the optimization model must ensure that the entire incoming flow is accepted by the available process lines. If this is not possible under the current operating constraints, the optimization problem has no feasible solution. In the Anylogic-based Petroleum Refining Library, such a situation can alternatively be handled by limiting the incoming flow to the maximum flow that can be accepted by the process unit.
If a bypass route is available, the unaccepted flow may be greater than zero and can be subject to additional constraints. For example, a minimum bypass flow can be required when the bypassed stream is needed to maintain the operation of another process unit or piece of equipment: . Similarly, a maximum bypass capacity can be imposed: . Therefore, the bypass flow can be treated not simply as residual flow, but as an additional flow path with its own operational constraints. This allows the optimization model to account for process configurations in which a portion of the incoming flow must either be processed by the unit or routed through a constrained bypass.
To account for preferred allocation between process lines, the model introduces a priority penalty:
The coefficients define the loading priority of the process lines. Since the optimization minimizes the weighted flow, a lower coefficient corresponds to a higher loading priority. In this example, the coefficients are assigned in descending order, , for example 110, 101, and 100. This establishes the preferred loading sequence as Line 3 → Line 2 → Line 1, tending to fully load a higher-priority line before allocating flow to the next line.
The total number of active process lines can be represented by:
where represents the number of currently active lines.
This variable can subsequently be used to introduce additional optimization criteria, for example, to prefer solutions using fewer operating lines.
The model also defines non-negativity constraints:
Finally, the line activation variables are binary:
The resulting model is therefore a mixed-integer linear programming (MILP) problem. Its solution simultaneously determines the operating state of each process line, the flow allocated to every line, and the minimum possible unaccepted flow for the current operating conditions of the process unit.
Consider a process unit with three parallel process lines. The available incoming flow is:
For each line, the selected operating mode allows a throughput from . The optimization returns: Second and third lines are active: while the remaining incoming flow is insufficient to meet the minimum throughput required to start Line 1: . The total accepted flow is: The resulting unaccepted flow is: