TwinEdge AI Research · Technical White Paper · May 2026

Deterministic AI for Cavitation Risk Management
in High-Pressure Desalination Pumps

A Physics-Audited Method for a Self-Improving, Deterministic Maintenance Agent with Public Edge Demonstrators

TwinEdge AI Research Team

Open Source: github.com/twinedge-ai/opcua-edge  ·  github.com/twinedge-ai/deterministic-asset-maintenance-agent

Abstract

Cavitation is a critical, often hidden, failure mechanism for high-pressure centrifugal pumps in reverse-osmosis desalination plants. Conventional monitoring approaches (periodic vibration checks, fixed-threshold alarms) can detect symptoms only after operating conditions have already moved outside the pump's safe NPSH envelope. This paper presents a deterministic, physics-grounded AI reasoning system for real-time cavitation risk quantification, remaining useful life (RUL) forecasting, and maintenance action recommendation. The public open-source projects published by TwinEdge AI are used as demonstrators: opcua-edge shows how industrial sensor data can be exposed through OPC UA at the edge, and AssetPilot shows a self-improving, deterministic maintenance agent that processes the data with auditable NPSH physics, Bayesian belief updates, counterfactual costs, policy selection, checklist generation, and governed operator feedback. The Water OS case study in this paper is a representative/proprietary scenario, not a claim that every Water OS model, calibration parameter, or historical trace is published in the open-source repositories. The worked example produces an NPSH margin of −2.27 m, a cavitation evidence score of 0.731, and a sustained-risk mean-state RUL of approximately 50 hours. If the low-suction condition is allowed to persist, the deterministic 7-day failure horizon reaches the failure threshold for the modeled posterior. Early root-cause correction and planned repair reduce modeled deferred-risk cost by $65,040. We then describe how TwinEdge Water OS extends the public demonstration pattern to multi-asset operations through unified asset identity, a physics-model registry, hydraulic solving, and governed operator workflows.

Keywords: NPSH, cavitation, deterministic AI, Bayesian inference, RUL, OPC UA, desalination, Water OS, self-improving maintenance agent, digital twin, maintenance optimisation

1. Introduction

Global installed desalination capacity is now on the order of 100 million m³/day, and membrane-based desalination technologies, including reverse osmosis (RO), account for the dominant share of modern capacity [1,2]. Large seawater RO trains commonly use high-pressure feed pumps operating at discharge pressures of roughly 55–90 bar, with flow rates that can reach hundreds to more than 1,000 m³/h depending on train size. These pumps are among the most energy-intensive and reliability-critical assets in the plant: a severe pump fault can force a train derating, standby transfer, or outage until inspection and repair are complete.

Cavitation is the formation and collapse of vapour bubbles when local liquid pressure approaches the liquid's vapour pressure. In pumps it can erode impellers, increase vibration and noise, reduce head and efficiency, and accelerate bearing and seal stress. The standard engineering metric for cavitation risk is the Net Positive Suction Head Available (NPSHA) relative to the pump's required value (NPSHR). When NPSHA falls below NPSHR, the pump is operating outside the manufacturer's required suction-head condition and cavitation-related performance degradation is expected or highly likely.

Most industrial SCADA systems implement only a fixed low-pressure alarm (e.g., suction < 0.5 bar). This is a lagging indicator. By the time it fires, cavitation may have been underway for hours. What operators need is a continuous probabilistic assessment: given current sensor readings, what is the probability of pump failure within 7 days, and what should we do now?

This paper makes the following contributions:

  1. A full derivation of NPSH from Bernoulli's equation with dimensional analysis, cross-checked against public engineering references and demonstrator code.
  2. A fixed-grid Bayesian belief update that is deterministic, replayable, and auditable, which is essential for regulated water infrastructure.
  3. A self-improving, deterministic maintenance agent pattern in which operator feedback can refine checklist priority and calibration state without handing safety decisions to an LLM.
  4. A counterfactual cost model that supports risk-averse maintenance decisions without allowing an LLM to own a safety decision.
  5. A representative Water OS case study with the physics arithmetic and intermediate values shown.
  6. A description of how TwinEdge Water OS extends the public demonstration pattern to utility-scale multi-asset operations.
Public Demonstrators vs. Water OS
The GitHub repositories listed in the header are public demonstrators. They show the deterministic data path (OPC UA edge ingestion) and the self-improving, deterministic maintenance-agent pattern (physics features, Bayesian belief, RUL forecast, counterfactual costs, policy selection, checklist generation, and operator feedback). The Water OS case study below uses the same class of physics and decision logic but does not disclose proprietary deployment internals, utility data, or production calibration.

2. Physical Background

2.1 Centrifugal Pump Fundamentals

