Calculation ServiceΒΆ

Wood InsightsPlatform (WIP) offers a powerful Calculation Service that can handle complex calculations. The Calculation Service is a time series-based calculation module designed to provide an easy method for building, reusing, and troubleshooting calculations in a low-code environment. The service supports both real-time and historical processing modes, making it versatile for various applications.

WIP users can set up flowsheets to specify inputs, outputs, and calculation blocks of varying complexity. Function blocks within flowsheets allow defining the code or logic for calculations.

The Calculation Service supports both automated and manual scheduling. Jobs can be configured to run once or on a recurring basis, and flowsheets are assigned to these jobs. Each flowsheet contains one or more function blocks, and each function block contains one or more equations. The service processes these elements in a defined sequence, ensuring accurate and efficient execution of logic.

The calculation cycle is the core execution loop of the service. The following figure illustrates the calculation cycle stages within WIP:


../_images/wip.calc.engine.png

  1. The calculation cycle is triggered by a scheduled job or a manual start. The job may involve a single flowsheet or multiple flowsheets executed in a defined order. The processing mode may be real-time (instantaneous) or historical (replay). Users can also control the cycle (Stop, Start, Complete actions).

  2. The cycle begins by executing the flowsheet, which triggers the calculation process.

  3. Each function block within the flowsheet is executed in the specified processing order.

  4. Within each function block, each equation expression is executed sequentially. During this step:

    • Input values are retrieved from data tags (real-time or aggregated) or constants.

    • For historical processing, the system uses the next interval value from the Last Value Time (LVT).

    • For real-time processing, the current value is used.

    • The expression is evaluated using the selected logic engine.

    • Parameter values are set as needed.

    • Output values are set (intermediates), such as data tag values or constants;

  5. After expression processing, the system checks if there are more expressions to be processed in the function block and if so, it proceeds to the next expression.

  6. Once all equations are complete, the system checks if there are more function blocks to process within the flowsheet and if so, it proceeds to the next function block.

  7. After all function blocks have been processed, the system evaluates whether the cycle should end. The cycle concludes if any of the following conditions are met:

    • The current time has been reached.

    • The MaxMinutesPerCycle limit has been reached, which prevents long-running cycles during historical replays.

    • No new input values are available (for example, in a 15-minute schedule, if all values have been processed and no new data has arrived).

    • There are no more flowsheets to process.

  8. If none of the end conditions apply, the cycle restarts and the flowsheets are executed again. Otherwise, the cycle ends and the system waits for the next scheduled run.