Source Statistics in Refinery Simulation

       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 refinery production monitoring, daily and monthly production planning, and historical performance analysis in AnyLogic simulation models.
       The API is organized into four groups:
        - Output — current and source-level output flows.
        - Plan — planned values, plan completion, and completion status.
        - Database — historical planned and actual values.
        - Properties — source and product identifiers.
       Together, these production performance metrics provide the data needed for refinery production monitoring, production plan execution analysis, historical reporting, time-series production analysis, and operational dashboards in refinery simulation models. This allows engineers to compare actual and planned production, analyze source performance, and evaluate refinery operating results 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.

Output Statistics

       Output Statistics provide real-time information about material leaving the Source in a refinery simulation. They can be used to monitor source output, analyze individual source elements, evaluate production flow rates, and determine whether the Source currently has an active output flow. These metrics support refinery production monitoring and operational analysis of simulated material flows. The API supports both mass and mass-flow measurements, allowing engineers to analyze production volumes, current output rates, and production flow statistics. These output measurements are particularly useful when analyzing feedstock deliveries and production flows across interconnected oil and gas facilities, such as those represented in crude oil supply chain simulation models. In an AnyLogic refinery simulation, these measurements can be used to monitor material throughput and evaluate the performance of individual Source elements. Source output statistics are particularly useful when analyzing feedstock deliveries from oil and gas fields to refinery facilities. For a broader view of these material flows, see our article on crude oil supply chain simulation for refineries, which covers pipelines, tank farms, feedstock prioritization, and refinery processing constraints.
       Source output statistics can also be used to analyze the continuous material flows generated from production plans in refinery simulation. The conversion of discrete production plans into continuous flow profiles is described in our article on flow smoothing for digital twin simulation, including its impact on downstream tank farms and refinery process units.
       Source output monitoring is an important part of integrated refinery logistics, where crude oil supply, transportation, storage, and processing are interconnected. See the Crude Oil Supply Chain Simulation solution for an example of modeling these interactions.

Plan Statistics

       Plan Statistics provide production performance metrics for evaluating how closely actual Source output follows the configured production plan in refinery simulation. The API supports both daily and monthly production planning and provides plan values, plan completion ratios, and completion statuses. These metrics help engineers evaluate actual vs planned production and identify deviations in refinery production plan execution. Production plan execution can also be coordinated through request-based production planning, where downstream requirements and operational information influence upstream production decisions.
       In refinery simulation, production plan execution is closely connected with the conversion of planned volumes into continuous operating flows. The relationship between production planning, flow smoothing, and downstream simulation behavior is discussed in Flow Smoothing for Digital Twin Simulation

Database Statistics (Historical Statistics)

       Historical Statistics provide access to stored planned, actual, and secondary plan values for individual source elements. Similar performance metrics can be used for other refinery subsystems, including tank farms, where simulation statistics support the analysis of material flows, storage utilization, residuals, and operational performance. When statistics saving is enabled, SourceStatistics maintains historical production data and time-series production data that can be queried by simulation time, date range, or month. This enables historical flow analysis, production reporting, and comparison of planned and actual refinery production over time.

Source Properties

Source Properties provide basic metadata for identifying source elements and their associated products in an AnyLogic refinery simulation model. They are useful when applications need to discover configured source IDs, map a source element to its product, and connect production flow data with specific refinery products. They are useful when applications need to discover configured source IDs or map a source element to its product.

Applications of Source Statistics

Source Statistics in refinery simulation can be used throughout the refinery simulation lifecycle, from model debugging and refinery production monitoring to production plan execution analysis and historical production reporting. These capabilities help engineers analyze Source output, compare actual and planned production, and evaluate production performance using the four functional groups provided by SourceStatistics: Output, Plan, Database, and Properties. In a refinery simulation, Source Statistics can help monitor variable feedstock production rates and evaluate how changes in upstream supply affect downstream refinery operations. These interactions are discussed in more detail in our guide to crude oil supply chain simulation.
Source performance monitoring becomes particularly valuable when feedstock production is part of an integrated refinery supply chain. The Crude Oil Supply Chain Simulation solution demonstrates how crude oil supply, transportation, storage, and refinery operations can be modeled as an interconnected system.

Conclusion

Source Statistics provide a consistent API for monitoring Source output, evaluating production plan execution, and analyzing historical performance in refinery simulation. The four statistics groups—Output, Plan, Database, and Properties—cover both operational and planning-related analysis.
By combining actual output with planned production and historical data, SourceStatistics helps engineers monitor refinery production, evaluate plan performance, and build reporting or analytical applications.

FAQ

1. What are Source Statistics in refinery simulation and production monitoring?
Source Statistics provide production performance metrics for monitoring Source output, evaluating production plan execution, and analyzing historical production flow data through the SourceStatistics API in refinery simulation.

2. What statistics are available for a Source?
SourceStatistics provides four functional groups: Output, Plan, Database, and Properties. They cover current output, production plans, historical data, and source/product identification.

3. How can I get the total Source output?
Use getTotalFlow(MeasurementType measType) to retrieve the total outgoing flow across all source elements in tons or tons per hour.

4. Can Source Statistics provide output for an individual source element?
Yes. getFlowBySourceId() returns the output flow for a specific source element and supports cumulative mass, incremental mass, and flow-rate measurements.

5. Does SourceStatistics support daily and monthly production planning in refinery simulation?
Yes. The Plan Statistics API supports both daily and monthly production planning and provides plan values, completion ratios, and completion statuses for evaluating refinery production plan execution.

6. How can I check production plan completion?
Use getPlanCompletion() to calculate the plan completion ratio for a selected source element and planning period. getPlanCompletionStatus() can then return the corresponding PlanCompletionStatus.

7. Can Source Statistics store historical production data from a refinery simulation?
Yes. When statistics saving is enabled, SourceStatistics maintains time-series production data containing planned, actual, and secondary plan values for individual source elements.

8. Can historical Source data be queried by date or month?
Yes. Historical data can be retrieved by simulation-time range, calendar month, YearMonth, or date range.

9. How can I identify the product associated with a source element?
Use getProductIdBySourceId(int sourceId) to retrieve the product identifier associated with a source element. getSourceIds() can be used to retrieve the identifiers of all source elements.

10. What are Source Statistics used for in refinery production monitoring?
Source Statistics can support refinery production monitoring, production planning, production plan execution analysis, historical production analysis, time-series reporting, product identification, model debugging, and operational dashboards in AnyLogic refinery simulation models.