A centrifugal pump transfers energy from a rotating impeller to the fluid. The Euler turbomachinery equation relates impeller geometry and rotational speed to the theoretical head rise:

\[ H_{th} = \frac{u_2 c_{u2} - u_1 c_{u1}}{g} \] (1)

where \(u\) is blade tip speed (m/s), \(c_u\) is the tangential component of absolute velocity (m/s), subscripts 1 and 2 denote inlet and outlet.

In practice, losses reduce the actual head. The pump affinity laws describe how performance scales with rotational speed \(N\):

\[ \frac{Q_2}{Q_1} = \frac{N_2}{N_1}, \qquad \frac{H_2}{H_1} = \left(\frac{N_2}{N_1}\right)^2, \qquad \frac{P_2}{P_1} = \left(\frac{N_2}{N_1}\right)^3 \] (2)

These laws are used in the TwinEdge Water OS hydraulic solver for VFD-modulated pump stations (Section 8).

2.2 NPSH Derivation from Bernoulli's Equation

Applying Bernoulli's energy equation along a streamline from the suction tank free surface (point 0) to the pump suction datum (point s):

\[ \frac{P_0}{\rho g} + \frac{v_0^2}{2g} + z_0 = \frac{P_s}{\rho g} + \frac{v_s^2}{2g} + z_s + h_L \] (3)

Cavitation inception risk increases as local pressure approaches the vapour pressure \(P_v\). NPSH Available is the absolute total suction head above vapour pressure at the pump suction datum:

\[ \text{NPSH}_A = \frac{P_s^{abs} - P_v}{\rho g} + \frac{v_s^2}{2g} \] (4)

The worked trace uses the pressure-only pump-flange approximation as a conservative lower bound because it is directly available from the field pressure transmitter. Full Water OS deployments can add velocity-head, elevation, and suction-line-loss corrections from the hydraulic model. For a liquid with specific gravity \(S_g\), \(\rho = 1000 \cdot S_g\) kg/m³. With \(P_{s,gauge}\) and \(P_{atm}\) in bar and \(P_v\) in kPa, the pressure-only lower bound is:

\[ \text{NPSH}_{A,lb} = \frac{\bigl[(P_{s,gauge} + P_{atm}) \times 100 - P_v\bigr] \times 1000}{1000 \cdot S_g \cdot g} \quad \text{[m]} \] (5)

Pressure-only demonstrator formula: crates/asset-agent-core/src/npsh.rs · Dimensionally checked

The NPSH margin determines risk level:

\[ \Delta\text{NPSH} = \text{NPSH}_{A,lb} - \text{NPSH}_R \] (6)

When \(\Delta\text{NPSH} < 0\), the pump is operating below the required suction-head condition defined for the pump curve; cavitation-related performance degradation is expected or highly likely. At \(\Delta\text{NPSH} < 0.20\) m, the design margin is effectively gone even before accounting for transmitter uncertainty, suction-line losses, or salinity/temperature drift.

2.3 Vapour Pressure and the Magnus Equation

Vapour pressure increases non-linearly with temperature. The Magnus formula (1844, refined by Alduchov & Eskridge 1996 [3]) provides a fast, accurate approximation:

\[ P_v(T) = 0.61078 \cdot \exp\!\left(\frac{17.27 \cdot T}{T + 237.3}\right) \quad \text{[kPa]} \] (7)

At \(T = 20\,°\text{C}\): \(P_v = 0.61078 \times e^{1.3424} = 2.338\,\text{kPa}\), matching standard freshwater saturation-pressure tables. Checked · Conservative for seawater (see §2.3.1)

2.3.1 Seawater Correction

Dissolved salts suppress vapour pressure. A standard seawater correction gives a vapour pressure roughly 0.98× the freshwater value at 35 PSU and 20°C, so \(P_v\) is approximately 2.29 kPa rather than 2.338 kPa [6]. The demonstrator formula uses the freshwater value, which slightly underestimates NPSHA and therefore produces conservative cavitation-risk estimates. The magnitude of this salinity-only effect is about 0.005 m of head, negligible relative to typical field uncertainty in suction-pressure measurement and pump-datum correction.

Figure 1. Pressure-only NPSHA,lb as a function of suction gauge pressure at 20°C, Sg=1.03, Patm=1.01325 bar. The dashed line marks NPSHR=19.0 m for the representative high-pressure pump. Risk zones are derived from Equation (6): HIGH (Δ<0.20 m), MEDIUM (0.20≤Δ<0.80 m), SAFE (Δ≥0.80 m). Incident data point at 0.70 bar (Δ=−2.27 m) and normal operating point at 1.50 bar (Δ=+5.65 m) are marked.

2.4 Pump Head from the Energy Equation

The total dynamic head delivered by the pump is derived from the pressure differential across inlet and outlet:

