Skip to main content

CAD Integration Concept - Water Treatment Plant

Proposal Document: Interactive 3D CAD Model with Component Selection & ML Model Integration


Executive Summary

This document proposes a CAD integration feature for Edubotx that allows users to interact with a 3D water treatment plant model, select individual components, extract metadata (water quality parameters), and run predictions using the existing ML models:

  1. Prediction Model (Reusability Classification)
  2. Treatment Model (Treatment Stage Recommendation)
  3. Twin Engine Model (Combined Analysis)

Table of Contents

#DocumentDescription
01OverviewArchitecture & concept explanation
02Component MetadataMapping CAD components to input params
03Water Treatment Plant3D model structure & components
04UI/UX FlowUser interaction flow & wireframes
05Implementation GuideTechnical implementation details
06P&ID ReferenceProcess & Instrumentation Diagram

Core Concept

┌─────────────────────────────────────────────────────────────────────────┐
│ CAD INTEGRATION WORKFLOW │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │
│ │ 3D CAD │ │ Component │ │ Input Parameters │ │
│ │ Model │────▶│ Selection │────▶│ (Metadata) │ │
│ │ (WTP) │ │ │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────┬───────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ FETCH PARAMETERS │ │
│ │ [Fetch Button] → Populate Input Form with Component Metadata │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ ML MODEL SELECTION │ │
│ │ │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ │
│ │ │ Prediction │ │ Treatment │ │ Twin Engine │ │ │
│ │ │ Model │ │ Model │ │ Model │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ Reusability │ │ Stage │ │ Combined Analysis │ │ │
│ │ │ Prediction │ │ Recommend │ │ (Both Models) │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────────────┘ │ │
│ │ │ │
│ │ Note: Adaptive Optimizer NOT included on this screen │ │
│ └────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ RESULTS DISPLAY │ │
│ │ - Reusability Class & Confidence │ │
│ │ - Treatment Stage & Steps │ │
│ │ - Chemical Suggestions │ │
│ │ - Risk Assessment │ │
│ └──────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘

Process Flow Diagram (PFD)

The CAD model follows standard P&ID conventions with proper equipment tags and instrumentation:


Equipment & Instrumentation Tags

Main Process Equipment

Tag IDEquipmentDescription
SCR-01ScreenCoarse solids removal
GR-01Grit ChamberSand and grit settling
CL-01Primary ClarifierPrimary sedimentation
AER-01Aeration TankBiological treatment (activated sludge)
SC-01Secondary ClarifierSecondary sedimentation
DIS-01Disinfection UnitChlorination/UV treatment
BL-201BlowerAir supply for aeration
CH-TK-01Chemical TankChemical storage (chlorine/alum)

Pumps & Valves

Tag IDEquipmentDescription
P-201RAS PumpReturn Activated Sludge pump
P-301Dosing PumpChemical dosing pump
FV-201Air Control ValveAeration rate control valve

Instrumentation (Analyzers & Transmitters)

Tag IDParameterMaps ToLocation
FIT-101Flow Rateflow_rateRaw Sewage
AIT-PH-101pHinfluent_pH / pHAfter Grit
AIT-TSS-101TSSinfluent_TSS / TSSAfter Grit
AIT-TDS-101TDSinfluent_TDS / TDSAfter Grit
AIT-TMP-101TemperaturetemperatureAfter Grit
FIT-103Flow Rateflow_rateTo Aeration
FIT-AIR-201Aeration Rateaeration_rateAir Line
AIT-PH-104pHpHAeration Out
AIT-TSS-104TSS/MLSSTSSAeration Out
AIT-TMP-104TemperaturetemperatureAeration Out
FIT-105Effluent Flowflow_rateEffluent
AIT-TSS-105Effluent TSSeffluent_TSSEffluent
AIT-TDS-106Effluent TDSeffluent_TDSEffluent
AIT-PH-106Effluent pHeffluent_pHEffluent
AIT-TMP-106Effluent TemptemperatureEffluent
FIT-201Sludge Recycle Ratesludge_recycle_rateRAS Line
DOSE SPChemical Dose Setpointchemical_doseDosing System

Process Streams

