Skip to main content
Loading navigation

Build a Water Network Contamination Flushing Sequence Optimizer — implementation

Prompt source

implementation71 lines11 sectionsNo variables1 code block
## Build
Simulate municipal network flushing operations using WNTR to clear localized pipe contamination events. Determine optimal hydrant discharge sequences to maximize flush velocity while minimizing water waste.

## User
Water Utility Operations Engineer

## Workflow
1. Ingest reported contamination node locations within the municipal water network topology.
2. Model transient flow paths and compute required flushing velocities using WNTR.
3. Select optimal downstream hydrants to open to draw clean water through the contaminated zone.
4. Compile a step-by-step hydrant flushing manifest for field operations to review.

## Interface
Interactive network map highlighting contamination spread, target flushing hydrants, and simulated velocity paths.

## Data
Utilize open-source WNTR distribution benchmarks with synthetic contaminant insertion points and target flushing criteria.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Water Network Tool for Resilience](https://raw.githubusercontent.com/USEPA/WNTR/main/README.md)
Uses WNTR flow simulation methods to compute node velocities and track contamination flushing pathways.

## Tools
semantic-kernel, wntr, fastapi.
Semantic Kernel orchestrates the integration of WNTR hydraulic outputs with operations scheduling schemas.
Local or hosted LLM capable of function calling and generating JSON responses.

## 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
- Executes WNTR hydraulic simulation to trace contamination from the source node.
- Identifies hydrants capable of achieving target flushing velocities in affected pipes.
- Outputs a human-reviewable manifest detailing sequence, duration, and estimated water loss.

## Starter Examples
```json
[
  {
    "input": {
      "event_id": "CONTAM-99",
      "source_node": "J-550",
      "contaminant_type": "Sediment",
      "target_velocity_mps": 1.5
    },
    "expected_output": {
      "target_hydrants": [
        "HYD-12",
        "HYD-14"
      ],
      "flush_duration_minutes": 45,
      "estimated_water_loss_m3": 120,
      "sequence_approved": true,
      "note": "simplified synthetic app record"
    }
  },
  {
    "input": {
      "event_id": "CONTAM-100",
      "source_node": "J-800",
      "contaminant_type": "Unknown Chemical",
      "target_velocity_mps": 2
    },
    "expected_output": {
      "target_hydrants": [
        "HYD-33"
      ],
      "flush_duration_minutes": 120,
      "estimated_water_loss_m3": 450,
      "sequence_approved": false,
      "alert": "Requires Hazmat containment before flushing.",
      "note": "simplified synthetic app record"
    }
  }
]
```

## Safety
Simulation environment only; prohibits direct supervisory control or SCADA valve closure without human review.
Use mock external writes. Require human review before any real deployment.