\[ H_{pump} = \frac{(P_{discharge}^{abs} - P_{suction}^{abs}) \times 1000}{1000 \cdot S_g \cdot g} \quad \text{[m]} \] (8)

Public demonstrator reference: npsh.rs::pump_head_m · At Ps=0.7 bar, Pd=63.5 bar: H=621.73 m. Checked

3. System Architecture

The complete system comprises three layers. The public components (Layers 1 and 2) are published on GitHub as demonstrators of edge ingestion and deterministic reasoning. TwinEdge Water OS (Layer 3) applies the same governed pattern to multi-asset, multi-utility operations without disclosing production internals.

PHYSICAL OPEN SOURCE ENTERPRISE Industrial Sensors Flow: 1004 m³/h Suction P: 0.70 bar Vibration: 7.2 mm/s Bearing T: 74°C Modbus TCP opcua-edge OPC UA Server (C) open62541 · port 4840 24 nodes · plant template In-memory hot path github.com/twinedge-ai OPC UA read AssetPilot Agent Deterministic Core (Rust) NPSH · Bayes · RUL · CVaR REST API port 8080 SQLite memory + dashboard github.com/twinedge-ai OPC UA out port 4841 risk · RUL · CVaR Water OS Asset Operations Multi-asset coordination Physics-based analytics PostGIS · pgvector · ClickHouse TwinEdge Enterprise Physics Model Registry Pump · Blower · Clarifier · UV Hydraulic solver (bisection) Affinity laws · BEP tracking Hazen-Williams · SOR · SLR Versioned equations per asset Asset Analytics Multi-asset · Multi-utility Wastewater · Chemical · GIS Regulatory KPIs (NRW, SOR) Azure OpenAI copilot Modbus · OPC UA · S7 · EIP TwinEdge Box: Containerised Edge Runtime OPC UA Hub (port 10000) · ONNX ML Inference (port 8000) · SQLite Storage (port 5001) · Alert Engine (port 5003) 90-day local retention · Air-gap capable · MQTT bridge · Rate-limited alerts (10/min) Docker Compose · Raspberry Pi / industrial x86 · Offline-first · Cloud sync when available Production deployment target for field sites without reliable connectivity

Figure 2. End-to-end system architecture. Open-source layer (blue): opcua-edge and AssetPilot demonstrate OPC UA edge ingestion and deterministic agent processing. Enterprise layer (amber): Water OS, physics model registry, and asset analytics provided by TwinEdge AI. Edge runtime (green): TwinEdge Box packages approved services for field deployment.

4. The Deterministic Reasoning Engine

Determinism Contract
Given identical inputs (sensor snapshot, configuration, model parameters, and feedback state), the deterministic core produces replayable outputs. The public Rust demonstrator avoids random number generators, uses a fixed damage grid, and keeps decisions as threshold or table evaluations. Water OS applies the same governance principle at production scale: an LLM may explain a result, but it does not own the risk score, action threshold, checklist, or plant command.

4.1 Feature Engineering

Seven physics-derived scores are computed from the raw sensor snapshot and normalised to [0, 1]. The primary indicator is the NPSH score, which reflects the margin to the pump's required NPSH condition:

\[ S_{NPSH} = \text{clamp}\!\left(1 - \frac{\Delta\text{NPSH}}{d_{warn}}, 0, 1\right) \quad \text{where } d_{warn} = 3.0\,\text{m} \] (9)

The composite cavitation evidence score \(E\) is a weighted sum of all indicators:

\[ E = 0.45\,S_{NPSH} + 0.20\,S_{p_s} + 0.20\,S_{vib} + 0.07\,S_{I} + 0.05\,S_{T} + 0.03\,\max(S_{Q\sigma}, S_{I\sigma}) \] (10)

Weights sum to 1.000. Public demonstrator reference: features.rs:145–150 · Checked

ScoreSensorWeightPhysical justification
\(S_{NPSH}\)NPSH margin (m)45%Primary cavitation indicator, directly from Bernoulli
\(S_{p_s}\)Suction pressure (bar)20%Direct transmitter symptom; correlated with NPSH and retained for operator traceability
\(S_{vib}\)Vibration RMS (mm/s)20%Bubble collapse creates measurable high-frequency shock waves
\(S_I\)Motor current (A)7%Cavitation alters hydraulic load; secondary indicator
\(S_T\)Bearing temperature (°C)5%Elevated temp indicates mechanical stress from erosion
\(S_{Q\sigma}, S_{I\sigma}\)Flow/current std. dev.3%Instability signatures of surge or vapour pocket formation

Table 1. Feature weights and physical basis. The weights are engineering priors used for deterministic scoring; production calibration remains asset-specific.

Model confidence increases with evidence strength:

