Back to Prompt Library
implementation
Build the application
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a District Water Reuse Allocation Engine under Facility Quality Constraints
Format
Code-aware
Lines
117
Sections
11
Linked challenge
Build a District Water Reuse Allocation Engine under Facility Quality Constraints
Prompt source
Original prompt text with formatting preserved for inspection.
117 lines
11 sections
No variables
1 code block
## Build
Allocate treated sewage effluent across industrial cooling towers, landscape irrigation, and concrete batching under quality thresholds. Formulate safe blending and rationing schedules to prevent equipment scaling during effluent supply deficits.
## User
Industrial Water Operations Engineer
## Workflow
1. Import simulated treated-effluent inflows, tank volumes, and water-quality readings.
2. Compare customer demand with supplied quality limits for cooling, irrigation, and concrete batching.
3. Propose allocations and blending ratios that preserve the supplied fire-water and buffer-storage reserves.
4. Export proposed allocations, shortages, blending volumes, and cost estimates for engineer review.
## Interface
A web dashboard featuring an interactive water flow diagram, customer allocation sliders, water quality limit indicators, and an approval action button to export the daily distribution plan.
## Data
Generate synthetic JSON records representing facility water meters, effluent holding tanks, and simulated WaterTAP RO/pretreatment flowsheet outputs with TDS concentrations between 400 and 2400 ppm. No proprietary data needed.
Starter examples below are synthetic. They are not downloaded records.
## Source
[WaterTAP treatment modeling](https://raw.githubusercontent.com/watertap-org/watertap/main/README.md)
Applies WaterTAP flowsheet mass balance and water treatment unit concentration principles to simulate TDS concentration changes during effluent mixing and secondary treatment.
## Tools
ray-serve, pydantic, numpy.
Ray Serve enables low-latency distributed serving of multi-facility water balancing models and rapid scenario re-evaluations under shifting supply flows.
Requires an instruction-tuned model via hosted API for structured allocation rationale explanations; no local fine-tuning required.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Rejects or penalizes any allocation plan where blended cooling tower water exceeds 1,200 ppm TDS.
- Guarantees that emergency storage tanks never fall below the 20% mandatory reserve threshold.
- Generates a complete daily allocation schedule matching total available TSE plus blended potable water within 1% mass balance error.
- Flags and isolates non-compliant off-spec effluent batches into equalization holding prior to distribution.
## Starter Examples
```json
[
{
"input": {
"effluent_inflow_m3": 12000,
"effluent_tds_ppm": 950,
"tank_storage_m3": 15000,
"tank_capacity_m3": 25000,
"demands_m3": {
"cooling_towers": 8000,
"landscape_irrigation": 3500,
"concrete_batching": 1500
},
"tds_limits_ppm": {
"cooling_towers": 1100,
"landscape_irrigation": 1800,
"concrete_batching": 500
},
"potable_tds_ppm": 120
},
"expected_output": {
"allocated_tse_m3": {
"cooling_towers": 8000,
"landscape_irrigation": 3500,
"concrete_batching": 0
},
"allocated_potable_m3": {
"cooling_towers": 0,
"landscape_irrigation": 0,
"concrete_batching": 1500
},
"final_tds_ppm": {
"cooling_towers": 950,
"landscape_irrigation": 950,
"concrete_batching": 120
},
"end_tank_storage_m3": 15500,
"reserve_compliance": true,
"engineer_action_required": false,
"status": "APPROVED"
}
},
{
"input": {
"effluent_inflow_m3": 5000,
"effluent_tds_ppm": 1400,
"tank_storage_m3": 6000,
"tank_capacity_m3": 25000,
"demands_m3": {
"cooling_towers": 7000,
"landscape_irrigation": 3000,
"concrete_batching": 1000
},
"tds_limits_ppm": {
"cooling_towers": 1000,
"landscape_irrigation": 1600,
"concrete_batching": 500
},
"potable_tds_ppm": 100
},
"expected_output": {
"allocated_tse_m3": {
"cooling_towers": 4846,
"landscape_irrigation": 1154,
"concrete_batching": 0
},
"allocated_potable_m3": {
"cooling_towers": 2154,
"landscape_irrigation": 0,
"concrete_batching": 1000
},
"final_tds_ppm": {
"cooling_towers": 999,
"landscape_irrigation": 1400,
"concrete_batching": 100
},
"end_tank_storage_m3": 5000,
"reserve_compliance": true,
"deficit_flag": true,
"engineer_action_required": true,
"status": "REQUIRES_ENGINEER_SIGN_OFF"
}
}
]
```
## Safety
All water allocations and blending ratios are advisory simulations only; field valves and pumping operations require explicit licensed human engineering validation before actuation.
Use mock external writes. Require human review before any real deployment.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.