Loading Rack Control in Refinery Simulation

      Loading Rack Control in Refinery Simulation defines how loading operations are managed dynamically while the model is running. A refinery loading rack must respond to train arrivals, available loading positions, product availability, schedules, priorities, and operational constraints. The model can determine which train should be processed, which loading position should be assigned, when loading can start, and when the train can be shipped. This dynamic loading rack management connects transportation, product storage, and loading resources into one operational process. Different control strategies can then be tested and compared based on key performance indicators such as truck waiting time, queue length, loading rack utilization, throughput, and turnaround time. This makes refinery and petroleum refining simulation a practical tool for evaluating refinery loading operations under both planned and changing operating conditions.

Loading Rack Control Methods

       During a simulation run, the loading rack can be controlled through a set of API methods that provide access to active trains, planned operations, product volumes, passportization, and loading flow rates. These methods allow the model to adjust loading operations dynamically rather than relying only on a predefined schedule.

       Train and Schedule Control
       The loading rack API provides methods for monitoring and controlling train processing:
       getActiveTrain() — returns the train currently being processed by the loading rack, including loading, passportization, or shipment operations.
       getPlannedTrains() — returns trains that are scheduled but have not yet been processed.
       forcePassportization() — forces the currently active train into the passportization stage, regardless of its current loading progress.
These methods can be used to build custom loading priority, loading rack scheduling, and operational control logic directly into the refinery simulation.

       Loading Flow Control
       The loading rate of an individual loading rack element can be controlled during the simulation:
       setInputSpeedLimitByItem() — sets the maximum input flow rate for a loading rack element in tons per hour.
       getInputSpeedLimitByItem() — returns the current flow rate limit.
       resetInputSpeedLimitByItem() — restores the flow limit to the system maximum defined by MAX_NODE_SPEED.
This allows the simulation to reproduce changing operating conditions, such as reduced loading rack capacity, temporary loading flow restrictions, or different loading strategies.

       Product Volume Monitoring
       getFillLevel(productId) returns the total fill level for a specified product in tons. The value combines the initially injected amount with the current volume stored in the wagon tanks.
       This provides a direct way to monitor product loading volumes during the simulation and use product availability as an input to loading decisions. Together, these methods provide the basic controls required for dynamic loading rack management: monitoring the current operation, controlling the loading sequence, adjusting flow rates, and tracking product volumes while the simulation is running.

Loading Rack Configuration Parameters

       In addition to API methods, the loading rack can be configured through a set of parameters that define its operating strategy, flow restrictions, wagon turnover, scheduling, and process timing. These parameters determine how the loading rack behaves during a simulation run and allow different operational scenarios to be modeled without changing the underlying control logic. The parameters can be combined to represent different loading rack operating strategies, including priority-based loading, schedule-based operations, direct flow, wagon turnover, and product flow restrictions.

Loading Strategy and Schedule
Parameters such as isLoadingPriorityOverSchedule, isDirectFlowMode, and enableDirectModeAfterSchedule determine how the loading rack selects and processes operations. This makes it possible to prioritize actual loading conditions over the planned schedule or switch to direct-flow operation after scheduled trains have been processed.

Wagon Turnover and Train Formation
Wagon-related parameters define how wagons become available for loading and how their turnover is represented in the simulation. useWagonTuner accounts for wagon turnover by returning wagons to the available pool after a defined period rather than keeping them permanently available. fullWagonSetRequired controls whether a complete required set of wagons must be available before supplying wagons to the loading operation. It does not define the train departure condition.

Flow and Loading Capacity
inputSpeedLimit, inputFlows, and outputFlows control the flow conditions of the loading rack. They can be used to model different loading capacities, product flows, and operational restrictions.

Timing and Scheduling
The remaining parameters define operational timing, train arrival intervals, passportization, wagon supply and removal, and schedule repetition. Together, they allow the simulation to reproduce realistic refinery loading logistics and wagon turnover processes.

Combining Methods, Parameters, and Events

       Loading rack control is based on three complementary mechanisms: configuration parameters define the operating strategy, API methods provide direct control during the simulation, and events allow the model to react to changes in the loading process.