\[ c = \text{clamp}(0.55 + 0.40 \cdot E,\; 0,\; 1) \] (11)

Baseline confidence reflects design-spec tolerance uncertainty. The maximum acknowledges irreducible model and sensor error. Public demonstrator reference: features.rs:175.

4.2 Bayesian Fixed-Grid Belief State

Pump damage \(d \in [0, 1]\) is tracked over a fixed grid of 101 points \(\{0.00, 0.01, \ldots, 1.00\}\). At each time step \(t\), the posterior is updated via Bayes' rule with a Gaussian likelihood centred on the predicted damage trajectory. The public demonstrator shows the method on a compact single-asset profile; Water OS persists the belief state across operating history and operator feedback.

\[ P(d_t \mid E_t) \propto \underbrace{\exp\!\left(-\frac{(E_t - \hat{d}_t)^2}{2\sigma^2}\right)}_{\text{Gaussian likelihood}} \cdot \underbrace{P(d_{t-1})}_{\text{prior}} \] (12)

where the one-step predicted damage is \(\hat{d}_t = d_{t-1} + r\) (clipped to 1.0), \(\sigma = 0.18\) is the observation noise standard deviation, and the posterior is normalised to sum to 1. The damage rate \(r\) is a phenomenological accumulation model:

\[ r = r_0 + g_c \cdot E + g_v \cdot S_{vib} + g_T \cdot S_T + b_{learned} \] (13)

Representative parameters: \(r_0=0.001\), \(g_c=0.010\), \(g_v=0.004\), \(g_T=0.002\) per hour. This is a linearized planning model, not a substitute for vendor pump curves or post-event inspection. Public demonstrator reference: belief.rs:68–75.

Figure 3. Bayesian belief state evolution under sustained low-NPSH conditions (E=0.731, r=0.01169/h). The probability mass shifts from near-zero damage (t=0 demonstration prior) toward a mean damage state of approximately 0.42 after 48 hours. Under the threshold forecast in Equation (15), continued operation at this rate reaches the failure threshold within the 7-day planning horizon.

4.3 Remaining Useful Life Forecast

RUL is defined as the expected time to reach the failure state \(d = 1.0\), computed as a probability-weighted average over the posterior:

\[ \text{RUL} = \sum_{d \in \mathcal{G}} P(d) \cdot \left\lceil \frac{1 - d}{r} \right\rceil \cdot \Delta t \quad \text{[hours]} \] (14)

The ceiling operator discretizes time to the next model tick. \(\Delta t = 1\) hour per tick in the worked example. Public demonstrator reference: forecast.rs:92–103.

Failure probabilities over fixed horizons are computed by integrating the belief distribution forward:

\[ P(\text{fail}_{kd}) = \sum_{d \in \mathcal{G}} P(d) \cdot \mathbf{1}\!\left[d + r \cdot k \cdot 24 \geq 1.0\right] \] (15)

Where k ∈ {1, 7, 30} for 24h, 7-day, and 30-day horizons.

4.4 Counterfactual Cost Analysis and CVaR₉₅

For each of five maintenance actions \(a \in \{\text{defer, inspect, reduce\_load, repair, replace}\}\), the expected cost is evaluated over the belief distribution. The Conditional Value at Risk at 95% is the average cost of the worst 5% of outcomes, a risk-averse metric suitable for critical infrastructure:

\[ \text{CVaR}_{95}(a) = \mathbb{E}\!\left[C_a \mid C_a \geq \text{VaR}_{95}(C_a)\right] \] (16)

In discrete form, states are sorted by descending cost and the top 5% of probability mass is accumulated:

\[ \text{CVaR}_{95}(a) = \frac{\sum_{i \in \text{worst 5\%}} c_i \cdot p_i}{\sum_{i \in \text{worst 5\%}} p_i} \] (17)

Public demonstrator reference: counterfactual.rs:67–102. Production Water OS action-effect calibration is deterministic but not disclosed in this paper.

Total cost for each action at damage state \(d\) incorporates fixed costs, operating penalty, and failure penalty:

\[ c(a, d) = C_{maint}(a) + C_{down}(a) + \alpha \cdot d + \beta \cdot \mathbf{1}[\text{failure}] \] (18)

Representative parameters used in the worked example: \(\alpha = \$12{,}000\)/unit damage, \(\beta = \$100{,}000\) failure penalty. These are planning-cost assumptions, not universal industry costs.

4.5 Deterministic Policy Selection

Action recommendations follow a deterministic priority tree, eliminating stochastic ambiguity:

\[ \text{Action} = \begin{cases} \text{replace} & P(\text{fail}_{7d}) \geq 0.85 \;\wedge\; \bar{d} \geq d_{replace} \\ \text{repair} & P(\text{fail}_{7d}) \geq 0.55 \\ \text{checklist} & P(\text{fail}_{7d}) \geq 0.20 \;\vee\; \text{risk} = \text{HIGH} \\ \text{monitor} & \text{risk} = \text{MEDIUM} \\ \text{normal} & \text{otherwise} \end{cases} \] (19)

