Skip to content

Phase 11 — Physical Process Simulation Engine

Choose a tag to compare

@iburres iburres released this 18 May 19:30
· 390 commits to main since this release

Phase 11 — Physical Process Simulation Engine

This release adds a real-time physics simulation layer to ICS Simulator. A new process-unit device type runs a self-contained Docker container (ics-sim-process) that models real industrial processes using differential equations and exposes all sensor values and control points as live Modbus TCP registers. Students can read process values, manipulate control setpoints, trigger alarms, and observe how the physics responds — all without connecting to real hardware.


Process Models

Model Primary Outputs Physics
Water Tank Level (m), flow in/out (L/min), pressure (bar), temperature (°C) Volume balance + Torricelli drain + Newton cooling
Pipeline Line pressure (bar), pump/outlet flow (L/min) Bulk-modulus pressure dynamics + orifice outflow
Generator Frequency (Hz), terminal voltage (%), active/reactive power (MW/MVAR) IEEE swing equation + governor lag (τ=5s) + AVR droop
Generic HR 0–3 configurable signals Sine / sawtooth waveform generator

Modbus TCP Register Map

Register Description Scale
HR 0 Level / fill % / frequency ×0.01 m / ×0.01 Hz
HR 1 Flow in (L/min) ×0.1
HR 2 Flow out (L/min) ×0.1
HR 3 Pressure (bar) ×0.01
HR 4 Temperature (°C) / voltage (%) ×0.1
HR 5 STATUS_WORD (alarm bitmask) See below
HR 6–9 Generator extended outputs (Hz, V%, MW, MVAR) ×0.01
HR 100–103 Setpoints: pump speed, inlet valve, outlet valve, load % (0–100)
CO 0–3 Digital coils: pump run, inlet valve open, outlet valve open, ESD reset 0/1

STATUS_WORD alarm bits:

  • 0x0001 — ESD active (Emergency Shutdown)
  • 0x0008 — ESD latch engaged
  • 0x0010 — High level alarm (>85%)
  • 0x0020 — Low level alarm (<15%)
  • 0x0040 — High pressure alarm (>8 bar)
  • 0x0080 — Low flow alarm (pump running, flow <5 L/min)

Educational Attack Scenarios

Because the process unit is a real-time physics model driven by Modbus register writes, students can:

  • Tank overflow / draindown — write CO 0/2 to lock pump on and close outlet, or reverse; watch level drift to alarm thresholds
  • Pressure spike — close outlet valve (HR 102 = 0) while pump runs at 100% and observe bulk-modulus overpressure
  • Grid frequency attack — write HR 103 (load setpoint) to swing active power demand; observe swing equation drive frequency outside 49–51 Hz
  • ESD bypass — clear CO 3 (ESD reset coil) while alarm bits are set to prevent automatic shutdown
  • False sensor injection — directly write HR 0–4 PV registers to feed an upstream HMI spoofed readings while the real physics diverges

New process-unit Device Type

Added to the canvas Device Palette under Process Simulation. Connects via Modbus TCP to PLCs, RTUs, HMIs, and historians in the OT zone.

ProcessUnitConfig schema fields:

Field Default Description
processType required water-tank | pipeline | generator | generic
simDtMs 1000 Simulation timestep in ms
tankVolumeL 1000 Tank capacity (L)
tankAreaM2 1.0 Tank cross-section (m²)
pumpFlowMaxLpm 150 Max pump outlet flow (L/min)
valveFlowMaxLpm 200 Max inlet valve flow (L/min)
initialLevelPct 50 Starting fill level (0–100%)
generatorRatedMw 100 Rated active power (MW)
generatorInertiaH 6 Inertia constant H (seconds)
generatorFreqBase 50 Synchronous frequency (Hz)
pipelineVolumeL 500 Pipeline internal volume (L)
pipelinePumpMaxLpm 300 Max pipeline pump flow (L/min)

New Files

  • containers/process-sim/sim.py — asyncio physics engine + pymodbus 3.7.4 async Modbus TCP server
  • containers/process-sim/Dockerfile — python:3.12-alpine, single pymodbus==3.7.4 dependency
  • containers/process-sim/entrypoint.sh — startup logging and PROCESS_TYPE dispatch

Phase Status

Phase Feature Status
1 Project scaffold + Electron shell ✅ Complete
2 Canvas drag-and-drop topology builder ✅ Complete
3 .icslab scenario format + import/export ✅ Complete
4 Docker Compose orchestration + live deploy ✅ Complete
5 Modbus TCP emulation (pymodbus) ✅ Complete
6 DNP3 emulation (OpenDNP3) ✅ Complete
7 OPC-UA emulation (open62541) ✅ Complete
8 Network zone enforcement + ACL/firewall rules ✅ Complete
9 Community scenario pack format (.icspack) ✅ Complete
10 S7comm + IEC 104 legacy device emulation (conpot) ✅ Complete
11 Physical process simulation (water tank, pipeline, generator) ✅ Complete
12 macOS + Linux packaging and distribution 🔲 Planned