Why Tank Farms Make Refinery Simulation Difficult?

       Refinery models are usually built around continuous process units and transport streams, where material flows can be described in a relatively smooth and well-structured way. Tank farms, loading racks and many other elements disrupt this assumption by introducing a residual-based system layer that couples production, logistics, and planning into a single constrained system.
       Tank farms introduce a storage-dependent layer that couples continuous material flows with discrete logistics decisions. This coupling makes system behavior dependent on inventory distribution rather than only flow rates.. Every transfer depends on available capacity, product segregation rules, and downstream commitments, which means that the system state is history-dependent rather than purely rate-driven. Tank farms extend the material balance network by introducing storage variables that affect routing and allocation decisions. Small changes in residuals distribution can make a previously optimal plan infeasible due to storage and logistics coupling. As a result, tank farms as many other components often determine whether a refinery plan is actually executable, not just optimal in theory. This effect becomes especially pronounced when tank farms have limited storage capacity and operate under strict minimum and maximum residual constraints. In such cases, their behavior cannot be approximated by an averaged or steady-state withdrawal rate. Tank farms are the only elements in refinery systems where physical storage state directly determines the feasibility of both logistics and optimization decisions.

Tank Farms as a Material Balance Node in Digital Twin Systems

       In refinery simulation, every unit and pipeline is typically treated as part of a material balance network where mass conservation must hold at all times. Tank farms, however, occupy a special position in this structure: they are storage nodes with history-dependent behavior that store, redistribute, and synchronize flows across the entire system.
Within a digital twin environment (such as AnyLogic-based refinery models), tank farms act as coupling points between continuous production and discrete logistics decisions. Unlike process units, their behavior depends not only on instantaneous flow rates but also on accumulated residuals, historical usage, and future shipment obligations.
       This makes tank farms a critical extension of the material balance graph. They enforce global conservation of mass while simultaneously introducing local constraints on capacity, product segregation, and operational rules. As a result, they do not simply pass oil and gas flows through the system—they redefine the feasible set of the optimization problem through state-dependent constraints..

Flowing vs Accumulative Tank Farms

       Tank farms in refinery systems typically operate in two distinct modes: flowing and accumulative, and this distinction is a major source of modeling complexity.
       Flowing tank farms behave as rate-driven buffering nodes with negligible inventory accumulation, where state dependence is minimal. They mainly dampen short-term fluctuations between units and downstream consumers, and are relatively close to continuous-flow behavior in simulation.
       Accumulative tank farms are state-driven storage systems where inventory evolution determines future routing, blending, and shipment decisions. They accumulate residuals over time and release them in discrete operations driven by shipment schedules, blending constraints, and operational rules. This creates path dependency: current flows depend on both past residual states and future delivery commitments.
Flowing systems are continuous-time processes, while accumulative systems introduce discrete state evolution.
The coexistence of both modes combines continuous transport dynamics with discrete storage operations.

Storage Constraints and Feasibility Region Collapse

       Storage limitations constrain the system through dynamic capacity and allocation restrictions that evolve with tank residuals. System constraints evolve as inventory levels change, continuously affecting admissible operating configurations. When multiple tanks approach capacity limits, available operating options become increasingly constrained.
       This effect is especially critical in integrated refinery models where production, blending, and shipment are tightly coupled. A theoretically optimal production plan may become infeasible simply due to storage saturation or insufficient buffer capacity, forcing re-optimization or operational fallback strategies.
       Thus, tank farms act as boundary-defining elements of the system state space. They do not only store material—they actively determine whether the refinery system can continue operating under given conditions.