Representative thresholds: \(\rho_{low}=0.20\), \(\rho_{high}=0.55\), \(\rho_{critical}=0.85\), with \(d_{replace}\) used to avoid replacing a repairable asset. The public AssetPilot demonstrator implements a simpler threshold tree for transparency.

5. Representative Case Study: RO Pump Suction Pressure Excursion

5.1 Asset Specification

The representative plant profile uses a high-pressure RO feed pump in a duty/standby operating bay. The pump is a synthetic BB3 multistage centrifugal profile with the following nameplate-style data. The public AssetPilot repository includes a similar synthetic hp_pump_1 profile to demonstrate the deterministic method; the Water OS case study is not presented as a released utility record.

Model
BB3 Multistage 8×15-4 (synthetic)
Service
RO Train 1 duty: seawater HP feed
Rated flow
1,012 m³/h
Rated head
628 m
Rated power
2,062 kW
Speed
2,783 RPM
NPSHR
19.0 m (4-stage, high speed)
Design suction
4.0 bar gauge
Specific gravity
1.03 (seawater/RO brine)
Flow range
600–1,215 m³/h

5.2 Incident Timeline

In the representative event, suction tank level began dropping because of a partially closed inlet valve. By 09:15, the suction pressure gauge at the pump inlet read 0.70 bar gauge, down from a normal operating point of approximately 1.50 bar.

5.3 Sensor Snapshot at t = 09:15

SensorValueNormalUnits
Flow rate1,0041,012m³/h
Suction pressure0.701.50bar gauge
Discharge pressure63.563.1bar gauge
Motor current782756A
Vibration (RMS)7.23.8mm/s
Bearing temperature74.068.0°C
Speed2,7832,783RPM
Liquid temperature20.020.0°C

Table 2. Representative sensor readings at incident onset. The public repository includes analogous synthetic traces for demonstration; these values are used here to show the full calculation path.

5.4 Full Decision Trace

Step 1: Vapour Pressure

\[ P_v = 0.61078 \cdot \exp\!\left(\frac{17.27 \times 20.0}{20.0 + 237.3}\right) = 0.61078 \cdot e^{1.3424} = \mathbf{2.338 \text{ kPa}} \]

Step 2: Absolute Suction Pressure

\[ P_s^{abs} = (0.70 + 1.01325) \times 100 = \mathbf{171.325 \text{ kPa}} \]

Step 3: NPSHA,lb

\[ \text{NPSH}_{A,lb} = \frac{(171.325 - 2.338) \times 1000}{1000 \times 1.03 \times 9.80665} = \frac{168{,}987}{10{,}100.85} = \mathbf{16.73 \text{ m}} \]

Step 4: NPSH Margin

\[ \Delta\text{NPSH} = 16.73 - 19.00 = \mathbf{-2.27 \text{ m}} \quad \Rightarrow \quad \text{\textbf{below required NPSH}} \]
Critical: Low-NPSH Condition
A negative NPSH margin means the pump is operating below the required suction-head condition for this pump curve. Cavitation-related performance degradation is expected or highly likely, and the operator should verify suction conditions, pump curve assumptions, transmitter health, and inlet restrictions immediately.

Step 5: Feature Scores

\[ S_{NPSH} = \text{clamp}\!\left(1 + \frac{2.27}{3.0}, 0, 1\right) = 1.000 \qquad S_{vib} = \frac{7.2 - 4.0}{8.5 - 4.0} = 0.711 \]
\[ S_{p_s} = \text{clamp}\!\left(1 - \frac{0.70}{1.0}, 0, 1\right) = 0.300 \qquad S_T = \frac{74 - 70}{85 - 70} = 0.267 \qquad S_I = \frac{782 - 700}{850 - 700} = 0.547 \]
\[ S_{\sigma} = \max\!\left(\frac{28}{35}, \frac{18}{20}\right) = 0.900 \]
\[ E = 0.45(1.000) + 0.20(0.300) + 0.20(0.711) + 0.07(0.547) + 0.05(0.267) + 0.03(0.900) = \mathbf{0.731} \]
\[ c = \text{clamp}(0.55 + 0.40 \times 0.731, 0, 1) = \mathbf{0.842} \quad (84.2\%) \]

Risk level: HIGH. Both \(E \geq 0.70\) and \(\Delta\text{NPSH} < 0.20\) m conditions satisfied.

Step 6: Damage Rate

\[ r = 0.001 + 0.010(0.731) + 0.004(0.711) + 0.002(0.267) = 0.001 + 0.00731 + 0.00284 + 0.000534 = \mathbf{0.01169 \text{ /hour}} \]

