#01 What is Petroleum Refining Library?

Oil and gas processing facilities are complex systems involving feedstock reception, processing, storage, and product shipment. In the era of digital transformation, digital twins and simulation modeling have become powerful tools for supporting operational and planning decisions in the oil and gas industry. The Petroleum Refining Library (PRL) for AnyLogic is a process simulator designed to facilitate the development of realistic digital twins of oil and gas facilities.

Petroleum Refining Library

is a process simulator for AnyLogic focused on operational and production management
Oil and gas processing facilities are complex systems involving feedstock reception, processing, storage, and product shipment. In the era of digital transformation, digital twins and simulation modeling have become powerful tools for supporting operational and planning decisions in the oil and gas industry. The Petroleum Refining Library (PRL) for AnyLogic is a process simulator designed to facilitate the development of realistic digital twins of oil and gas facilities.
Petroleum Refining Library is a process simulator for AnyLogic. PRL provides a comprehensive framework for building digital twins and solving a wide range of operational and planning tasks:
  1. Feedstock distribution. The library supports the modeling of crude oil, natural gas, condensate, and other feedstock flows. It enables engineers to analyze different routing strategies and distribute feedstocks between process units while considering capacity limitations and operating constraints.
  2. Production planning. PRL allows users to create production schedules, evaluate product output scenarios, and estimate resource requirements. Different operating strategies can be compared to achieve production targets and maximize facility utilization.
  3. Process unit management. The library enables detailed simulation of processing units and their operating modes. Engineers can model equipment performance, switching between technological schemes, maintenance activities, and interactions between interconnected units. As a chemical process simulator, PRL helps evaluate the impact of operational decisions before implementing them in real facilities.
  4. Reservoir park management. Storage facilities and tank farms can be represented with realistic operational logic. The library supports inventory tracking, product accumulation, blending operations, and capacity constraints, providing better visibility of storage system performance.
  5. Shipment planning. PRL allows users to model product withdrawal requests and transportation operations. Various shipment priorities and loading strategies can be evaluated to ensure that contractual obligations and production targets are satisfied.
  6. Optimization schemes. The library provides mechanisms for integrating optimization algorithms with simulation models. Users can perform bottleneck analysis, evaluate alternative operating strategies, and improve facility performance using a process simulator integrated with advanced planning workflows.
Combined with external databases and enterprise information systems, these capabilities enable the development of realistic digital twins that support production planning, storage management, shipment scheduling, process optimization, and scenario analysis. As a result, Petroleum Refining Library helps engineers and decision-makers improve operational efficiency and make more effective strategic decisions.
Petroleum Refining Library is fully integrated into the AnyLogic simulation environment and provides a comprehensive set of components for modeling oil and gas processing facilities, including process units, tank farms, sources, and blending and splitting nodes. Flexible settings and parameters allow engineers to accurately represent real-world assets.

Applications of Petroleum Refining Library

Refinery Production Planning
Tank Farm Optimization
Pipeline Simulation
Digital Twin Development
Supply Chain Simulation
In addition, Petroleum Refining Library includes a large collection of reusable Java class templates that provide advanced modeling capabilities and significantly simplify the development, customization, and maintenance of large-scale AnyLogic models. These utilities cover many common tasks encountered in industrial simulation projects and allow engineers to focus on process logic instead of implementing supporting infrastructure from scratch.
  • Control and model management.The library contains classes for processing control requests and model commands. They support object identification, state management, serialization, and replay mechanisms, enabling the creation of controllable and reproducible digital twins.
  • Data export and reporting. Shared export utilities provide convenient mechanisms for collecting and writing structured simulation results to Excel and other external formats. This simplifies reporting and integration with corporate information systems.
  • Maintenance and repair scheduling. Specialized classes support equipment repair planning under operational constraints. They efficiently track maintenance intervals and dynamically apply schedule changes during simulation, making it possible to represent realistic maintenance strategies.
  • Statistical analysis tools. The library includes a wide range of statistical classes for collecting and processing information about material flows, equipment utilization, loading levels, inventories, and other performance indicators. These tools provide detailed insight into system behavior and simplify model analysis.
  • Centralized model constants. Configuration classes provide centralized access to model parameters and constants loaded from databases or external sources. This approach improves maintainability and facilitates scenario management.
  • Plant synchronization mechanisms. The library contains utilities for coordinating operating modes between interconnected facilities and process units. Such mechanisms are especially useful for building integrated supply chain and cluster-level models.
  • Extensible Java framework. Beyond these examples, the library contains numerous additional Java utilities and templates designed to accelerate the development of industrial-scale oil and gas models. These components provide a solid software foundation for creating flexible, maintainable, and highly customized digital twins in AnyLogic.
As a result, Petroleum Refining Library not only provides domain-specific simulation blocks, but also delivers an extensive software framework that helps engineers develop sophisticated oil and gas models faster and with significantly less programming effort.
Petroleum Refining Library is intended for engineers, researchers, and developers working on digital twins for oil and gas facilities. It is used by refineries, gas processing plants, universities, research organizations, and AnyLogic users developing advanced process and production models. With Petroleum Refining Library, engineers can concentrate on solving real industrial challenges instead of spending time building simulation infrastructure from the ground up.

To demonstrate the capabilities of the library, let us consider a simplified gas condensate processing plant. A condensate stabilization unit operates in two modes — stabilization and deethanization — producing several products that are accumulated in dedicated tank farms before shipment. Because the LPG storage capacity is limited, the operating mode must periodically switch when storage is full or production targets are achieved. The model records product flows and enables engineers to evaluate production plans and analyze facility utilization. Let's do it with Petroleum Refining Library!
The model of this gas condensate processing plant is implemented in AnyLogic using the Petroleum Refining Library.
Feed sources simulate unstable gas condensate inflow and support different planning modes. They are connected to the condensate stabilization plant, which flexibly defines product separation and output streams.
The stabilization unit is connected to tank farms, which provide flexible configuration of product withdrawal priorities. In this example, only Priority A is used, ensuring that tank farms are filled to meet the current month's shipment targets. The product dispatch nodes dynamically monitor plan execution and support different withdrawal strategies, including maximum-rate operation, uniform withdrawal, and daily scheduled withdrawal.
After the simulation starts, the feed sources begin sending unstable gas condensate to the stabilization unit according to the specified production plan. The feed then enters the stabilization plant, which consists of two process lines. At the moment, one line is operating in stabilization mode, while the other is operating in deethanization mode. At certain periods, both lines switch to deethanization mode simultaneously, as shown now. This behavior is caused by the limited capacity of the NGL receiving tank farm, which periodically becomes completely full. When both tanks are filled and no additional NGL can be accepted, the plant automatically switches to deethanization mode. If we accelerate the simulation, we can see that as storage capacity becomes available again, one of the process lines returns to stabilization mode, while the other continues operating in deethanization mode.
In addition to the NGL reservoir park, the model includes several other parks. However, due to their large capacities, they do not significantly affect the operation of the process unit. As time progresses, production targets for all product streams are successfully achieved. At the same time, the product dispatch nodes gradually approach one hundred percent completion of the scheduled shipment targets.
This example demonstrates how the Petroleum Refining Library for AnyLogic can be used to model real-world oil refining and gas condensate processing facilities with a high level of detail.