Everything below runs in your browser in js/sim.js. AquaSentinel is a fouling forecast and early-warning system. It uses a mechanistic data generator and a scoring protocol to test when its forecast occurs relative to a future intervention criterion. It is a TRL 3 computational proof of concept: all benchmark figures are modeled on synthetic data, not measured plant outcomes.
1. The digital twin (how the data is generated)
A seawater RO train is simulated hourly in constant-permeate-flow mode: feed pressure is raised to hold the design flux as the membrane fouls, so fouling shows up as rising pressure and declining normalized permeability. The governing relations:
- Concentration across the train uses the log-mean factor
C_avg = C_feed · (−ln(1−r)/r)for recoveryr; wall concentration adds the polarization factorβ. - Fouling
f= a slow benign decline (≈0.0015/day) plus any injected fault, optionally reset by cleaning-in-place (CIP). - Temperature follows a diurnal sinusoid; permeability is temperature-corrected by
TCF = 1 + 0.03·(T − 25). - Measurement noise is added to every observed channel (pressure, flux, conductivity, feed-channel Δp, temperature, feed TDS), so detection is non-trivial.
Default operating point (high-salinity Gulf/Red Sea): feed ≈ 45,000 mg/L, ≈ 28 °C, recovery 45 %, design flux 14 LMH, pump efficiency 0.85, energy-recovery effectiveness 0.95.
2. Fault models
| Fault | How it perturbs the train |
|---|---|
| Mineral scaling | accelerating fouling (∝ days + days²) and rising salt passage |
| Biofouling | sigmoidal biofilm growth → permeability decline + a characteristic feed-channel Δp rise |
| Particulate | cake layer → sharp feed-channel Δp rise, modest permeability loss |
| Integrity breach | step rise in salt passage at near-constant pressure (instantaneous) |
| Sensor drift | slow upward bias on the permeate-conductivity sensor only — no physical change (a deliberate confounder) |
Each fault carries a recorded onset time and a per-timestep label — the ground truth real historians lack.
3. What the detectors see
Detectors use only the measured channels plus known design constants. They reconstruct the plant's own normalized parameters:
4. The detectors
DuPont-aligned intervention comparator
Uses the upper recommended FilmTec cleaning criteria: normPerm < 0.90, normSp > 1.10, or normDpfc > 1.15. AquaSentinel's primary benchmark requires 24 hours of confirmation and separately reports 12/24/48-hour sensitivity. The confirmation duration is our declared policy assumption, not a DuPont instruction.
CUSUM (statistical)
A one-sided cumulative-sum on the permeability-trajectory residual (a single, in-control mean-zero signal): S(i) = max(0, S(i−1) + z(i) − k), alarm when S > h. Catches permeability-affecting faults; by design it misses a pure salt-passage breach.
Trailing intervention forecast
Fits trailing 72-hour trends using only present and past observations and projects when the trajectory will reach an intervention criterion during the next 72 hours. An advisory requires 12 hours of persistence. Rate gates reject deliberately slow sensor drifts; salt forecasts require corroboration from permeability or pressure unless the signature is a large sudden integrity step.
Forecast scope. Scaling, biofouling, and particulate fouling develop gradually enough to support a meaningful time-to-criterion forecast. A sudden integrity breach is detected after it begins and is not claimed as advance prediction.
Sensor and condition controls
The locked suite includes fault-free operation, conductivity drift, pressure-sensor drift, feed-channel-pressure drift, conductivity bias, telemetry dropout, salinity ramp, and temperature shift. Passing these declared controls prevents known confounders from being hidden; it does not prove real-world specificity.
CIP-aware re-baselining
Cleaning events are operator-logged (known times), so the expected trajectory is re-fit per cleaning segment — the detector isn't fooled by the post-cleaning permeability jump.
Logistic regression (learned)
A class-balanced logistic model uses reserved seeds 10001-10003. Reported test seeds are 0-4, so no displayed test run is used for training. It is a secondary reference, not the headline detector.
Fault diagnosis (which fault)
Beyond detection, a transparent classifier reads the presence pattern across [permeability drop, salt rise, feed-channel Δp rise] — each saturated to present/absent — and matches it to a fault signature (e.g., salt-only → integrity; Δp-dominant, no salt → particulate). The permeability term uses the deviation below the expected natural trajectory, so background aging isn't mistaken for a fault.
5. Scoring metrics
- Event lead-time = t(industry criterion) − t(advisory), with bootstrap 95% confidence intervals.
- Early-win rate, event sensitivity, pre-onset alarms, and false process alarms per 1,000 control hours.
- Diagnosis at first advisory, not after the full fault has developed.
- Average precision is primary for time-point ranking; ROC-AUC is secondary because hourly samples are autocorrelated.
The current locked version measures realized lead to the simulated criterion. The next forecast-validation version will also score predicted crossing-time error, forecast stability, 24/48/72-hour accuracy, and interval coverage. AquaSentinel will show probability only after calibration is implemented and tested.
6. The cost calculator
The page computes only a synthetic energy-window scenario between advisory and criterion:
ΔSEC is modeled; the ½ assumes a linear ramp. Downtime, CIP, membrane-life and intervention savings are unknown, not hidden upside. They require plant records and are separated as editable hypotheses in the offline decision model.
7. Plausibility check vs. the literature
This is not real-plant validation. It checks whether the twin's synthetic numbers sit in physically plausible published ranges:
| Quantity | AquaSentinel (modeled) | Published SWRO range |
|---|---|---|
| Specific energy (with ERD) | ≈ 2.85 kWh/m³ | ≈ 3–4 kWh/m³ [1,3] |
| Recovery | 45 % | ≈ 40–50 % [1] |
| Feed pressure | ≈ 67 bar | high-salinity SWRO ≈ 60–80 bar [1] |
| Feed salinity (Gulf/Red Sea) | 45,000 mg/L | ≈ 40,000–46,000 mg/L |
Separately, an automated self-consistency test confirms the twin's clean-state pressure, specific energy and normalized permeability reproduce the closed-form equations above to floating-point precision — i.e. the calculations are implemented correctly (a correctness check, distinct from plant validation).
[1] Elimelech & Phillip 2011, Science. [2] Voutchkov 2018, Desalination. [3] Abuwatfa et al. 2023, Membranes (review of ML for membrane fouling, which notes the field's need for a publicly accessible open dataset — the gap AquaSentinel fills).
8. Limitations & roadmap
- Synthetic evidence. Realism is bounded by the models; biofouling kinetics in particular are simplified. Independent design-tool review and real historian evaluation are the explicit steps toward TRL 4 and beyond.
- Declared controls are finite; real telemetry and mixed faults will contain unmodeled conditions.
- Diagnosis at alarm is imperfect (approximately 73-93% across gradual synthetic faults) and real plants exhibit mixed signatures.