Step 7: Belief Update

For the demonstration prior, the pump starts near zero damage. After the first observation with E=0.731:

\[ P(d \mid E=0.731) \propto \exp\!\left(-\frac{(0.731 - d - 0.01169)^2}{2 \times 0.18^2}\right) \cdot P_0(d) \]

After 48 hours of sustained low-NPSH operation with no corrective action:

\[ \bar{d}_{48h} = \sum_{d \in \mathcal{G}} d \cdot P_{48}(d) \approx \mathbf{0.420} \qquad \text{Var}(d_{48h}) \approx 0.00039 \]

Step 8: RUL and Failure Probabilities

\[ \text{Mean-state RUL} = \frac{1.0 - 0.420}{0.01169} \approx \mathbf{49.6 \text{ hours}} \quad \text{(weighted grid RUL ≈ 50.1 h)} \]
\[ P(\text{fail}_{24h}) \approx 0.00 \qquad P(\text{fail}_{7d}) = \mathbf{1.00} \qquad P(\text{fail}_{30d}) = 1.00 \]

Step 9: Policy Decision

\[ P(\text{fail}_{7d}) = 1.00 \geq \rho_{high} = 0.55 \;\wedge\; \bar{d}=0.420 < d_{replace}=0.80 \quad \Rightarrow \quad \boxed{\textbf{Recommended action: REPAIR}} \]

5.5 Counterfactual Cost Comparison

Figure 4. Expected planning cost for each maintenance action at the incident state (mean damage=0.42). Under sustained low-NPSH operation, deferral reaches the 7-day failure threshold; correcting the root cause and performing a planned repair reduces residual modeled failure probability and total expected cost. CVaR₉₅ is evaluated by the deterministic policy layer but proprietary action-effect calibration is not disclosed.

5.6 Intervention and Outcome

The operator received the HIGH risk alert with the 10-item cavitation checklist at 09:22. Item 2 (inlet valve position) was identified as the representative root cause by 09:35. The inlet valve was fully opened, restoring suction pressure to 1.52 bar by 09:50. A planned repair/inspection was scheduled for the following weekend to check the impeller, wear rings, seal faces, and bearing condition before returning the pump to normal duty.

ScenarioCostRationale
Deferred sustained low-NPSH operation$105,040$100,000 failure penalty + $12,000 × 0.420 operating damage penalty
Root-cause correction + planned repair$40,000Representative fixed repair/inspection cost after suction pressure recovery
Modeled cost avoided$65,040Net planning-cost reduction from early detection and intervention

Table 3. Modeled financial outcome for the representative suction-pressure event. All costs in USD.

6. Physics Verification Summary

Equation / ModelReference BasisWorked ResultStatus
NPSHA,lb formula (Eq. 5)Bernoulli + NPSH definition16.73 m lower bound at 0.70 bar, 20°C, Sg=1.03PASS
Vapour pressure at 20°C (Eq. 7)NIST/IAPWS saturation pressure ≈2.339 kPa2.338 kPa (Magnus formula)PASS
Pump head formula (Eq. 8)Energy equation pressure-head conversion621.73 m at ΔP=62.8 barPASS
Feature weight sum (Eq. 10)Must = 1.0000.45+0.20+0.20+0.07+0.05+0.03 = 1.000PASS
Bayesian posterior sum (Eq. 12)Must = 1.000∑p = 1.000 to 10⁻⁹PASS
RUL units (Eq. 14)Dimensionally: h = h·h⁻¹·h[dimensionless] / [h⁻¹] × [h] = hPASS
CVaR₉₅ tail integral (Eq. 17)Decision theoryWorst 5% probability-mass averagePASS
Seawater vapour pressureP_v(35 PSU, 20°C) ≈ 2.29 kPaFreshwater value 2.338 kPa is a safe-side approximationCONSERVATIVE
Specific gravity 1.03RO feed: Sg=1.010–1.0351.03 within rangeACCEPTABLE
Damage rate linearityReal damage may be nonlinear and asset-specificLinearized planning model for deterministic traceabilityDOCUMENTED SIMPLIFICATION

Table 4. Physics and decision-model verification summary for the worked example and public demonstrators. "Conservative" denotes a safe-side approximation; "Documented Simplification" denotes a known model limitation that should be calibrated for each production asset.

7. Open-Source Demonstrators

MIT + Apache-2.0

TwinEdge AI publishes two open-source repositories to demonstrate the deterministic architecture in public. They are useful for researchers, pilot projects, and teams evaluating deterministic AI approaches for industrial asset monitoring. They are demonstrators, not a disclosure of Water OS production internals or a warranty that the representative case-study calibration is identical to the public code.

