Skip to content

IOModule: reactor-sim

The simulated I/O module for reactor-1. Use this module whenever you need to run the reactor's phases and recipes without real hardware: development, CI, demos, operator training, and recipe validation. It exposes 16 analog channels and 8 discrete channels (enough for every sensor, actuator, and valve on the reactor) and references the reusable jacketed-reactor SimulationPreset for its physics model, mapping the preset's generic address names onto this module's tag addresses via spec.simulation.addressMap.

Where to find it

System endpointSetupIO Modules → select reactor-sim.

The detail view shows the channel list, the owning controller, the protocol (simulation), the simulation block (referenced preset, seed, address map, optional inline behavior overrides and faults), and a status badge. Every simulation IOModule reports Healthy because there is no real network to fail.

HMI screenshot pending

An annotated capture of the reactor-sim detail view will be added here.

What you see

Element Meaning
Channels One row per channel — name, direction, signal type, and address (analog.N / discrete.N)
Controller pharma-controller — the logical owner that the unit runtime connects to
Protocol simulation — routes reads/writes to the in-process simulation engine, with no network driver involved
Preset jacketed-reactor — the reusable SimulationPreset that supplies this vessel's behavior list
Address map Binds the preset's generic address names (temperature_pv, jacket_sp, etc.) onto this IOModule's tag addresses
Behaviors Inherited from the preset — one entry per output channel (Expr closed-form update equations, ValveFeedback first-order lag). Inline behaviors on the IOModule override the preset for the same resolved address; the reference plant does not use any overrides today.

Channels

Analog (16): reactor temperature, jacket setpoint, jacket feedback, jacket return temperature, pressure, level, weight, pH, agitator command and feedback, solvent/outlet/reagent valve commands and feedback.

Discrete (8): WFI valve drive + feedback, N₂ valve drive + feedback, vent valve drive + feedback, sample valve drive + feedback.

Each channel has a name, a direction (input or output), a signal type (analog/discrete), and an address of the form analog.N or discrete.N that the runtime uses to route reads and writes. The control modules in 07-controlmodules.yaml bind these addresses to tag names the phase templates reference.

Properties

Property Value
Controller pharma-controller
Protocol simulation
Address sim://local
Preset jacketed-reactor (see 05a-simulation-presets.yaml)
Address map Defined on spec.simulation.addressMap
Namespace site-riverbend
Seed 42 (deterministic)

How the simulation works

The reactor's physics model lives on the jacketed-reactor SimulationPreset. At reconcile time the Unit controller expands the preset's behavior list using this IOModule's addressMap (generic name → real tag address), substitutes identifiers inside every Expr expression, and hands the resulting flat behavior list to the unit runtime. Each simulation tick (driven by the runtime scan cycle) the simulation engine evaluates every behavior in order:

  1. ValveFeedback behaviors drive a feedback tag toward its paired command tag at a configurable ratePerSec. Used for every modulating actuator: solvent valve, outlet valve, reagent valve, agitator, jacket controller (and the discrete valves' FB tags).
  2. Expr behaviors evaluate a closed-form process equation that writes the channel's next value. The expressions reference self (current value), other addresses, dt (scan interval), and noise(σ) (Gaussian noise). For example, reactor temperature integrates heat flow from the jacket and conductive loss to ambient:

    self + ((jacket_sp - self) / (300 * max(level/500, 0.2))
            - 0.0003 * (self - 20)) * dt + noise(0.2)
    
  3. Faults (if any) short-circuit specific addresses with stuck values, bias, or dropouts, used to exercise alarm and failure paths.

The simulation is deterministic given a fixed seed, so the same recipe run produces the same trend curves every time.

Used by

  • reactor-1 — the unit runtime pod mounts this IOModule and reads every tag the reactor's control modules need

Try it

  1. Processriverbendpharma-areasim-cellreactor-1
  2. Watch any sensor faceplate (temperature, pressure, level) update every scan cycle with simulated values
  3. Start a recipe that uses the reactor (e.g. sim-reactor-heat-m1) and watch the temperature climb as jacket_sp drives the temperature integration
  4. Edit this IOModule's spec.simulation.faults to inject a stuck sensor or a valve mismatch and verify that the paired alarm fires. See Alarms and Interlocks for pairing patterns