Skip to main content
Loading navigation
Back to prompt library

Build a Desalination Brine Outage and Tanker Logistics Coordinator — implementation

Linked challenge: Build a Desalination Brine Outage and Tanker Logistics Coordinator

Prompt source

implementation68 lines11 sectionsNo variables1 code block
## Build
Model coastal desalination brine discharge outages and land-based zero-liquid discharge evaporation pond capacity. Coordinate emergency brine hauling tankers to prevent plant shutdowns.

## User
Desalination environmental compliance engineers and industrial logistics coordinators

## Workflow
1. Ingest marine outfall diffusers maintenance status, current reject brine production, and storage capacity.
2. Simulate brine dilution and evaporation pond liquid levels using WaterTAP flowsheet mass balance methods.
3. Synthesize emergency brine road-tanker hauling rosters when pond storage exceeds 85% capacity.
4. Export an environmental mitigation dossier and trucking dispatch manifest for plant manager review.

## Interface
Brine pond level gauges, tanker queue dispatch cards, and outfall environmental salinity telemetry feeds.

## Data
Use WaterTAP brine concentration flowsheet models and synthetic industrial fleet dispatch logs.
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 mass-balance and brine concentration property models from the WaterTAP framework.

## Tools
ray-serve, pydantic-ai, pandas, fastapi.
ray-serve provides scalable distributed microservice execution for dynamic fleet routing and continuous mass-balance calculations.
Local or hosted LLM for drafting driver route manifests and regulatory compliance declarations.

## 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
- Tracks cumulative reject brine generation against available retention pond storage volumes.
- Calculates the exact number of 30-ton road tanker trips needed to prevent pond overtopping.
- Ensures emergency hauling preserves continuous desalination uptime during outfall diffusers maintenance.
- Requires environmental operations director verification before simulated fleet haul runs are authorized.

## Starter Examples
```json
[
  {
    "input": {
      "plant_id": "SWRO-WEST-2",
      "outfall_status": "MAINTENANCE_BLOCKED",
      "brine_flow_m3_h": 400,
      "pond_capacity_m3": 10000,
      "current_pond_level_m3": 8200,
      "tanker_capacity_m3": 35
    },
    "expected_output": {
      "hours_to_overflow": 4.5,
      "tanker_dispatch_required": true,
      "tankers_per_hour": 12,
      "mitigation_plan": "Dispatch 12 tankers/hour to evaporation basin C to sustain plant output."
    }
  },
  {
    "input": {
      "plant_id": "SWRO-EAST-1",
      "outfall_status": "NORMAL",
      "brine_flow_m3_h": 600,
      "pond_capacity_m3": 25000,
      "current_pond_level_m3": 3000,
      "tanker_capacity_m3": 35
    },
    "expected_output": {
      "hours_to_overflow": 36.67,
      "tanker_dispatch_required": false,
      "tankers_per_hour": 0,
      "mitigation_plan": "Outfall online; normal marine diffuser discharge operating."
    }
  }
]
```

## Safety
Advisory logistics planning only; environmental permits and physical spill barriers govern real industrial trucking.
Use mock external writes. Require human review before any real deployment.