7.1 opcua-edge v0.1 (alpha)

A lightweight OPC UA server written in plain C using the open62541 library. It loads a plant hierarchy from a text template file (.edge format), exposes plant tags over OPC UA at opc.tcp://<host>:4840, and polls downstream devices via Modbus TCP. The public repository includes parser, address-space, Modbus, SQLite, event, and benchmark coverage; published benchmarks include 1,100-tag edge-device runs and larger server-reference synthetic runs. SQLite provides non-critical-path persistence for asset definitions, latest values, events, and benchmark history.

Capabilityv0.1 Status
Plant template loadingImplemented
OPC UA address spaceImplemented
Modbus pollingImplemented
Performance benchmarksImplemented
EtherNet/IP, Profibus, S7 adaptersPlanned (not in v0.1)
Multi-plant supportPlanned (not in v0.1)
Production security hardeningNot in scope for open-source

7.2 AssetPilot (deterministic-asset-maintenance-agent) v0.1

A Rust-native self-improving, deterministic maintenance agent. The codebase is organised into six crates: asset-agent-core (physics + Bayesian inference), asset-agent-api (Axum REST server), asset-agent-opcua (OPC UA I/O), asset-agent-memory (SQLite case store and feedback), asset-agent-llm (optional Mistral.rs explanation layer with guard checks), and asset-agent-cli. The memory layer demonstrates deterministic self-improvement: confirmed field feedback can update checklist ordering and calibration state while preserving auditable decision logic.

Limitation: Single Asset
AssetPilot v0.1 monitors one asset at a time (hp_pump_1 in the reference configuration). Asset-level aggregation, cross-asset risk correlation, and utility-wide reporting are not in scope. The LLM explanation layer (Mistral.rs) is optional and never owns a risk decision; all recommendations come from the deterministic core.

8. TwinEdge Water OS

The open-source demonstrators show a single-asset pattern. Utilities operate hundreds of assets across multiple plants, protocols, and systems of record (SCADA, CMMS, GIS, LIMS, billing). Water OS bridges this gap by giving every asset, sensor, zone, and work order a governed identity regardless of source system, then running deterministic physics and risk models across approved assets.

8.1 Physics Model Registry

Water OS extends the single-asset NPSH model to a versioned physics model registry covering the full water treatment train:

ModelKey equationsAdditional metrics
Centrifugal pumpTotal head, hydraulic power, pump efficiency, BEP deviationSpecific energy (Wh/m³), load factor
VFD pump stationAffinity laws (Eq. 2), level-speed setpoint controlForce main Hazen-Williams, scouring velocity
Circular clarifierSOR, SLR, detention time, weir overflow rateTSS removal efficiency, sludge blanket %
Centrifuge dewateringSolids capture rate, G-force at bowl, specific energyPolymer dose optimisation, operating cost
UV disinfectionApplied UV dose (mJ/cm²), log reduction, lamp ageUVT transmittance, fouling detection
Blower (aeration)Wire-to-air efficiency, specific power (W/Nm³/h)Surge margin, discharge temperature

Table 6. Physics model registry in TwinEdge Water OS. Equations are stored as versioned formula strings with source attribution.

8.2 Hydraulic Solver

A deterministic hydraulic solver finds the operating point at the intersection of the pump curve and system curve using bounded iteration with configurable derating factors:

\[ Q^* = \arg\min_{Q} \left| H_{pump}(Q \cdot \kappa_c) \cdot \kappa_h - H_{system}(Q) \right| \] (20)

where \(\kappa_c\) is the capacity derating factor (VFD modulation, impeller wear), \(\kappa_h\) is the head derating factor (valve throttling, fouling). Derating factors enable prognostic modelling: the solver predicts how the operating point shifts as the pump ages.

8.3 What Water OS Adds Over the Open-Source Baseline

CapabilityOpen Source (AssetPilot + opcua-edge)TwinEdge Water OS
Asset scopeSingle asset (hp_pump_1)Hundreds of assets across multiple plants
ProtocolsOPC UA, Modbus TCPOPC UA, Modbus TCP/RTU, EtherNet/IP, Siemens S7, GPIO
Object identityLocal asset_id stringUnified identity across SCADA, CMMS, GIS, and LIMS
Physics modelsNPSH/cavitation (pump only)6 model types, versioned registry, hydraulic solver
Water domain coveragePump healthTreatment, network, chemical, wastewater, and regulatory domains
Regulatory reportingNoneNRW, TCR, CMOM, SSO regulatory endpoints
AI copilotOptional local Mistral.rs explanation layerApproved enterprise LLM with governed retrieval over O&M manuals
DeploymentSingle host, manual DockerTwinEdge Box (edge) + cloud platform (multi-tenant)
Offline capabilityPartial (replay traces)Full 90-day air-gap capable via TwinEdge Box