For example, an event can trigger custom logic when a train arrives, an API method can change the loading conditions, and configuration parameters determine how subsequent trains are processed. This combination allows the loading rack to respond dynamically to operational conditions during the simulation run.

Loading Rack Events

       In addition to API methods and configuration parameters, the loading rack provides events that allow the simulation model to react to key stages of the loading process. These events can be used to trigger custom logic, update statistics, change operating parameters, or coordinate the loading rack with other refinery processes.

       Available Loading Rack Events
       onAfterInitialize() — triggered after the loading rack has been initialized and is ready to operate.
       onTrainArrive() — triggered when a train arrives at the loading rack.
       onTrainShipped() — triggered when a train has completed the loading and shipment process.
       onTrainScheduleCompleted() — triggered when the configured train schedule has been completed.

       These events provide convenient control points for connecting loading rack operations with other simulation logic. For example, onTrainArrive() can be used to update queue statistics or apply loading priorities, while onTrainShipped() can trigger downstream logistics operations or record completed loading volumes. Together with the API methods and configuration parameters, events provide a complete mechanism for monitoring and controlling loading rack behavior during refinery simulation.
In AnyLogic refinery simulation models, these control mechanisms can be combined to represent dynamic petroleum loading operations, test alternative loading strategies, and evaluate their impact on refinery logistics performance.

Conclusion

       Loading Rack Control in Refinery Simulation combines API methods and configuration parameters to reproduce dynamic loading operations under different operating conditions. API methods provide direct control over active trains, loading flow rates, product volumes, and process transitions, while configuration parameters define the overall loading strategy, scheduling rules, wagon turnover, and operational timing. Together, these controls allow the simulation to evaluate different loading rack operating and scheduling strategies and their impact on refinery logistics. By changing priorities, schedules, flow limits, wagon availability, and processing times, users can test loading rack optimization scenarios and identify their effect on throughput, loading rack utilization and capacity, queue length, waiting time, and wagon turnaround time.

FAQ

1. What is Loading Rack Control in Refinery Simulation?
Loading Rack Control defines how loading operations are managed dynamically during a simulation run, including train selection, loading priorities, flow rates, wagon availability, and process transitions.

2. How can a loading rack be controlled during simulation?
The loading rack can be controlled using API methods and configuration para

3. Can loading priority override the planned train schedule?
Yes. The isLoadingPriorityOverSchedule parameter allows loading priority to take precedence over the planned schedule.

4. Can the loading flow rate be changed during simulation?
Yes. The setInputSpeedLimitByItem() method can dynamically change the maximum input flow rate for a specific loading rack element.

5. How can the current active train be identified?
The getActiveTrain() method returns the train currently being processed by the loading rack.

6. Can planned trains be accessed during simulation?
Yes. getPlannedTrains() returns the trains that are scheduled but have not yet been processed.

7. Can passportization be forced during a loading operation?
Yes. forcePassportization() forces the currently active train into the passportization stage regardless of its current loading progress.

8. How is wagon turnover represented in the simulation?
The useWagonTuner parameter accounts for wagon turnover by returning wagons to the available pool after the defined turnover period.

9. Can the simulation require a complete wagon set before loading?
Yes. fullWagonSetRequired requires the complete required wagon set to be available before wagons are supplied to the loading operation.

10. Can direct-flow operation be enabled automatically?
Yes. enableDirectModeAfterSchedule can enable direct-flow mode after the scheduled train operations have been processed.

11. Can product loading volumes be monitored during simulation?
Yes. getFillLevel(productId) returns the total fill level for the specified product in tons.

12. What operational conditions can be controlled in a loading rack simulation?
Loading priority, train scheduling, direct flow, loading speed limits, wagon availability, wagon turnover, passportization timing, and product loading volumes can be controlled or monitored during the simulation.

13. Can different loading strategies be tested?
Yes. Scheduling, priority-based loading, direct flow, flow restrictions, wagon turnover, and other operational strategies can be configured and compared within the simulation.

14. Can loading rack flow restrictions represent real operating conditions?
Yes. Input speed limits and configured input and output flows can represent reduced capacity, operational restrictions, or other changes in loading conditions.

15. Why use simulation for loading rack control?
Simulation allows different loading rack control strategies to be tested under realistic operating conditions before they are applied to actual refinery or terminal operations.