Export Simulation Results to XLSX: Complete Guide

Why Exporting Simulation Results Matters

       A simulation run is only the beginning of the analysis. In a petroleum refining simulation, results are distributed across multiple Sources, Process Units, and Tank Farms. To analyze the refinery as a whole, these simulation results and statistics must be combined into a unified material balance. The Exporter component of the Petroleum Refining Library automates this process by collecting refinery simulation data and converting it into a structured XLSX report for analysis, verification, reporting, and sharing.

The Challenge of Collecting Simulation Statistics

       As a refinery simulation model grows, simulation data and statistics become distributed across an increasing number of components. Each Process Unit, Source, and Tank Farm may generate different inputs, outputs, storage values, and operational statistics. Collecting and exporting these simulation results manually requires additional code and makes it difficult to maintain a consistent reporting structure as the model evolves. A centralized export mechanism separates result collection from simulation logic and provides a common reporting process for the entire model.

What Is Exporter in the Petroleum Refining Library

       Exporter is a dedicated component of the Petroleum Refining Library for exporting simulation results and statistics from supported refinery model components to a structured XLSX report. Only one Exporter instance can be used in a model, following a Singleton pattern. It automatically finds supported Sources, Process Units, and Tank Farms and collects their statistics without requiring individual export logic for each object. The collected data is then organized into a unified report according to the standard structure of each component type.

Building a Unified Material Balance

       Exporter combines simulation statistics from different parts of the refinery into a unified refinery material balance:

Sources → Process Units → Tank Farms → Outputs

       This makes it possible to follow how material enters the refinery simulation, is processed, stored, and leaves the system. Results can be aggregated by hour, day, month, or year, depending on the level of detail required. The resulting report provides a common basis for checking material flows, verifying the simulation model, and analyzing refinery operations.

How Exporter Collects Simulation Results

       Exporter automatically scans the refinery simulation model and collects simulation statistics and results from supported Sources, Process Units, and Tank Farms. Objects can be ordered according to the actual material-flow sequence through the refinery, while individual objects can be excluded when they are not relevant to the analysis. This allows the same Exporter to produce either a complete refinery material balance or a focused report for a selected part of the model.

Standard Report Structure

       Exporter uses a standard structure for presenting simulation results from different refinery component types. This structure reflects the role of each component in the material balance. For Process Units, the report is organized around two main groups: Input and Output. This shows how much material enters the unit and what products or streams leave it during the selected reporting period.
       For Tank Farms, the structure also includes Residuals. The report therefore follows the basic sequence: Input → Residuals → Output. This additional information is essential for storage facilities, where part of the material may remain in the tanks at the end of the reporting period. The same structure is applied consistently across the model, making results from different components easier to compare and combine into a unified refinery material balance.

Export Simulation Results to XLSX

       After collecting and organizing the simulation results and statistics, Exporter generates a structured XLSX report for refinery simulation data. A new report is created for each simulation run and is automatically named My Report with the corresponding date and time. This makes the simulation results easy to inspect, filter, analyze, and share with specialists who are not directly involved in model development. The report can be generated automatically when the simulation ends or triggered manually during a run. Manual export is useful for long-running simulations or when an intermediate stage of the process needs to be analyzed before the simulation is complete. The exported file therefore serves as an external representation of the simulation results that can be used for model verification, operational analysis, reporting, and further data processing.

Analyzing Refinery Simulation Results

       Once refinery simulation results are exported to XLSX, the data can be used for a wide range of analysis tasks. The unified material balance provides a convenient basis for checking whether material flows through the model as expected and for identifying discrepancies between inputs, outputs, and residuals. The same report can also be used to analyze production volumes, process unit performance, storage levels, material flows, and other operational indicators. Because the data is presented in a structured tabular format, it can be filtered, compared, visualized, or processed further using standard Excel tools.
An important advantage is that the exported report can be shared with other specialists. Engineers, process experts, or analysts can work with the simulation results without having to open or understand the underlying AnyLogic model. This separates model development from result analysis, making simulation results more accessible and useful beyond the modeling environment.

Consistent Reporting Across Large Models

       Exporter maintains the same reporting principles as the refinery simulation model grows, making simulation data from different components and simulation runs easier to compare. Adding new Sources, Process Units, or Tank Farms should not require writing separate export logic for each object. Exporter provides a common reporting mechanism for supported components. Their statistics are collected and presented using the same principles, regardless of the size of the model. This consistency is valuable when working with complex refinery models containing many interconnected objects. It reduces custom reporting code and makes results easier to compare across different parts of the model and across different simulation runs. The result is a reporting process that can scale with the model while preserving a consistent structure for simulation statistics and material balances.

Customizing Exporter Reports

       Exporter provides a standardized report structure, but real refinery models often require additional information. The report can be extended with custom classes that add:
        - additional rows;
        - rows before or after totals;
        - incoming and outgoing flow breakdowns;
        - user-defined names for products and flows.
       This keeps the core report structure consistent while allowing the final report to reflect the specific requirements of a model.

Conclusion

       Exporter provides a standardized way to export refinery simulation results to XLSX, transforming distributed simulation statistics into a structured refinery material balance. It automatically collects results from supported Petroleum Refining Library components and exports them to XLSX for verification, analysis, and reporting. With configurable object ordering, selective reporting, intermediate exports, and report customization, Exporter connects the simulation model with the analysis of its results.

FAQ

1. What is Exporter in the Petroleum Refining Library?
Exporter is a component for automatically collecting simulation statistics from supported Petroleum Refining Library components and exporting them as a structured XLSX report.

2. What simulation results can Exporter collect?
Currently, Exporter collects statistics from Sources, Process Units, and Tank Farms. The collected data is organized into a unified material balance.

3. Can Exporter create a material balance for a refinery simulation?
Yes. Exporter combines the results of supported components into a continuous material balance, covering material entering, being processed, stored, and leaving the model.

4. What format does Exporter use for simulation results?
Exporter generates an Excel-compatible XLSX file. Each report is created with a name based on My Report and the date and time of generation.

5. Can Exporter generate reports during a simulation run?
Yes. A report can be generated automatically at the end of the simulation or triggered manually while the simulation is running. This is useful for long-running models and intermediate analysis.

6. Can the reporting period be changed?
Yes. Statistics can be aggregated by different time periods, including hours, days, months, and years.

7. Can I control the order of objects in the exported report?
Yes. Objects can be ordered so that the report follows the actual material-flow sequence through the refinery, for example by grouping a Source with the downstream Process Units and Tank Farms associated with it.

8. Can individual objects be excluded from the report?
Yes. Objects that are not relevant to a particular analysis can be excluded, allowing the report to focus on selected parts of the model.

9. Can the standard Exporter report be customized?
Yes. Exporter provides a separate customization mechanism that allows additional rows, flow breakdowns, and user-defined names to be added to the standard report structure.

10. Can Exporter be used with multiple Exporter components in one model?
No. The model is designed to use a single Exporter instance. This Singleton approach provides one central point for collecting and organizing the simulation results.

11. Why use Exporter instead of writing custom Excel export code?
Exporter provides a standardized mechanism for collecting statistics from supported Petroleum Refining Library components, building a material balance, organizing the results, and generating an XLSX report without implementing separate export logic for each component.

12. Who can use the exported XLSX report?
The report can be analyzed by model developers as well as process engineers, analysts, and other specialists who do not work directly with the AnyLogic simulation model.