Table 7. Capability comparison between the public demonstrators and TwinEdge Water OS enterprise platform.

9. Conclusion

We have presented a physics-audited deterministic AI approach for cavitation risk management in high-pressure desalination pumps. The core risk assessment combines first-principles pressure-head calculations, vapor-pressure thermodynamics, fixed-grid Bayesian belief updates, deterministic RUL forecasting, and risk-averse counterfactual maintenance analysis. The public repositories at github.com/twinedge-ai demonstrate the OPC UA edge data path and deterministic maintenance-agent method; Water OS production deployment details and calibration parameters remain proprietary.

The representative case study demonstrates that early detection of a −2.27 m NPSH margin and a 0.731 cavitation evidence score leads to a deterministic repair recommendation before the modeled 7-day sustained-risk horizon reaches failure. In the planning-cost scenario shown, root-cause correction plus planned repair reduces modeled deferred-risk cost by $65,040. The approach is auditable: operators can replay an approved snapshot and obtain the same governed result, making it appropriate for regulated water infrastructure where explainability is a compliance requirement, not an option.

The open-source tools (opcua-edge and AssetPilot) provide a practical single-asset demonstration of deterministic ingestion, reasoning, checklist generation, guarded explanation, and feedback-driven self-improvement. In short: AssetPilot demonstrates a self-improving, deterministic maintenance agent. TwinEdge Water OS extends that pattern to utility-scale multi-asset operations through governed asset identity, multi-protocol ingestion, a versioned physics model registry, hydraulic solving, and regulatory workflows without abandoning the deterministic safety boundary.

References

  1. International Energy Agency. Wired for water: how electrification is transforming desalination. iea.org.
  2. U.S. Geological Survey. Desalination. usgs.gov.
  3. Alduchov, O. A. & Eskridge, R. E. Improved Magnus Form Approximation of Saturation Vapor Pressure. J. Appl. Meteor. 35, 601–609 (1996).
  4. Gülich, J. F. Centrifugal Pumps, 3rd ed. Springer, 2014. ISBN 978-3-642-40113-8.
  5. Hydraulic Institute. ANSI/HI 9.6.1: Rotodynamic Pumps, Guideline for NPSH Margin. HI, 2017.
  6. Weiss, R. F. & Price, B. A. Nitrous oxide solubility in water and seawater. Mar. Chem. 8, 347–359 (1980); NOAA OCADS appendix. ncei.noaa.gov.
  7. IAPWS. Supplementary Release on Saturation Properties of Ordinary Water Substance. iapws.org.
  8. ISO 9906:2012. Rotodynamic pumps: Hydraulic performance acceptance tests. ISO, 2012.
  9. Bernardo, J. M. & Smith, A. F. M. Bayesian Theory. Wiley, 2000. ISBN 978-0-471-49464-5.
  10. Rockafellar, R. T. & Uryasev, S. Conditional value-at-risk for general loss distributions. J. Banking Finance 26, 1443–1471 (2002).
  11. OPC Foundation. OPC Unified Architecture, Part 1: Overview and Concepts. OPC-UA, 2022.
  12. TwinEdge AI. opcua-edge public demonstrator. github.com/twinedge-ai/opcua-edge.
  13. TwinEdge AI. deterministic-asset-maintenance-agent / AssetPilot public demonstrator. github.com/twinedge-ai/deterministic-asset-maintenance-agent.

Appendix A: hp_pump_1 Full Specification (from asset.toml)

asset_id        = "hp_pump_1"
asset_name      = "High-Pressure RO Feed Pump, Train 1"
vendor_model    = "Synthetic BB3 Multistage 8x15-4"
service         = "RO Train 1 duty"
rated_flow_m3h  = 1012.0
rated_head_m    = 628.0
rated_power_kw  = 2062.0
rated_speed_rpm = 2783.0
npshr_m         = 19.0
stages          = 4
specific_gravity = 1.03
design_suction_bar = 4.0
max_discharge_bar  = 89.2
flow_range_min_m3h = 600.0
flow_range_max_m3h = 1215.0

Appendix B: Checklist Generated for Low-Suction Incident

The following 10-item deterministic checklist was generated by checklist.rs upon HIGH risk detection:

  1. Check suction strainer for blockage.
  2. Check inlet valve position.
  3. Check suction pipe restriction or blockage.
  4. Check for air ingress on the suction side.
  5. Check liquid temperature.
  6. Verify NPSHA is greater than NPSHR from the pump curve.
  7. Check whether the pump is operating too far from its intended flow range.
  8. Check clogged filters upstream.
  9. Check suction tank level.
  10. Check whether pump speed changed.

Item 2 (inlet valve position) was confirmed as the representative root cause at 09:35.