Introduction
This guide outlines how to use the OLI Process API to optimize cooling tower operations. The optimization aims to minimize scaling and water usage by adjusting operational parameters based on real-time plant measurements.
How It Works
This real-time optimization tool integrates a cooling tower flowsheet model with live plant data to continuously monitor plant conditions. As these conditions change, an optimization algorithm simulates ideal scenarios and provides recommendations to minimize both scaling and water usage. Running seamlessly in the background, the solution offers valuable feedback and optimization instructions. It performs the following:
- Data Collection: Collects key plant variables in real-time, such as chemical dosing rates, air temperature, and humidity.
- Simulation: Using the OLI Process API, it simulates current plant conditions within the OLI Cloud to mirror actual cooling tower operations.
- Prediction: Calculates critical parameters such as scaling tendency and returns the results.
- Optimization: Runs additional calculations to determine the optimal condition that balances reduced blowdown rates and makeup water flow and increased water reuse while minimizing scaling risks.
- Recommendations: Provides feedback and operational adjustments to achieve optimal performance.
Getting Started
Requirements
- Python 3.x: To run the solution.
- OLI Process API Access: Ensure valid credentials are in place.
- Cooling Tower Optimization Algorithm: Available via OLI upon request.
Step-by-Step Guide
1. Input Data from the Plant
For optimal data integration, we recommend directly connecting to the plant's data system within the business network. This method ensures real-time access to the most current information. However, if access to the plant data system is restricted, an alternative approach using CSV file exports can be implemented. In this case, an automated export job will run at regular intervals (e.g., every few minutes) to generate a CSV file containing the required data.
Example: Data Export File (input_data.csv
)
- Include variables such as
sampleid
,moist_air
,temperature
, andmakeup_water
as columns. - Each row corresponds to a sample of the plant’s operational data, timestamped for accuracy.
2. Update Input Properties
To modify plant-specific properties and run a real-time Process API simulation, follow below listed steps. First, ensure you've uploaded your Flowsheet PKG file to the OLI cloud using your API account. If you haven't done this yet, refer to "Getting Started with OLI Process API" for instructions. After uploading the Flowsheet package file, proceed to update the input properties section listed below.
-
Retrieve Default Properties:
- Call
oliapi.get_user_input_spec
to obtain the default model properties from the Flowsheet PKG file.
- Call
-
Locate Input Properties:
-
- In the JSON object, input properties reside in
data.flowsheet.properties.input
. Example JSON structure{
"data": {
"flowsheet": {
"chemical-info": { ... },
"general-info": { ... },
"layout": { ... },
"properties": {
"input": { ... },
"output": { ... },
"postCalc": { ... }
},
"units_set_info": { ... }
}
}
}
- In the JSON object, input properties reside in
-
-
Update Process Values:
-
Update the JSON object with your desired input values for process units and streams.
-
Only change the values you need; omitted properties will use default values from the Flowsheet case file.
-
The following code example demonstrates how to update the TotalFlow value for the Flow2 stream:
-
- JSON specification
-
-
-
-
-
-
- Code snippet to update the flow rate for Flow2
properties["data"]["flowsheet"]["properties"]["input"]["streams"][0]["props"][2]["value"] = flow2_flow_rate
- Code snippet to update the flow rate for Flow2
-
-
-
-
-
For more detailed information, please refer to the OLI Process API Documentation.
-
3. Run Calculations and Retrieve Results
To perform calculations and obtain results using the OLI Process API:
-
Submit Calculations:
-
Send a POST request via
oliapi.call
, updating the properties and specifying the chemistry file ID. For instance: -
out_results = oliapi.call("run-process", chemistry_file_id, properties["properties"])
-
-
Retrieve Results:
- Once the calculation status is
COMPLETED
, the results—delivered as a JSON object—can be parsed for key performance metrics, such as scaling risk.
- Once the calculation status is
Note: The OLI script automatically handles polling and result retrieval, including error handling and retries on failure.
4. Optimize Blowdown
The optimize_blowdown
function determines the optimal blowdown ratio to minimize total dissolved solids, while ensuring sustainable water use.
-
Initialize Optimization Parameters:
- Define initial boundary conditions.
Note: Boundary conditions define the operating limits for an algorithm. For blowdown optimization, these conditions set the minimum and maximum values for the blowdown split parameter in the model. The "low" and "high" variables establish these boundaries, ensuring the optimization process stays within the specified range. The goal is to find the optimal blowdown split that achieves target solids concentration while maximizing water reuse.
- Define initial boundary conditions.
-
Optimization Process:
- Use results from the current plant condition as a baseline for the optimization sweep.
- Perform a sweep over a range of input conditions to determine optimal operating parameters.
- Programmatically identify the optimal condition based on predefined criteria (e.g., acceptable scaling risk, minimum required makeup water, etc.).
- Generate recommendations for plant operators to implement in real time.
These recommendations, accessible via a live dashboard, allow for continuous monitoring and rapid adjustments, ensuring that your system operates efficiently with minimal resource waste.
By leveraging the OLI Process API, cooling tower operations can be optimized in real time, resulting in lower water and chemical consumption, reduced scaling issues, and minimized operational costs. Should you require further assistance or would like access to our pre-built code examples, please contact OLI Customer Support.