Stream IDDescriptionFrom → To
S-101Raw Sewage LineInlet → Screen
S-102Screened SewageGrit Chamber → Primary Clarifier
S-103Primary EffluentPrimary Clarifier → Aeration
S-104Mixed LiquorAeration → Secondary Clarifier
S-105Secondary EffluentSecondary Clarifier → Disinfection
S-106Final EffluentDisinfection → Outlet
S-201RAS LineSecondary Clarifier → Aeration

Water Treatment Plant Components

The 3D model will represent a typical water treatment plant with these selectable components:

ComponentTag IDMetadata TypeParameters Extracted
Inlet/InfluentS-101Raw Water QualitypH, BOD, COD, TSS, TDS, Turbidity
ScreenSCR-01Pre-treatmentTSS removal (coarse)
Grit ChamberGR-01Pre-treatmentGrit/sand removal
Primary ClarifierCL-01Settling StageTSS removal, Oil & Grease
Aeration TankAER-01Biological TreatmentBOD, NH4-N, Aeration Rate
Secondary ClarifierSC-01Secondary TreatmentTSS, BOD after treatment
Disinfection UnitDIS-01Final TreatmentFecal Coliform, Chemical Dose
Outlet/EffluentS-106Treated WaterAll final parameters
RAS PumpP-201Sludge ReturnSludge recycle rate
Chemical TankCH-TK-01Chemical DosingChemical dose setpoint

Input Parameters Reference

Based on types.ts, the following parameters are used:

Treatment Model Input (TreatmentInput)

interface TreatmentInput {
pH: number; // 0-14
TSS: number; // mg/L - Total Suspended Solids
Turbidity: number; // NTU
BOD: number; // mg/L - Biochemical Oxygen Demand
COD: number; // mg/L - Chemical Oxygen Demand
NH4_N: number; // mg/L - Ammonium Nitrogen
Total_Nitrogen: number; // mg/L
Phosphate: number; // mg/L
Fecal_Coliform: number; // count
Oil_Grease: number; // mg/L
TDS: number; // mg/L - Total Dissolved Solids
Heavy_Metals: number; // concentration
flow_rate?: number; // m³/day (optional)
}

Reusability Model Input (WastewaterInput)

interface WastewaterInput {
flow_rate?: number;
influent_BOD?: number;
influent_COD?: number;
influent_TSS?: number;
influent_pH?: number;
influent_TDS?: number;
aeration_rate?: number;
chemical_dose?: number;
sludge_recycle_rate?: number;
retention_time?: number;
temperature?: number;
effluent_BOD_lag1?: number;
// ... effluent values
}

Key Features

1. Interactive 3D Model

  • Rotate, zoom, pan the water treatment plant
  • Click on components to select them
  • Visual highlighting of selected component
  • Component information tooltip on hover

2. Metadata Extraction

  • Each component has predefined metadata
  • Metadata represents water quality at that stage
  • "Fetch" button populates the input form

3. Model Selection (No Adaptive Optimizer)

  • Prediction Model: Reusability classification
  • Treatment Model: Treatment stage recommendation
  • Twin Engine: Combined analysis

4. Results Dashboard

  • Real-time prediction results
  • Visual indicators for severity/risk
  • Treatment recommendations
  • Chemical dosing suggestions

Next Steps

  1. Read 01-OVERVIEW.md for detailed architecture
  2. Read 02-COMPONENT-METADATA.md for parameter mapping
  3. Read 03-WTP-MODEL.md for 3D model specifications
  4. Read 04-UI-UX-FLOW.md for user interaction design
  5. Read 05-IMPLEMENTATION.md for code implementation

Tech Stack

ComponentTechnologyPurpose
3D RenderingThree.js / react-three-fiberInteractive 3D model
State ManagementReact useState/useReducerComponent selection state
ML IntegrationExisting ML API hooksModel predictions
UI Componentsshadcn/ui + TailwindForms, cards, buttons
Type SafetyTypeScriptType-safe metadata

Quick Reference: Models Available

ModelEndpointInput TypeOutput
Prediction/api/predict/reusabilityWastewaterInputReusability class
Treatment/api/predict/treatmentTreatmentInputTreatment stage & steps
Twin EngineBoth endpointsCombinedFull analysis

Document Version: 1.0
Last Updated: December 2024