Shipment Scheduling as a Discrete Optimization Problem

       Shipment operations introduce a fundamentally discrete layer on top of continuous refinery flows. While production and transfer rates can often be modeled continuously, shipment decisions are event-based: a tank is loaded, a batch is formed, and oil and gas flows are dispatched according to a schedule to the loading rack (if it's has a filling train).
       This transforms tank farms into a scheduling hub where residuals availability, contractual obligations, and transport constraints must align. Even when sufficient total volume exists in the system, shipments can fail due to segmentation across tanks, incompatible product grades, or timing mismatches.
       In optimization terms, this creates a combinatorial problem layered on top of the material balance network. Decisions are no longer only about flow rates but also about allocation of discrete batches across storage units and time windows. Small changes in residual distribution can cascade into missed shipments or forced rescheduling.
       As a result, shipment planning becomes one of the main sources of nonlinearity in refinery simulation, tightly linking logistics execution with upstream production and tank farm state.

Direct Flow vs Storage Routing Logic

       Refinery systems must continuously choose between direct transfer and storage-based routing, and this choice is a major source of simulation complexity.
       Direct flow moves oil and gas flows immediately between units under pipeline and process constraints, with minimal state dependency. Storage routing, however, introduces tank farms as intermediate decision points where material is held, redistributed, and later allocated to blending or shipment.
       The key difficulty is that routing is not fixed. It depends on real-time residual levels, capacity limits, blending requirements, and downstream demand timing. The same stream may bypass storage in one scenario and be routed through tanks in another, depending on system state.
       Refinery tank farms operate in two modes: flowing and accumulative, combining continuous transport behavior with discrete storage operations. Errors in routing logic can lead to infeasibility—such as overfilled tanks, missed shipments, or broken blending constraints—even when overall mass balance is preserved.

Why Tank Farms Transform LP Into Hybrid Problem?

       Most refinery optimization models assume that oil and gas flows can be redistributed smoothly across the system as long as mass balance and capacity constraints are satisfied. Tank farms invalidate this assumption by introducing state-dependent constraints and discrete operational decisions.
       Unlike process units, tank farms impose segmentation into physical storage locations, each with its own limits, product compatibility rules, and operational status. This means that two scenarios with identical total residuals can have completely different feasibility outcomes depending on how they distributed across tanks.
       In addition, decisions such as blending, shipment, and routing are tightly coupled through residual inventory. A small change in one tank residual can cascade through the system, affecting multiple downstream constraints simultaneously and invalidating previously optimal solutions.
       As a result, classical linear or even smooth nonlinear optimization approaches struggle to capture real refinery behavior. Tank farms effectively transform the problem into a system of continuous flows and discrete state transitions, where feasibility and optimality must be evaluated together rather than separately.

       Tank farms are the most common example of this behavior, but they are not the only ones. Loading racks can exhibit similar dynamics, as they may contain significant residual volumes and are strongly dependent on the availability and scheduling of rail tank cars. This introduces additional constraints and variability in shipment operations, which can substantially affect the feasibility of optimization plans and further increase the coupling between logistics, storage, and production decisions.

Conclusion: Tank Farms as the Core Source of Refinery Complexity

       Tank farms define how inventories interacts with production and logistics constraints, determining the operational feasibility of refinery systems. By introducing stateful storage, discrete decision points, and strict capacity and quality constraints, they fundamentally reshape how material flows can be planned and executed.
       In a digital twin context, including AnyLogic-based simulation environments, tank farms are the main reason refinery systems cannot be reduced to simple continuous flow networks or classical optimization models. They couple production, blending, and logistics into a single interdependent system where feasibility is continuously evolving.
       Tank farms determine which flow configurations are physically possible. They act as the constraint layer that binds material balance, storage logic, and shipment scheduling into one coherent—but highly nonlinear—system.

FAQ

1. Why are tank farms so important in refinery simulation?
Tank farms define how material is stored, buffered, and redistributed. They directly affect whether production and shipment plans are feasible solution space, not just optimal. Without them, simulation models miss critical operational constraints.

2. What is the main difference between flowing and accumulative tank farms?
Flowing tank farms behave like near-continuous buffers with minimal storage time, while accumulative tank farms store residual over time and release it in discrete operations driven by demand, blending, or scheduling constraints.

3. Why do tank farms make optimization more difficult?
They introduce discrete decisions (storage allocation, routing, shipment timing) on top of continuous flow dynamics. This structure breaks assumptions used in linear and smooth nonlinear optimization models.

4. How do tank farms affect material balance?
They preserve global mass balance but introduce local constraints on where and when material can be stored or moved. This changes the feasible set of the entire system dynamically.

5. What role do tank farms play in blending?
Tank farms are where blending is physically realized. Product quality depends on how streams are distributed across tanks, making residual structure directly tied to specification compliance.

6. Why can two identical inventories lead to different outcomes?
Because distribution across tanks matters. Even if total volume is the same, constraints like capacity limits, product segregation, and routing rules can lead to different feasible operations.

7. How do tank farms interact with shipment planning?
Shipments depend on available batches, tank compatibility, and timing constraints. Even sufficient total residual does not guarantee shipment feasibility if material is not properly allocated.

8. Can refinery models ignore tank farms for simplification?
Only in very abstract models. In realistic digital twin systems or optimization tools, excluding tank farms leads to infeasible or overly optimistic results.

9. How are tank farms represented in digital twin systems like AnyLogic?
They are modeled as stateful storage nodes within a material flow network, with constraints on capacity, flows, blending logic, and shipment scheduling.

10. What makes tank farms a bottleneck in refinery systems?
They combine storage limits, discrete logistics decisions, and quality constraints. This combination makes them the primary source of infeasibility and scheduling complexity in refinery operations.