Source Statistics in refinery simulation provide a structured way to monitor Source output, evaluate production plan execution, and analyze historical production flow data in petroleum refining and oil and gas simulation models. The
Petroleum Refining Library provides these capabilities through the
SourceStatistics API, supporting daily and monthly production planning, current production monitoring, and historical performance analysis in AnyLogic refinery simulation models.
The SourceStatistics API is organized into four main components:
- Output — provides access to connected fluid blocks and valves and retrieves flow or mass values for individual source items through getFlowBySourceId(). The returned value depends on the requested measurement type and whether cumulative mass or mass produced during the current planning period is required.
- PlanCompletion — provides production plan execution metrics through getCurrentPeriod() and getMonthly(). Its nested Execution class exposes primary and secondary plan values, actual production, completion ratios, completion statuses, unfulfilled plan mass, and shortfall against the plan expected by the current simulation time.
- Database — provides historical planned and actual production data. Its methods support aggregation by model-time-step range, calendar month, and date range, as well as retrieval of time-series values as maps. When statistics saving is enabled, actual history is available in every planning mode. In unlimited planning, primary and secondary plan values are stored as NULL.
- Properties — provides source metadata, including source item identifiers through getSourceIds() and product identifiers through getProductIdBySourceId().
Together, these components provide the data needed for refinery production monitoring, production plan execution analysis, historical reporting, time-series analysis, and operational dashboards. Engineers can compare actual production against planned values, evaluate plan completion, identify production shortfalls, and analyze source performance over time.
Source Statistics can be used to monitor feedstock output and production performance within a broader refinery logistics model. A practical application of these concepts is presented in the
Crude Oil Supply Chain Simulation solution, which demonstrates how feedstock deliveries, pipelines, tank farms, and refinery operations can be modeled as an integrated system.
While production performance metrics show how a Source behaves during simulation,
Source Control in Refinery Simulation explains how its flow limits can be managed dynamically during model execution. The
FlowProvider architecture provides a unified interface for accessing flow information across compatible refinery simulation components.