Petroleum Refining Library extends the AnyLogic simulation platform with refinery-specific maintenance algorithms that coordinate tank repairs, product redistribution, production planning, and storage capacity validation using an event-driven architecture.
Petroleum Refining Library simulates
tank repair as a controlled, event-driven process rather than a simple equipment state change. The objective of the algorithm is to prepare a storage tank for maintenance while preserving mass balance, maintaining product availability, and minimizing the impact on production and shipment operations.
When a repair request is received, the system first determines how many tanks should be taken out of service and automatically selects the most suitable candidates for maintenance. Tanks with the lowest inventory are preferred because they require the least amount of product redistribution. Whenever possible, shipment tanks and reserve tanks are excluded from consideration to avoid disrupting refinery logistics.
Before any maintenance begins, the algorithm evaluates whether the remaining tanks have sufficient free capacity to accommodate the product stored in the selected tank. If the available storage volume is insufficient, the repair operation is excluded from consideration. This prevents unrealistic situations in which a tank is removed from service without a feasible destination for its inventory.
If the capacity check is successful, the remaining product is transferred through a sequence of pumping operations. Rather than moving the entire residual instantaneously, Petroleum Refining Library simulates the redistribution process between connected tanks. As each receiving tank reaches its allowable capacity, the algorithm automatically selects the next available destination and continues pumping until the
repair tank reaches its minimum operating level.