Skip to main content
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 Treated Sewage Effluent District Cooling Make-Up Water Allocator

Format
Code-aware
Lines
69
Sections
11
Linked challenge
Build a Treated Sewage Effluent District Cooling Make-Up Water Allocator

Prompt source

Original prompt text with formatting preserved for inspection.

69 lines
11 sections
No variables
1 code block
## Build
Evaluate treated sewage effluent availability against industrial district cooling tower evaporative losses and municipal irrigation constraints. Allocate secondary water volumes while enforcing fictional salinity and storage buffer rules.

## User
District cooling utility water systems engineer

## Workflow
1. Ingest daily treated effluent inflows, cooling tower evaporative demands, and irrigation demand logs.
2. Model dynamic salinity accumulation and evaporative concentration across wet cooling towers using WaterTAP mass balance concepts.
3. Solve hourly allocation schedules under storage tank reserve limits and total dissolved solids constraints.
4. Export an operational water dispatch plan and flag unfulfilled volumes for potable water blending review.

## Interface
A web dashboard displaying hourly storage levels, effluent distribution shares, salinity curves, and interactive allocation overrides.

## Data
Generate synthetic hourly time-series JSON files simulating 7-day cycles of sewage treatment plant outflow, cooling tower loads, and landscaping quotas.
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 flowsheet water mass-balance and dissolved solids concentration equations modeled after WaterTAP desalination and treatment flowsheet principles.

## Tools
pydantic-ai, fastapi, numpy.
Enforces strict type safety and schema validation across numeric flow rates, concentration limits, and multi-consumer allocation vectors.
Local or hosted LLM with function-calling capabilities for constraint extraction and tabular water allocation summaries.

## 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 allocation schedules that exceed maximum storage tank capacity or drop below 15% emergency reserve buffer.
- Maintains cooling tower circulating water total dissolved solids below 2,200 mg/L by triggering potable make-up blending.
- Outputs complete 24-hour balance reports where inflow equals consumption, storage delta, and blowdown discharge within 0.1% tolerance.

## Starter Examples
```json
[
  {
    "input": {
      "effluent_inflow_m3": 12000,
      "cooling_demand_m3": 7500,
      "irrigation_demand_m3": 3500,
      "tank_initial_m3": 2000,
      "max_tank_m3": 5000,
      "effluent_tds_mg_l": 650
    },
    "expected_output": {
      "allocated_cooling_m3": 7500,
      "allocated_irrigation_m3": 3500,
      "tank_final_m3": 3000,
      "potable_blend_m3": 0,
      "status": "balanced"
    }
  },
  {
    "input": {
      "effluent_inflow_m3": 4000,
      "cooling_demand_m3": 6000,
      "irrigation_demand_m3": 2000,
      "tank_initial_m3": 1000,
      "max_tank_m3": 5000,
      "effluent_tds_mg_l": 900
    },
    "expected_output": {
      "allocated_cooling_m3": 4500,
      "allocated_irrigation_m3": 0,
      "tank_final_m3": 500,
      "potable_blend_m3": 1500,
      "status": "deficit_blended"
    }
  }
]
```

## Safety
Simulation and scheduling tool only. Never directly actuate motorized valves or alter chemical dosing pumps in physical water facilities.
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.