Tank Farm Simulation Additional Flows: Losses, Additives and Removable Streams in Refinery Digital Twins

       Tank farm simulation is a modeling approach used in oil and gas logistics to represent storage behavior in refinery networks and terminals. It supports refinery operations, where hydrocarbons are accumulated, stored, and dispatched under operational constraints. In modern refinery storage systems, simulation captures flow dynamics, pipeline inflows, and production fluctuations. Within a digital twin, tank farm models act as an intermediate layer between production and processing, enabling realistic flow and system interaction modeling. These models are widely used in production planning to ensure stable throughput and efficient coordination of refinery logistics. Tank farm simulation is also a key element in production planning, enabling coordination between storage capacity, inflow schedules, and downstream demand.
       Modern refinery and oil & gas logistics systems rely heavily on accurate tank farm simulation models to represent storage, buffering, and shipment of hydrocarbon streams. In digital twin environments such as the Petroleum Refining Library (PRL) implemented in AnyLogic, tank farms are not passive storage units but dynamic process nodes that directly influence material balance, product quality, and refinery logistics performance.
       A key limitation of simplified simulation approaches is the assumption that tank farms operate only with incoming and outgoing flows. In real industrial systems, however, hydrocarbon streams are continuously modified by additional physical and operational mechanisms such as losses, flow removals, and additives. These effects significantly impact simulation model accuracy and must be explicitly represented in a refinery digital twin model.
       This article describes how additional flows in tank farm simulation are modeled, how they influence mass balance, and how they are implemented in PRL components such as RpAccumulative and RpFlowing. These tank farm types differ both in their objectives and in their operational logic.This directly impacts production planning in refinery logistics and storage systems. Tank farm simulation supports operational decision-making by providing accurate visibility into storage levels, flow constraints, and dispatch conditions.

Tank farm simulation in refinery and oil & gas systems

       Tank farms are essential infrastructure elements in refinery and petroleum logistics networks. Within a tank farm simulation model, they operate as buffering and transformation nodes between upstream production unit; pipeline transport systems; refinery processing units; storage and shipping terminals.
       Their main functions include:
        - buffering feed streams;
        - stabilizing downstream process input;
        - enabling blending and quality adjustment;
        - supporting shipment scheduling and logistics planning;
        - decoupling production variability from consumption demand.
       In a digital twin refinery simulation, tank farms also serve as control points for residual management and flow regulation. However, realistic modeling requires accounting for secondary effects beyond simple mass transfer.

Material balance in tank farm simulation models

       The core principle of any refinery simulation system is conservation of mass. For tank farm systems, the generalized material balance can be expressed as:

Incoming Flow + Additives = Outgoing Flow + Losses + ΔResiduals

where:
       Incoming Flow – hydrocarbon feed entering the tank farm;
       Additives – injected chemical or blending components;
       Outgoing Flow – product leaving the tank system;
       Losses – mass lost due to physical or operational processes;
       ΔResiduals – change in stored residual inside tanks.

This equation is fundamental for:
  • refinery production planning
  • oil and gas logistics optimization
  • pipeline balancing
  • storage terminal operations
  • digital twin validation and calibration
Ignoring any of these components leads to systematic deviations between simulated and real system behavior.
Consider a tank farm system with the following conditions:
  • Incoming diesel flow: 100 t/h
  • Removable gas flow: 0.3 t/h
  • Losses: 0.5 t/h
  • Additives: 1.2 t/h
  • Inventory increase: +10 t/h
Resulting outgoing flow: 90.7 t/h
This example demonstrates how additional flows directly influence:
  • output mass
  • internal storage dynamics
  • system-wide material balance
Such calculations are critical for:
  • refinery production optimization
  • pipeline scheduling
  • storage terminal management
  • digital twin validation

Tank farm losses modeling in oil and gas systems

In real refinery storage systems, losses occur during:
  • tank filling and shipment operations
  • long-term storage (evaporation and breathing losses)
  • pumping and transfer operations
  • blending and circulation processes
These losses are particularly important for light hydrocarbon fractions, which exhibit higher volatility.

Component-dependent loss behavior

In multi-component hydrocarbon mixtures:
  • light fractions → high evaporation losses
  • medium fractions → moderate losses
  • heavy fractions → low losses
As molecular weight increases, the loss coefficient decreases nonlinearly. This behavior significantly affects at product composition stability; downstream refinery yield; blending quality consistency.

PRL implementation

In the Petroleum Refining Library (PRL):
  • losses are defined as a percentage reduction of output flow
  • losses are applied after internal tank operations
  • component-level redistribution follows volatility rules
  • lost material is fully removed from system balance
In the PRL library, losses are represented as a separate independent output stream of product composition, defined in the rp_modes_separation database table. Losses are explicitly identified by the unique identifier ID = LossId.

This ensures physical realism in tank farm simulation models used in digital twins.

Additives in refinery simulation models

       Additives are widely used in refinery operations to modify product properties and ensure compliance with specifications. Typical applications include:
  • octane enhancement in gasoline production
  • cold flow improvement in diesel fuels
  • corrosion inhibition in storage systems
  • oxidation stability improvement
  • regulatory marking and product identification
  • process-specific chemical conditioning
       Unlike physical flows, additives in simulation models are not treated as independent incoming streams. Instead, they represent post-processing modifications applied to outgoing product streams.

