At first glance,
refinery flow allocation may seem simple: an incoming feedstock stream can be divided between several process units using a few conditional rules. In a real refinery, however, these decisions are strongly interconnected, making a rule-based approach increasingly difficult to maintain. A single refinery feedstock stream may have several possible processing destinations, each with its own minimum and maximum capacity. Process units may also consist of several production lines with different capacities, throughput limits, and operating ranges. As a result, the model must determine not only how much flow each unit receives, but also how that flow is distributed between individual lines. The situation becomes more complex when operating priorities are introduced. Two units may both be able to accept the same feed, but overloading one may be much more undesirable than overloading the other. Most importantly, refinery process units cannot be optimized independently, because upstream feedstock allocation affects downstream processing, intermediate products,
storage and tank farm capacity, and overall production feasibility. Increasing the feed to an upstream unit also changes the production of intermediate products and therefore affects downstream process units, storage facilities, and their capacity requirements. A decision that is feasible for one unit can therefore make the overall production system infeasible. In addition, refinery optimization decisions combine continuous and discrete variables. Refinery flow rates are continuous, while decisions such as starting a production line, selecting an operating mode, or taking equipment out of service are discrete. A single process unit may have several mutually exclusive operating modes, each with different throughput and blending constraints. Equipment availability must also be considered. The nominal capacity of a unit or line may become unavailable because of maintenance, shutdowns, or other operating conditions.
These characteristics create a highly interconnected decision problem:
feed allocation → unit selection → line selection → operating mode → throughput → downstream feasibility
A sequence of if statements can represent individual rules, but it becomes increasingly difficult to manage when all these conditions must be satisfied simultaneously.
Linear programming (LP) and mixed-integer linear programming (MILP) provide a more systematic approach to refinery flow allocation: refinery operating logic is expressed through
material balances, capacity constraints, binary variables, equipment availability constraints, and an objective function, allowing the optimization solver to determine the best feasible allocation.