PRL implementation

In the Petroleum Refining Library (PRL):
  • additives are applied after loss calculation
  • they are defined as proportional increases in output flow
  • they do not affect tank inventory directly
  • their volume is treated as theoretically available (non-limiting)
Additives are configured via the Anylogic agent's menu using two parameters: additiveId (label: Output flow additive id) for specifying the additive identifier, and additiveRatio (label: Output flow additive fraction) for defining the relative proportion of the additive in the output stream.

This approach simplifies system topology while preserving correct material balance behavior.

Removable flow concept in tank farm simulation

       A removable flow is an incoming stream that enters a tank farm system but does not contribute to the outgoing product flow.
Removable flows represent:
  • purge gases and vent streams
  • internal process consumption
  • bypassed or diverted streams
  • temporary operational discharges
These flows are essential for representing internal system behavior that does not result in final product formation.

PRL implementation

In the Petroleum Refining Library (PRL):
  • removable flows are explicitly defined
  • they are excluded from output aggregation
  • they remain part of input balance accounting
  • they are removed internally within the tank farm model
The removable flow is configured via the component menu using the parameter inputFlowRemovable (label: O: Input flow, removable (FluidExit)), which defines an auxiliary input stream that is subsequently removed from the system as a separate fluid exit flow.

This enables accurate representation of internal consumption mechanisms in oil and gas digital twin systems.

PRL implementation

The Petroleum Refining Library (PRL) implements tank farm behavior using two core components:
RpAccumulative – accumulative tank farm model. This component represents storage systems where:
  • residuals accumulates over time
  • product is stored in multiple tanks
  • shipment is driven by scheduling logic
  • buffering between supply and demand is enabled
Key features include:
  • multi-tank structure
  • production schedule execution
  • integration with logistics planning
  • support for losses and additives
  • control of filling and withdrawal strategies
RpFlowing – flowing tank farm model
This component represents flow stabilization systems where:
  • storage is minimal or implicit
  • flow smoothing is the primary function
  • buffering is reduced compared to accumulative systems

Key features include:
  • continuous flow regulation
  • reduced residuals sensitivity
  • stabilization of downstream feed
  • simplified material handling logic

Types of Additional Flows in PRL

PRL supports three fundamental categories of additional flows:
Removable Flows
  • removed inside the system;
  • do not contribute to output;
  • represent internal consumption processes
Losses
  • percentage-based reduction of output mass;
  • distributed across hydrocarbon components;
  • represent physical inefficiencies
Additives
  • applied to outgoing product streams;
  • increase final mass or modify composition;
  • modeled as post-processing adjustments

Engineering Significance for Digital Twin Systems

Accurate modeling of additional flows is essential for modern refinery digital twin systems because it impacts:
       1 Production planning - accurate throughput estimation depends on correct mass balance representation.
       2 Logistics optimization - flow distortions propagate across pipeline and storage networks.
       3 Storage management - residuals deviations lead to incorrect shipment scheduling.
       4 Simulation fidelity - without additional flows, model behavior diverges from real systems.
       5 Product quality control - additives and losses directly affect final product specifications.

Conclusion

Modeling additional flows in tank farm simulation systems is essential for achieving high-fidelity representation of refinery and oil & gas logistics operations. Losses, removable flows, and additive injection are not secondary effects - they are core components of real industrial behavior.
The Petroleum Refining Library (PRL) implements these mechanisms through RpAccumulative and RpFlowing components, enabling robust and scalable digital twin refinery simulation models. By modeling storage constraints and flow interactions, tank farm simulation enhances operational decision-making in refinery planning and execution processes.

By incorporating these mechanisms, PRL-based tank farm models achieve significantly improved realism in:
  • material balance calculations
  • production planning
  • logistics optimization
  • refinery system simulation

FAQ

1. What is tank farm simulation?
Tank farm simulation is a computational method for modeling storage tank behavior in oil refineries, terminals, and oil & gas logistics networks. It describes how hydrocarbon flows are accumulated, stored, and dispatched under operational constraints.

2. Why is tank farm simulation important in refinery operations?
It ensures stable refinery operations by managing fluctuations in inflow and outflow, maintaining balance, and preventing bottlenecks in storage and transportation systems.

3. How is tank farm simulation used in oil and gas logistics?
It is used to coordinate pipeline flows, storage allocation, and product dispatching across refinery networks and terminals, improving efficiency and reducing operational risks.

4. What is the role of tank farms in a digital twin?
In a digital twin, tank farms represent the storage layer between production units and downstream processing, enabling realistic modeling of residual dynamics and system interactions.

5. How does tank farm simulation support production planning?
It helps optimize scheduling of inflows and outflows, ensuring that storage constraints are respected and that refinery throughput remains stable.

6. What are the main components of tank farm simulation models?
Typical components include input flows, output flows, losses, additives, storage constraints, and control logic for tank selection and dispatching.

7. Can tank farm simulation be implemented in AnyLogic?
Yes, tank farm simulation can be implemented in AnyLogic using discrete-event or hybrid modeling approaches, often as part of a larger refinery digital twin framework.

Last updated on 25.06.2026